public function ExeDelete($mat_id)
 {
     $FeExames = new FeExames();
     $FeExames->setFe_material($mat_id);
     $FeExames->Execute()->Query("#fe_material#");
     if (!$FeExames->Execute()->getResult()) {
         $this->Read->setMat_id($mat_id);
         return $this->Read->Execute()->delete();
     }
 }
 /**
  * Deleta ação de exame se não estiver sendo usado
  * 
  * @param int $acao_id
  * @return boolean
  */
 function ExeDelete($acao_id)
 {
     $FeExames = new FeExames();
     $FeExames->setFe_acoes($acao_id);
     $FeExames->Execute()->find();
     if (!$FeExames->Execute()->getResult()) {
         $this->Read->setAcao_id($acao_id);
         return $this->Read->Execute()->delete();
     }
 }
Exemplo n.º 3
0
                } else {
                    WSErro("Erro ao deletar", WS_ERROR);
                }
                break;
            default:
                WSErro("Opss! opção invalida.", WS_ERROR);
                break;
        }
    } else {
        WSErro("O material informada não pode ser encontrado!", WS_INFOR);
    }
}
$getPage = filter_input(INPUT_GET, 'page', FILTER_VALIDATE_INT);
$Pager = new Pager(FAST_INCLUDE . "admin/&exe=exames/index&page=");
$Pager->ExePager($getPage, 15);
$FeExames = new FeExames();
$FeExames->Execute()->FullRead("SELECT * FROM fe_exames WHERE ex_cancelado = 0 ORDER BY ex_status, ex_data_fechamento DESC LIMIT :limit OFFSET :offset", "limit={$Pager->getLimit()}&offset={$Pager->getOffset()}", true);
if (!$FeExames->Execute()->getResult()) {
    $Pager->ReturnPage();
    WSErro("Nenhum solicitação de alteraçao de exame encontrado!", WS_INFOR);
} else {
    ?>
    <table class="table table-striped text-center" id="form" style="font-size: 0.9em;">
        <thead>
            <tr>
                <th class="text-center">Descrição</th>
                <th class="text-center">Mnemônico</th>
                <th class="text-center">Setor Exec.</th>
                <th class="text-center">Ações</th>
                <th class="text-center">Solicitado em.</th>
                <th class="text-center">Concluido em.</th>
Exemplo n.º 4
0
<?php

if (file_exists('include/fast-exames/_models/AdminExames.class.php')) {
    include_once 'include/fast-exames/_models/AdminExames.class.php';
}
Register::addRegister("<script src='" . HOME . "/js/google-charts/columns.charts.js'></script>");
$using = filter_input(INPUT_GET, 'using', FILTER_VALIDATE_BOOLEAN);
if ($using) {
    WSErro("Este exame já esta sendo usado por outra pessoa.", WS_ALERT);
}
$FeExames = new FeExames();
$AdminExames = new AdminExames();
//Total por usuarios
$FeExames->Execute()->FullRead("SELECT count(e.ws_users) as 'cont' , u.* FROM fe_exames e " . "JOIN ws_users u ON(u.user_id = e.ws_users) " . "GROUP BY e.ws_users;");
$usuarios = $FeExames->Execute()->getResult();
//Tempo Medio dias corrisdos
$ListaTempoMedio = $FeExames->Execute()->FullRead("SELECT e.ex_data_abertura as 'data_inicio' , e.ex_data_fechamento  as 'data_fim' " . "FROM fe_exames e where e.ex_status=1");
$TempoMedio = $AdminExames->TempoMedio($ListaTempoMedio);
//Tempo medio de resolução por periodo
//LastMonth
$lastMonth = date('Y-m-d H:i:s', strtotime('-1 month'));
$mes = $FeExames->Execute()->FullRead("SELECT e.ex_data_abertura as 'data_inicio' , e.ex_data_fechamento  as 'data_fim' " . "FROM fe_exames e where e.ex_status=1 AND e.ex_data_abertura >= '{$lastMonth}'");
$month = $AdminExames->TempoMedio($mes);
//LastWeek
$lastWeek = date('Y-m-d H:i:s', strtotime('-1 week'));
$semana = $FeExames->Execute()->FullRead("SELECT e.ex_data_abertura as 'data_inicio' , e.ex_data_fechamento  as 'data_fim' " . "FROM fe_exames e where e.ex_status=1 AND e.ex_data_abertura >= '{$lastWeek}'");
$week = $AdminExames->TempoMedio($semana);
//LastDay
$lastDay = date('Y-m-d H:i:s', strtotime('-1 day'));
$dia = $FeExames->Execute()->FullRead("SELECT e.ex_data_abertura as 'data_inicio' , e.ex_data_fechamento  as 'data_fim' " . "FROM fe_exames e where e.ex_status=1 AND e.ex_data_abertura >= '{$lastDay}'");
$day = $AdminExames->TempoMedio($dia);