Subversion Repositories Sites.obs-saisons.fr

Rev

Rev 5 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 aurelien 1
<?
2
include("../modules/connect.php");
3
 
4
  $contenu = "";
5
  //$entetes = array("personne_id","personne_nom","personne_email","personne_adulte");
6
  $requete_utils = mysql_query("select distinct -PARTICIPANT_ID,".
7
                        "CONCAT_WS(' ',PARTICIPANT_NOM,PARTICIPANT_PRENOM),".
8
			//"CONCAT_WS(' ',PARTICIPANT_ADRESSE,COMMUNE_CODEPOSTAL,COMMUNE_NOM),".
9
			"COMMUNE_CODEPOSTAL,".
10
                        "PARTICIPANT_EMAIL from PARTICIPANT LEFT JOIN COMMUNE on PARTICIPANT.COMMUNE_ID=COMMUNE.COMMUNE_ID where PARTICIPANT_ADULTE=1");
11
 
12
  $fichierc = "";
13
  while ($util = mysql_fetch_row($requete_utils)) {
14
    $fichierc .= implode(';',$util).";\n";
15
  }
16
  $fichier = "participants_export.csv";
17
  $handle = fopen($chemin.$fichier,'w');
18
  fwrite($handle,$fichierc);
19
  fclose($handle);
20
 
21
$contenue        = file_get_contents($fichier);
22
$tailledufichier = filesize($fichier);
23
 
24
@ob_end_clean();
25
@ini_set('zlib.output_compression','Off');
26
 
27
header('Pragma: public');
28
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
29
header('Cache-Control: must-revalidate, pre-check=0, post-check=0, max-age=0');
30
 
31
header('Content-Tranfer-Encoding: none');
32
 
33
header('Content-Type: application/octetstream; name="'.$fichier.'"');
34
header('Content-Disposition: attachement; filename="'.$fichier.'"');
35
 
36
header('Content-Length: '.$tailledufichier);
37
 
38
echo $contenue;
39
exit();
40
?>