1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| <?php
// si bouton rechercher et collaborateur bien sélectionné dans la liste déroulante
if(isset($_POST['rechercherPersonne']) AND isset($_POST['nomPrenomAppelant'])){
$nomPrenomAppelant=$_POST['nomPrenomAppelant'];
// connaître la durée totale de communication d'une personne
$rechercherPersonne = $bdd->prepare("SELECT SEC_TO_TIME(SUM(TIME_TO_SEC('dureeAppel')))
AS personneTotaleAppel FROM appels
WHERE nomPrenomAppelant='".$nomPrenomAppelant."'");
$rechercherPersonne->execute();
var_dump($rechercherPersonne);
// on affiche le temps de communication
while ($donnees = $rechercherPersonne->fetch())
{
$afficheRechercherPersonne = array (
'<tr>',
'Temps de communication → '.$donnees['personneTotaleAppel'].
'</tr>');
foreach($afficheRechercherPersonne as $element)
{
echo $element.'<br />';
} |