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
|
$sql = "SELECT temps_jour FROM presence WHERE id_sem = '1' AND id_stagiaire = '2'";
echo $sql;
$quer = mysql_query($sql);
$total_heure = 0;
$total_min = 0;
while ($fe = mysql_fetch_array($quer))
{
$h = $fe[0];
echo "<br>".$h."TIME<br><br>";
function AddTime($total_heure,$h) {
list( $hr1, $min1, $sec1 ) = explode( ":", $h);
echo $hr1."heure<br>";
echo $min1."minute<br>";
echo $sec1."seconde<br>";
$UTime1 = mktime($hr1,$min1,$sec1,01,01,1970);
echo $UTime1."mktime<br>";
$UTimeTotal = $UTime1 + $total_heure;
$UTimeTotal = $UTimeTotal - 3600;
$UTimeTotal = abs($UTimeTotal);
echo $UTimeTotal."<br>";
$timeTotal = date ("H:i:s",$UTimeTotal);
list( $hr3, $min3, $sec3 ) = split( ":", $timeTotal);
$hrTotal = $hr1 + $total_heure;
if ($hr3 >= 1)
$hrTotal = $hrTotal + $hr3;
$timeTotal = $hrTotal.":".$min3.":".$sec3;
return $timeTotal;
}
//Utilisation
echo AddTime($total_heure,$h);
} |
Partager