示例#1
0
 public function getAll()
 {
     $sql = "SELECT cod_ocorrencia as codigo, descricao\n                FROM hor_tipo_ocorrencia\n                ORDER BY cod_ocorrencia;";
     $rs = parent::obterRecordSet($sql);
     $oOcorrencia = array();
     foreach ($rs as $row) {
         $vOcorrencia = new Ocorrencia();
         $vOcorrencia->setCodigo($row["codigo"]);
         $vOcorrencia->setDescricao($row["descricao"]);
         $oOcorrencia[] = $vOcorrencia;
         $vOcorrencia = null;
     }
     return $oOcorrencia;
 }
示例#2
0
 public static function getRelatorioOperacoes()
 {
     Excel::create('Planilha de Controle da Farmacia - Ocorrencias', function ($excel) {
         $excel->sheet('Ref. ', function ($sheet) {
             $sheet->mergeCells('A1:J5');
             $sheet->setHeight(1, 50);
             $sheet->row(1, function ($row) {
                 $row->setFontFamily('Arial');
                 $row->setFontSize(20);
             });
             $sheet->cell('A1', function ($cell) {
                 $cell->setAlignment('center');
             });
             $sheet->getStyle('D')->getAlignment()->setWrapText(true);
             $sheet->row(1, array('Frizelo Frigorificos Ltda.'));
             $periodo = explode('-', Input::get('periodo'));
             $a = [];
             foreach (Ocorrencia::whereBetween('data_hora', $periodo)->get() as $val) {
                 $a[] = ['Nome' => $val->colaborador->nome, 'Setor' => !empty($val->colaborador->setor->descricao) ? $val->colaborador->setor->descricao : null, 'Data' => $val->data_hora, 'Queixa' => empty($val->queixa->descricao) ? null : $val->queixa->descricao, 'Descrição / Motivo' => $val->relato . ' - ' . $val->diagnostico, 'Conduta / Destino' => $val->conduta . ' - ' . $val->destino];
             }
             $sheet->setAutoFilter('A6:J6');
             $sheet->setOrientation('landscape');
             $sheet->fromArray($a, null, 'A6', true);
         });
     })->export('xls');
 }
 public function run()
 {
     foreach (Ocorrencia::all() as $ocorrencia) {
         $colaborador = $ocorrencia->colaborador;
         $ocorrencia->setor_id = $colaborador->setor_id;
         $ocorrencia->posto_id = $colaborador->posto_id;
         $ocorrencia->save();
     }
 }
 public function getDelete($id)
 {
     $model = Ocorrencia::find($id);
     if ($model->usuario_id !== Auth::user()->ni) {
         return Redirect::to('/aluno/' . $model->aluno_id)->withDanger('Somente o autor pode excluir esta mensagem!');
     }
     if (Ocorrencia::find($id)->delete()) {
         return Redirect::to('/aluno/' . $model->aluno_id)->withSuccess('Ocorrência deletada com sucesso!');
     }
 }
示例#5
0
 public function setRedirecionar($id)
 {
     $input = Input::all();
     $ocorrencia = Ocorrencia::find($id);
     if ($ocorrencia->update($input)) {
         $ocorrencia->investigacao->delete();
     }
     return Redirect::route('sesmt.investigacao.index');
 }
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Ocorrencia::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
示例#7
0
    <div class="row">
        <div class="col-md-12">
            <h3 class="page-header"><?php 
echo $data['pagetitle'];
?>
</h3>
        </div>
    </div>

    <!--Teste de Perfil-->
    <div class="row">
        <div class="col-md-12">
            <div class="jumbotron">
                <?php 
$ocorrencia = $data['perfil'];
$action = new Ocorrencia();
$action->removerOcorrencia($ocorrencia);
?>

                <div class="container">
                    <?php 
if (!Input::exists()) {
    ?>
                        <h1><span class="glyphicon glyphicon-arrow-right"></span> Atenção!</h1>

                        <p>Deseja deletar a ocorrência <strong><?php 
    echo $ocorrencia->getDescAssunto();
    ?>
</strong>?
                        </p>
 public function show($id)
 {
     $aluno = Aluno::find($id);
     $ocorrencias = Ocorrencia::where('aluno_id', $id)->orderBy('created_at', 'desc')->paginate(5);
     return View::make('aluno.view', ['aluno' => $aluno, 'ocorrencias' => $ocorrencias]);
 }
示例#9
0
 public function edit()
 {
     try {
         // define view
         $view = new View("editar_registro.html");
         $view->addFile("TOPO", "topo.html");
         $vData = new DateTime(str_replace("/", "-", $_GET["_token"]));
         // preenche view com dados do profissional
         $oProf = new Profissional();
         $oProf = Sessao::getObject("oProf");
         $vTitulo = ":: EDITAR REGISTRO DE PONTO :: " . $oProf->getMatricula() . " - " . $oProf->getNome() . " :: " . $oProf->getFuncao();
         $view->setValue("TITULO", $vTitulo);
         // preenche view com dados do registro
         $oRegistro = new Registro();
         $oRegistro = $this->model->getByDate($oProf, $vData->format("d-m-Y"));
         $view->setValue("DATA", $vData->format("d-m-Y"));
         $view->setValue("DIASEMANA", Data::getDiaSemana($vData));
         if ($oRegistro) {
             $view->setValue("ENTRADA", $oRegistro->getEntradaManha());
             $view->setValue("ALMOCO", $oRegistro->getSaidaManha());
             $view->setValue("RETORNO", $oRegistro->getEntradaTarde());
             $view->setValue("SAIDA", $oRegistro->getSaidaTarde());
         }
         // carrega selects de ocorrencia
         $oOcorrencia = new Ocorrencia();
         $vOcorrencia = $oOcorrencia->getAll();
         foreach ($vOcorrencia as $row) {
             $view->setValue("CODIGO", $row->getCodigo());
             $view->setValue("DESCRICAO", $row->getDescricao());
             $view->parseBlock("BLOCK_OCORRENCIA1", true);
             $view->parseBlock("BLOCK_OCORRENCIA2", true);
             $view->parseBlock("BLOCK_OCORRENCIA3", true);
             $view->parseBlock("BLOCK_OCORRENCIA4", true);
         }
         // exibe view
         $view->addFile("FOOTER", "rodape.html");
         $view->show();
     } catch (Exception $e) {
         die($e->getMessage());
     }
 }
示例#10
0
<?php

$ocorrencia = $data['perfil'];
$ocorrencia_form = new Ocorrencia();
$cadastrado = $ocorrencia_form->cadastra($ocorrencia);
//Não cadastra na entra pois ainda não tem Token
$id_check = $data['id'];
$token = Token::generate();
?>
<div class="container">
<div class="row">
    <div class="col-sm-12">
        <h3 class="page-header"><?php 
echo $data['pagetitle'];
?>
            <small><?php 
echo $data['pagesubtitle'];
?>
</small>
            <?php 
if ($id_check) {
    ?>
                <span class="btn-panel pull-right">
                <a href="Ocorrencia/visualizar/<?php 
    echo $id_check;
    ?>
" data-toggle="tooltip" data-placement="top"
                   title="Ver Perfil!"
                   class="btn btn-circle btn-lg">
                    <i class="fa fa-eye"></i>
                </a>
示例#11
0
 public function postos($queixas)
 {
     foreach (Setor::orderBy('descricao')->get() as $setor) {
         if (!empty($setor->postoTrabalhos->count())) {
             $this->AddPage();
             $this->setFillColor(150);
             $this->Cell(0, 5, utf8_decode('SETOR - ' . $setor->descricao), 1, 0, 'C', 1);
             //$this->Ln(15);
             $this->Ln();
             $this->setFont('Arial', '', 6);
             $this->Cell(50, 30, 'POSTO DE TRABALHO', 1, 0, 'l', 0);
             $this->Ln();
             //-- Lista de Causas --//
             $this->Rotate(90);
             $this->Ln(50);
             $qs = null;
             foreach ($queixas->get() as $queixa) {
                 $this->setFillColor(230);
                 $this->Cell(30, 4, utf8_decode($queixa->descricao), 1, 0, 'l', 1);
                 $qs[] = $queixa;
                 $this->Ln();
             }
             $this->Cell(30, 4, utf8_decode('TOTAL DO POSTO'), 1, 0, 'l', 1);
             $this->Rotate(0);
             $this->SetAutoPageBreak(true, 5);
             $linhas = -($queixas->count() * 4 + 50);
             //-- Fim ista de Causas --//
             $this->Ln($linhas);
             unset($totalQueixas);
             foreach ($setor->postoTrabalhos as $posto) {
                 $this->setFillColor(200);
                 $this->Cell(50, 4, utf8_decode(substr($posto->descricao, 0, 37)), 1, 0, 'l', 0);
                 $totalQueixaPosto = 0;
                 foreach ($qs as $q) {
                     $totalQueixa = Ocorrencia::where('setor_id', $setor->id)->where('posto_id', $posto->id)->where('queixa_id', $q->id)->count();
                     $this->Cell(4, 4, $totalQueixa, 1, 0, 'C', 0);
                     if (empty($totalQueixas[$q->id])) {
                         $totalQueixas[$q->id] = 0;
                     }
                     $totalQueixas[$q->id] = $totalQueixa + $totalQueixas[$q->id];
                     $totalQueixaPosto = $totalQueixaPosto + $totalQueixa;
                 }
                 $this->Cell(4, 4, $totalQueixaPosto, 1, 0, 'C', 1);
                 $this->Ln();
             }
             $this->Cell(50, 4, utf8_decode('TOTAL DA QUEIXA'), 1, 0, 'l', 1);
             foreach ($totalQueixas as $total) {
                 $this->Cell(4, 4, $total, 1, 0, 'C', 1);
             }
             $this->Ln();
         }
     }
 }
示例#12
0
 /**
  * Show the form for editing the specified resource.
  * GET /analise/{id}/edit
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $ocorrencia = Ocorrencia::find($id);
     return View::make('sesmt::analises.edit', compact('ocorrencia'));
 }
示例#13
0
 public function getReport()
 {
     $input = Input::all();
     $periodo = explode(' - ', $input['periodo']);
     switch ($input['tipo']) {
         case 'atestados':
             OcorrenciaAtestado::relatorioAtestados();
             break;
         case 'ocorrencia':
             Ocorrencia::getRelatorioOperacoes();
             break;
         default:
             # code...
             break;
     }
 }