public function registrarYGuardarEstudiantes()
 {
     $idPersona = isset($_POST['idPersona']) ? $_POST['idPersona'] : NULL;
     //datos personales
     $tipoDocumento = isset($_POST['tipoDocumento']) ? $_POST['tipoDocumento'] : NULL;
     $lugarExpedicion = isset($_POST['lugarExpedicion']) ? $_POST['lugarExpedicion'] : NULL;
     $fechaExpedicion = isset($_POST['fechaExpedicion']) ? $_POST['fechaExpedicion'] : NULL;
     $nombres = isset($_POST['nombres']) ? $_POST['nombres'] : NULL;
     $pApellido = isset($_POST['pApellido']) ? $_POST['pApellido'] : NULL;
     $sApellido = isset($_POST['sApellido']) ? $_POST['sApellido'] : NULL;
     $sexo = isset($_POST['sexo']) ? $_POST['sexo'] : NULL;
     $tipoSanguineo = isset($_POST['tipoSanguineo']) ? $_POST['tipoSanguineo'] : NULL;
     $eps = isset($_POST['eps']) ? $_POST['eps'] : NULL;
     $telefono = isset($_POST['telefono']) ? $_POST['telefono'] : NULL;
     $correo = isset($_POST['correo']) ? $_POST['correo'] : NULL;
     $instProcedencia = isset($_POST['instProcedencia']) ? $_POST['instProcedencia'] : NULL;
     /***fin de datos Personales**/
     // datos de nacimiento
     $fNacimiento = isset($_POST['fNacimiento']) ? $_POST['fNacimiento'] : NULL;
     $paisNacimiento = isset($_POST['paisNacimiento']) ? $_POST['paisNacimiento'] : NULL;
     $departamentoNacimiento = isset($_POST['departamentoNacimiento']) ? $_POST['departamentoNacimiento'] : NULL;
     $municipioNacimiento = isset($_POST['municipioNacimiento']) ? $_POST['municipioNacimiento'] : NULL;
     //fin de datos de nacimiento
     // datos de ubicacion
     $direccion = isset($_POST['direccion']) ? $_POST['direccion'] : NULL;
     $barrio = isset($_POST['barrio']) ? $_POST['barrio'] : NULL;
     $municipioResidencia = isset($_POST['municipioResidencia']) ? $_POST['municipioResidencia'] : NULL;
     // fin de datos de ubicacion
     // datos del padre
     $idPadre = isset($_POST['idPadre']) ? $_POST['idPadre'] : NULL;
     $nombresPadre = isset($_POST['nombresPadre']) ? $_POST['nombresPadre'] : NULL;
     $apellidosPadre = isset($_POST['apellidosPadre']) ? $_POST['apellidosPadre'] : NULL;
     $ocupacionPadre = isset($_POST['ocupacionPadre']) ? $_POST['ocupacionPadre'] : NULL;
     $telPadre = isset($_POST['telPadre']) ? $_POST['telPadre'] : NULL;
     $telOficinaPadre = isset($_POST['telOficinaPadre']) ? $_POST['telOficinaPadre'] : NULL;
     $dirPadre = isset($_POST['dirPadre']) ? $_POST['dirPadre'] : NULL;
     //datos de la madre
     $idMadre = isset($_POST['idMadre']) ? $_POST['idMadre'] : NULL;
     $nombresMadre = isset($_POST['nombresMadre']) ? $_POST['nombresMadre'] : NULL;
     $apellidosMadre = isset($_POST['apellidosMadre']) ? $_POST['apellidosMadre'] : NULL;
     $ocupacionMadre = isset($_POST['ocupacionMadre']) ? $_POST['ocupacionMadre'] : NULL;
     $telMadre = isset($_POST['telMadre']) ? $_POST['telMadre'] : NULL;
     $telOficinaMadre = isset($_POST['telOficinaMadre']) ? $_POST['telOficinaMadre'] : NULL;
     $dirMadre = isset($_POST['dirMadre']) ? $_POST['dirMadre'] : NULL;
     //datps de el acudiente
     $idAcudiente = isset($_POST['idAcudiente']) ? $_POST['idAcudiente'] : NULL;
     $nombresAcudiente = isset($_POST['nombresAcudiente']) ? $_POST['nombresAcudiente'] : NULL;
     $apellidosAcudiente = isset($_POST['apellidosAcudiente']) ? $_POST['apellidosAcudiente'] : NULL;
     $ocupacionAcudiente = isset($_POST['ocupacionAcudiente']) ? $_POST['ocupacionAcudiente'] : NULL;
     $telAcudiente = isset($_POST['telAcudiente']) ? $_POST['telAcudiente'] : NULL;
     $telOficinaAcudiente = isset($_POST['telOficinaAcudiente']) ? $_POST['telOficinaAcudiente'] : NULL;
     $dirAcudiente = isset($_POST['dirAcudiente']) ? $_POST['dirAcudiente'] : NULL;
     $idSalon = isset($_POST['idSalon']) ? $_POST['idSalon'] : NULL;
     $jornada = isset($_POST['jornada']) ? $_POST['jornada'] : NULL;
     $foto = isset($_POST['foto']) ? $_POST['foto'] : NULL;
     $estado = '0';
     $idRol = 'E';
     try {
         $estudiante = new Estudiante();
         $persona = $estudiante->leerPorId($idPersona);
         if ($persona != NULL) {
             echo json_encode(2);
         } else {
             if ($foto != "") {
                 $foto = $this->limpia_espacios($foto);
                 $contents = file_get_contents($foto);
                 $savefile = fopen('utiles/imagenes/fotos/' . $idPersona . '.png', 'w');
                 fwrite($savefile, $contents);
                 fclose($savefile);
             }
             $estudiante->setIdPersona($idPersona);
             $estudiante->setTipoDocumento($tipoDocumento);
             $estudiante->setLugarExpedicion($lugarExpedicion);
             $estudiante->setFechaExpedicion($fechaExpedicion);
             $estudiante->setNombres($nombres);
             $estudiante->setPApellido($pApellido);
             $estudiante->setSApellido($sApellido);
             $estudiante->setSexo($sexo);
             $estudiante->setTipoSanguineo($tipoSanguineo);
             $estudiante->setEps($eps);
             $estudiante->setTelefono($telefono);
             $estudiante->setCorreo($correo);
             $estudiante->setInstProcedencia($instProcedencia);
             $estudiante->setFNacimiento($fNacimiento);
             $estudiante->setPaisNacimiento($paisNacimiento);
             $estudiante->setDepartamentoNacimiento($departamentoNacimiento);
             $estudiante->setMunicipioNacimiento($municipioNacimiento);
             $estudiante->setDireccion($direccion);
             $estudiante->setBarrio($barrio);
             $estudiante->setMunicipioResidencia($municipioResidencia);
             $estudiante->setIdPadre($idPadre);
             $estudiante->setNombresPadre($nombresPadre);
             $estudiante->setApellidosPadre($apellidosPadre);
             $estudiante->setOcupacionPadre($ocupacionPadre);
             $estudiante->setTelPadre($telPadre);
             $estudiante->setTelOficinaPadre($telOficinaPadre);
             $estudiante->setDirPadre($dirPadre);
             $estudiante->setIdMadre($idMadre);
             $estudiante->setNombresMadre($nombresMadre);
             $estudiante->setApellidosMadre($apellidosMadre);
             $estudiante->setOcupacionMadre($ocupacionMadre);
             $estudiante->setTelMadre($telMadre);
             $estudiante->setTelOficinaMadre($telOficinaMadre);
             $estudiante->setDirMadre($dirMadre);
             $estudiante->setIdAcudiente($idAcudiente);
             $estudiante->setNombresAcudiente($nombresAcudiente);
             $estudiante->setApellidosAcudiente($apellidosAcudiente);
             $estudiante->setOcupacionAcudiente($ocupacionAcudiente);
             $estudiante->setTelAcudiente($telAcudiente);
             $estudiante->setTelOficinaAcudiente($telOficinaAcudiente);
             $estudiante->setDirAcudiente($dirAcudiente);
             $estudiante->setEstado($estado);
             $estudiante->setIdRol($idRol);
             $estudiante->crearPersona($estudiante);
             $estudiante->crearDatos($estudiante);
             $estudiante->crearDatosNacimiento($estudiante);
             $estudiante->crearDatosUbicacion($estudiante);
             if ($idPadre != NULL) {
                 if ($estudiante->verificarPadre($idPadre) == NULL) {
                     $estudiante->crearDatosPadre($estudiante);
                 }
                 $estudiante->estudiantePadre($estudiante);
             }
             if ($idMadre != NULL) {
                 if ($estudiante->verificarMadre($idMadre) == NULL) {
                     $estudiante->crearDatosMadre($estudiante);
                 }
                 $estudiante->estudianteMadre($estudiante);
             }
             if ($idAcudiente != NULL) {
                 if ($estudiante->verificarAcudiente($idAcudiente) == NULL) {
                     $estudiante->crearDatosAcudiente($estudiante);
                     //$estudiante->CrearRolAcudiente($estudiante);
                 }
                 $estudiante->estudianteAcudiente($estudiante);
             }
             //Matricula ¨**
             $fecha = getdate();
             $FechaTxt = $fecha["year"] . "-" . $fecha["mon"] . "-" . $fecha["mday"];
             if ($fecha["month"] == 'December' or $fecha["month"] == 'November' or $fecha["month"] == 'October') {
                 $año = $fecha["year"];
                 $añoLectivo = $año + 1;
             } else {
                 $añoLectivo = $fecha["year"];
             }
             $mat = new Matricula();
             $matricula = $mat->leerMatriculaPorId($idPersona);
             if ($matricula != NULL) {
                 echo json_encode(3);
             } else {
                 $mat->setIdPersona($idPersona);
                 $mat->setIdSalon($idSalon);
                 $mat->setJornada($jornada);
                 $mat->setFecha($FechaTxt);
                 $mat->setAnoLectivo(strval($añoLectivo));
                 $mat->matricularEstudiante($mat);
                 //**
                 echo json_encode(1);
             }
         }
     } catch (Exception $exc) {
         $estudiante2 = new Estudiante();
         $estudiante2->eliminarPersona($idPersona);
         $estudiante2->eliminarUsuario($idPersona);
         $estudiante2->eliminarDatos($idPersona);
         $estudiante2->eliminarDatosNacimiento($idPersona);
         $estudiante2->eliminarDatosUbicacion($idPersona);
         $estudiante2->eliminarEstudiantePadre($idPersona, $idPadre);
         $estudiante2->eliminarEstudianteMadre($idPersona, $idMadre);
         $estudiante2->eliminarEstudianteAcudiente($idPersona, $idAcudiente);
         echo json_encode('Error de aplicacion: ' . $exc->getMessage());
     }
 }
Example #2
0
 public function observadorSantaTeresita($idPersona)
 {
     $estudiante = new Estudiante();
     $est = $estudiante->leerPorId($idPersona);
     $estudiante->leerDatos($idPersona, $est);
     $estudiante->leerNacimiento($idPersona, $est);
     $estudiante->leerUbicacion($idPersona, $est);
     $estudiante->leerPadre($idPersona, $est);
     $estudiante->leerMadre($idPersona, $est);
     $estudiante->leerAcudiente($idPersona, $est);
     $ape = $est->getPApellido() . " " . $est->getSApellido();
     $nom = $est->getNombres();
     $sexo = $est->getSexo();
     $tel = $est->getTelefono();
     $fecha_nac = $est->getFNacimiento();
     $lugar_nac = $est->getMunicipioNacimiento();
     $direccion = $est->getDireccion();
     $barrio = $est->getBarrio();
     $tipo_doc = $est->getTipoDocumento();
     $eps = $est->getEps();
     $procedencia = $est->getInstProcedencia();
     $id_padre = $est->getIdPadre();
     $nom_padre = $est->getNombresPadre();
     $ape_padre = $est->getApellidosPadre();
     $ocupacion_padre = $est->getOcupacionPadre();
     $tel1_padre = $est->getTelPadre();
     $tel2_padre = $est->getTelOficinaPadre();
     $direccion_padre = $est->getDirPadre();
     $id_madre = $est->getIdMadre();
     $nom_madre = $est->getNombresMadre();
     $ape_madre = $est->getApellidosMadre();
     $ocupacion_madre = $est->getOcupacionMadre();
     $tel1_madre = $est->getTelMadre();
     $tel2_madre = $est->getTelOficinaMadre();
     $direccion_madre = $est->getDirMadre();
     $id_acud = $est->getIdAcudiente();
     $nom_acu = $est->getNombresAcudiente();
     $ape_acu = $est->getApellidosAcudiente();
     $ocupacion_acu = $est->getOcupacionAcudiente();
     $tel1_acu = $est->getTelAcudiente();
     $tel2_acu = $est->getTelOficinaAcudiente();
     $direccion_acu = $est->getDirAcudiente();
     $fecha = getdate();
     $FechaTxt = $fecha["year"] . "-" . $fecha["mon"] . "-" . $fecha["mday"];
     if ($fecha["month"] == 'December' or $fecha["month"] == 'November' or $fecha["month"] == 'October') {
         $año = $fecha["year"];
         $añoLectivo = $año + 1;
     } else {
         $añoLectivo = $fecha["year"];
     }
     $matricula = new Matricula();
     $mat = $matricula->leerMatriculaPorId($idPersona);
     $matriculas = $matricula->leerMatriculasPorId($idPersona);
     $pdf = new FPDF('L', 'cm', 'Legal');
     $pdf->AddPage();
     $x = 2;
     $y = 1;
     $pdf->SetFont("Arial", "B", 20);
     $pdf->SetXY($x - 1, $y);
     $pdf->Cell(18, 1, "COLEGIO SANTA TERESITA", 0, 0, "C");
     $pdf->SetFont("Arial", "B", 20);
     $pdf->SetXY($x + 13, $y);
     $pdf->Cell(18, 1, "OBSERVADOR DEL ALUMNO", 0, 0, "C");
     $pdf->SetFont("Arial", "", 14);
     $y += 1;
     $pdf->SetXY($x - 1, $y);
     $pdf->cell(18, 0.5, "Educamos para hacer posible la vida y la felicidad", 0, 0, "C");
     $pdf->Image('utiles/imagenes/escudoSantaTeresita.jpg', 0.5, 0.5, 3, 3);
     $pdf->Image('utiles/imagenes/escudoSantaTeresita.jpg', 30, 0.5, 2, 3);
     $x = 0.5;
     $y += 2;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "", 10);
     $pdf->cell(5, 0.5, "APELIIDOS Y NOMBRES:", 0, 0, "l");
     //Linea1
     $pdf->Line($x + 4.5, $y + 0.5, $x + 15, $y + 0.5);
     $pdf->SetXY($x + 5, $y);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(7.5, 0.5, utf8_decode(strtoupper($est->getPApellido() . " " . $est->getSApellido() . " " . $est->getNombres())), 0, 0, "L");
     $pdf->SetXY($x + 16.5, $y);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(7.5, 0.5, "N. Padre:", 0, 0, "L");
     //Linea2
     $pdf->Line($x + 18.5, $y + 0.5, $x + 27, $y + 0.5);
     $pdf->SetXY($x + 18.5, $y);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(7.5, 0.5, utf8_decode(strtoupper($nom_padre . " " . $ape_padre)), 0, 0, "L");
     $pdf->SetXY($x + 27.5, $y);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(2.5, 0.5, "VIVE:", 0, 0, "L");
     $pdf->SetXY($x + 29, $y - 0.25);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(1, 1, "SI", 1, 0, "C");
     $pdf->SetXY($x + 30, $y - 0.25);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(1, 1, "NO", 1, 0, "C");
     $vec = ["P", "J", "T", "1°", "2°", "3°", "4°", "5°", "6°", "7°", "8°", "9°", "10°", "11°"];
     $y += 0.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "", 11);
     $pdf->Cell(2, 1, utf8_decode("GRADO"), 0, 0, "L");
     $pdf->SetXY($x, $y + 1);
     $pdf->SetFont("Arial", "", 11);
     $pdf->Cell(2, 1, utf8_decode("AÑO"), 0, 0, "L");
     $pdf->SetXY($x + 16.5, $y);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(2, 1, utf8_decode("Ocupación:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 18.5, $y + 0.75, $x + 24, $y + 0.75);
     $pdf->SetXY($x + 18.5, $y + 0.25);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(7.5, 0.5, utf8_decode(strtoupper($ocupacion_padre)), 0, 0, "L");
     $pdf->SetXY($x + 24, $y);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(2, 1, utf8_decode("Tel Emergencia:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 26.5, $y + 0.75, $x + 32, $y + 0.75);
     $pdf->SetXY($x + 27, $y + 0.25);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(7.5, 0.5, utf8_decode(strtoupper($tel1_padre)), 0, 0, "L");
     //____________MADRE
     $pdf->SetXY($x + 16.5, $y + 1.25);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(7.5, 0.5, "N. Madre:", 0, 0, "L");
     //Linea2
     $pdf->Line($x + 18.5, $y + 1.75, $x + 27, $y + 1.75);
     $pdf->SetXY($x + 18.5, $y + 1.25);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(7.5, 0.5, utf8_decode(strtoupper($nom_madre . " " . $ape_madre)), 0, 0, "L");
     $pdf->SetXY($x + 27.5, $y + 1.25);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(2.5, 0.5, "VIVE:", 0, 0, "L");
     $pdf->SetXY($x + 29, $y + 1);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(1, 1, "SI", 1, 0, "C");
     $pdf->SetXY($x + 30, $y + 1);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(1, 1, "NO", 1, 0, "C");
     $pdf->SetXY($x + 16.5, $y + 1.75);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(2, 1, utf8_decode("Ocupación:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 18.5, $y + 2.5, $x + 24, $y + 2.5);
     $pdf->SetXY($x + 18.5, $y + 2);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(7.5, 0.5, utf8_decode(strtoupper($ocupacion_madre)), 0, 0, "L");
     $pdf->SetXY($x + 24, $y + 1.75);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(2, 1, utf8_decode("Tel Emergencia:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 26.5, $y + 2.5, $x + 32, $y + 2.5);
     $pdf->SetXY($x + 27, $y + 2);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(7.5, 0.5, utf8_decode(strtoupper($tel1_madre)), 0, 0, "L");
     //_______________________ACUDIENTE
     $pdf->SetXY($x + 16.5, $y + 2.75);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(7.5, 0.5, "Acudiente:", 0, 0, "L");
     //Linea2
     $pdf->Line($x + 18.5, $y + 3.25, $x + 27, $y + 3.25);
     $pdf->SetXY($x + 18.5, $y + 2.75);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(7.5, 0.5, utf8_decode(strtoupper($nom_acu . " " . $ape_acu)), 0, 0, "L");
     $pdf->SetXY($x + 27.5, $y + 2.75);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(2.5, 0.5, "PARENTESCO:", 0, 0, "L");
     //Linea2
     $pdf->Line($x + 30.25, $y + 3.25, $x + 32, $y + 3.25);
     $pdf->SetXY($x + 29, $y + 1);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(1, 1, "SI", 1, 0, "C");
     $pdf->SetXY($x + 30, $y + 1);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(1, 1, "NO", 1, 0, "C");
     $pdf->SetXY($x + 16.5, $y + 3.25);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(2, 1, utf8_decode("Ocupación:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 18.5, $y + 4, $x + 24, $y + 4);
     $pdf->SetXY($x + 18.5, $y + 3.5);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(7.5, 0.5, utf8_decode(strtoupper($ocupacion_acu)), 0, 0, "L");
     $pdf->SetXY($x + 24, $y + 3.25);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(2, 1, utf8_decode("Tel Emergencia:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 26.5, $y + 4, $x + 32, $y + 4);
     $pdf->SetXY($x + 27, $y + 3.5);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(7.5, 0.5, utf8_decode(strtoupper($tel1_acu)), 0, 0, "L");
     $pdf->SetXY($x + 16.5, $y + 3.75);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(2, 1, utf8_decode("Dirección:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 18.5, $y + 4.5, $x + 25, $y + 4.5);
     $pdf->SetXY($x + 18.5, $y + 4);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(7.5, 0.5, utf8_decode(strtoupper($direccion)), 0, 0, "L");
     $pdf->SetXY($x + 25, $y + 3.75);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(2, 1, utf8_decode("Barrio:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 26.5, $y + 4.5, $x + 32, $y + 4.5);
     $pdf->SetXY($x + 27, $y + 4);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(7.5, 0.5, utf8_decode(strtoupper($barrio)), 0, 0, "L");
     $pdf->SetXY($x + 16.5, $y + 4.5);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(2, 1, utf8_decode("Correo Electronico:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 19.75, $y + 5.25, $x + 27, $y + 5.25);
     $pdf->SetXY($x + 27.2, $y + 4.5);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(2, 1, utf8_decode("Ciudad:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 28.6, $y + 5.25, $x + 32, $y + 5.25);
     $pdf->SetXY($x + 28.5, $y + 4.75);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(7.5, 0.5, utf8_decode(strtoupper($est->getMunicipioResidencia())), 0, 0, "L");
     $pdf->SetXY($x + 16.5, $y + 5);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(2, 1, utf8_decode("Aficiones Personales:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 20, $y + 5.75, $x + 32, $y + 5.75);
     $grupo = "";
     $x += 2;
     //CICLO
     foreach ($vec as $v) {
         $band = 0;
         $pdf->SetXY($x, $y);
         $pdf->SetFont("Arial", "B", 11);
         if (strlen($v) == 4) {
             $g = substr($v, 0, 2);
         } else {
             $g = $v[0];
         }
         if ($matriculas != null) {
             foreach ($matriculas as $ma) {
                 $salon = new Salon();
                 $sal = $salon->leerSalonePorId($ma->getIdSalon());
                 if ($sal->getIdGrado() == $g) {
                     $band++;
                     $pdf->Cell(1, 1, utf8_decode($v), 1, 0, "C");
                     $pdf->SetXY($x, $y + 1);
                     $pdf->SetFont("Arial", "", 11);
                     $pdf->Cell(1, 1, utf8_decode(substr($ma->getAnoLectivo(), 2, 2)), 1, 0, "C");
                 }
             }
         }
         $salon = new Salon();
         $sal = $salon->leerSalonePorId($mat->getIdSalon());
         if ($sal->getIdGrado() == $g) {
             $band++;
             $pdf->Cell(1, 1, utf8_decode($v), 1, 0, "C");
             $pdf->SetXY($x, $y + 1);
             $pdf->SetFont("Arial", "", 11);
             $pdf->Cell(1, 1, utf8_decode(substr($mat->getAnoLectivo(), 2, 2)), 1, 0, "C");
             $grupo = $sal->getGrupo();
         }
         if ($band == 0) {
             $pdf->Cell(1, 1, utf8_decode($v), 1, 0, "C");
             $pdf->SetXY($x, $y + 1);
             $pdf->SetFont("Arial", "", 11);
             $pdf->Cell(1, 1, utf8_decode(""), 1, 0, "C");
         }
         $x++;
     }
     $y += 2.25;
     $x = 0.5;
     $pdf->SetXY($x, $y);
     $pdf->Cell(4, 0.5, utf8_decode("Fecha de Ingreso:"), 0, 0, "L");
     $pdf->SetXY($x + 3.5, $y);
     $pdf->Cell(1, 0.5, utf8_decode(""), 1, 0, "L");
     $pdf->SetXY($x + 4.5, $y);
     $pdf->Cell(1, 0.5, utf8_decode(""), 1, 0, "L");
     $pdf->SetXY($x + 5.5, $y);
     $pdf->Cell(1, 0.5, utf8_decode(""), 1, 0, "L");
     $pdf->SetXY($x + 7, $y);
     $pdf->Cell(1.5, 0.5, utf8_decode("GRUPO:"), 0, 0, "L");
     $pdf->SetXY($x + 8.75, $y);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(1, 0.5, utf8_decode($grupo), 1, 0, "L");
     $pdf->SetXY($x + 10.5, $y);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(1.5, 0.5, utf8_decode("Repitente:"), 0, 0, "L");
     $pdf->SetXY($x + 13, $y);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(1, 0.5, utf8_decode("SI"), 1, 0, "C");
     $pdf->SetXY($x + 14, $y);
     $pdf->Cell(1, 0.5, utf8_decode("NO"), 1, 0, "C");
     $y += 0.6;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(1.5, 0.5, utf8_decode("Fecha de Nacimiento:"), 0, 0, "L");
     $f = explode("-", $fecha_nac);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->SetXY($x + 4, $y);
     $pdf->Cell(1, 0.5, utf8_decode($f[2]), 1, 0, "C");
     $pdf->SetXY($x + 5, $y);
     $pdf->Cell(1, 0.5, utf8_decode($f[1]), 1, 0, "C");
     $pdf->SetXY($x + 6, $y);
     $pdf->Cell(1, 0.5, utf8_decode($f[0]), 1, 0, "C");
     $pdf->SetXY($x + 7.25, $y);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(1.5, 0.5, utf8_decode("Sexo:"), 0, 0, "L");
     $pdf->SetXY($x + 8.5, $y);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(1, 0.5, utf8_decode($sexo), 1, 0, "C");
     $pdf->SetXY($x + 9.75, $y);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(1, 0.5, utf8_decode("L. Nacimiento:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 12.5, $y + 0.5, $x + 16, $y + 0.5);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->SetXY($x + 12.5, $y);
     $pdf->Cell(1, 0.5, utf8_decode($lugar_nac), 0, 0, "L");
     $y += 0.6;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(1.5, 0.5, utf8_decode("Cuidado Especial:"), 0, 0, "L");
     $pdf->SetXY($x + 3.1, $y);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(1, 0.5, utf8_decode("SI"), 1, 0, "C");
     $pdf->SetXY($x + 4.1, $y);
     $pdf->Cell(1, 0.5, utf8_decode("NO"), 1, 0, "C");
     $pdf->SetXY($x + 5.5, $y - 0.25);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(2, 1, utf8_decode("Teléfono:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 7.2, $y + 0.5, $x + 10, $y + 0.5);
     $pdf->SetXY($x + 7.2, $y);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(7.5, 0.5, utf8_decode(strtoupper($tel)), 0, 0, "L");
     $pdf->SetXY($x + 10.5, $y - 0.25);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(2, 1, utf8_decode("E.P.S:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 11.7, $y + 0.5, $x + 16, $y + 0.5);
     $pdf->SetXY($x + 11.7, $y);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(7.5, 0.5, utf8_decode(strtoupper($eps)), 0, 0, "L");
     $y += 0.6;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(1.5, 0.5, utf8_decode("Enfermedad De Cuidado:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 4.2, $y + 0.5, $x + 12, $y + 0.5);
     $pdf->SetXY($x + 12.5, $y - 0.25);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(2, 1, utf8_decode("R.H:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 13.7, $y + 0.5, $x + 16, $y + 0.5);
     $pdf->SetXY($x + 13.7, $y);
     $pdf->SetFont("Arial", "B", 10);
     $pdf->Cell(7.5, 0.5, utf8_decode(strtoupper($est->getTipoSanguineo())), 0, 0, "L");
     $y += 0.6;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(1.5, 0.5, utf8_decode("Medicamentos Exclusivos:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 4.5, $y + 0.5, $x + 16, $y + 0.5);
     $y += 0.6;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "", 10);
     $pdf->Cell(1.5, 0.5, utf8_decode("Institución educativa de donde procede:"), 0, 0, "L");
     //Linea2
     $pdf->Line($x + 6.5, $y + 0.5, $x + 16, $y + 0.5);
     //TABLAAA_________________
     $y += 0.6;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "b", 12);
     $pdf->Cell(2.5, 0.75, utf8_decode("FECHA"), 1, 0, "C");
     $pdf->SetXY($x + 2.5, $y);
     $pdf->Cell(0.75, 0.75, utf8_decode("P"), 1, 0, "C");
     $pdf->SetXY($x + 3.25, $y);
     $pdf->Cell(0.75, 0.75, utf8_decode("T"), 1, 0, "C");
     $pdf->SetXY($x + 4, $y);
     $pdf->Cell(9, 0.75, utf8_decode("EXPLICACIÓN DE LA SITUACIÓN"), 1, 0, "C");
     $pdf->SetXY($x + 13, $y);
     $pdf->Cell(6.5, 0.75, utf8_decode("PROCEDIMIENTO"), 1, 0, "C");
     $pdf->SetXY($x + 19.5, $y);
     $pdf->Cell(6.5, 0.75, utf8_decode("COMPROMISO"), 1, 0, "C");
     $pdf->SetXY($x + 26, $y);
     $pdf->Cell(4, 0.75, utf8_decode("F. ALUMNO"), 1, 0, "C");
     $pdf->SetXY($x + 30, $y);
     $pdf->Cell(4, 0.75, utf8_decode("F.PROFESOR"), 1, 0, "C");
     //____________ESPACIOS
     $y += 0.75;
     $pdf->SetFont("Arial", "", 12);
     for ($i = 0; $i < 15; $i++) {
         $pdf->SetXY($x, $y);
         $pdf->Cell(2.5, 0.5, utf8_decode(""), 1, 0, "C");
         $pdf->SetXY($x + 2.5, $y);
         $pdf->Cell(0.75, 0.5, utf8_decode(""), 1, 0, "C");
         $pdf->SetXY($x + 3.25, $y);
         $pdf->Cell(0.75, 0.5, utf8_decode(""), 1, 0, "C");
         $pdf->SetXY($x + 4, $y);
         $pdf->Cell(9, 0.5, utf8_decode(""), 1, 0, "C");
         $pdf->SetXY($x + 13, $y);
         $pdf->Cell(6.5, 0.5, utf8_decode(""), 1, 0, "C");
         $pdf->SetXY($x + 19.5, $y);
         $pdf->Cell(6.5, 0.5, utf8_decode(""), 1, 0, "C");
         $pdf->SetXY($x + 26, $y);
         $pdf->Cell(4, 0.5, utf8_decode(""), 1, 0, "C");
         $pdf->SetXY($x + 30, $y);
         $pdf->Cell(4, 0.5, utf8_decode(""), 1, 0, "C");
         $y += 0.5;
     }
     $pdf->AddPage();
     //TABLAAA_________________
     $y = 0.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "b", 12);
     $pdf->Cell(2.5, 0.75, utf8_decode("FECHA"), 1, 0, "C");
     $pdf->SetXY($x + 2.5, $y);
     $pdf->Cell(0.75, 0.75, utf8_decode("P"), 1, 0, "C");
     $pdf->SetXY($x + 3.25, $y);
     $pdf->Cell(0.75, 0.75, utf8_decode("T"), 1, 0, "C");
     $pdf->SetXY($x + 4, $y);
     $pdf->Cell(9, 0.75, utf8_decode("EXPLICACIÓN DE LA SITUACIÓN"), 1, 0, "C");
     $pdf->SetXY($x + 13, $y);
     $pdf->Cell(6.5, 0.75, utf8_decode("PROCEDIMIENTO"), 1, 0, "C");
     $pdf->SetXY($x + 19.5, $y);
     $pdf->Cell(6.5, 0.75, utf8_decode("COMPROMISO"), 1, 0, "C");
     $pdf->SetXY($x + 26, $y);
     $pdf->Cell(4, 0.75, utf8_decode("F. ALUMNO"), 1, 0, "C");
     $pdf->SetXY($x + 30, $y);
     $pdf->Cell(4, 0.75, utf8_decode("F.PROFESOR"), 1, 0, "C");
     //____________ESPACIOS
     $y += 0.75;
     for ($i = 0; $i < 23; $i++) {
         $pdf->SetXY($x, $y);
         $pdf->Cell(2.5, 0.5, utf8_decode(""), 1, 0, "C");
         $pdf->SetXY($x + 2.5, $y);
         $pdf->Cell(0.75, 0.5, utf8_decode(""), 1, 0, "C");
         $pdf->SetXY($x + 3.25, $y);
         $pdf->Cell(0.75, 0.5, utf8_decode(""), 1, 0, "C");
         $pdf->SetXY($x + 4, $y);
         $pdf->Cell(9, 0.5, utf8_decode(""), 1, 0, "C");
         $pdf->SetXY($x + 13, $y);
         $pdf->Cell(6.5, 0.5, utf8_decode(""), 1, 0, "C");
         $pdf->SetXY($x + 19.5, $y);
         $pdf->Cell(6.5, 0.5, utf8_decode(""), 1, 0, "C");
         $pdf->SetXY($x + 26, $y);
         $pdf->Cell(4, 0.5, utf8_decode(""), 1, 0, "C");
         $pdf->SetXY($x + 30, $y);
         $pdf->Cell(4, 0.5, utf8_decode(""), 1, 0, "C");
         $y += 0.5;
     }
     $y += 0.25;
     $pdf->SetFont("Arial", "B", 15);
     $pdf->SetXY($x, $y);
     $pdf->Cell(34, 0.5, utf8_decode("CITAS ACUDIENTE"), 0, 0, "C");
     //Linea2
     $pdf->Line($x, $y + 1, $x + 8, $y + 1);
     $pdf->SetXY($x + 8, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $pdf->SetXY($x + 9, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $pdf->SetXY($x + 10, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $x += 11.5;
     $pdf->Line($x, $y + 1, $x + 8, $y + 1);
     $pdf->SetXY($x + 8, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $pdf->SetXY($x + 9, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $pdf->SetXY($x + 10, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $x += 11.5;
     $pdf->Line($x, $y + 1, $x + 8, $y + 1);
     $pdf->SetXY($x + 8, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $pdf->SetXY($x + 9, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $pdf->SetXY($x + 10, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $y += 1.1;
     $x = 0.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(8, 0.5, "FIRMA", 0, 0, "C");
     $pdf->SetXY($x + 8, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(3, 0.5, "FECHA", 0, 0, "C");
     $x += 11.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(8, 0.5, "FIRMA", 0, 0, "C");
     $pdf->SetXY($x + 8, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(3, 0.5, "FECHA", 0, 0, "C");
     $x += 11.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(8, 0.5, "FIRMA", 0, 0, "C");
     $pdf->SetXY($x + 8, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(3, 0.5, "FECHA", 0, 0, "C");
     //______COPIA FIRMAS
     $y += 0.75;
     $x = 0.5;
     $pdf->Line($x, $y + 1, $x + 8, $y + 1);
     $pdf->SetXY($x + 8, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $pdf->SetXY($x + 9, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $pdf->SetXY($x + 10, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $x += 11.5;
     $pdf->Line($x, $y + 1, $x + 8, $y + 1);
     $pdf->SetXY($x + 8, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $pdf->SetXY($x + 9, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $pdf->SetXY($x + 10, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $x += 11.5;
     $pdf->Line($x, $y + 1, $x + 8, $y + 1);
     $pdf->SetXY($x + 8, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $pdf->SetXY($x + 9, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $pdf->SetXY($x + 10, $y + 0.5);
     $pdf->Cell(1, 0.5, "", 1, 0, "C");
     $y += 1.1;
     $x = 0.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(8, 0.5, "FIRMA", 0, 0, "C");
     $pdf->SetXY($x + 8, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(3, 0.5, "FECHA", 0, 0, "C");
     $x += 11.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(8, 0.5, "FIRMA", 0, 0, "C");
     $pdf->SetXY($x + 8, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(3, 0.5, "FECHA", 0, 0, "C");
     $x += 11.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(8, 0.5, "FIRMA", 0, 0, "C");
     $pdf->SetXY($x + 8, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(3, 0.5, "FECHA", 0, 0, "C");
     //______________________
     $x = 0.5;
     $y += 1;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(6, 0.5, "ENTREGA DE BOLETINES", 0, 0, "R");
     $x += 6;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(5.5, 0.5, "PRIMER PERIODO", 1, 0, "C");
     $x += 5.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(5.5, 0.5, "SEGUNDO PERIODO", 1, 0, "C");
     $x += 5.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(5.5, 0.5, "TERCER PERIODO", 1, 0, "C");
     $x += 5.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(5.5, 0.5, "CUARTO PERIODO", 1, 0, "C");
     $x += 5.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(5.5, 0.5, "QUINTO INFORME", 1, 0, "C");
     $x = 0.5;
     $y += 0.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(6, 1, "FIRMA ACUDIENTE", 0, 0, "R");
     $x += 6;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(5.5, 1, "", 1, 0, "C");
     $x += 5.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(5.5, 1, "", 1, 0, "C");
     $x += 5.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(5.5, 1, "", 1, 0, "C");
     $x += 5.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(5.5, 1, "", 1, 0, "C");
     $x += 5.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(5.5, 1, "", 1, 0, "C");
     $y += 1;
     $x = 0.5;
     $pdf->SetXY($x, $y);
     $pdf->SetFont("Arial", "B", 12);
     $pdf->Cell(5.5, 1, "DIRECTOR DE GRUPO:", 0, 0, "C");
     $pdf->Line($x + 5.75, $y + 0.75, $x + 30, $y + 0.75);
     $pdf->Output("Observador " . $nom . " " . $ape, "I");
 }