function listarMedicao() { $DAO = new MedicaoAcessoDao(); $retorno = $DAO->Listar("SELECT *, MONTH(ref_inicio) as mes FROM " . MYSQL_BASE_MEDICAO . " WHERE status = 'S' ORDER BY id_contrato"); foreach ($retorno as $item) { if ($item['id_contrato'] == 1) { $tipo = "Contrato"; } else { $tipo = "Aditivo"; } switch ($item['mes']) { case 1: $mes = 'Jan'; break; case 2: $mes = 'Fev'; break; case 3: $mes = 'Mar'; break; case 4: $mes = 'Abr'; break; case 5: $mes = 'Mai'; break; case 6: $mes = 'Jun'; break; case 7: $mes = 'Jul'; break; case 8: $mes = 'Ago'; break; case 9: $mes = 'Set'; break; case 10: $mes = 'Out'; break; case 11: $mes = 'Nov'; break; case 12: $mes = 'Dez'; break; default: $mes = ""; break; } echo '<option value=' . $item['id'] . '>Medição ' . $item['numero'] . ' (' . $mes . ') - ' . $tipo . '</option>'; } }
<?php include_once '../../includes.sys/ini.php'; include_once INTERNAL_ROOT_PORTAL . '/includes.sys/metodos.php'; include_once INTERNAL_ROOT_PORTAL . '/medicao/DAO/MedicaoAcessoDAO.php'; checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true'); include_once INTERNAL_ROOT_PORTAL . '/head.php'; $DAO = new MedicaoAcessoDao(); if (!empty($_GET['cmd']) && $_GET['cmd'] == 'del') { $id = limpaTexto($_GET['id']); $retorno = $DAO->Finalizar($id); if ($retorno == 1) { $msg = "Associação removida com sucesso."; echo '<script language= "JavaScript">alert("' . $msg . '");</script>'; echo '<script language= "JavaScript">location.href="index.php";</script>'; } else { print_r($retorno); } } ?> <!-- topbar ends --> <div class="container-fluid"> <div class="row-fluid"> <!-- left menu starts --> <div class="span2 main-menu-span"> <?php include_once INTERNAL_ROOT_PORTAL . '/medicao/menu.php'; ?> </div><!--/span-->