private function _listarNotas() { $mensaje = ''; $asignatura = $_POST['asignatura']; $nota = new Nota($asignatura); //mensaje se pasa por referencia (ver método $nota->load()) if ($datos = $nota->load($mensaje)) { foreach ($datos as $nota) { $curso = $nota['curso']; $alumno = $nota['alumno']; $id = $nota['Id']; $asignatura = $nota['asignatura']; $nota = $nota['nota']; $notas[] = new Nota($asignatura, $id, $nota, $curso, $alumno); } if ($notas) { Vista::setAccion('listar'); Vista::setNotas($notas); if (isset($_POST['numeroregistros']) and $_POST['numeroregistros'] == "S") { $numRegistros = count($notas); $numFilas = "Se han obtenido {$numRegistros} resultados"; Vista::setNumFilas($numFilas); } } } else { Vista::setAccion('mensaje'); if ($mensaje) { Vista::setMensaje($mensaje); } else { Vista::setMensaje("<b>No se ha encontrado nigún dato</b>"); } } Vista::retornarVista(); }
public function factory($arrayfetch) { $arraytoret = array(); if ($arrayfetch) { foreach ($arrayfetch as $fetch) { $newObject = new Nota($this->driver); $newObject->fill($fetch); array_push($arraytoret, $newObject); } } return $arraytoret; }
public function actionCadastrar() { if ($this->request->isPostRequest) { $cadastrarNota = new Nota(); $cadastrarNota->descricao = $this->request->getPost('descricao'); $cadastrarNota->situacao = $this->resquest->getPost('situacao'); $cadastrarNota->topico_id = $this->resquet->getPost('topico_id'); $cadastrarNota->dt_criacao = date('Y-m-d'); if ($cadastrarNota->save()) { $this->user->setFlash('success', 'Esta nota foi criad com sucesso.'); $this->redirect(['nota/novaNota']); } else { $this->user->setFlash('error', 'Error ao cadastrar esta nota, verifique se está tudo correto!'); } } }
private function mapearNota(Nota $nota, array $props) { if (array_key_exists('idNota', $props)) { $nota->setId($props['idNota']); } if (array_key_exists('primerP', $props)) { $nota->setPrimerP($props['primerP']); } if (array_key_exists('segundoP', $props)) { $nota->setSegundoP($props['segundoP']); } if (array_key_exists('tercerP', $props)) { $nota->setTercerP($props['tercerP']); } if (array_key_exists('cuartoP', $props)) { $nota->setCuartoP($props['cuartoP']); } if (array_key_exists('definitiva', $props)) { $nota->setDefinitiva($props['definitiva']); } }
function rowToDto($row) { $objNota = new Nota(); $objNota->setId($row["Id"]); $objNota->setFecha($row["Fecha"]); $objNota->setNota($row["Nota"]); $objNota->setEstado($row["Estado"]); $objNota->setId_categoria($row["Id_categoria"]); return $objNota; }
public static function listaralertasdashboard($model) { // Obtener ids de contactos $contactos_ids = array(); // foreach ($model->contactos as $contacto) // $contactos_ids[] = $contacto->id; /** * Obtener las actividades */ $alertas = array(); $query = Yii::app()->db->createCommand()->select()->from('alerta')->where(array('and', 'entidad_tipo = :cuenta', 'entidad_id = :entidad_id'), array(':cuenta' => $model->tableName(), ':entidad_id' => $model->id))->orWhere(array('and', 'entidad_tipo = :contacto', array('in', 'entidad_id', $contactos_ids)), array(':contacto' => Contacto::model()->tableName()))->orWhere(array('and', 'entidad_tipo = :tarea', array('in', 'entidad_id', $tareas_ids)), array(':tarea' => Tarea::model()->tableName()))->orWhere(array('and', 'entidad_tipo = :oportunidad', array('in', 'entidad_id', $oportunidades_ids)), array(':oportunidad' => Oportunidad::model()->tableName()))->orWhere(array('and', 'entidad_tipo = :cobranza', array('in', 'entidad_id', $cobranzas_ids)), array(':cobranza' => Cobranza::model()->tableName()))->orWhere(array('and', 'entidad_tipo = :evento', array('in', 'entidad_id', $eventos_ids)), array(':evento' => Evento::model()->tableName()))->orWhere(array('and', 'entidad_tipo = :nota', array('in', 'entidad_id', $notas_ids)), array(':nota' => Nota::model()->tableName()))->order('fecha DESC'); $alertas = $query->queryAll(); return $alertas; }
public function informePorSalon($idSalon) { $persona = new Persona(); $pdf = new FPDF('P', 'cm', 'Letter'); $personas = $persona->leerPorSalon($idSalon); foreach ($personas as $p) { $pdf->AddPage(); $matricula = new Matricula(); $matr = $matricula->leerMatriculaPorId($p->getIdPersona()); $salon = new Salon(); $sal = $salon->leerSalonePorId($matr->getIdSalon()); $grado = new Grado(); $grad = $grado->leerGradoPorId($sal->getIdGrado()); $pensum = new Pensum(); $pens = $pensum->leerPensum($matr->getIdSalon()); $x = 1; $y = 1; $pdf->SetXY($x, $y); $pdf->SetFont("Times", "B", 12); $pdf->Cell(20, 1, 'Liceo Galois', 0, 0, "C"); $y += 1; $pdf->SetXY($x, $y); $pdf->Cell(20, 1, utf8_decode('Reporte Académico'), 0, 0, "C"); $y += 1; $pdf->SetXY($x, $y); $pdf->Cell(20, 1, strtoupper(utf8_decode($p->getPApellido() . " " . $p->getSApellido() . " " . $p->getNombres())), 0, 0, "C"); $y += 1; $pdf->SetXY($x, $y); $pdf->SetFont("Times", "BI", 12); $pdf->Cell(5, 1, 'MATERIA', 1, 0, "C"); $pdf->Cell(3, 1, '1er PERIODO', 1, 0, "C"); $pdf->Cell(3, 1, '2do PERIODO', 1, 0, "C"); $pdf->Cell(3, 1, '3er PERIODO', 1, 0, "C"); $pdf->Cell(3, 1, '4to PERIODO', 1, 0, "C"); $pdf->Cell(3, 1, 'PONDERADO', 1, 0, "C"); $cont = 0; foreach ($pens as $pen) { $cont++; $y += 1; $pdf->SetXY($x, $y); $mat = new Materia(); $materia = $mat->leerMateriaPorId($pen->getIdMateria()); foreach ($materia as $mate) { $pdf->Cell(5, 1, $mate->getNombreMateria(), 1, 0, "L"); } $nota = new Nota(); $not = $nota->leerNotaEstudiante($p->getIdPersona(), $pen->getIdMateria()); $prom = round($nota->calcularDef2($not->getprimerP(), $not->getSegundoP(), $not->getTercerP(), $not->getCuartoP()), 2); $pdf->Cell(3, 1, $not->getPrimerP(), 1, 0, "C"); $pdf->Cell(3, 1, $not->getSegundoP(), 1, 0, "C"); $pdf->Cell(3, 1, $not->getTercerP(), 1, 0, "C"); $pdf->Cell(3, 1, $not->getCuartoP(), 1, 0, "C"); if ($prom < 30) { $pdf->SetTextColor(190, 21, 34); } else { $pdf->SetTextColor(0, 0, 0); } $pdf->Cell(3, 1, $prom, 1, 0, "C"); $pdf->SetTextColor(0, 0, 0); } } $pdf->Output("REPORTE ACADEMICO GRADO " . $idSalon, "I"); }
//Inclusión de navbar. Omitible si no la necesita require_once '../model/driver.php'; //Inclusión de Driver de las clases de "model". Omitible si no las usamos //Conexion a la BD (Permite usar las funciones de DBManager de Cancerbero) $db = Driver::getInstance(); //Instancias TemplateEngine, renderizan elementos $renderMain = new TemplateEngine(); $renderPlantilla = new TemplateEngine(); //FUNCIONES DEL CONTROLADOR //Escribimos aquí lo que hace este controlador en concreto (Comprueba el login, redirecciona...) $renderMain->title = "Nueva Nota"; //Titulo y cabecera de la pagina if (isset($_POST['editor'])) { $user = new Usuario($db); $user = $user->findBy('user_name', $_SESSION['name'])[0]; $nota = new Nota($db); $nota->setNota_name($_POST['title']); $nota->setContenido(htmlspecialchars($_POST['editor'])); $nota->setUser_id($user->getUser_id()); $date = getdate(); $buffer = $date['year'] . "-" . $date['mon'] . "-" . $date['mday']; $nota->setFecha($buffer); $nota->create(); header("location: editarNota.php?nota=" . $nota->getNota_id()); } //RENDERIZADO FINAL $renderMain->navbar = renderNavBar(); //Inserción de navBar en la pagina. Omitible si no la necesita $renderMain->content = $renderPlantilla->render('nuevaNota_v.php'); //Inserción del contenido de la página echo $renderMain->renderMain();
function rowToDto($row) { $objNota = new Nota(); $objNota->setId($row["id"]); $objNota->setFecha($row["fecha"]); $objNota->setTitulo($row["titulo"]); $objNota->setNota($row["nota"]); $objNota->setEstado($row["estado"]); $objNota->setIdCategoria($row["idCategoria"]); return $objNota; }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Nota the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Nota::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
$editar = $nota->editarNota($_POST['editar'], $valor, $usertime, $obs); if ($editar['tipo'] == "alerta") { $tpl->ALERTA = $editar['msg']; } elseif ($editar['tipo'] == "aviso") { $tpl->AVISO = $editar['msg']; } } } /*************************************** MOSTRAR OU UMA NOTA OU TODAS NO PERIODO ***************************************/ $mes_ref = isset($_GET['mes']) && $_GET['mes'] >= 1 && $_GET['mes'] <= 12 ? $_GET['mes'] : Date('n'); $ano_ref = isset($_GET['ano']) && $_GET['ano'] >= 2012 && $_GET['ano'] <= Date('Y') ? $_GET['ano'] : Date('Y'); if (isset($_GET['chave']) && $_GET['chave'] > 0) { $notaid = (int) $_GET['chave']; $nota = new Nota($notaid); $permissao = $nota->get('contrato')->get('permissao'); if ($_SESSION['nivel'] == 1 || $_SESSION['nivel'] == $permissao) { $tpl->NOTANUM = $nota->get('numero'); $tpl->UO = $nota->get('uc')->get('uo')->getSigla(); $tpl->UC = $nota->get('uc')->get('rgi') . " - [ " . $nota->get('uc')->getNome() . " ]"; $tpl->DATA_REF = $nota->get('data_ref'); $tpl->EMPRESA = $nota->get('uc')->get('empresa')->getNome(); $tpl->EMISSAO = setDateDiaMesAno($nota->get('emissao')); $tpl->VENCTO = setDateDiaMesAno($nota->get('vencto')); $tpl->SAIDA = setDateDiaMesAno($nota->get('saida')); $tpl->PROV = $nota->get('provisoria'); $tpl->CONSUMO = tratarValor($nota->get('consumo')); $tpl->VALOR = tratarValor($nota->get('valor'), true); $tpl->USUARIO = $nota->get('usuario')->get('login'); $tpl->OBS = $nota->getObs();
$tpl->RGI = $uc->get('rgi'); $tpl->RGINOME = $uc->getEndereco() . " ~> " . $uc->getNome(); //$tpl->DISABLE_RGI = 'disabled="disabled"'; $tpl->block('EACH_RGI'); $tpl->NOTAVAL = $nota; $tpl->COMPLVAL = $_POST['compl']; $tpl->CONSVAL = $consumo; $tpl->VALORVAL = $_POST['valor']; $tpl->OBS = $_POST['obs']; $tpl->AVISO = $valor; } else { $compl = mysql_real_escape_string($_POST['compl']); $uc = new UnidadeConsumidora($rgi); $contrato = $uc->get('contrato')->get('id'); $obs = nl2br(mysql_real_escape_string($_POST['obs'])); $nota = new Nota("", 0, $nota, $compl, 0, $emissao, $mes_ref, $ano_ref, $consumo, $valor, $contrato, $user->get('id'), $uc->get('id'), $saida, '', $prov, $obs, $vencto); if ($nota->saveNew()) { $tpl->AVISO = "Nota lançada com sucesso!"; } else { $tpl->ALERTA = "Houve um erro: " . mysql_error(); } } } else { $tpl->ALERTA = "Número de Alertas: " . 1 . "<br />Algum campo obrigatório não foi preenchido. " . $_POST['rgi'] . $_POST['nota'] . $_POST['mes_ref'] . $_POST['ano_ref'] . $_POST['emissao'] . $_POST['vencto'] . $_POST['valor'] . "--"; } } /*************************************************** MOSTRAR TODOS OS RGI OU DESABILITAR COM APENAS UM ***************************************************/ $sql_verif; if (isset($_GET['dataref']) && count(explode('-', $_GET['dataref'])) == 2 || isset($_SESSION['data_ref'])) {
public function datosAcademicosMovil() { try { $idPersona = isset($_POST['idPersona']) ? $_POST['idPersona'] : NULL; $this->vista->set('titulo', 'Datos Academicos'); $matricula = new Matricula(); $matr = $matricula->leerMatriculaPorId($idPersona); $salon = new Salon(); $sal = $salon->leerSalonePorId($matr->getIdSalon()); $grado = new Grado(); $grad = $grado->leerGradoPorId($sal->getIdGrado()); $pensum = new Pensum(); $pens = $pensum->leerPensum($matr->getIdSalon()); $respuesta = ""; $respuesta .= '<table > <tr> <td align="left" class="color-text-azul" colspan="6"><h3>Datos Academicos</h3></td> </tr> </table> <table style="font-size: 11px" width="98%" border="0" cellspacing="0" cellpadding="2" align="center" class="table tBlue"> <tr class="modo1"> <td width="25%"><b>Materia</td> <td width="15%"><b>P.1</b></td> <td width="15%"><b>P.2</b></td> <td width="15%"><b>P.3</b></td> <td width="15%"><b>P.4</b></td> <td width="15%"><b>Prom.</b></td> </tr> '; $cont = 0; $s1 = 0; $s2 = 0; $s3 = 0; $s4 = 0; foreach ($pens as $pen) { $cont++; $respuesta .= ' <tr>'; $mat = new Materia(); $materia = $mat->leerMateriaPorId($pen->getIdMateria()); foreach ($materia as $mate) { $respuesta .= '<td width="25%"><b> ' . $mate->getNombreMateria() . '</b> </td>'; } $nota = new Nota(); $not = $nota->leerNotaEstudiante($idPersona, $pen->getIdMateria()); $respuesta .= '<td width="15%">' . $not->getPrimerP() . '</td>'; $respuesta .= '<td width="15%">' . $not->getSegundoP() . '</td>'; $respuesta .= '<td width="15%">' . $not->getTercerP() . '</td>'; $respuesta .= '<td width="15%">' . $not->getCuartoP() . '</td>'; $prom = round($nota->calcularDef2($not->getprimerP(), $not->getSegundoP(), $not->getTercerP(), $not->getCuartoP()), 2); //$prom=$prom/4; $respuesta .= '<td width="15%" class="color-text-azul">' . $prom . '</td>'; $respuesta .= '</tr>'; $s1 += $not->getPrimerP(); $s2 += $not->getSegundoP(); $s3 += $not->getTercerP(); $s4 += $not->getCuartoP(); } $p1 = round($s1 / $cont, 2); $p2 = round($s2 / $cont, 2); $p3 = round($s3 / $cont, 2); $p4 = round($s4 / $cont, 2); //$pg = round((($p1 + $p2 + $p3 + $p4 ) /4), 2); $pg = round($nota->calcularDef2($p1, $p2, $p3, $p4), 2); $this->vista->set('grado', $grad); $this->vista->set('matricula', $matr); $this->vista->set('tabla', $respuesta); $this->vista->set('p1', $p1); $this->vista->set('p2', $p2); $this->vista->set('p3', $p3); $this->vista->set('p4', $p4); $this->vista->set('pg', $pg); return $this->vista->imprimir(); } catch (Exception $exc) { echo 'Error de aplicacion: ' . $exc->getMessage(); } }
public static function getNo() { self::model()->updateCounters(array('no_nota' => +1)); $no = Nota::model()->findByPk(1)->no_nota; return $no; }
include_once "src/classes/Users.class.php"; include_once "src/classes/Notas.class.php"; include_once "src/classes/UnidadeCons.class.php"; /************************************************** ARQUIVO DE SCRIPTS DE AÇÃO RECEBIDOS POR S_POST **************************************************/ if (getenv("REQUEST_METHOD") == "POST") { if (isset($_POST['action'])) { switch ($_POST['action']) { case "verificaNota": $uc = new UnidadeConsumidora($_POST['ucid']); echo $uc->isNotaRegistered($_POST['data']); break; case "marcarPago": $data = getTransformDate($_POST['data']); $nota = new Nota($_POST['nid']); $nota->marcarPago($data); echo "<font color='red'>" . $_POST['data'] . "</font>"; break; case "getProvs": $autos = (int) $_POST['autos']; $sql = "SELECT DISTINCT(provisoria) FROM daee_notas WHERE contrato = {$autos} ORDER BY provisoria DESC"; $query = mysql_query($sql); if (mysql_num_rows($query) > 0) { while ($prov = mysql_fetch_array($query)) { $num = $prov['provisoria']; if ($num == 0) { echo "<option value='{$num}'>Desconhecida</option>"; } else { echo "<option value='{$num}'>{$num}</option>"; }
public function notasCompartidas() { $notas = new Nota($this->driver); $query = "select Nota.nota_id, Nota.nota_name, Nota.fecha, Nota.contenido, Nota.user_id\n from Nota, Comparte_Nota, Usuario where\n Nota.nota_id = Comparte_Nota.nota_id and\n Comparte_Nota.user_id = Usuario.user_id and\n Usuario.user_id = '" . $this->getUser_id() . "'"; $results = $this->driver->exec($query); return $notas->factory($results); }
public function retirar() { try { $idPersona = isset($_POST['idPersona']) ? $_POST['idPersona'] : NULL; $opcion = isset($_POST['opcion']) ? $_POST['opcion'] : NULL; $fecha = getdate(); $Alectivo = $fecha["year"]; if ($fecha["month"] == "December") { $Alectivo++; } $mat = new Matricula(); $nota = new Nota(); $falla = new Falla(); if ($opcion == "1") { $mat->retirarEstudiante($idPersona, $Alectivo); } else { if ($opcion == "2") { $mat->eliminarMatriculaPorId($idPersona); } } $nota->eliminarNotasPorId($idPersona); $falla->eliminarFallasPorId($idPersona); echo json_encode(1); } catch (Exception $exc) { echo json_encode('Error de aplicacion: ' . $exc->getMessage()); } }
$tpl->BLOCK('EACH_MENSAL'); $z++; } $tpl->CONSTOTAL = tratarValor($mesConsTotal); $tpl->PAGOTOTAL = tratarValor($mesPagoTotal, true); $mediaUC = count($eachMes) > 0 ? $mesPagoTotal / count($eachMes) : 1; $tpl->MEDIA = tratarValor($mediaUC, true); $tpl->AUMENTO = getPorcentagem(end($eachMes)['valor'] * 100 / $mediaUC - 100, true); /********************************* MOSTRAR HISTÓRICO GERAL *********************************/ $cumulativo = 0; $cons_soma = 0; if (count($uc->getAllNotas(false)) >= 1) { foreach ($uc->getAllNotas(false) as $notaRes) { $nota = new Nota($notaRes['id']); if (!$nota->isEmpenho()) { $tpl->NFMESANO = $nota->get('data_ref'); $tpl->NFNUMERO = $nota->get('numero'); $nota->get('nome') != "" ? $nota->get('numero') . " - " . $nota->get('nome') : $nota->get('numero'); $tpl->NFNOME = $nota->get('nome') != "" ? "- " . $nota->get('nome') : ""; $tpl->NFDATA = setDateDiaMesAno($nota->get('emissao')); $tpl->NFCONS = tratarValor($nota->get('consumo')); $tpl->NFPAGO = tratarValor($nota->get('valor'), true); $tpl->NFPROV = $nota->get('provisoria'); $tpl->NFLANCPOR = $nota->get('usuario')->get('login'); $tpl->NFSAIDA = setDateDiaMesAno($nota->get('saida')); $tpl->NFPAGODATA = setDateDiaMesAno($nota->get('pagoem')); $cumulativo += $nota->get('valor'); $tpl->NFCUMULATIVO = tratarValor($cumulativo, true); $cons_soma += $nota->get('consumo');