Esempio n. 1
0
 public static function viewDateTime($date_time)
 {
     $d = explode(' ', $date_time);
     $date = Format::viewDate($d[0]);
     $hora = $d[1];
     return $date . ' ' . $hora;
 }
Esempio n. 2
0
 public static function relatorioAtestados()
 {
     Excel::create('Planilha de Controle da Farmacia - Atestado / Cesta Básica', function ($excel) {
         $excel->sheet('Excel sheet', 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->row(1, array('Frizelo Frigorificos Ltda.'));
             $sheet->setAutoFilter('A6:J6');
             $sheet->setOrientation('landscape');
             $input = Input::all();
             $periodo = explode(' - ', $input['periodo']);
             $atestados = OcorrenciaAtestado::whereBetween('inicio_afastamento', $periodo)->get();
             $return = null;
             foreach ($atestados as $atestado) {
                 if (empty($atestado->getCid->descricao)) {
                     $cid = $atestado->cid;
                 } else {
                     $cid = $atestado->getCid->cod_cid . ' - ' . $atestado->getCid->descricao;
                 }
                 $return[] = ['matricula' => $atestado->ocorrencia->colaborador->codigo_interno, 'nome' => $atestado->ocorrencia->colaborador->nome, 'setor' => $atestado->ocorrencia->colaborador->setor->descricao, 'data inicio' => Format::viewDate($atestado->inicio_afastamento), 'fim afastamento' => Format::viewDate($atestado->fim_afastamento), 'descricao' => $atestado->tipoDescricao, 'obs' => $atestado->obs, 'cid' => $cid, 'medico' => $atestado->profissional, 'Total Dias' => $atestado->dias_afastamento];
             }
             $sheet->fromArray($return, null, 'A6', true);
         });
     })->export('xls');
 }
Esempio n. 3
0
 public function getDataNascimentoAttribute()
 {
     if (!empty($this->attributes['data_nascimento'])) {
         return Format::viewDate($this->attributes['data_nascimento']);
     }
 }
Esempio n. 4
0
 public function getDataOcorrenciaAttribute()
 {
     $hora = explode(' ', $this->attributes['data_hora']);
     return Format::viewDate($hora[0]);
 }
Esempio n. 5
0
 public function farmacia($colaborador)
 {
     $this->SetFont('Arial', 'B', 12);
     $this->Cell(0, 6, utf8_decode('Farmácia'), 'LTBR', 0, 'C');
     $this->Ln();
     // -- Ocorrencias -- //
     if (count($colaborador->ocorrencias()->monitoramento()->get())) {
         $this->SetFont('Arial', '', 9);
         $this->Cell(0, 6, utf8_decode('Ocorrencias'), 'LTBR', 0, 'L', 1);
         $this->Ln();
         $this->SetFont('Arial', '', 6);
         foreach ($colaborador->ocorrencias()->monitoramento()->get() as $ocorrencia) {
             $this->MultiCell(0, 4, str_replace('', ' ', $ocorrencia->data_hora . ': ' . utf8_decode($ocorrencia->relato) . ' ' . utf8_decode($ocorrencia->diagnostico) . ' ' . utf8_decode($ocorrencia->conduta) . ' | ' . $ocorrencia->profissional), 'LRT', 'L', 0);
             if ($ocorrencia->atestados->count()) {
                 $this->Cell(20, 4, utf8_decode('Inicio Atestado'), 'LTBR', 0, 'C');
                 $this->Cell(20, 4, utf8_decode('Fim Atestado'), 'LTBR', 0, 'C');
                 $this->Cell(20, 4, utf8_decode('Dias Afastamento'), 'LTBR', 0, 'C');
                 $this->Cell(40, 4, utf8_decode('Local Atendimento'), 'LTBR', 0, 'L');
                 $this->Cell(50, 4, utf8_decode('Cid - descrição'), 'LTBR', 0, 'L');
                 $this->Cell(40, 4, utf8_decode('Profissional'), 'LTBR', 0, 'L');
                 $this->Ln();
                 foreach ($ocorrencia->atestados as $atestado) {
                     $this->Cell(20, 4, Format::viewDate($atestado->inicio_afastamento), 'LTBR', 0, 'C');
                     $this->Cell(20, 4, Format::viewDate($atestado->fim_afastamento), 'LTBR', 0, 'C');
                     $this->Cell(20, 4, $atestado->dias_afastamento, 'LTBR', 0, 'C');
                     $this->Cell(40, 4, $atestado->local, 'LTBR', 0, 'L');
                     $this->Cell(50, 4, substr($atestado->cid . ' - ' . utf8_decode($atestado->getCid->descricao), 0, 40), 'LTBR', 0, 'L');
                     $this->Cell(40, 4, utf8_decode($atestado->profissional), 'LTBR', 0, 'L');
                     $this->Ln();
                 }
             }
         }
     }
     // -- Fim Ocorrencias -- //
     // -- Inicio Asos -- //
     if (count($colaborador->asos)) {
         $this->SetFont('Arial', '', 9);
         $this->Cell(190, 6, utf8_decode('Fichas Aso'), 'LTBR', 0, 'L', 1);
         $this->Ln();
         $this->SetFont('Arial', '', 6);
         foreach ($colaborador->asos as $aso) {
             $this->Cell(30, 4, $aso->id . ' - ' . Format::viewDate($aso->data), 'LT', 0, 'L');
             $this->Cell(30, 4, strtoupper($aso->tipo), 'T', 0, 'L');
             $this->Cell(40, 4, strtoupper($aso->medico), 'T', 0, 'L');
             $this->Cell(40, 4, strtoupper($aso->status), 'T', 0, 'L');
             $this->Cell(50, 4, strtoupper($aso->situacao), 'TR', 0, 'L');
             $this->Ln();
             if (count($aso->exames)) {
                 $this->Cell(40, 3, strtoupper('Exame'), 'LTR', 0, 'L', 1);
                 $this->Cell(15, 3, strtoupper('Data'), 'LTR', 0, 'L', 1);
                 $this->Cell(15, 3, strtoupper('Validade'), 'LTR', 0, 'L', 1);
                 $this->Cell(40, 3, utf8_decode(strtoupper('Local RealizaÇÃo')), 'LTR', 0, 'L', 1);
                 $this->Cell(50, 3, strtoupper('Medico'), 'LTR', 0, 'L', 1);
                 $this->Cell(30, 3, strtoupper('Resultado'), 'LTR', 0, 'L', 1);
                 $this->Ln();
                 foreach ($aso->exames as $exame) {
                     $this->Cell(40, 3.5, utf8_decode($exame->descricao), 'L', 0, 'L');
                     $this->Cell(15, 3.5, Format::viewDate($exame->data), 0, 0, 'L');
                     $this->Cell(15, 3.5, $exame->data_validade, 0, 0, 'L');
                     $this->Cell(40, 3.5, utf8_decode($exame->local_realizacao), 0, 0, 'L');
                     $this->Cell(50, 3.5, utf8_decode($exame->medico), 0, 0, 'L');
                     $this->Cell(30, 3.5, utf8_decode($exame->resultado), 'R', 0, 'L');
                     $this->Ln();
                 }
                 $this->Cell(0, 1, '', 'T');
             }
             $this->Ln();
         }
     }
     // -- Fim Asos -- //
 }
Esempio n. 6
0
 public function getDataAcidenteAttribute()
 {
     return Format::viewDate($this->attributes['data_acidente']);
 }
Esempio n. 7
0
 public function getDataNascimentoAttribute()
 {
     if ($this->attributes['data_nascimento']) {
         return Format::viewDate($this->attributes['data_nascimento']);
     } else {
         return null;
     }
 }