コード例 #1
0
ファイル: MedicaoAcesso.class.php プロジェクト: hexti/troncal
 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&ccedil;&atilde;o ' . $item['numero'] . ' (' . $mes . ') - ' . $tipo . '</option>';
     }
 }