Ejemplo n.º 1
0
 public function consultaSalon()
 {
     $idSalon = isset($_POST['idSalon']) ? $_POST['idSalon'] : NULL;
     try {
         $persona = new Persona();
         $personas = $persona->leerPorSalon($idSalon);
         $respuesta = '<table  width="60%" border="0" align="center" cellpadding="0" cellspacing="0" class="tabla" id="tabla">
                             <tr class="modo1">
                              <td><div align="center">.</div></td>
                                 <td width="12%"><div align="right" >IDENTIFICACION</div></td>
                                 <td><div align="center">APELLIDOS</div></td>
                                 <td><div align="center" >NOMBRES</div></td>
                             </tr>';
         foreach ($personas as $person) {
             $respuesta .= '<tr class="recorrer" id="cebra" onmouseover="cambiacolor_over(this)" onmouseout="cambiacolor_out(this)">
             <td align="left"><input type="radio" name="select" id="select" value="' . $person->getIdPersona() . '" onclick="asignar()"/></td>
             <td align="rigth">' . $person->getIdPersona() . '</td>
             <td align="right">' . strtoupper($person->getPApellido() . ' ' . $person->getSApellido()) . '</td> 
             <td align="right">' . strtoupper($person->getNombres()) . '</td>';
         }
         //fin del For
         $respuesta .= '</tr>
                 </table>';
         echo json_encode($respuesta);
     } catch (Exception $exc) {
         echo json_encode("1");
     }
 }
Ejemplo n.º 2
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");
 }
Ejemplo n.º 3
0
 public function eliminarPensum()
 {
     try {
         $idGrado = isset($_POST['idGrado']) ? $_POST['idGrado'] : NULL;
         $idMateria = isset($_POST['idMateria']) ? $_POST['idMateria'] : NULL;
         $salon = new Salon();
         $salones = $salon->leerSalonePorIdGrado($idGrado);
         $pensum = new Materia();
         foreach ($salones as $sal) {
             $persona = new Persona();
             $personas = $persona->leerPorSalon($sal->getIdSalon());
             foreach ($personas as $p) {
                 $nota = new Nota();
                 $nota->eliminarNota($p->getIdPersona(), $idMateria);
             }
         }
         $pensum->eliminarPensum($idGrado, $idMateria);
         echo json_encode("Pensum Eliminado Correctamente");
     } catch (Exception $exc) {
         echo json_encode('Error de aplicacion: ' . $exc->getMessage());
     }
 }
Ejemplo n.º 4
0
 /**
  * Imprime estudiantes por salones
  * @return type
  */
 public function estudiantesSalones()
 {
     try {
         $idSalon = isset($_POST['idSalon']) ? $_POST['idSalon'] : NULL;
         $persona = new Persona();
         $estudiante = $persona->leerPorSalon($idSalon);
         $respuesta = "";
         $respuesta .= '<table width="90%" border="0" cellspacing="0" cellpadding="2" align="center" class="tabla">
                  
                 <td align="center" class="color-text-gris" colspan="11"><h1>Salon:' . $idSalon . '</h1></td></tr>
                 <tr class="modo1">
                 <td>Documento</td>
                 <td>Nombres</td>
                 <td>P.Apellido</td>
                 <td>S.Apellido</td>
                 <td>Sexo</td>
                 <td>Telefono</td>
                 <td>Dirección</td>
                 <td>Correo</td>
                 <td>consultar</td>
                 <td>Actualizar</td>
                 <td>Inhabilitar</td>
                 </tr> ';
         foreach ($estudiante as $est) {
             $respuesta .= '<tr  onmouseover="cambiacolor_over(this)" onmouseout="cambiacolor_out(this)">
                 <td>' . $est->getIdPersona() . '</td>
                 <td>' . $est->getNombres() . '</td>
                 <td>' . $est->getPApellido() . '</td>
                 <td>' . $est->getSApellido() . '</td>
                 <td>' . $est->getSexo() . '</td>
                 <td>' . $est->getTelefono() . '</td>
                 <td>' . $est->getDireccion() . '</td>
                 <td>' . $est->getCorreo() . '</td>
                 <td align="center"><a href="#" onclick="consultaPersona (' . strtoupper($est->getIdPersona()) . ') "><img src="../utiles/imagenes/iconos/consultarPersona.png"/></a></td>
                 <td align="center"><a href="#" onclick="vistaActualizarPersona(' . $est->getIdPersona() . ') "><img src="../utiles/imagenes/iconos/editarPersona.png" /></a></td>
                 <td align="center"><a href="#" onclick="eliminarPersona (' . strtoupper($est->getIdPersona()) . ') "><img src="../utiles/imagenes/iconos/errorCalificacion.png"/></a></td>
             </tr>';
         }
         $respuesta .= '</table>';
         if (strlen($respuesta) > 0) {
             echo json_encode($respuesta);
         } else {
             echo json_encode("<tr> </tr>");
         }
     } catch (Exception $exc) {
         echo json_encode('Error de aplicacion: ' . $exc->getMessage());
     }
 }