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
|
<html>
<head>
</head>
<body>
<?php
include('connection.php');
?>
<?php
echo ("<table border='1' align = center'>");
$req1 = "SELECT AN2.DATANA as date, NUMLOT as lot, LIEUPRE as lieu FROM ANAENT AS ANT, ANADET AS AN2 WHERE ANT.ANCLEUNIK = AN2.ANCLEUNIK AND AN2.CODAR = 'SANG' AND AN2.CODSOC = 'ABA' AND AN2.DATANA between 20070101 AND 20070131";
$detana = odbc_exec($connection, $req1);
echo ("<tr>");
for ($j = 1; $j <= odbc_num_fields($detana); $j++)
{
echo("<th aligne ='center'>" .odbc_field_name($detana,$j)."</th>");
}
$requete = "select distinct CODMES from ANADET where CODAR = 'SANG' AND CODSOC = 'ABA' AND DATANA between 20070101 AND 20080101";
$entete = odbc_exec($connection, $requete);
while (odbc_fetch_into($entete, $codmes)!= FALSE)
{
echo("<th aligne ='center'>$codmes[0]</th>");
}
echo ("</tr>");
while (odbc_fetch_into($detana, $labo)!= FALSE);
{
echo ("<tr>");
echo("<th aligne ='center'>".$labo[0]."</th>");
echo("<th aligne ='center'>".$labo[1]."</th>");
echo("<th aligne ='center'>".$labo[2]."</th>");
echo ("</tr>");
}
$req3 = "select ANCLEUNIK FROM ANAENT WHERE CODAR = 'SANG' AND CODSOC = 'ABA' AND DATANA between 20070101 AND 20080101";
$libana = odbc_exec($connection, $req3);
while (odbc_fetch_into($libana, $ana)!= FALSE);
{
$anatest1 = $ana[0];
$req4 = "select count(CODMES) as nbmes FROM ANADET WHERE ANCLEUNIK = $anatest1";
$temes = odbc_exec($connection, $req4);
$mesure = odbc_fetch_into($temes, $nbmes);
$req5 = "select CODMES FROM ANADET WHERE ANCLEUNIK = $anatest1";
$libmes = odbc_exec($connection, $req5);
while (odbc_fetch_into($libmes, $mes)!= FALSE);
{
$testmes = $mes[0];
echo ("<tr>");
for ($l = 0; $l< $nbmes[0] ; $l++)
{
$req6 = "select VALEUR FROM ANADET WHERE CODMES = '$testmes' and ANCLEUNIK = $anatest1";
$libval = odbc_exec($connection, $req6);
$test2 = odbc_fetch_into($libval, $val);
echo "<th aligne ='center'>$val[0]</th>";
}
echo ("</tr>");
}
}
echo ("</table>");
?>
</body>
</html> |
Partager