コード例 #1
0
 /**
  * proceso de consultar persona/estudiante por numero de identificacion
  */
 public function consultarEstudiante2()
 {
     try {
         $idPersona = isset($_POST['idPersona']) ? $_POST['idPersona'] : NULL;
         $persona = new Persona();
         $estudiante = $persona->leerPorId($idPersona);
         $matricula = new Matricula();
         $mat = $matricula->leerMatriculaPorId($idPersona);
         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->setVista('mensaje');
                 $msj = "El estudiante No tiene una matricula Activa";
                 $this->vista->set('msj', $msj);
             } else {
                 $this->vista->set('estudiante', $estudiante);
                 $this->vista->set('idSalon', $mat->getIdSalon());
             }
         }
         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();
     }
 }
コード例 #2
0
 public function consultarNotas()
 {
     try {
         if ($this->verificarSession()) {
             $this->vista->set('titulo', 'Consulta de Notas');
             $idPersona = $_SESSION['idUsuario'];
             $matricula = new Matricula();
             $mat = $matricula->leerMatriculaPorId($idPersona);
             $this->vista->set('matricula', $mat);
             //$this->vista->set('persona', $persona);
             return $this->vista->imprimir();
         }
     } catch (Exception $exc) {
         echo $exc->getTraceAsString();
     }
 }
コード例 #3
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");
 }