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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
<form name="Formulaire" method="post" action="LISTING.php">
<input type="submit" name="value" value="Rechercher" style="background-color:#3cb371" style="color:white; font-weight:bold"onclick>
<select name="choix" size="1" style="width:150px">
</form>
<?PHP
/*#######################*/
/*#CONNEXION A L'AS400 #*/
/*#######################*/
$choix=$_POST['choix'];
echo "<br>Votre choix est : ",$choix;
$dsn = "*****"; /* Nom du lien ODBC mis dans le fichier de configuration odbc.ini */
$user = "****"; /* Votre nom dutilisateur AS400 */
$passwd = "****"; /* Mot de passé AS400 */
$connAs400 = odbc_connect($dsn,$user,$passwd );
if ($connAs400 <= 0)
{
echo "Erreur dans la connexion<BR>";
exit;
}
else
{
$query = "SELECT distinct servi from program.zp5reser";
$result = odbc_exec($connAs400, $query);
echo "<option>Toutes les US</option>";
while(odbc_fetch_row($result))
{
//echo odbc_result($result, 1);
echo "<option>".odbc_result($result, 1)."</option>";
}
echo "</select>";
$query = "SELECT nompre,datent,datope,intlib,
case(cp) when ' ' then 'CC'
else 'CP'
end as Type_cham,
pbdob,pbsex,nomm,datent+nbrjrs days,
case dayofweek_iso(datent)
when 1 then 'Lundi'
when 2 then 'Mardi'
when 3 then 'Mercredi'
when 4 then 'Jeudi'
when 5 then 'Vendredi'
when 6 then 'Samedi'
else 'Dimanche'
end
from sysibm.sysdummy1,program.zp5reser,medcpof.sptml0,medcpofb.smedec
where pbmrn=dos7a and datent>=current_date and datent<=current_date + 15 days and meopen=nrpr";
}
$result = odbc_exec($connAs400, $query);
echo '<table bgcolor="#FFFFFF">'."\n";
echo '<tr>';
echo '<td bgcolor="#6495ED"><b><u>Jour</u></b></td>';
echo '<td bgcolor="#6495ED"><b><u>Date_entrée</u></b></td>';
echo '<td bgcolor="#6495ED"><b><u>Nom_Prénom</u></b></td>';
echo '<td bgcolor="#6495ED"><b><u>Date_nais</u></b></td>';
echo '<td bgcolor="#6495ED"><b><u>Sexe</u></b></td>';
echo '<td bgcolor="#6495ED"><b><u>Chirurgien</u></b></td>';
echo '<td bgcolor="#6495ED"><b><u>Intervention</u></b></td>';
echo '<td bgcolor="#6495ED"><b><u>Type_cham</u></b></td>';
echo '<td bgcolor="#6495ED"><b><u>Date_interven</u></b></td>';
echo '<td bgcolor="#6495ED"><b><u>Date_sortie</u></b></td>';
echo '</tr>'."\n";
while(odbc_fetch_row($result))
{
$nom = odbc_result($result, 1);
$datent = odbc_result($result, 2);
$datent=substr($datent,8,9) ."/". substr($datent,5,2)."/".substr($datent,0,4);
$datope = odbc_result($result, 3);
$datope=substr($datope,8,9) ."/". substr($datope,5,2)."/".substr($datope,0,4);
$Intervention = odbc_result($result, 4);
$Type_cham = odbc_result($result, 5);
$Date_nais= odbc_result($result, 6);
$Date_nais=substr($Date_nais,6,2) ."/". substr($Date_nais,4,2)."/".substr($Date_nais,0,4);
$Sexe = odbc_result($result, 7);
$Chirurgien = odbc_result($result, 8);
$Date_sortie = odbc_result($result, 9);
$Date_sortie=substr($Date_sortie,8,9) ."/". substr($Date_sortie,5,2)."/".substr($Date_sortie,0,4);
$Jour = odbc_result($result, 10);
echo '<tr>';
echo '<td bgcolor="#CCCCCC">'.$Jour.'</td>';
echo '<td bgcolor="#CCCCCC">'.$datent.'</td>';
echo '<td bgcolor="#CCCCCC">'.$nom.'</td>';
echo '<td bgcolor="#CCCCCC">'.$Date_nais.'</td>';
echo '<td bgcolor="#CCCCCC">'.$Sexe.'</td>';
echo '<td bgcolor="#CCCCCC">'.$Chirurgien.'</td>';
echo '<td bgcolor="#CCCCCC">'.$Intervention.'</td>';
echo '<td bgcolor="#CCCCCC">'.$Type_cham.'</td>';
echo '<td bgcolor="#CCCCCC">'.$datope.'</td>';
echo '<td bgcolor="#CCCCCC">'.$Date_sortie.'</td>';
echo '</tr>'."\n";
}
odbc_close($connAs400);
?>
</body>
</html> |
Partager