if (!in_array(38, listarAcesso())) { echo '<script language= "JavaScript">location.href="../../modulos.php";</script>'; } if (!empty($_GET['cmd']) && $_GET['cmd'] == 'del') { $id = ValidateInteger(INPUT_GET, 'id'); $retorno = $DAO->Deletar($id); if ($retorno == 1) { echo '<script language= "JavaScript">alert("Caixa removido com sucesso");</script>'; echo '<script language= "JavaScript">location.href="index.php";</script>'; } else { print_r($retorno); } } if (!empty($_GET['cmd']) && $_GET['cmd'] == 'reabrir') { $id = ValidateInteger(INPUT_GET, 'id'); $retorno = $DAO->Reabrir($id); if ($retorno == 1) { echo '<script language= "JavaScript">alert("Medição reaberta com sucesso");</script>'; echo '<script language= "JavaScript">location.href="index.php";</script>'; } else { print_r($retorno); } } if (!empty($_GET['cmd']) && $_GET['cmd'] == 'atualizar') { $id = limpaTexto($_GET['id']); connectSQL(); $query = mysql_query("SELECT * FROM " . MYSQL_BASE_MEDICAO . " WHERE id = " . $id); $id_contrato = 1; while ($row = mysql_fetch_array($query)) { $id_contrato = $row['id_contrato']; }