Example #1
0
 public function frame()
 {
     $fc = Zend_Controller_Front::getInstance();
     $fc->registro['os_empresa_agrupadora_id'] = $_REQUEST['os_empresa_agrupadora_id'] != NULL ? $_REQUEST['os_empresa_agrupadora_id'] : NULL;
     $modelo = new Empresa();
     $empresas = $modelo->arraySelect();
     $dados = $_REQUEST['os_empresa_agrupadora_id'] . $fc->getRequest()->getParam("os_empresa_agrupadora_id") . $fc->registro['os_empresa_agrupadora_id'];
     $dados .= "<label for='os_empresa_agrupadora_id'>Empresa:</label>\n";
     $dados .= "<select name='os_empresa_agrupadora_id' id='os_empresa_agrupadora_id' required onchange=\"location.href='?os_empresa_agrupadora_id='+this.value;\">\n";
     $dados .= "<option></option>\n";
     foreach ($empresas as $id => $empresa) {
         $dados .= "<option ";
         $dados .= $fc->registro['os_empresa_agrupadora_id'] == $id ? 'selected' : NULL;
         $dados .= " value=" . $id . ">{$empresa}</option>\n";
     }
     $dados .= "</select><br>\n";
     $modelo = new Setor();
     $setores = $modelo->arraySelect($fc->registro['os_empresa_agrupadora_id']);
     $dados .= "<label for='os_setor_id'>Setor:</label>\n";
     $dados .= "<select name='os_setor_id' id='os_setor_id' required>\n";
     $dados .= "<option></option>\n";
     foreach ($setores as $id => $setor) {
         $dados .= "<option ";
         $dados .= $fc->registro['os_setor_id'] == $id ? 'selected' : NULL;
         $dados .= " value=" . $id . ">" . $setor . "</option>\n";
     }
     $dados .= "</select><br>";
     file_put_contents(APPLICATION_PATH . "\\..\\www\\frame\\Equipamento.html", $dados);
 }
 public function del()
 {
     $setor = new Setor();
     $delete = explode(':', $this->data->marca);
     foreach ($delete as $id) {
         $setor->getById($id);
         $setor->delete();
     }
     $this->grid();
 }
Example #3
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();
         }
     }
 }
Example #4
0
 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;
 }
Example #5
0
 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();
                 }
             }
         }
     }
 }
Example #6
0
<?php

$setor = $data['setor'];
$setor_form = new Setor();
$cadastrado = $setor_form->cadastra($setor);
//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="Setor/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>
Example #7
0
 public function setors($exames)
 {
     foreach (Setor::orderBy('descricao')->get() as $setor) {
         if (!empty($setor->postoTrabalhos->count())) {
             $this->SetFillColor(150);
             $this->Cell(190, 5, utf8_decode($setor->descricao), 1, 0, 'C', 1);
             $this->Ln();
             $this->SetFillColor(200);
             $this->Cell(50, 4, utf8_decode('Posto de Trabalho'), 1, 0, 'C', 1);
             $this->Cell(80, 4, utf8_decode('Tipo de Exame'), 1, 0, 'C', 1);
             $this->Cell(15, 4, utf8_decode('Total'), 1, 0, 'C', 1);
             $this->Cell(15, 4, utf8_decode('Alterados'), 1, 0, 'C', 1);
             $this->SetFont('Arial', '', 6);
             $this->Cell(21, 4, utf8_decode('Alterados * 100/Total'), 1, 0, 0, 1);
             $this->Ln();
             foreach ($setor->postoTrabalhos()->orderBy('descricao')->get() as $posto) {
                 $aso = Aso::where('colaborador_setor_id', $setor->id)->where('posto_id', $posto->id)->lists('id');
                 if (count($posto->asos) && AsoExame::whereIn('relacao_id', $aso)->count() != 0) {
                     $this->SetFillColor(240);
                     $this->SetFont('Arial', '', 9);
                     $this->Cell(50, 4, utf8_decode($posto->descricao), 1, 0, 'L', 1);
                     $count = 0;
                     foreach (Exame::all() as $exame) {
                         $exames = AsoExame::where('exame_id', $exame->id)->whereIn('relacao_id', $aso)->count();
                         $alterado = AsoExame::where('exame_id', $exame->id)->whereIn('relacao_id', $aso)->whereNotIn('resultado', ['normal', 'NÃO REAGENTE', 'NORMAL', 'norm', 'NORMA'])->count();
                         if ($exames != 0) {
                             if ($count == 0) {
                                 $this->Cell(80, 4, utf8_decode($exame->descricao), 1, 0, 'L', 0);
                                 $this->Cell(15, 4, $exames, 1, 0, 'L', 0);
                                 $this->Cell(15, 4, $alterado, 1, 0, 'L', 0);
                                 $this->Cell(21, 4, number_format($alterado * 100 / $exames, 2, ',', '.') . ' %', 1, 0, 'R', 0);
                                 $this->Ln();
                             } else {
                                 $this->Cell(50, 4, '', 0, 0, 'L', 0);
                                 $this->Cell(80, 4, utf8_encode($exame->descricao), 1, 0, 'L', 0);
                                 $this->Cell(15, 4, $exames, 1, 0, 'L', 0);
                                 $this->Cell(15, 4, $alterado, 1, 0, 'L', 0);
                                 $this->Cell(21, 4, number_format($alterado * 100 / $exames, 2, ',', '.') . ' %', 1, 0, 'R', 0);
                                 $this->Ln();
                             }
                             if (empty($totalExame[$exame->descricao])) {
                                 $totalExame[$exame->descricao] = 0;
                             }
                             if (empty($totalAlterados[$exame->descricao])) {
                                 $totalAlterados[$exame->descricao] = 0;
                             }
                             $totalExame[$exame->descricao] = $exames + $totalExame[$exame->descricao];
                             $totalAlterados[$exame->descricao] = $alterado + $totalAlterados[$exame->descricao];
                             $count = $count + 1;
                         }
                     }
                     $this->Ln();
                 }
             }
             $this->AddPage();
         }
     }
     $this->Cell(190, 7, utf8_decode('Total de Exames Realizados'), 1, 0, 'C', 1);
     $this->Ln();
     $this->Cell(80, 6, utf8_decode('Descrição'), 'BLT', 0, 'C', 1);
     $this->Cell(30, 6, 'Realizados', 'BLT', 0, 'C', 1);
     $this->Cell(30, 6, 'Alterados', 'BLT', 0, 'C', 1);
     $this->Cell(40, 6, 'Alterados*100/Realizados', 1, 0, 'C', 1);
     $this->Ln();
     foreach ($totalExame as $exame => $valor) {
         $this->Cell(80, 6, utf8_decode($exame), 'BLT', 0, 'L');
         $this->Cell(30, 6, $totalExame[$exame], 'BLT', 0, 'C');
         $this->Cell(30, 6, $totalAlterados[$exame], 'BLT', 0, 'C');
         $this->Cell(40, 6, number_format($totalAlterados[$exame] * 100 / $totalExame[$exame], 2, ',', '.') . ' %', 1, 0, 'C');
         $this->Ln();
     }
 }
Example #8
0
 /**
  * Duas operações com objetos diferentes, usando a mesma transação
  */
 public function nestedTransactions()
 {
     try {
         $transaction = $this->beginTransaction();
         $this->getById(1);
         $this->save();
         // cria um novo usuário com um novo setor
         $setor = new Setor();
         $setor->novo('NOVO SETOR');
         $this->setPersistent(false);
         $this->setIdSetor($setor->getIdSetor());
         $this->save();
         $transaction->commit();
     } catch (EModelException $e) {
         $transaction->rollback();
         throw new EModelException($e->getMessage());
     }
 }
Example #9
0
    Route::resource('users', 'UserController');
    Route::get('users/permissao/{id}', 'PermissaoController@getSistema');
    Route::post('users/permissao', 'PermissaoController@postMenu');
});
/**
 *
 *	Ordem Interna
 *
 **/
Route::group(['before' => 'auth'], function () {
    Route::get('/setors/find/{id}/postoTrabalho', function ($setor_id) {
        $setor = Setor::find($setor_id);
        return Response::json($setor->postoTrabalhos);
    });
    Route::get('/setors/find/{id}/funcao', function ($setor_id) {
        $setor = Setor::find($setor_id);
        return Response::json($setor->funcaos);
    });
    Route::get('/farmacia/{cod}/cid', function ($cod) {
        $cid = FarmaciaCid::where('cod_cid', '=', $cod)->get();
        if ($cid->count() == 0) {
            return 0;
        } else {
            return $cid;
        }
    });
    Route::get('/fichas/find/{rg}/rg', function ($rg) {
        $ficha = Ficha::where('rg', $rg)->where('situacao', '<>', 0)->get();
        if (count($ficha)) {
            return $ficha;
        }
Example #10
0
 public function getColaboradorExames()
 {
     $setors = Setor::all();
     return View::make('farmacia::relatorios.views.colaborador_exames', compact('setors'));
 }
Example #11
0
 public function getSetorAcidentes()
 {
     $setors = Setor::ativos()->get();
     return View::make('sesmt::relatorios.reports.setor_acidentes', compact('setors'));
 }
Example #12
0
$fpdf->Cell(190, 7, 'Posto de Trabalho: ' . utf8_decode(!$aso->postoTrabalho ? null : $aso->postoTrabalho->descricao), 'LTR', 0, 'L');
$fpdf->Ln();
$fpdf->SetFillColor(200);
if (!empty($aso->postoTrabalho)) {
    $fpdf->SetFont('Arial', '', 7);
    $fpdf->MultiCell(190, 6, utf8_decode('Atividades: ' . implode(', ', $aso->postoTrabalho->atividades->lists('descricao'))), 'LTRB', 'L');
}
$fpdf->SetFont('Arial', 'B', 10);
$fpdf->Cell(190, 6, utf8_decode('Tipo de Exame Médico: ') . strtoupper($aso->tipo), 'TLRB', 0, 'C', 1);
$fpdf->Ln();
$fpdf->SetFont('Arial', '', 9);
if ($aso->tipo == 'mudanca de funcao') {
    $novo = DB::table('farmacia.asos')->where('id', $aso->id)->first();
    $fpdf->Cell(0, 6, utf8_decode('NOVO POSTO DE TRABALHO'), 'TLRB', 0, 'C', 0);
    $fpdf->Ln();
    $fpdf->Cell(70, 7, utf8_decode('Setor: ' . Setor::find($novo->colaborador_setor_id)->descricao), 'LTR', 0, 'L');
    $fpdf->Cell(0, 7, utf8_decode('Função: ' . SetorFuncao::find($novo->colaborador_funcao_id)->descricao), 'LTR', 0, 'L');
    $fpdf->Ln();
    $fpdf->Cell(190, 7, utf8_decode('Posto de Trabalho: ' . SetorPosto::find($novo->posto_id)->descricao), 'LTR', 0, 'L');
    $fpdf->Ln();
}
$fpdf->SetFont('Arial', 'B', 10);
$fpdf->Cell(190, 6, utf8_decode('Riscos'), 'TLRB', 0, 'C', 1);
$fpdf->Ln();
$fpdf->SetFont('Arial', '', 9);
$fpdf->SetFillColor(255);
$fpdf->Cell(38, 6, utf8_decode('Físicos'), 'TLRB', 0, 'C');
$fpdf->Cell(28, 6, utf8_decode('Químicos'), 'TLRB', 0, 'C');
$fpdf->Cell(28, 6, utf8_decode('Biológicos'), 'TLRB', 0, 'C');
$fpdf->Cell(43, 6, utf8_decode('Ergonomicos'), 'TLRB', 0, 'C');
$fpdf->Cell(53, 6, utf8_decode('Acidentes'), 'TLRB', 0, 'C');
Example #13
0
File: Aso.php Project: kuell/buriti
 public function getSetorAttribute()
 {
     if (empty($this->attributes['colaborador_id'])) {
         return Setor::find($this->attributes['colaborador_setor_id'])->descricao;
     } else {
         return $this->colaborador->setor->descricao;
     }
 }
Example #14
0
                <small>
                    <?php 
echo isset($data['pagesubtitle']) ? $data['pagesubtitle'] : "";
?>
                </small>
            </h3>
        </div>
    </div>

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

                <div class="container">
                    <?php 
if (!Input::exists()) {
    ?>
                        <div class="col-md-4">
                            <img class="img-circle profilefoto left"
                                 src="<?php 
    echo Image::get($setor);
    ?>
">
                        </div>
                        <div class="col-md-8">