Rev 5 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?
include("../modules/connect.php");
$contenu = "";
$entetes = array("Pseudo","ID","Nom","Prenom",
"Adresse","Commune","E-mail","Mot de passe");
$requete_utils = mysql_query("select distinct PARTICIPANT_PSEUDO, PARTICIPANT_ID, PARTICIPANT_NOM,PARTICIPANT_PRENOM,CONCAT(PARTICIPANT_ADRESSE,', ',PARTICIPANT_VILLE),PARTICIPANT_CODE_POSTAL,".
" PARTICIPANT_EMAIL,PARTICIPANT_MOTDEPASSE, PARTICIPANT_DATE_INSCRIPTION ".
" FROM PARTICIPANT where PARTICIPANT_ADULTE=1 ".
" ORDER by PARTICIPANT_NOM");
$fichierc = implode(';',$entetes).";\n";
while ($util = mysql_fetch_row($requete_utils)) {
$fichierc .= implode(';',$util).";\n";
}
$fichier = "participants_export.csv";
$handle = fopen($chemin.$fichier,'w');
fwrite($handle,$fichierc);
fclose($handle);
$contenue = file_get_contents($fichier);
$tailledufichier = filesize($fichier);
@ob_end_clean();
@ini_set('zlib.output_compression','Off');
header('Pragma: public');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: must-revalidate, pre-check=0, post-check=0, max-age=0');
header('Content-Tranfer-Encoding: none');
header('Content-Type: application/octetstream; name="'.$fichier.'"');
header('Content-Disposition: attachement; filename="'.$fichier.'"');
header('Content-Length: '.$tailledufichier);
echo $contenue;
exit();
?>