1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
if ( $format == "asc") {
$contenu = "";
$gpsevasion = mysql_pconnect($hostname_gpsevasion, $username_gpsevasion, $password_gpsevasion) or die(mysql_error());
mysql_select_db($database_gpsevasion, $gpsevasion);
$query_ov2 = "SELECT * FROM poi_adresse WHERE valid_ad = 1 and cat_ad ='101' and pays_ad = '103' and suspendre_ad = '0' ORDER BY nom_ad ASC";
$ov2= mysql_query($query_ov2, $gpsevasion) or die(mysql_error());
$totalRows_ov2= mysql_num_rows($ov2);
$nomfichier = $cat_ad.".asc";
while($row_ov2= mysql_fetch_assoc($ov2)){
$ascii = $row_ov2['lon_ad']." , ".$row_ov2['la_ad']." , \"".stripslashes($row_ov2['nom_ad'])." [".$row_ov2['cp_ad']." ".$row_ov2['ville_ad']."]\""."\r\n";
$contenu = $contenu.$ascii;
}
//
//fermeture
mysql_free_result ($ov2);
mysql_close ($gpsevasion);
}
//
// Constantes de configuration
//
define('CFG_SEND_FILENAME', $nomfichier);
//
// Constantes à ne pas modifier
//
define('CFG_FILESIZE', strlen($contenu));
define('CFG_FILE_MD5', md5($contenu));
define('CFG_DATE_FORMAT', 'D, d M Y H:i:s');
//
// Quelques éléments nécessaires
//
error_reporting(0);
ini_set('zlib.output_compression', 0);
/*
*Début de l'envoi
*/
//
// Gestion du cache
//
header('Pragma: public');
header('Last-Modified: '.gmdate(CFG_DATE_FORMAT).' GMT');
header('Cache-Control: must-revalidate, pre-check=0, post-check=0, max-age=0');
//
// Informations sur le contenu à envoyer
//
header('Content-Tranfer-Encoding: none');
header('Content-Length: '.CFG_FILESIZE);
header('Content-MD5: '.base64_encode(CFG_FILE_MD5));
header('Content-Type: application/octetstream; name="'.CFG_SEND_FILENAME.'"');
header('Content-Disposition: attachement; filename="'.CFG_SEND_FILENAME.'"');
//
// Informations sur la réponse HTTP elle-même
//
header('Date: '.gmdate(CFG_DATE_FORMAT, time()).' GMT');
header('Expires: '.gmdate(CFG_DATE_FORMAT, time()+1).' GMT');
header('Last-Modified: '.gmdate(CFG_DATE_FORMAT, time()).' GMT');
//
$upload_folder = "_notes/";
$res_move = @move_uploaded_file( $contenu , $upload_folder.$contenu );
if ($res_move) { echo ""; }
else { echo"<center><font><font size='2' face=\"Arial, Helvetica, sans-serif\" font color=\"$fctexte\">$tx_erreur10<br><a href=\"javascript:history.back()\">$tx_retour</a></center></font></center>";} |
Partager