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
| <?php
session_start();
?>
<html>
<!################################################################################################################################>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Conversion Indicateur</title>
<link rel="stylesheet" media="screen" type="text/css" title="identification" href="Require\Application.css">
</head>
<!################################################################################################################################>
<!--------------- Bannière --------------->
<div id="ban3" > </div>
<?
require('Require\Connexion.php');
$date_deb = $_SESSION['d'];
$date_fin = $_SESSION['f'];
//echo"date deb =".$date_deb;
//echo"date fin =".$date_fin;
$req = "SELECT * FROM ARRET_CHAINE WHERE DEBUT BETWEEN #$date_deb# AND #$date_fin#";
$res = odbc_exec($conn,$req) or die('Erreur SQL : <br />'.$req);
//--------------- AJOUTER ---------------//
$file = ("Indicateur.xls"); // le fichier doit déjà exister
if(!$myfile = fopen($file, "w")) //on ouvre le fichier
{
print("erreur: ");
print("'$filename' n'existe pas!\n");
exit;
}
fputs($myfile," TYPE\t DATE\t DEBUT\t FIN\t CONSTAT\t DEMANDE\t CAUSE\t INFO\t IMPUTATION\n\n");
while (odbc_fetch_row($res))
{
$TYPE=odbc_result($res,"TYPE"); // on récupère les champs
$DATE = odbc_result($res,"DEBUT"); // on récupère les champs
$DEBUT=odbc_result($res,"HEURE_DEBUT"); // on récupère les champs
$FIN=odbc_result($res,"HEURE_FIN"); // on récupère les champs
$CONSTAT=odbc_result($res,"CONSTAT"); // on récupère les champs
$DEMANDE=odbc_result($res,"DEMANDE"); // on récupère les champs
$CAUSE=odbc_result($res,"CAUSE"); // on récupère les champs
$INFO=odbc_result($res,"COMPLEMENT_INFORMATION"); // on récupère les champs
$IMPUTATION=odbc_result($res,"IMPUTATION"); // on récupère les champs
//--------------- ecriture ---------------//
fputs($myfile," $TYPE\t $DATE\t $DEBUT\t $FIN\t $CONSTAT\t $DEMANDE\t $CAUSE\t $INFO\t $IMPUTATION\n");
}
fclose($myfile); //--------------- On ferme le fichier ---------------//
echo "<br> <center>La conversion à correctement été éffectuer</center>";
?>
<br><br>
<center><input name="lien1" value="Ouvrir le fichier " onclick="window.open('Indicateur.xls', 'utilisateur', config='width=900, height=650, resizable=no, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no');" type="button"></center>
</html> |
Partager