public function printFunc() { $empresa = new Empresa(); $empresa->get_empresa_by_id($this->id_empresa); $valor_custo = new Valor_custo(); $valor_custo->get_valor_custo_id($this->id_valor_custo); $vlr = $this->verificaValor($valor_custo->valor); if ($vlr == "") { $vlr = 0.0; } $sal = $this->verificaValor($this->salario_base); $filial = Filial::get_filial_id($this->id_empresa_filial); $cbo = new Cbo(); $cbo->get_cbo_by_id($this->id_cbo); $turno = new Turno(); $turno->getTurnoById($this->id_turno); $u = new Epi(); $epi_func = $u->get_epi_func($this->id); $texto = ""; $texto .= "<table class='table_pesquisa'><tr>"; $texto .= "<td colspan='2'><b><span>ID: <span></b></td><td><span><span>" . $this->id . "</span><td><span>Cod_Serie</span></td><td><span>" . $this->cod_serie . "</span></td></td>"; $texto .= "</tr>"; $texto .= "<tr>"; $texto .= "<td colspan='2'><b><span>Nome: <span></b></td><td colspan='3'><span>" . $this->nome . "</span></td>"; $texto .= "</tr>"; $texto .= "<tr>"; $texto .= "<td colspan='2'><b><span>Telefone: <span></b></td><td colspan='3'><span>" . $this->telefone . "</span></td>"; $texto .= "</tr>"; $texto .= "<tr>"; $texto .= "<td colspan='2'><b><span>CPF: <span></b></td><td colspan='3'><span>" . $this->cpf . "</span></td>"; $texto .= "</tr>"; $texto .= "<tr>"; $texto .= "<td colspan='2'><b><span>Data de Nascimento: <span></b></td><td colspan='3'><span>" . $this->data_nasc . "</span></td>"; $texto .= "</tr>"; $texto .= "<tr>"; $texto .= "<td colspan='2'><b><span>Email:<span> </b></td><td colspan='3'><span>" . $this->email . "</span></td>"; $texto .= "</tr>"; $texto .= "<tr>"; $texto .= "<td colspan='2'><b><span>Empresa: <span></b></td><td colspan='3'><span>" . $empresa->nome_fantasia . "</span></td>"; $texto .= "</tr>"; if ($filial) { $texto .= "<tr>"; $texto .= "<td colspan='2'><b><span>Filial: <span></b></td><td colspan='3><span>" . $filial->nome . "</span></td>"; $texto .= "</tr>"; } $texto .= "<tr>"; $texto .= "<td colspan='2'><b><span>Salário base: <span></b></td><td colspan='3'><span>R\$ " . number_format($sal, 2, ',', '.') . "</span></td>"; $texto .= "</tr>"; $texto .= "<tr>"; $texto .= "<td colspan='2'><b><span>Valor de Custo: <span></b></td><td colspan='3'><span>R\$ " . number_format($vlr, 2, ',', '.') . "</span></td>"; $texto .= "</tr>"; $texto .= "<tr>"; if (isset($cbo->descricao)) { $texto .= "<td colspan='2'><b><span>CBO: <span></b></td><td colspan='3'><span>" . $cbo->descricao . "</span></td>"; } $texto .= "</tr>"; $texto .= "<tr>"; $texto .= "<td colspan='2'><b><span>Turno: <span></b></td><td colspan='3'><span>" . $turno->nome . " - " . $turno->desc . "</span></td>"; $texto .= "</tr>"; if (count($epi_func) > 0) { $texto .= '<tr> <td colspan="5"><span><b>Equipamentos do funcionário:</b></span></td></tr>'; $texto .= '<tr> <td><span>ID</span></td> <td><span>Nome</span></td> <td><span>Data da entrega</span></td><td><span>Quantidade</span></td></tr>'; foreach ($epi_func as $key => $value) { $texto .= '<tr><td><span>' . $epi_func[$key]->id . '</span></td><td><span>' . $epi_func[$key]->nome_epi . '</span></td><td><span>' . $epi_func[$key]->data_entrega . '</span></td><td><span>' . $epi_func[$key]->quantidade . '</span></td></tr>'; } } $texto .= "</table>"; return $texto; }
<input style="width:80px;" name="button" class="button" onclick="window.location.href='add_epiXfunc.php'" id="button" value="Cancelar"> </td> </tr> </table> </form> <?php } else { if (isset($_GET['tipo']) && $_GET['tipo'] == 'editar') { // EDITAR EPI POR FUNCIONARIO ?> <div class="title-box" style="float:left"><div style="float:left"><img src="../images/edit-icon.png" width="35px"></div><div style="float:left; margin-top:10px; margin-left:10px;"><span class="title">Editar EPI para funcionario</span></div></div> <?php $func = new Funcionario(); $func = $func->get_func_id($_GET['id']); $u = new Epi(); $epi_func = $u->get_epi_func($func->id); ?> <form method="POST" id="add_epiXfunc" action="add_epiXfunc.php" onsubmit="return validate(this)"> <table border="0" style="width:100%; text-align:center"> <input type="hidden" id="tipo" name="tipo" value="cadastrar"> <input type="hidden" id="id_func" name="id_func" value="<?php echo $func->id; ?> "> <tr><td style="width:100px;"><span>Funcionario:</td><td colspan="4"><input style="width:100%" type="text" id="funcionario" disabled name="funcionario" value="<?php echo $func->nome; ?> "> <!-- <tr> <td ><span>Data de entrega:</span></td> <td><input type="date" id="data" name="data" value='<?php echo date("Y-m-d");