SHARE
TWEET

Untitled

a guest Feb 18th, 2020 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  $pesquisaIdPresenca = "SELECT * FROM presenca where idEstudante='$id' and dia='2019-10-21'";
  2.   $rodarPesquisaPresenca = mysqli_query($conn, $pesquisaIdPresenca) or die(mysqli_error($conn));
  3.  
  4.   $horarioEntrada = null ;
  5.   $horarioSaida221 = null;
  6.   $horarioTotal = new DateTime();
  7.   while ($results = mysqli_fetch_array($rodarPesquisaPresenca)) {
  8.  
  9.     if ($results['tipo'] = 'Entrada') {
  10.  
  11.       $horarioEntrada =  DateTime::createFromFormat('H:i :s', $results['horario']);
  12.      
  13.     }
  14.     if ($results['tipo'] = 'Saida') {
  15.       $horarioSaida21 = DateTime::createFromFormat('H:i:s', $results['horario']);
  16.      
  17.     }
  18.   }
  19.   if($horarioEntrada!== null and $horarioSaida221!== null) {
  20.  
  21.     $aiff = $horarioEntrada->diff($horarioSaida221)->format("%h:%i:%s");
  22.     $horarioSaida221 = null;
  23.     $horarioEntrada = null;
  24.     print_r($aiff);
  25.     echo '<br>';
  26.   }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top