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
| #encours
{
width: 966px;
height: 200px;
overflow: auto;
font-size: 8;
font-weight: lighter;
}
<div id="encours">
<?php
//AFFICHAGE DES LIGNES
function ecartemps($n1,$n2){
settype($n1, "integer");
settype($n2, "integer");
$tzert=array(0,0);
if($n1 > $n2)$tzert[0]=-1;
else {
$fgmhkjt= ($n2-$n1)/3600 ;
$h= intval(floor($fgmhkjt)); //heures entieres
//var_dump($n1); var_dump($n2); var_dump($h);
$tzert[0]= intval($h/24); // jours
$tzert[1]= $h%24;
}
return $tzert ;
}
$t1=time();
// BOUCLE SUR LES LIGNES
while($resultat=mysql_fetch_array($result1,MYSQL_ASSOC)){
$t2 = $resultat['heure_lim'] ;
$tyui = ecartemps($t1,$t2);
$sql = "SELECT * FROM matieres WHERE Code_mat ='$codemat'" ;
$res0 = mysql_query($sql)or die('Erreur SQL!'.$sql.''.mysql_error());
$dat0 = mysql_fetch_assoc($res0);
$lib=htmlentities($dat0['Libelle_matiere']);
$classe=htmlentities($dat0['classe_eleve']);
// A aligner A gauche :
echo '<font size="5" >';
echo $tyui[0],'j',$tyui[1],'h' ;
echo '</font>';
echo '<font color="#0000FF" size="5" >';
// A ALIGNER AU CENTRE;
switch ($etat) {
case 0:
echo "Patienter";
break;
case 1:
echo "Accepté ";
break;
case 2:
echo "Refusé";
break;
} echo '</font>';
echo '<div align="RIGHT">';
//ACTIONS A ALIGNER A DROITE
switch ($etat) {
case 0:
echo"<a href=\"voir.php?id=$numdevoir\"><img src=\"voir.jpg\"></a>";
echo"<a href=\"terminer.php?id=$numdevoir\"><img src=\"terminer.jpg\"></a>";
if(empty($idprof)){
}
else{
if($directeur!=0)
{ echo"<a href=\"accepter.php?id=$numdevoir\"><img src=\"accepter.jpg\"></a>";
echo"<a href=\"refuser.php?id=$numdevoir\"><img src=\"refuser.jpg\"></a>";
echo"<a href=\"devoir.php?id=$numdevoir\"><img src=\"travailler.jpg\"></a>";
}
}
break;
case 1:
// echo"<a href=\"voir.php?id=$numdevoir\"><img src=\"voir.jpg\"></a>";
echo"<a href=\"voir.php?id=$numdevoir\"><img src=\"voir.jpg\"></a>";
}
break;
case 2:
echo"<a href=\"voir.php?id=$numdevoir\"><img src=\"voir.jpg\"></a>";
echo"<a href=\"terminer.php?id=$numdevoir\"><img src=\"terminer.jpg\"></a>";
break;
}
// Fin de boucle de ligne
echo ' </div> ';
}
?>
</div> |
Partager