Ejemplo n.º 1
0
 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();
     }
 }
Ejemplo n.º 2
0
 private function getParametros(Pensum $mat)
 {
     $parametros = array(':idMateria' => $mat->getIdMateria(), ':idGrado' => $mat->getIdGrado());
     return $parametros;
 }
Ejemplo n.º 3
0
 public function generarConsolidado()
 {
     try {
         $idSalon = isset($_POST['idSalon']) ? $_POST['idSalon'] : NULL;
         $periodo = isset($_POST['periodo']) ? $_POST['periodo'] : NULL;
         $pensum = new Pensum();
         $pens = $pensum->leerPensum($idSalon);
         //__________________________-
         $salon = new Salon();
         $sal = $salon->leerSalonePorId($idSalon);
         $grado = new Grado();
         $grad = $grado->leerGradoPorId($sal->getIdGrado());
         $vec = array();
         if ($grad->getIdGrado() == 'p1' || $grad->getIdGrado() == 'p2' || $grad->getIdGrado() == 'p3') {
             $seccion = 'PREESCOLAR';
             $vec = ["PMAT", "PLEC", "ING", "PCN", "PCS", "ER", "EV", "ART", "EF", "COM"];
         } else {
             if ($grad->getIdGrado() == '1' || $grad->getIdGrado() == '2' || $grad->getIdGrado() == '3' || $grad->getIdGrado() == '4' || $grad->getIdGrado() == '5') {
                 $seccion = 'BASICA PRIMARIA';
                 $vec = ["MAT", "ING", "LC", "CN", "CS", "ER", "INF", "EF", "ART", "EV", "COM"];
             } else {
                 if ($grad->getIdGrado() == '6' || $grad->getIdGrado() == '7' || $grad->getIdGrado() == '8' || $grad->getIdGrado() == '9' || $grad->getIdGrado() == '10' || $grad->getIdGrado() == '11') {
                     $seccion = 'BASICA SECUNDARIA';
                     if ($grad->getIdGrado() == '6' || $grad->getIdGrado() == '7' || $grad->getIdGrado() == '8') {
                         $vec = ["AYG", "EST", "ING", "LC", "CN", "GEO", "HIS", "CONS", "ER", "INF", "EF", "ART", "EV", "COM"];
                     } else {
                         if ($grad->getIdGrado() == '9') {
                             $vec = ["ALYG", "EST", "ING", "LC", "CN", "GEO", "HIS", "CONS", "ER", "INF", "EF", "ART", "EV", "COM"];
                         } else {
                             if ($grad->getIdGrado() == '10') {
                                 $vec = ["TRI", "EST", "ING", "LC", "QUI", "FIS", "FIL", "CS", "ER", "INF", "EF", "ART", "EV", "COM"];
                             } else {
                                 if ($grad->getIdGrado() == '11') {
                                     $vec = ["CALC", "EST", "ING", "LC", "QUI", "FIS", "FIL", "CS", "ER", "INF", "EF", "ART", "EV", "COM"];
                                 }
                             }
                         }
                     }
                 }
             }
         }
         $this->vista->set('idSalon', $idSalon);
         $this->vista->set('periodo', $periodo);
         $this->vista->set('pens', $pens);
         $this->vista->set('sal', $sal);
         $this->vista->set('grad', $grad);
         $this->vista->set('vec', $vec);
         $this->vista->set('seccion', $vec);
         return $this->vista->imprimir();
     } catch (Exception $exc) {
         $this->setVista('mensaje');
         $msj = "Error en la aplicación.. Coloquese en contacto con el Desarrollador";
         $this->vista->set('msj', $msj);
         return $this->vista->imprimir();
     }
 }
Ejemplo n.º 4
0
 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");
 }