<th>Bairro</th> <th>Status</th> <th>Controles</th> </tr> </thead> <tfoot> <tr> <th>Motorista</th> <th>Bairro</th> <th>Status</th> <th>Controles</th> </tr> </tfoot> <tbody> <?php foreach ($readmotorista->getResult() as $regs) { $id = (int) $regs['motorista_id']; ?> <tr> <td><?php echo $regs['motorista_nome'] . ' ' . $regs['motorista_sobrenome']; ?> </td> <td><?php echo $regs['bairros_nome']; ?> </td> <td><?php echo $regs['motorista_status'] ? '<span class="label label-success">Ativo</span>' : '<span class="label label-danger">Desligado</span>'; ?> </td>
if (isset($dados) && !empty($dados)) { if (isset($dados['editar'])) { unset($dados['search_form'], $dados['editar']); $upmotorista = new ModelMotorista(); $upmotorista->ModelUpdate($idMotorista, $dados); if ($upmotorista->getResult()) { echo "<div class='alert alert-success alert-dismissible' role='alert'>\n <button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>×</span></button>\n <strong><span class='fa fa-check-circle'></span></strong> Dados atualizados com sucesso.\n </div>"; } else { echo "<div class='alert alert-warning alert-dismissible' role='alert'>\n <button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>×</span></button>\n <strong><span class='fa fa-exclamation-circle'></span></strong> Aconteceram erros, portanto, nenhum dado foi atualizado.\n </div>"; } } } if (isset($idMotorista) && !empty($idMotorista)) { $read = new ModelMotorista(); $read->getMotorista($idMotorista); if ($read->getResult()) { ?> <div class="page-title"> <span class="title">Atualização de dados cadastrais</span> <div class="description">Atualizando dados do motorista.</div> </div> <div class="card"> <div class="card-header"> <div class="card-title"> Atenção! Campos com (*) são de preenchimento obrigatório. </div> </div> <div class="card-body"> <div class="form-group">
<?php include_once '../app/Config.inc.php'; $varcheck = filter_input(INPUT_GET, 'var', FILTER_DEFAULT); $del = filter_input(INPUT_GET, 'del', FILTER_VALIDATE_INT); $dados = filter_input(INPUT_POST, 'json', FILTER_DEFAULT); if (isset($del) && !empty($del)) { if (isset($varcheck) && $varcheck == 'delete') { $deleteI = new ModelMotorista(); $deleteI->ModelDelete($del); if ($deleteI->getResult()) { ADSError('Alterado com sucesso!', CRAZY_ACCEPT); } else { ADSError('errado denovo!', CRAZY_ERROR); } } }