Planning hebdomadaire de production'; echo ''; echo ''; echo ''; while ($i<$diff){ echo ''; $i++; } echo ''; $i=0; while ($i<$diff){ echo ''; $i++; } echo ''; $i=0; while ($i<$diff){ echo ''; $i++; } echo ''; echo ''; $i=0; while ($i<$diff){ echo ''; $i++; } echo ''; $connec=connexion(); $req="SELECT DISTINCT Id_eta FROM periode WHERE Curdate BETWEEN '$datedus' AND '$datefus'"; $res=mysql_query($req); $nbj=mysql_num_rows($res); $req="SELECT Nom_eta, Curdate, Petit_dej, Gouter, Repas_midi, Repas_soir, Pik_nik_midi, Pik_nik_soir, Id_eta FROM contrat as A1, periode as A2 WHERE A1.Id_auto=A2.Id_eta AND Curdate BETWEEN '$datedus' AND '$datefus' ORDER BY Nom_eta ASC, Curdate ASC"; $res=mysql_query($req); $nbi=mysql_num_rows($res); $i=0; while ($data=mysql_fetch_array($res)){ $nometa[$i]=$data[0]; $curdate[$i]=$data[1]; $ptidej[$i]=$data[2]; $gouter[$i]=$data[3]; $rpmid[$i]=$data[4]; $rpsoir[$i]=$data[5]; $pkmid[$i]=$data[6]; $pksoir[$i]=$data[7]; $ideta[$i]=$data[8]; $i++; } $j=0; $i=0; // Affichage du nb de petit dej while ($j<$nbj){ echo ''; $x=0; while ($curdate[$i]!=$dateus[$x]){ echo ''; $x++; } $a=$i; while ($ideta[$i]==$ideta[$a]){ if ($x<$diff){ if ($curdate[$i]==$dateus[$x]){ if ($ptidej[$i]!=0){ echo ''; $tot[$x]+=$ptidej[$i]; }else{ echo ''; } }else{ echo ''; } } $a=$i; $i++; $x++; } if ($x<$diff){ while ($x<$diff){ echo ''; $x++; } } $j++; echo ''; } echo ''; $i=0; while ($i<$diff){ if ($tot[$i]!=""){ echo ''; }else{ echo ''; } $i++; } // Affichage du nb de dejeuner echo ''; $i=0; while ($i<$diff){ echo ''; $i++; } echo ''; echo ''; $i=0; while ($i<$diff){ echo ''; $i++; } echo ''; $j=0; $i=0; while ($j<$nbj){ echo ''; $x=0; while ($curdate[$i]!=$dateus[$x]){ echo ''; $x++; } $a=$i; while ($ideta[$i]==$ideta[$a]){ if ($x<$diff){ if ($curdate[$i]==$dateus[$x]){ if ($rpmid[$i]!=0){ echo ''; $tot1[$x]+=$rpmid[$i]; }else if ($pkmid[$i]!=0){ echo ''; $tot1pk[$x]+=$pkmid[$i]; }else{ echo ''; } }else{ echo ''; } } $a=$i; $i++; $x++; } if ($x<$diff){ while ($x<$diff){ echo ''; $x++; } } $j++; echo ''; } echo ''; $i=0; while ($i<$diff){ if ( ($tot1[$i]!="") && ($tot1pk[$i]!="") ){ echo ''; }else if ($tot1[$i]!=""){ echo ''; }else if ($tot1pk[$i]!=""){ echo ''; }else{ echo ''; } $i++; } //Affichage du nb de gouter $req2bis="SELECT DISTINCT Id_eta FROM periode WHERE Gouter !='' AND Curdate BETWEEN '$datedus' AND '$datefus'"; $res2bis=mysql_query($req2bis); $nbgout=mysql_num_rows($res2bis); $req2="SELECT Nom_eta, Id_eta, Gouter, Curdate FROM contrat as A1, periode as A2 WHERE A1.Id_auto=A2.Id_eta AND Curdate BETWEEN '$datedus' AND '$datefus' AND Gouter !='' ORDER BY Nom_eta ASC, Curdate ASC"; $res2=mysql_query($req2); if (mysql_num_rows($res2)!=0){ echo ''; $i=0; while ($i<$diff){ echo ''; $i++; } echo ''; $i=0; while ($data2=mysql_fetch_array($res2)){ $nometa2[$i]=$data2[0]; $ideta2[$i]=$data2[1]; $gouter2[$i]=$data2[2]; $curdate2[$i]=$data2[3]; $i++; } echo ''; $i=0; while ($i<$diff){ echo ''; $i++; } echo ''; $j=0; $i=0; while ($j<$nbgout){ echo ''; $x=0; while ($curdate2[$i]!=$dateus[$x]){ echo ''; $x++; } $a=$i; while ($ideta2[$i]==$ideta2[$a]){ if ($x<$diff){ if ($curdate2[$i]==$dateus[$x]){ if ($gouter2[$i]!=0){ echo ''; $tot2[$x]+=$gouter2[$i]; }else{ echo ''; } }else{ echo ''; } } $a=$i; $i++; $x++; } if ($x<$diff){ while ($x<$diff){ echo ''; $x++; } } $j++; echo ''; } echo ''; $i=0; while ($i<$diff){ if ($tot2[$i]!=""){ echo ''; }else{ echo ''; } $i++; } } // Affichage du nb de diner echo ''; $i=0; while ($i<$diff){ echo ''; $i++; } echo ''; echo ''; $i=0; while ($i<$diff){ echo ''; $i++; } echo ''; $j=0; $i=0; while ($j<$nbj){ echo ''; $x=0; while ($curdate[$i]!=$dateus[$x]){ echo ''; $x++; } $a=$i; while ($ideta[$i]==$ideta[$a]){ if ($x<$diff){ if ($curdate[$i]==$dateus[$x]){ if ($rpsoir[$i]!=0){ echo ''; $tot3[$x]+=$rpsoir[$i]; }else if ($pkmid[$i]!=0){ echo ''; $tot3pk[$x]+=$pksoir[$i]; }else{ echo ''; } }else{ echo ''; } } $a=$i; $i++; $x++; } if ($x<$diff){ while ($x<$diff){ echo ''; $x++; } } $j++; echo ''; } echo ''; $i=0; while ($i<$diff){ if ( ($tot3[$i]!="") && ($tot3pk[$i]!="") ){ echo ''; }else if ($tot3[$i]!=""){ echo ''; }else if ($tot3pk[$i]!=""){ echo ''; }else{ echo ''; } $i++; } echo '
GROUPES'.$jour[$i].'
'.$date[$i].'
RepasPique-nique
Petits Dèjeuners  
'.$nometa[$i].'  '.$ptidej[$i].'       
TOTAL'.$tot[$i].'   
   
Dèjeuners   
'.$nometa[$i].'  '.$rpmid[$i].'  '.$pkmid[$i].'      
TOTAL'.$tot1[$i].''.$tot1pk[$i].''.$tot1[$i].'  '.$tot1pk[$i].'  
   
Goûters   
'.$nometa2[$i].'  '.$gouter2[$i].'       
TOTAL'.$tot2[$i].'   
   
Dîners   
'.$nometa[$i].'  '.$rpsoir[$i].'  '.$pksoir[$i].'      
TOTAL'.$tot3[$i].''.$tot3pk[$i].''.$tot3[$i].'  '.$tot3pk[$i].'  
'; mysql_close(); ?>
WriteHTML($content, isset($_GET['vuehtml'])); $html2pdf->Output('editionFicheIndiv2.pdf'); ?>