コード例 #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();
     }
 }
コード例 #2
0
 public function consultaTransferencia()
 {
     try {
         $idPersona = isset($_POST['idPersona']) ? $_POST['idPersona'] : NULL;
         $persona = new Persona();
         $estudiante = $persona->leerPorId($idPersona);
         $matricula = new Matricula();
         $mat = $matricula->leerMatriculaPorId($idPersona);
         $salon = new Salon();
         $sal = $salon->leerSalonePorId($mat->getIdSalon());
         $salones = $salon->leerSalonePorIdGrado($sal->getIdGrado());
         if ($estudiante == NULL) {
             $this->setVista('mensaje');
             $msj = "El Número de Documento no existe en el sistema";
             $this->vista->set('msj', $msj);
         } else {
             $rol = new Rol();
             $roles = $rol->leerRoles($idPersona);
             $band = 0;
             foreach ($roles as $ro) {
                 if ($ro->getIdRol() == 'E') {
                     $band = 1;
                 }
             }
             if ($band != 1) {
                 $this->setVista('mensaje');
                 $msj = "El Número de Documento ingresado no corresponde al de un estudiante";
                 $this->vista->set('msj', $msj);
             } elseif ($mat != NULL) {
                 $this->vista->set('estudiante', $estudiante);
                 $this->vista->set('salones', $salones);
                 $this->vista->set('idSalon', $mat->getIdSalon());
             } else {
                 $this->setVista('mensaje');
                 $msj = "El estudiante NO se encuentra matriculado";
                 $this->vista->set('msj', $msj);
             }
         }
         return $this->vista->imprimir();
     } catch (Exception $exc) {
         $this->setVista('mensaje');
         $msj = "Error en la aplicación, Colocarse en contacto con el Desarrollador";
         $this->vista->set('msj', $msj);
         return $this->vista->imprimir();
     }
 }
コード例 #3
0
 public function actualizarLogrosMovil()
 {
     try {
         $this->vista->set('titulo', 'ingreso de Logros');
         $idDocente = isset($_POST['idPersona']) ? $_POST['idPersona'] : NULL;
         $carga = new Carga();
         $Cargas = $carga->leerCargasPorDocente($idDocente);
         $salones = array();
         foreach ($Cargas as $carga) {
             $salon = new Salon();
             $sal = $salon->leerSalonePorId($carga->getIdSalon());
             $salones[$sal->getIdSalon()] = $sal;
         }
         $grados = array();
         $i = 0;
         foreach ($salones as $salon) {
             $grados[$i] = $salon->getIdGrado();
             $i++;
         }
         $grads = array_unique($grados);
         $gradosNetos = array();
         for ($i = 0; $i < count($grads); $i++) {
             $gra = new Grado();
             $gradosNetos[$grads[$i]] = $gra->leerGradoPorId($grads[$i]);
         }
         $this->vista->set('grados', $gradosNetos);
         return $this->vista->imprimir();
     } catch (Exception $exc) {
         echo $exc->getTraceAsString();
     }
 }
コード例 #4
0
ファイル: Reportes.php プロジェクト: josegaitan123/colegio
 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");
 }