Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $pesquisaIdPresenca = "SELECT * FROM presenca where idEstudante='$id' and dia='2019-10-21'";
- $rodarPesquisaPresenca = mysqli_query($conn, $pesquisaIdPresenca) or die(mysqli_error($conn));
- $horarioEntrada = null ;
- $horarioSaida221 = null;
- $horarioTotal = new DateTime();
- while ($results = mysqli_fetch_array($rodarPesquisaPresenca)) {
- if ($results['tipo'] = 'Entrada') {
- $horarioEntrada = DateTime::createFromFormat('H:i :s', $results['horario']);
- }
- if ($results['tipo'] = 'Saida') {
- $horarioSaida21 = DateTime::createFromFormat('H:i:s', $results['horario']);
- }
- }
- if($horarioEntrada!== null and $horarioSaida221!== null) {
- $aiff = $horarioEntrada->diff($horarioSaida221)->format("%h:%i:%s");
- $horarioSaida221 = null;
- $horarioEntrada = null;
- print_r($aiff);
- echo '<br>';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement