public function setors($returns) { foreach (Setor::all() as $setor) { echo '<ul><li>' . $setor->descricao . '</li><ul>'; foreach ($setor->colaboradores as $colaborador) { for ($mes = 1; $mes <= 12; $mes++) { $total[] = $colaborador->ocorrencias()->whereRaw("\textract(month from data_hora) = ? and\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \textract(year from data_hora) = 2015", [$mes])->count(); } print_r($total); } echo '</ul></ul>'; } die; }
public function Dados($ocorrencias) { foreach (Setor::all() as $setor) { if (!empty($setor->postoTrabalhos()->count())) { $this->AddPage(); $this->Cell(0, 5, $setor->descricao, 1, 0, 'L', 0); $this->Ln(); foreach ($setor->postoTrabalhos as $posto) { if (!empty($ocorrencias[$setor->descricao][$posto->descricao])) { $this->Cell(100, 5, utf8_decode($posto->descricao), 1, 0, 'L', 0); $this->Cell(40, 5, $ocorrencias[$setor->descricao][$posto->descricao], 1, 0, 'L', 0); $this->Ln(); } } } } }
public function getColaboradorExames() { $setors = Setor::all(); return View::make('farmacia::relatorios.views.colaborador_exames', compact('setors')); }