Gros problème en php
drogba7213
Messages postés
1550
Statut
Membre
-
yooyoo12 Messages postés 337 Statut Membre -
yooyoo12 Messages postés 337 Statut Membre -
Bonjour,
voila voici un imprim ecran de la page ou j'ai un problème
http://www.imagefreehost.com/files/25022009/co63239619318.bmp
et donc je vous explique j'ai donc mon premier tableau qui se tri grâce a des requetes en cascade par rapport au sélection dans les listes
si l'on choisit type trou le tableau pésentera que les trous.
Le problème que j'ai est pour le deuxième tableau car il faut bien sur qu'il donne les résultats en fonction des tris.
Et hélas j'ai des bugs alors je suppose que sans code ca va etre difficile de m'aider je vous met donc ma page de code
Svp aidez moi je bloque
merci d'avance
voila voici un imprim ecran de la page ou j'ai un problème
http://www.imagefreehost.com/files/25022009/co63239619318.bmp
et donc je vous explique j'ai donc mon premier tableau qui se tri grâce a des requetes en cascade par rapport au sélection dans les listes
si l'on choisit type trou le tableau pésentera que les trous.
Le problème que j'ai est pour le deuxième tableau car il faut bien sur qu'il donne les résultats en fonction des tris.
Et hélas j'ai des bugs alors je suppose que sans code ca va etre difficile de m'aider je vous met donc ma page de code
Svp aidez moi je bloque
merci d'avance
<?php session_start(); ?>
<html>
<!##########################################################################################################################>
<head>
<title>Synthèse</title>
<link rel="stylesheet" media="screen" type="text/css" title="identification" href="Require\Application.css">
<script language="javascript" src="Require\function_verif_champs.js">
function ouvrir(l,h,url)
{
hauteur=Math.round((screen.availHeight-h)/2);
largeur=Math.round((screen.availWidth-l)/2);
window.open(url, "site", "toolbar=0,location=0,directories=0,status=0, scrollbars=0,resizable=0,menubar=0,top="+hauteur+",left="+largeur+",width="+l+",height="+h);
}
</script>
</head>
<!##########################################################################################################################>
<form method="post" action="Indicateur.php" onsubmit="return verifperiode();" enctype="multipart/form-data">
<body>
<!--------------- Appel des require et déclaration de $date --------------->
<?php
require('Require\Connexion.php');
require('Require\Calendrier.php');
$date = date("Y/m/d");
?>
<!--------------- Champs de saisie de la période --------------->
<center>
<div style='text-align: center;'>
<input id='debut' name='d' value='<?php if (isset($_POST['d'])) { echo $_POST['d']; } else { echo "Début de période"; } ?>'class='calendrier' type='date'>
<input id='fin' name='f' value='<?php if (isset($_POST['f'])) { echo $_POST['f']; } else { echo "Fin de période"; } ?>'class='calendrier' type='date'>
<!----------------- Boutton Excel --------------->
<input type="submit" name="excel" value="Extraction tableur" onclick="ouvrir(600,230,'Make_Excel.php')"> <br><br>
</div>
</center>
<!----------------- Déclaration des listes déroulante ----------------->
<?php
//################## Liste déroulante permettant de choisir un TYPE ##################//
echo "<center>";
$sql = "SELECT DESIGNATION FROM TYPE";
$req = odbc_exec($conn,$sql) or die('Erreur SQL : <br />'.$sql);
echo "<select name= 'TYPE' size=\"1\" >";
echo "<option value='' selected='selected'>Tous</option>";
while($data = odbc_fetch_array($req))
{
if ($data["DESIGNATION"] == $_POST['TYPE']) { $selected = ' selected="selected" '; } else { $selected = ''; }
echo "\n <option value=\"".$data["DESIGNATION"]."\" " . $selected . ">".$data["DESIGNATION"]."</option>";
}
echo "</select>";
//################## Liste déroulante permettant de choisir un CONSTAT ##################//
$sql = "SELECT DESIGNATION FROM CONSTAT";
$req = odbc_exec($conn,$sql) or die('Erreur SQL : <br />'.$sql);
echo ' <select name="CONSTAT" >';
echo "<option value='' selected='selected'>Tous</option>";
while($data = odbc_fetch_array($req))
{
if ($data["DESIGNATION"] == $_POST['CONSTAT']) { $selected = ' selected="selected" '; } else { $selected = ''; }
echo "\n <option value=\"".$data["DESIGNATION"]."\" " . $selected . ">".$data["DESIGNATION"]."</option>";
}
echo "</select>";
//################## Liste déroulante permettant de choisir un DEMANDE ##################//
$sql = "SELECT DESIGNATION FROM DEMANDE";
$req = odbc_exec($conn,$sql) or die('Erreur SQL : <br />'.$sql);
echo ' <select name="DEMANDE" >';
echo "<option value='' selected='selected'>Tous</option>";
while($data = odbc_fetch_array($req))
{
if ($data["DESIGNATION"] == $_POST['DEMANDE']) { $selected = ' selected="selected" '; } else { $selected = ''; }
echo "\n <option value=\"".$data["DESIGNATION"]."\" " . $selected . ">".$data["DESIGNATION"]."</option>";
}
echo "</select>";
//################## Liste déroulante permettant de choisir un CAUSE ##################//
$sql = "SELECT DESIGNATION FROM CAUSE";
$req = odbc_exec($conn,$sql) or die('Erreur SQL : <br />'.$sql);
echo ' <select name="CAUSE" >';
echo "<option value='' selected='selected'>Tous</option>";
while($data = odbc_fetch_array($req))
{
if ($data["DESIGNATION"] == $_POST['CAUSE']) { $selected = ' selected="selected" '; } else { $selected = ''; }
echo "\n <option value=\"".$data["DESIGNATION"]."\" " . $selected . ">".$data["DESIGNATION"]."</option>";
}
echo "</select>";
//################## Liste déroulante permettant de choisir un IMPUTATION ##################//
$sql = "SELECT DESIGNATION FROM IMPUTATION";
$req = odbc_exec($conn,$sql) or die('Erreur SQL : <br />'.$sql);
echo ' <select name="IMPUTATION" >';
echo "<option value='' selected='selected'>Tous</option>";
while($data = odbc_fetch_array($req))
{
if ($data["DESIGNATION"] == $_POST['CIMPUTATION']) { $selected = ' selected="selected" '; } else { $selected = ''; }
echo "\n <option value=\"".$data["DESIGNATION"]."\" " . $selected . ">".$data["DESIGNATION"]."</option>";
}
echo "</select>";
//----------------- Button SUBMIT qui charge le tableau -----------------//
echo " ";
echo "<input value='Ok' name='button' type='submit'>";
echo "</center><br>";
//--------------- Tableau qui va afficher les tuples de type choisit précédement ---------------//
echo "<div style='overflow-y: scroll; height: 270' > ";
//--------------- Construction des variables ---------------//
$DATE_DEBUT = $_POST['d']." 00:00:00";
$DATE_FIN = $_POST['f']." 00:00:00";
list($datedeb, $heure_deb)=explode(" ",$DATE_DEBUT);
list($datefin, $heure_fin)=explode(" ",$DATE_FIN);
list($jj_deb, $mm_deb, $yy_deb)=explode("-",$datedeb);
list($jj_fin, $mm_fin, $yy_fin)=explode("-",$datefin);
$date_deb = $yy_deb."-".$mm_deb."-".$jj_deb." ".$heure_deb;
$date_fin = $yy_fin."-".$mm_fin."-".$jj_fin." ".$heure_fin;
//--------------- Requete pour la période ---------------//
if (isset($_POST['d']) && isset($_POST['f']))
{
$sql = "SELECT * FROM ARRET_CHAINE WHERE DEBUT BETWEEN #$date_deb# AND #$date_fin#" ;
$rs = odbc_exec($conn,$sql) or die(' Saisir une période ');
$_SESSION['d'] = $_POST['d'];
$_SESSION['f'] = $_POST['f'];
if(!empty($_POST['TYPE'])) { $TYPE = $_POST['TYPE']; } else { $TYPE = ''; }
if(!empty($_POST['CONSTAT'])) { $CONSTAT = $_POST['CONSTAT']; } else { $CONSTAT = ''; }
if (!empty($_POST['DEMANDE'])) { $DEMANDE = $_POST['DEMANDE']; } else { $DEMANDE = ''; }
if (!empty($_POST['CAUSE'])) { $CAUSE = $_POST['CAUSE']; } else { $CAUSE = ''; }
if (!empty($_POST['IMPUTATION'])) { $IMPUTATION = $_POST['IMPUTATION']; } else { $IMPUTATION = ''; }
$sql1 = " SELECT * FROM ARRET_CHAINE WHERE DEBUT BETWEEN #$date_deb# AND #$date_fin#" ;
if(!empty($TYPE)) $sql1.= "AND TYPE = '$TYPE'";
if(!empty($CONSTAT)) $sql1.= "AND CONSTAT = '$CONSTAT'";
if(!empty($DEMANDE)) $sql1.= "AND DEMANDE = '$DEMANDE'";
if(!empty($CAUSE)) $sql1.= "AND CAUSE = '$CAUSE'";
if(!empty($IMPUTATION)) $sql1.= "AND IMPUTATION = '$IMPUTATION'";
$rs = odbc_exec($conn,$sql1) or die(' Saisir une période ');
}
//-##################################################### Tableau de tri ########################################################-//
echo "<center>";
echo "<table border='0' cellpadding='0' cellspacing='0' width='500'>";
echo "<tbody>";
echo "<tr>";
echo "<table style='width: 990px; height: 60px;' border='5' cellpadding='2' cellspacing='1'>"; // Taille du tableau //
echo "<tbody>";
echo "<tr>";
echo "<td class='table-titre' colspan='7'> Tableau des Synthèses </td>";
echo "</tr>";
echo "<tr>";
echo "<td class='table-entete-centre' width='20'>Type</td>";
echo "<td class='table-entete-centre' width='20'>Constat</td>";
echo "<td class='table-entete-centre' width='20'>Demande </td>";
echo "<td class='table-entete-centre' width='20'>Cause</td>";
echo "<td class='table-entete-centre' width='20'>Imputation</td>";
echo "<td class='table-entete-centre' width='20'>Information</td>";
echo "<td class='table-entete-centre' width='20'>Durée</td>";
echo "</tr>";
if (isset($_POST['d']) && isset($_POST['f']))
{
while (odbc_fetch_row($rs))
{
$TYPE=odbc_result($rs,"TYPE");
$DEBUT=odbc_result($rs,"HEURE_DEBUT");
$FIN=odbc_result($rs,"HEURE_FIN");
$CONSTAT=odbc_result($rs,"CONSTAT");
$DEMANDE=odbc_result($rs,"DEMANDE");
$CAUSE=odbc_result($rs,"CAUSE");
$INFO=odbc_result($rs,"COMPLEMENT_INFORMATION");
$IMPUTATION=odbc_result($rs,"IMPUTATION");
if ($TYPE == 'Trou') { $Durée = $total; }
else
{
list($heure_deb, $minute_deb, $seconde_deb)=explode(":",$DEBUT);
list($heure_fin, $minute_fin, $seconde_fin)=explode(":",$FIN);
if ($minute_fin == '00') { $minute_fin = 60; $heure_deb = $heure_deb + 1; }
if ($seconde_fin == '00') { $seconde_fin = 60; $minute_deb = $minute_deb + 1; }
$hh = $heure_fin - $heure_deb;
$mm = $minute_fin - $minute_deb;
$ss = $seconde_fin - $seconde_deb;
if ($seconde_fin < $seconde_deb) { $ss = 60 + $ss; $mm = $mm - 1; }
if ($minute_fin < $minute_deb) { $mm = 60 + $mm; $hh = $hh - 1; }
if ($ss >= 60) { $mm = $mm + 1; $ss = 0; }
if ($hh < 10) { $hh = "0".$hh; }
if ($mm < 10) { $mm = "0".$mm; }
if ($ss < 10) { $ss = "0".$ss; }
$Durée = $hh.":".$mm.":".$ss;
}
echo "<tr>";
echo "<td class='table-ligne1-centre' width='100'>$TYPE</td>";
echo "<td class='table-ligne1-centre' width='100'>$CONSTAT</td>";
echo "<td class='table-ligne1-centre' width='100'>$DEMANDE</td>";
echo "<td class='table-ligne1-centre' width='100'>$CAUSE</td>";
echo "<td class='table-ligne1-centre' width='100'>$IMPUTATION</td>";
echo "<td class='table-ligne1-centre' width='100'>$INFO</td>";
echo "<td class='table-ligne1-centre' width='100'>$Durée</td>";
echo "</tr>";
}
}
echo "</tbody>";
echo "</table>";
echo "</tr>";
echo "</tbody>";
echo "</table>";
//--------------- Fin du tableau ---------------//
echo"</div>";
echo"<br><br>";
//-###################################### Tableau des informations générales sur le tri ########################################-//
//---------- Champs d'information ----------//
if (isset($_POST['d']) && isset($_POST['f']))
{
if (!empty($_POST['TYPE'])) { $TYPE = $_POST['TYPE']; } else { $TYPE = ''; }
if (!empty($_POST['CONSTAT'])) { $CONSTAT = $_POST['CONSTAT']; } else { $CONSTAT = ''; }
if (!empty($_POST['DEMANDE'])) { $DEMANDE = $_POST['DEMANDE']; } else { $DEMANDE = ''; }
if (!empty($_POST['CAUSE'])) { $CAUSE = $_POST['CAUSE']; } else { $CAUSE = ''; }
if (!empty($_POST['IMPUTATION'])) { $IMPUTATION = $_POST['IMPUTATION']; } else { $IMPUTATION = ''; }
//---------- Requete comptant le nombre de ligne existant dans la table arret chaine à la date du jour ----------//
$sql2 = " SELECT COUNT(*)
FROM arret_chaine
WHERE DEBUT BETWEEN #$date_deb#
AND #$date_fin#";
if(!empty($TYPE)) $sql2.= "AND TYPE = '$TYPE'";
if(!empty($CONSTAT)) $sql2.= "AND CONSTAT = '$CONSTAT'";
if(!empty($DEMANDE)) $sql2.= "AND DEMANDE = '$DEMANDE'";
if(!empty($CAUSE)) $sql2.= "AND CAUSE = '$CAUSE'";
if(!empty($IMPUTATION)) $sql2.= "AND IMPUTATION = '$IMPUTATION'";
$sql_result = odbc_prepare($conn,$sql2) or die("ERROR"); odbc_execute($sql_result) or die("ERROR");
$rc = odbc_fetch_into($sql_result, $my_array); odbc_free_result($sql_result);
//-################################### Requete pour compléter les informations du tableau ######################################-//
//--------------- Calcul de la différence d'heure ---------------//
function difheure($heuredeb,$heurefin)
{
$hd=explode(":",$heuredeb);
$hf=explode(":",$heurefin);
$hd[0]=(int)($hd[0]);$hd[1]=(int)($hd[1]);$hd[2]=(int)($hd[2]);
$hf[0]=(int)($hf[0]);$hf[1]=(int)($hf[1]);$hf[2]=(int)($hf[2]);
if($hf[2]<$hd[2]){$hf[1]=$hf[1]-1;$hf[2]=$hf[2]+60;}
if($hf[1]<$hd[1]){$hf[0]=$hf[0]-1;$hf[1]=$hf[1]+60;}
if($hf[0]<$hd[0]){$hf[0]=$hf[0]+24;}
return (($hf[0]-$hd[0]).":".($hf[1]-$hd[1]).":".($hf[2]-$hd[2]));
}
//-################## Requete de la durée perdu en comptant que les arrêt chaîne (T2 C2) ##################-//
$sqlhh = " SELECT HEURE_DEBUT,HEURE_FIN
FROM arret_chaine
WHERE DEBUT BETWEEN #$date_deb#
AND #$date_fin#
AND TYPE = 'Arrêt chaîne'";
//if(!empty($TYPE)) $sqlhh.= "AND TYPE = '$TYPE'";
if(!empty($CONSTAT)) $sqlhh.= "AND CONSTAT = '$CONSTAT'";
if(!empty($DEMANDE)) $sqlhh.= "AND DEMANDE = '$DEMANDE'";
if(!empty($CAUSE)) $sqlhh.= "AND CAUSE = '$CAUSE'";
if(!empty($IMPUTATION)) $sqlhh.= "AND IMPUTATION = '$IMPUTATION'";
$rs = odbc_exec($conn,$sqlhh) or die('Erreur SQL :<br />' .$sqlhh);
//--------------- initialisation des variables ---------------//
$totalhh = 0;
$totalmm = 0;
$totalss = 0;
while (odbc_fetch_row($rs))
{
$hdeb=odbc_result($rs,"HEURE_DEBUT");
$hfin=odbc_result($rs,"HEURE_FIN");
//--------------- Appel de la fonction diffheure pour connaitre la durée d'un arret chaine ---------------//
$duree = difheure($hdeb,$hfin);
//--------------- Explode $durée en trois variable ---------------//
list($hh, $mm, $ss)=explode(":",$duree);
//--------------- Restructuration de $durée avec des nouvelles variables ---------------//
$totalhh = $totalhh + $hh;
$totalmm = $totalmm + $mm;
$totalss = $totalss + $ss;
}
//--------------- Si la durée totale des minutes OU des secondes est égale ou supérieur à 60 ---------------//
if ($totalmm >=60 || $totalss >= 60)
{
//--------------- On calcul la retenue par la fonction intval qui garde juste le nombre entier ---------------//
$retenuess = intval($totalss/60);
//--------------- On ajoute les minutes et la retenue ---------------//
$totalmm = $totalmm + $retenuess;
//--------------- On ajoute le reste aux secondes ---------------//
$totalss = $totalss%60;
$retenuemm = intval($totalmm/60);
$totalhh = $totalhh + $retenuemm;
$totalmm = $totalmm%60;
}
if ($totalhh < 10) { $totalhh = "0".$totalhh; }
if ($totalmm < 10) { $totalmm = "0".$totalmm; }
if ($totalss < 10) { $totalss = "0".$totalss; }
//--------------- Nouvelle durée grace à la concaténation des variables ---------------//
$dureeperdu = $totalhh.":".$totalmm.":".$totalss;
//-################## Requete Temps d'information (T2 C4) ##################-//
$sqlh = " SELECT HEURE_DEBUT,HEURE_FIN
FROM arret_chaine
WHERE DEBUT BETWEEN #$date_deb#
AND #$date_fin#
AND TYPE = 'Autre'";
if(!empty($TYPE)) $sqlh.= "AND TYPE = '$TYPE'";
if(!empty($CONSTAT)) $sqlh.= "AND CONSTAT = '$CONSTAT'";
if(!empty($DEMANDE)) $sqlh.= "AND DEMANDE = '$DEMANDE'";
if(!empty($CAUSE)) $sqlh.= "AND CAUSE = '$CAUSE'";
if(!empty($IMPUTATION)) $sqlh.= "AND IMPUTATION = '$IMPUTATION'";
$rs = odbc_exec($conn,$sqlh) or die('Erreur SQL : <br />'.$sqlh);
$totalhh = 0;
$totalmm = 0;
$totalss = 0;
while (odbc_fetch_row($rs))
{
$hdeb=odbc_result($rs,"HEURE_DEBUT");
$hfin=odbc_result($rs,"HEURE_FIN");
$duree = difheure($hdeb,$hfin);
list($hh, $mm, $ss)=explode(":",$duree);
$totalhh = $totalhh + $hh;
$totalmm = $totalmm + $mm;
$totalss = $totalss + $ss;
}
if ($totalmm >=60 || $totalss >= 60)
{
$retenuess = intval($totalss/60);
$totalmm = $totalmm + $retenuess;
$totalss = $totalss%60;
$retenuemm = intval($totalmm/60);
$totalhh = $totalhh + $retenuemm;
$totalmm = $totalmm%60;
}
if ($totalhh < 10) { $totalhh = "0".$totalhh; }
if ($totalmm < 10) { $totalmm = "0".$totalmm; }
if ($totalss < 10) { $totalss = "0".$totalss; }
$dureeinfo = $totalhh.":".$totalmm.":".$totalss;
//-################## Requete temps trou colonne (T2 C5) ##################-//
//--------------- Connaitre le jour actuel ---------------//
$time = time('Y/m/d');
$jours = Array('DIMANCHE', 'LUNDI', 'MARDI', 'MERCREDI', 'JEUDI', 'VENDREDI', 'SAMEDI');
$numJour = date('w', $time);
$jour = $jours[$numJour];
$base_info = " SELECT OUVERTURE,CADENCE
FROM JOUR,BASE_INFO
WHERE JOUR = '".addslashes($jour)."'
AND JOUR.DATE_DEBUT=BASE_INFO.DATE_DEBUT";
$result_base_info = odbc_exec($conn,$base_info) or die('Erreur SQL : <br />'.$base_info);
//--------------- En fonction du jour que l'on est on ressort l'ouverture et la cadence correspondant ---------------//
while (odbc_fetch_row($result_base_info))
{
$ouverture=odbc_result($result_base_info,"OUVERTURE");
$cadence=odbc_result($result_base_info,"CADENCE");
$taktime = $ouverture/$cadence;
$taktime = round($taktime, 2);
list($mm, $ss)=explode(".",$taktime);
$ss = $taktime - $mm;
$hhtaktime = "00";
$sstaktime = $ss*0.6;
$total = $mm+$sstaktime;
}
$totaltaktime = round($total, 2);
list($mm, $ss)=explode(".",$totaltaktime);
//--------------- On multiplie $total aux nombres de trou ce qui donne $resultat ---------------//
$sql = "SELECT COUNT(*)
FROM arret_chaine
WHERE TYPE = 'Trou'
AND DEBUT BETWEEN #$date_deb#
AND #$date_fin#";
if(!empty($TYPE)) $sql.= "AND TYPE = '$TYPE'";
if(!empty($CONSTAT)) $sql.= "AND CONSTAT = '$CONSTAT'";
if(!empty($DEMANDE)) $sql.= "AND DEMANDE = '$DEMANDE'";
if(!empty($CAUSE)) $sql.= "AND CAUSE = '$CAUSE'";
if(!empty($IMPUTATION)) $sql.= "AND IMPUTATION = '$IMPUTATION'";
$sql_result = odbc_prepare($conn,$sql) or die("ERROR");
odbc_execute($sql_result) or die("ERROR"); $rc = odbc_fetch_into($sql_result, $my_array3);
odbc_free_result($sql_result);
$nb_trou = $my_array3[0];
$resultat = $nb_trou *$totaltaktime;
list($mm, $ss)=explode(".",$resultat);
if ($ss >= 60)
{
$retenuess = intval($ss/60);
$mm = $mm + $retenuess;
$ss = $ss%60;
}
if ($mm >=60)
{
$retenuemm = intval($mm/60);
$hh = $hh + $retenuemm ;
$mm = $mm%60;
}
if ($hh < 10) { $hh = "0".$hh; }
if ($mm < 10) { $mm = "0".$mm; }
if ($ss < 10) { $ss = "0".$ss; }
$resultat = $hh.":".$mm.":".$ss;
//-################## Requete Nombre perte TA en comptant que les arrêts chaîne (T2 C3) ##################-//
list($TAhh, $TAmm, $TAss)=explode(":",$dureeperdu);
$TAhh = $TAhh * 60;
$totalMin = $TAhh + $TAmm;
$totalSec = "0.".$TAss;
$totalMin = $totalMin + $totalSec;
$perteTA = $totalMin/$totaltaktime;
$perteTA = round($perteTA, 2);
//--------------- La fonction round permet d'arrondir à la virgule le chiffre décimal que l'on souhaite ---------------//
//-################## Requete Durée totale perdu (T2 C6) ##################-//
$sqls = " SELECT HEURE_DEBUT,HEURE_FIN
FROM arret_chaine
WHERE DEBUT BETWEEN #$date_deb#
AND #$date_fin#";
if(!empty($TYPE)) $sqls.= "AND TYPE = '$TYPE'";
if(!empty($CONSTAT)) $sqls.= "AND CONSTAT = '$CONSTAT'";
if(!empty($DEMANDE)) $sqls.= "AND DEMANDE = '$DEMANDE'";
if(!empty($CAUSE)) $sqls.= "AND CAUSE = '$CAUSE'";
if(!empty($IMPUTATION)) $sqls.= "AND IMPUTATION = '$IMPUTATION'";
$rs = odbc_exec($conn,$sqls) or die('Erreur SQL : <br />'.$sqls);
$totalhh = 0;
$totalmm = 0;
$totalss = 0;
while (odbc_fetch_row($rs))
{
$hdeb=odbc_result($rs,"HEURE_DEBUT");
$hfin=odbc_result($rs,"HEURE_FIN");
$duree = difheure($hdeb,$hfin);
list($heureTrou, $minuteTrou, $secondeTrou)=explode(":",$resultat);
list($hh, $mm, $ss)=explode(":",$duree);
$totalhh = $totalhh + $hh;
$totalmm = $totalmm + $mm;
$totalss = $totalss + $ss;
}
$totalhh = $totalhh + $hh;
$totalmm = $totalmm + $minuteTrou;
$totalss = $totalss + $secondeTrou;
if ($totalss >= 60)
{
$retenuess = intval($totalss/60);
$totalmm = $totalmm + $retenuess;
$totalss = $totalss%60;
}
if ($totalmm >=60)
{
$retenuemm = intval($totalmm/60);
$totalhh = $totalhh + $retenuemm ;
$totalmm = $totalmm%60;
}
if ($totalhh < 10) { $totalhh = "0".$totalhh; }
if ($totalmm < 10) { $totalmm = "0".$totalmm; }
if ($totalss < 10) { $totalss = "0".$totalss; }
$totalduree = $totalhh.":".$totalmm.":".$totalss;
//-################## Requete Nombre perte TA avec tous les type (T2 C7) ##################-//
list($Thh, $Tmm, $Tss)=explode(":",$totalduree);
$Thh = $Thh * 60;
$Tmm = $Tmm;
$totalMin = $Thh + $Tmm;
$Tss = $Tss;
$totalSec = "0.".$Tss;
$totalMin = $totalMin + $totalSec;
$pertetotaleTA = ($totalMin/$totaltaktime);
$pertetotaleTA = round($pertetotaleTA, 2);
}
//--------------- Déclaration du tableau ---------------//
echo "<table border='0' cellpadding='0' cellspacing='0' width='500'>";
echo "<tbody>";
echo "<table style='width: 900px; height: 20px;' border='5' cellpadding='2' cellspacing='1'>";
echo "<tr>";
echo "<td class='table-titre' colspan='13'> Infos en temps réel </td>";
echo "</tr>";
//--------------- En tete de colonne ---------------//
echo "<tr>";
echo "<td class='table-entete-centre' width='700'>Nombre d'arrêt (s) </td>";
echo "<td class='table-entete-centre' width='600'>Durée perdue </td>";
echo "<td class='table-entete-centre' width='900'>Tracteur (s) perdu (s) </td>";
echo "<td class='table-entete-centre' width='2'></td>";
echo "<td class='table-entete-centre' width='300'>Autre (s) </td>";
echo "<td class='table-entete-centre' width='300'>Trou (s)</td>";
echo "<td class='table-entete-centre' width='2'></td>";
echo "<td class='table-entete-centre' width='700'>Durée total perdue </td>";
echo "<td class='table-entete-centre' width='1100'>Total tracteur (s) perdu (s) </td>";
echo "</tr>";
//--------------- RESULTATS ---------------//
echo "<tr>";
echo "<td class='table-ligne1-centre' width='100'> $my_array[0] </td>";
echo "<td class='table-ligne1-centre' width='100'> $dureeperdu </td>";
echo "<td class='table-ligne1-centre' width='100'> $perteTA </td>";
echo "<td class='table-ligne1-centre' width='2'></td>";
echo "<td class='table-ligne1-centre' width='100'> $dureeinfo </td>";
echo "<td class='table-ligne1-centre' width='100'> $resultat </td>";
echo "<td class='table-ligne1-centre' width='2'></td>";
echo "<td class='table-ligne1-centre' width='100'> $totalduree </td>";
echo "<td class='table-ligne1-centre' width='100'> $pertetotaleTA </td>";
echo "</tr>";
echo "</tbody>";
echo "</table>";
echo "</center>";
?>
<!--------------- Fin de la page Indicateur ---------->
</form>
</body>
</html>
A voir également:
- Gros problème en php
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Retour à la ligne php ✓ - Forum PHP
- Alert php - Forum PHP
- Retour a la ligne php ✓ - Forum PHP