public function run() { Eloquent::unguard(); // Borramos todos los periodos DB::table('periodos')->delete(); Periodo::create(['id' => '1', 'numero' => 1, 'fecha_inicio' => '2015-01-20', 'fecha_fin' => '2015-03-30', 'actual' => true, 'year_id' => 1, 'fecha_plazo' => '2015-03-15']); }
function listarcontroller() { $periodo = new Periodo(); $linhas = $periodo->listar(); $tabela = ''; foreach($linhas as $linha) { $tabela .= '<tr> <td>'.$linha['id'].'</td> <td><a href="periodo_form.php?id='.$linha['id'].'">'.$linha['nome'].'</a></td> </tr> '; } return $tabela; }
public function getHorasTrabalharNoPeriodo(Periodo $pPeriodo) { // checa se o profissional � horista, // horistas n�o possuem limite de horas a trabalhar if ($this->getHorista()) { return 0; } //Prepara períodos $pInicio = new DateTime($pPeriodo->getInicial()); $pFim = new DateTime($pPeriodo->getFinal()); // checa se j� existe registro na tabela de horas a trabalhar $sql = "SELECT horas " . "FROM hor_a_trabalhar " . "WHERE cod_prof_funcao = " . $this->getCodProfFuncao() . " AND periodo_ini = '" . $pInicio->format("Y-m-d") . "';"; $cont = parent::executarScalar($sql); if ($cont > 0) { return $cont; } // obtem a carga hor�ria do profissional, converte para numero $varCargaHoraria = $this->getCargaHoraria(); // calcula a quantidade de horas a // trabalhar no per�odo entre duas datas //$oTipoDia = new Data(); while ($pInicio <= $pFim) { $varTipoDia = Data::getTipoDia($pInicio); if (!($varTipoDia == "Sábado" || $varTipoDia == "Domingo")) { if ($varCargaHoraria == 8.5) { if ($varTipoDia == "Sexta-Feira") { $varTotal += 8; } else { $varTotal += $varCargaHoraria; } } else { $varTotal += $varCargaHoraria; } } else { // Trata feriado // Há feriados que só desconta um turno, por exemplo $oFeriado = new Feriado(); if ($oFeriado->isFeriado($pInicio)) { $varDesconto += $oFeriado->getHoras(); // Se o feriado cair dia de sábado // Desconta 2h da carga horária referente a este dia if (Data::getDiaSemana($pInicio) == "Sábado") { $varDesconto += 2; } } } // Incrementa dia $pInicio->modify("+1 day"); } $varTotal -= $varDesconto; return number_format($varTotal, 2); }
public function index() { $cursos = Curso::all(); $periodos = Periodo::all(); $cursos_sel = array_pluck($cursos, 'nome', 'id'); $periodos_sel = array_pluck($periodos, 'nome', 'id'); if (count(Input::all()) > 0) { $turmas = Turma::where(['curso_id' => Input::all()['curso']])->get(); } else { $turmas = Turma::where(['curso_id' => array_keys($cursos_sel)[0]])->get(); } return View::make('aluno.index', ['turmas' => $turmas, 'cursos' => $cursos_sel, 'periodos' => $periodos_sel, 'data' => $cursos]); }
public function home() { if (Auth::check()) { $data["inside_url"] = Config::get('app.inside_url'); $data["user"] = Session::get('user'); $data["permisos"] = Session::get('permisos'); $data["periodo_actual"] = Periodo::getPeriodoActual()->get(); $data["usuario_ya_inscrito"] = true; if (!$data["periodo_actual"]->isEmpty()) { $data["periodo_actual"] = $data["periodo_actual"][0]; $usuario_ya_existe = UsersPeriodo::getUsersPeriodoByUserXPeriodo($data["user"]->id, $data["periodo_actual"]->idperiodos)->get(); if ($usuario_ya_existe->isEmpty()) { $data["usuario_ya_inscrito"] = false; } } else { $data["periodo_actual"] = array(); } if (in_array('side_aprobar_padrinos', $data["permisos"])) { $data["prepadrinos"] = Prepadrino::all()->count(); } if (in_array('side_listar_convocatorias', $data["permisos"])) { $periodo_actual = Periodo::getPeriodoActual()->get(); if ($periodo_actual->isEmpty()) { $data["postulantes"] = 0; $data["idperiodos"] = null; } else { $aprobacion = null; $periodo_actual = $periodo_actual[0]; $data["postulantes"] = PostulantesPeriodo::getPostulantesPorPeriodoFase($periodo_actual->idperiodos, 1, $aprobacion)->get()->count(); $data["idperiodos"] = $periodo_actual->idperiodos; } } if (in_array('side_aprobar_colegios', $data["permisos"])) { $data["precolegios"] = Precolegio::all()->count(); } if (in_array('side_listar_usuarios', $data["permisos"])) { $data["usuarios"] = User::all()->count(); } if (in_array('side_mis_eventos', $data["permisos"])) { return Redirect::to('/eventos/mis_eventos'); } return View::make('dashboard/dashboard', $data); } else { return View::make('error/error'); } }
public function store() { $rules = array('nombres' => 'required', 'apellido_pat' => 'required', 'apellido_mat' => 'required', 'num_documento' => 'required', 'fecha_nacimiento' => 'required', 'email' => 'required'); $validator = \Validator::make(Input::all(), $rules); if ($validator->passes()) { $postulante = new \Postulante(); $postulante->nombres = Input::get('nombres'); $postulante->apellido_pat = Input::get('apellido_pat'); $postulante->apellido_mat = Input::get('apellido_mat'); $postulante->num_documento = Input::get('num_documento'); $postulante->fecha_nacimiento = date('Y-m-d', strtotime(Input::get('fecha_nacimiento'))); $postulante->email = Input::get('email'); $postulante->direccion = Input::get('direccion'); $postulante->telefono = Input::get('telefono'); $postulante->celular = Input::get('celular'); $postulante->idtipo_identificacion = 1; $postulante->centro_estudio_trabajo = Input::get('centro_estudio_trabajo'); $postulante->ciclo_grado = Input::get('ciclo_grado'); $postulante->carrera = Input::get('carrera'); $postulante->experiencia = Input::get('experiencia'); $postulante->aprendizaje = Input::get('aprendizaje'); $postulante->motivacion = Input::get('motivacion'); $postulante->aporte = Input::get('aporte'); $postulante->expectativas = Input::get('expectativas'); $postulante->save(); $periodo_actual = \Periodo::getPeriodoActual()->first(); $postulantexperiodo = new \PostulantesPeriodo(); $postulantexperiodo->idpostulantes = $postulante->idpostulantes; $postulantexperiodo->idperiodos = $periodo_actual->idperiodos; $postulantexperiodo->idfases = 1; $postulantexperiodo->save(); return Response::json(['success' => 1], 200); } else { return Response::json($validator->messages(), 200); } }
/** * Muestra las semanas especiales cargadas en el período actual. * @param Periodo $periodo */ private function imprimirListaSemanasEspeciales($periodo) { imprimirTabulados(5); echo '<div class="tablaTituloBotones">'; // Acciones ejecutadas $semanasEspeciales = $this->gestorPeriodos->getSemanasEspeciales($periodo->getIdPeriodo()); // Impresion imprimirTabulados(6); echo '<h2>Semanas especiales: </h2>'; if (empty($semanasEspeciales)) { echo '<p>No hay semanas especiales asignadas a este período</p>'; } $tabla = new TablaSemanasEspecialesEditable($semanasEspeciales, $periodo); $tabla->imprimir(); imprimirTabulados(5); echo '</div>'; }
public function getPeriodoActual($idArea) { $connection = parent::initDB(); $query = "SELECT idPeriodo, nombre, area, inicio, fin, observaciones " . "FROM periodo " . "WHERE inicio < curdate() AND curdate() < fin AND area = {$idArea} "; $result = mysql_query($query); if (mysql_num_rows($result) == 0) { throw new Exception('No hay periodos activos para esa área'); } $row = mysql_fetch_array($result); $periodo = new Periodo(); $periodo->setIdPeriodo($row['idPeriodo']); $periodo->setNombre($row['nombre']); $periodo->setArea($this->areaDAO->getArea($row['area'])); $periodo->setInicioISO($row['inicio']); $periodo->setFinISO($row['fin']); $periodo->setObservaciones($row['observaciones']); parent::closeDB($connection); return $periodo; }
public function setPeriodo(Periodo $v = null) { if ($v === null) { $this->setFkPeriodoId(0); } else { $this->setFkPeriodoId($v->getId()); } $this->aPeriodo = $v; if ($v !== null) { $v->addExamen($this); } return $this; }
public function submit_enable_convocatoria() { if (Auth::check()) { $data["inside_url"] = Config::get('app.inside_url'); $data["user"] = Session::get('user'); $data["permisos"] = Session::get('permisos'); if (in_array('side_nuevo_usuario', $data["permisos"])) { $idperiodo = Input::get('idperiodo'); $url = "convocatorias/edit_convocatoria/" . $idperiodo; $periodo = Periodo::withTrashed()->find($idperiodo); $periodo->restore(); // Llamo a la función para registrar el log de auditoria $descripcion_log = "Se habilitó el periodo con id {{$periodo->idperiodos}}"; Helpers::registrarLog(6, $descripcion_log); Session::flash('message', 'Se habilitó correctamente la convocatoria.'); return Redirect::to($url); } else { // Llamo a la función para registrar el log de auditoria $descripcion_log = "Se intentó acceder a la ruta '" . Request::path() . "' por el método '" . Request::method() . "'"; Helpers::registrarLog(10, $descripcion_log); Session::flash('error', 'Usted no tiene permisos para realizar dicha acción.'); return Redirect::to('/dashboard'); } } else { return View::make('error/error'); } }
function determinarProximoNivel() { end($this->seguimiento); $ultimoregistro = current($this->seguimiento); $anioultimo = $ultimoregistro[RegAno]; $periodoultimo = $ultimoregistro[id_periodo]; $nivelultimo = $ultimoregistro[nivel]; $id_nivelultimo = $ultimoregistro[id_nivel]; $notaultima = $ultimoregistro[Def_numero]; $penultimoregistro = prev($this->seguimiento); $aniopenultimo = $penultimoregistro[RegAno]; $periodopenultimo = $penultimoregistro[id_periodo]; $periodo = new Periodo(); $periodoactual = $periodo->sel_periodo_Actual(); $anioactual = date("Y"); if ($periodo->siguientePeriodo($periodoultimo, $periodoactual, $anioultimo, $anioactual) > 1) { $nivelDeterminado = $this->ultimoPeriodoAprobado(); if ($nivelDeterminado == "") { $nivelDeterminado = $nivelultimo; } } elseif ($periodo->siguientePeriodo($periodopenultimo, $periodoultmimo, $aniopenultimo, $anioultimo) == 1) { $nivelDeterminado = $nivelultimo; } elseif ($this->siDosCompromisosSeguidos($ultimoregistro, $penultimoregistro)) { $nivelDeterminado = $nivelultimo; } elseif ($notaultima < 75) { $nivelDeterminado = $nivelultimo; } else { $nivel = new Nivel(); $nivel->sel_niveles_mas_Actual($id_nivelultimo, $ultimoregistro[id_programa]); $arreglonivel = $nivel->retornaSiguienteNivelAprobado(); $nivelDeterminado = $arreglonivel[1]; } return $nivelDeterminado; }
public function getTotaisTrabalhados(Profissional $pProf, Periodo $pPeriodo) { $oInicio = new DateTime($pPeriodo->getInicial()); $oFim = new DateTime($pPeriodo->getFinal()); $sql = "SELECT SUM(h_50) as Hex50, SUM(h_100) as Hex100, SUM(total) as total " . "FROM hor_frequencia " . "WHERE cod_prof_funcao = " . $pProf->getCodProfFuncao() . " AND data BETWEEN '" . $oInicio->format('Y-m-d') . "' AND '" . $oFim->format('Y-m-d') . "';"; $rs = parent::obterRecordSet($sql); $this->setExtra50($rs[0]["Hex50"]); $this->setExtra100($rs[0]["Hex100"]); $this->setTotal($rs[0]["total"]); }
function totalHorariosController() { $total_horarios = 0; $sala = new sala(); $periodo = new Periodo(); // Total de salas * total de horarios * 30 dias $salas = $sala->total(); $periodos = $periodo->total(); $total_horarios = $salas[0]['total'] * $periodos[0]['total'] * 30 ; return $total_horarios; }
<?php include_once "entidad/Periodo.php"; $periodo = new Periodo(); echo 'is_null($periodo->getInicio()): ' . is_null($periodo->getInicio()); echo 'empty($periodo->getInicio()): ' . $periodo->getInicio();
public static function addInstanceToPool(Periodo $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getId(); } self::$instances[$key] = $obj; } }
public function numeroMatricula($num) { $p = new Periodo(); $numb = $p->sel_numePeriodo_Matricula(); $contMatricula; if ($num < 10) { $contMatricula = "2150000" . $num; } else { if ($num < 100) { $contMatricula = "215000" . $num; } else { if ($num < 1000) { $contMatricula = "21500" . $num; } else { if ($num < 10000) { $contMatricula = "2150" . $num; } else { $contMatricula = $numb . $num; } } } } return $contMatricula; }
public function listarDisponiveisProfessorSerie($serie, $idProfessor) { $sql = "SELECT * FROM periodo p\n JOIN grupo g ON g.grp_periodo = p.prd_id\n WHERE g.grp_professor = " . $idProfessor . " AND g.grp_serie = " . $serie; $result = $this->retrieve($sql); $lista = array(); while ($qr = mysqli_fetch_array($result)) { $per = new Periodo(); $per->setPrd_id($qr["prd_id"]); $per->setPrd_periodo($qr["prd_periodo"]); array_push($lista, $per); } return $lista; }
public function generarPeriodos() { switch ($this->tippernom) { case '0': // Semanal $this->totalperiodos = 52; break; case '1': // Quincenal $this->totalperiodos = 24; break; case '2': // Mensual $this->totalperiodos = 12; break; case '3': // Anual $this->totalperiodos = 1; break; } $diasperiodo = round(365 / $this->totalperiodos, 0); $fecha = $this->fecininom; $anioinicial = substr($fecha, 0, 4); for ($i = 1; $i <= $this->totalperiodos && $this->valido; $i++) { $objPeriodo = new Periodo(); $objPeriodo->codemp = $this->codemp; $objPeriodo->codnom = $this->codnom; $objPeriodo->codperi = str_pad($i, 3, '0', 0); $objPeriodo->fecdesper = $fecha; $objPeriodo->fechasper = $this->obtenerFinalPeriodo($fecha, $diasperiodo); $objPeriodo->totper = 0; $objPeriodo->cerper = 0; $objPeriodo->conper = 0; $objPeriodo->apoconper = 0; $objPeriodo->ingconper = 0; $objPeriodo->fidconper = 0; $objPeriodo->peradi = 0; $objPeriodo->obsper = ''; $objPeriodo->incluir(); $fecha = sumarDias($objPeriodo->fechasper, 1); unset($objPeriodo); if ($this->tippernom != 0) { $anioactual = substr($fecha, 0, 4); if ($anioinicial != $anioactual) { break; } } } $objPeriodo = new Periodo(); $objPeriodo->codemp = $this->codemp; $objPeriodo->codnom = $this->codnom; $objPeriodo->codperi = '000'; $objPeriodo->fecdesper = '1900-01-01'; $objPeriodo->fechasper = '1900-01-01'; $objPeriodo->totper = 0; $objPeriodo->cerper = 0; $objPeriodo->conper = 0; $objPeriodo->apoconper = 0; $objPeriodo->ingconper = 0; $objPeriodo->fidconper = 0; $objPeriodo->peradi = 0; $objPeriodo->obsper = 'Periodo Nulo'; $objPeriodo->incluir(); unset($objPeriodo); }
public function render_mis_eventos() { if (Auth::check()) { $data["inside_url"] = Config::get('app.inside_url'); $data["user"] = Session::get('user'); $data["permisos"] = Session::get('permisos'); $data["user_info"] = User::searchUserById($data["user"]->id)->get(); if (in_array('side_mis_eventos', $data["permisos"])) { $data["periodo_actual"] = Periodo::getPeriodoActual()->get(); $data["usuario_ya_inscrito"] = true; if (!$data["periodo_actual"]->isEmpty()) { $data["periodo_actual"] = $data["periodo_actual"][0]; $usuario_ya_existe = UsersPeriodo::getUsersPeriodoByUserXPeriodo($data["user"]->id, $data["periodo_actual"]->idperiodos)->get(); if ($usuario_ya_existe->isEmpty()) { $data["usuario_ya_inscrito"] = false; } } else { $data["periodo_actual"] = array(); } return View::make('eventos/misEventos', $data); } else { // Llamo a la función para registrar el log de auditoria $descripcion_log = "Se intentó acceder a la ruta '" . Request::path() . "' por el método '" . Request::method() . "'"; Helpers::registrarLog(10, $descripcion_log); Session::flash('error', 'Usted no tiene permisos para realizar dicha acción.'); return Redirect::to('/dashboard'); } } else { return View::make('error/error'); } }
public function submit_asistencia_excel() { if (Auth::check()) { $data["inside_url"] = Config::get('app.inside_url'); $data["user"] = Session::get('user'); $data["permisos"] = Session::get('permisos'); if (in_array('side_reporte_asistencia', $data["permisos"])) { $data["search_periodo"] = Input::get('search_periodo_excel'); $data["search_usuario"] = Input::get('search_usuario_excel'); $data["periodos"] = Periodo::lists('nombre', 'idperiodos'); $periodo = Periodo::find($data["search_periodo"]); $eventos_asistencia = Asistencia::getEventosAsistencia()->get(); $voluntarios_data = UsersPerfil::searchVoluntariosReporteInfo($data["search_periodo"], $data["search_usuario"]); $str_table = "<table><tr><td></td><td></td><td></td><td><strong>Reporte de Asistencia</strong></td></tr></table>"; if ($periodo == null) { $str_table .= "<table><tr><td><strong>Periodo</strong></td><td>Todos</td></tr><tr></tr></table>"; } else { $str_table .= "<table><tr><td><strong>Periodo:</strong></td><td>" . $periodo->nombre . "</td></tr><tr></tr></table>"; } $str_table .= "<table border=1><tr><th>Periodo</th><th>Doc. de Identidad</th><th>Nombre</th><th>Eventos Programados</th><th>Eventos que Asistio</th><th>% Asistencia</th><th>Promedio Calificacion</th></tr>"; if ($voluntarios_data != null) { foreach ($voluntarios_data as $voluntario_data) { $eventos_total = 0; $eventos_asistidos = 0; $str_table .= "<tr><td>" . htmlentities($voluntario_data->nombre_periodo) . "</td><td>" . htmlentities($voluntario_data->num_documento) . "</td><td>" . htmlentities($voluntario_data->apellido_pat . ' ' . $voluntario_data->apellido_mat . ', ' . $voluntario_data->nombre_persona) . "</td><td>"; foreach ($eventos_asistencia as $asistencia) { if ($asistencia->idusers == $voluntario_data->id) { $str_table .= "-" . htmlentities($asistencia->nombre) . "<br>"; $eventos_total++; } } $str_table .= "</td><td>"; foreach ($eventos_asistencia as $asistencia) { if ($asistencia->idusers == $voluntario_data->id) { if ($asistencia->asistio == 1) { $str_table .= "-" . htmlentities($asistencia->nombre) . "<br>"; $eventos_asistidos++; } } } $str_table .= "</td><td>" . htmlentities(round($eventos_asistidos / $eventos_total * 100, 2)) . "%</td><td>" . htmlentities(round($voluntario_data->prom_calificaciones), 2) . "</td></tr>"; } } $str_table .= "</table>"; $filename = "reporte_asistencia" . date('Y-m-d') . ".xls"; // Show the download dialog header("Content-type: application/vnd.ms-excel; charset=utf-8"); // Let's indicate to the browser we are giving it the file header("Content-Disposition: attachment; filename=\"{$filename}\""); // Avoid the browser to save the file into it's cache header("Pragma: no-cache"); header("Expires: 0"); // Render the table echo $str_table; } else { return View::make('error/error'); } } else { return View::make('error/error'); } }
public function getSaldoApropriar() { try { $oProf = new Profissional($this->getCodProfFuncao()); $oPeriodo = new Periodo(); $oRegistro = new Registro(); $oPeriodo->setInicial($this->getData()); $oPeriodo->setFinal($this->getData()); $oRegistro->getTotaisTrabalhados($oProf, $oPeriodo); $tRegistrado = $oRegistro->getTotal(); $tApropriado = $this->getTotalApropriado(); $vSaldo = $tRegistrado - $tApropriado; return $vSaldo; } catch (Exception $e) { throw new Exception($e->getMessage()); } }
/** * Declares an association between this object and a Periodo object. * * @param Periodo $v * @return Gradeunit The current object (for fluent API support) * @throws PropelException */ public function setPeriodo(Periodo $v = null) { if ($v === null) { $this->setPeriodoId(NULL); } else { $this->setPeriodoId($v->getId()); } $this->aPeriodo = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the Periodo object, it will not be re-added. if ($v !== null) { $v->addGradeunit($this); } return $this; }
<?php /* * To change this template, choose Tools | Templates * and open the template in the editor. */ include dirname(dirname(__FILE__)) . "/DAL/Modelos/Periodo.php"; $s = new Periodo(); $k = $s->sel_periodo_Actual(); var_dump($k);
} else { //echo "tiene carne"; $refcarne = 0; $valor_carne = 0; $recibocarne = "NO"; } if (comprobarCedula($link, $cedula)) { $refcarne = 0; $valor_carne = 0; $recibocarne = "NO"; } $contador_matricula = $matriculita->ins_contador(); //echo "<hr>".$contador_matricula; $numatricula = $matriculita->numeroMatricula($contador_matricula); $fechamatricula = date("Y-m-d"); $periodo = new Periodo(); $idperiodo = $periodo->sel_periodo_Actual(); $recibonumeroperiodo = $periodo->sel_identificador_nivel(); //insercion matricula function precios($idprograma, $idnivel, $link, $cedula) { $retorno_condicion_gratis = array(); //para los FCE $precio = 0; $condicion_gratis = 0; switch ($idprograma) { case 1: if ($idnivel == "E12" or $idnivel == "E13" or $idnivel == "E14") { if (comprobarCedula($link, $cedula)) { $precio = 99000; $condicion_gratis = 0;
/** * Parámetros comunes en los formularios de las acciones. * * @return string Código HTML con las acciones. */ private function accionesComunes() { $salida = '<input type="hidden" name="idPeriodo" value="' . $this->periodo->getIdPeriodo() . '" />'; return $salida; }
<?php echo utf8_decode($programa[Idioma]); if ($programa[Idioma] == "Children") { echo " Bimestral -DEBE INSCRIBIRSE EN ESTE PROGRAMA SI TIENE UNA EDAD ENTRE 7 A 10 AÑOS- "; } else { if ($programa[Idioma] == "Teenagers") { echo " Bimestral -DEBE INSCRIBIRSE EN ESTE PROGRAMA SI TIENE UNA EDAD ENTRE 11 A 14 AÑOS- "; } } ?> </h3></td></tr> <tr><td> <?php $peri = new Periodo(); $idperi = $peri->sel_identificador_nivel() . date('y'); //echo $idperi; $matriculita = new Matricula(); if (!$matriculita->sel_if_matriculas("{$idperi}%", $programa["Id_programa"], $_POST[cedula])) { echo "Matrícula en tramite </td></tr></table>"; } else { $seg = new Seguimiento(); $seg->sel_seguimiento_estud_prg($_POST["cedula"], $programa["Id_programa"]); if ($seg->tblSeguimiento2()) { $nivelproximo = $seg->determinarProximoNivel(); } else { $nivel = new Nivel(); $arrnivelproximo = $nivel->sel_primer_nivel($programa["Id_programa"]); $nivelproximo = $arrnivelproximo[1]; }
function getBanco($pCodProfFuncao) { try { // horista não possui banco de horas $oProf = new Profissional($pCodProfFuncao); if ($oProf->getHorista()) { return false; } // retorna banco de horas $sql = "SELECT hb.periodo_ini, hb.hex_50, hb.hex_100,\n hb.total_trab as normais,\n (hb.total_trab + hb.hex_50 + hb.hex_100) as total_trab,\n IFNULL(hp.horas,0) as horas_pagas, IFNULL(ht.horas,'0') as horas_a_trabalhar\n FROM hor_banco as hb\n LEFT JOIN hor_pagas as hp\n ON (hb.cod_prof_funcao = hp.cod_prof_funcao AND hb.periodo_ini = hp.periodo_ini)\n LEFT JOIN hor_a_trabalhar as ht\n ON (hb.cod_prof_funcao = ht.cod_prof_funcao AND hb.periodo_ini = ht.periodo_ini)\n WHERE hb.cod_prof_funcao = " . $pCodProfFuncao . " ORDER BY hb.periodo_ini ASC;"; $rs = parent::obterRecordSet($sql); //$varAcumulado = 0; $ret = array(); foreach ($rs as $row) { $oPeriodo = new Periodo($row["periodo_ini"]); $vPeriodo = "de " . $oPeriodo->getInicial() . " a " . $oPeriodo->getFinal(); $oBanco = new Banco(); $oBanco->setPeriodo($vPeriodo); $oBanco->setHorhex50($row["hex_50"]); $oBanco->setHorhex100($row["hex_100"]); $oBanco->setHornormais($row["normais"]); $oBanco->setHortrabalhadas($row["total_trab"]); $oBanco->setHoratrabalhar($row["horas_a_trabalhar"]); $oBanco->setHorpagas($row["horas_pagas"]); $oBanco->setHorsaldo($row["total_trab"] - $row["horas_a_trabalhar"]); $varAcumulado += $row["total_trab"] - $row["horas_a_trabalhar"] - $row["horas_pagas"]; $oBanco->setHoracumuladas($varAcumulado); $ret[] = $oBanco; } return $ret; } catch (Exception $e) { throw new Exception($e->getTraceAsString()); } }