Example #1
0
 private function getParametros(Logro $logro)
 {
     $parametros = array(':periodo' => $logro->getPeriodo(), ':idGrado' => $logro->getidGrado(), ':idMateria' => $logro->getIdMateria(), ':superior' => $logro->getSuperior(), ':alto' => $logro->getAlto(), ':basico' => $logro->getBasico(), ':bajo' => $logro->getBajo());
     return $parametros;
 }
Example #2
0
 public function guardarLogro()
 {
     try {
         $idGrado = isset($_POST['idGrado']) ? $_POST['idGrado'] : NULL;
         $idMateria = isset($_POST['idMateria']) ? $_POST['idMateria'] : NULL;
         $periodo = isset($_POST['periodo']) ? $_POST['periodo'] : NULL;
         $superior = isset($_POST['superior']) ? $_POST['superior'] : NULL;
         $alto = isset($_POST['alto']) ? $_POST['alto'] : NULL;
         $basico = isset($_POST['basico']) ? $_POST['basico'] : NULL;
         $bajo = isset($_POST['bajo']) ? $_POST['bajo'] : NULL;
         $logro = new Logro();
         $logro->setPeriodo($periodo);
         $logro->setIdGrado($idGrado);
         $logro->setIdMateria($idMateria);
         $logro->setSuperior($superior);
         $logro->setBasico($basico);
         $logro->setAlto($alto);
         $logro->setBajo($bajo);
         $logro->actualizarLogro($logro);
         echo json_encode(1);
     } catch (Exception $exc) {
         echo json_encode(0);
     }
 }
Example #3
0
 function boletinSantaTeresita($idSalon, $periodo)
 {
     $area = new Area();
     $areas = $area->leerAreas();
     $pensum = new Pensum();
     $pens = $pensum->leerPensum($idSalon);
     $persona = new Persona();
     $estudiantes = $persona->leerPorSalon($idSalon);
     $nots = new Nota();
     if ($periodo == "PRIMERO") {
         $puestos = $nots->leerPromedios($idSalon, "primerP");
     } elseif ($periodo == "SEGUNDO") {
         $puestos = $nots->leerPromedios($idSalon, "segundoP");
     } elseif ($periodo == "TERCERO") {
         $puestos = $nots->leerPromedios($idSalon, "tercerP");
     } elseif ($periodo == "CUARTO") {
         $puestos = $nots->leerPromedios($idSalon, "cuartoP");
     } elseif ($periodo == "FINAL") {
         $puestos = $nots->leerPromediosFinal($idSalon);
     }
     $pdf = new FPDF('P', 'cm', 'Legal');
     $pdf->SetMargins(0, 0, 0);
     $puest = 0;
     foreach ($puestos as $puesto) {
         foreach ($estudiantes as $estudiante) {
             if ($puesto["idPersona"] == $estudiante->getIdPersona()) {
                 $matricula = new Matricula();
                 $matr = $matricula->leerMatriculaPorId($estudiante->getIdPersona());
                 $salon = new Salon();
                 $sal = $salon->leerSalonePorId($idSalon);
                 $grado = new Grado();
                 $grad = $grado->leerGradoPorId($sal->getIdGrado());
                 $pdf->AddPage();
                 $pdf->SetFont("Arial", "B", 14);
                 $pdf->SetXY(1, 0);
                 $pdf->cell(18.5, 1, 'COLEGIO "SANTA TERESITA"', 0, 0, "C");
                 $pdf->ln();
                 $pdf->cell(4, 4, "", 0);
                 $pdf->Image('utiles/imagenes/escudoSantaTeresita.jpg', 1, 0, 2.5);
                 $pdf->SetFont("Arial", "", 10);
                 //CAbecera
                 $pdf->SetXY(1, 1);
                 $pdf->Cell(18.5, 1, utf8_decode('"EDUCAMOS PARA HACER POSIBLE LA VIDA Y LA FELICIDAD"'), 0, 1, "C");
                 $pdf->SetXY(1, 1.5);
                 $pdf->Cell(18.5, 1, "INFORME EVALUATIVO", 0, 1, "C");
                 $pdf->SetXY(16, 0);
                 $pdf->SetFont("Arial", "", 10);
                 $pdf->Cell(4, 1, "Bajo(Db): 10 - 69 ", 0, 0, "C");
                 $pdf->SetXY(16, 0.5);
                 $pdf->Cell(4, 1, "Basico(DB): 70 - 79  ", 0, 0, "C");
                 $pdf->SetXY(16, 1);
                 $pdf->Cell(4, 1, "Alto(DA): 80 - 94 ", 0, 0, "C");
                 $pdf->SetXY(16, 1.5);
                 $pdf->Cell(4, 1, "Superior(DS): 95 - 100", 0, 0, "C");
                 $pdf->SetXY(16, 0);
                 $pdf->Cell(4, 2.5, "", 1, 0, "C");
                 if ($periodo == "PRIMERO") {
                     $periodo3 = "1";
                 }
                 if ($periodo == "SEGUNDO") {
                     $periodo3 = "2";
                 }
                 if ($periodo == "TERCERO") {
                     $periodo3 = "3";
                 }
                 if ($periodo == "CUARTO") {
                     $periodo3 = "4";
                 }
                 if ($periodo == "FINAL") {
                     $periodo3 = "F";
                 }
                 $x = 1;
                 $y = 2.75;
                 $pdf->SetXY($x, $y);
                 $pdf->SetFont("Arial", "", 10);
                 $pdf->Cell(3.3, 0.5, "Apellidos y Nombre:", 0, 0, "L");
                 $pdf->SetFont("Arial", "B", 10);
                 $pdf->Cell(8, 0.5, utf8_decode(strtoupper($estudiante->getPApellido() . " " . $estudiante->getSApellido() . " " . $estudiante->getNombres())), 0, 0, "L");
                 $pdf->SetXY($x, $y);
                 $pdf->Cell(12.8, 0.5, "", 1, 0, "L");
                 $pdf->SetFont("Arial", "", 10);
                 $pdf->Cell(1.2, 0.5, "Grado:", 0, 0, "L");
                 $pdf->SetFont("Arial", "B", 10);
                 $pdf->Cell(0.8, 0.5, $idSalon, 0, 0, "L");
                 $pdf->SetXY($x + 12.8, $y);
                 $pdf->Cell(2.2, 0.5, "", 1, 0, "L");
                 $pdf->SetFont("Arial", "", 10);
                 $pdf->Cell(1.5, 0.5, "Periodo:", 0, 0, "L");
                 $pdf->SetFont("Arial", "B", 10);
                 $pdf->Cell(0.5, 0.5, $periodo3, 0, 0, "L");
                 $pdf->SetXY($x + 15, $y);
                 $pdf->Cell(2, 0.5, "", 1, 0, "L");
                 $pdf->SetFont("Arial", "", 10);
                 $pdf->Cell(1, 0.5, utf8_decode("Año:"), 0, 0, "L");
                 $pdf->SetFont("Arial", "B", 10);
                 $pdf->Cell(1, 0.5, $matr->getAnoLectivo(), 0, 0, "L");
                 $pdf->SetXY($x + 17, $y);
                 $pdf->Cell(2, 0.5, "", 1, 0, "L");
                 $pdf->SetFont("Arial", "B", 9);
                 $y += 0.5;
                 $pdf->SetXY($x, $y);
                 $pdf->SetFont("Arial", "B", 9);
                 $pdf->Cell(5.5, 0.5, "AREAS Y ASIGNATURAS", 1, 0, "L");
                 $pdf->SetFont("Arial", "B", 8);
                 $pdf->Cell(0.5, 0.5, "I.H", 1, 0, "L");
                 $pdf->SetFont("Arial", "B", 9);
                 $pdf->Cell(12, 0.5, "FORTALEZAS Y/O DIFICULTADES", 1, 0, "C");
                 $pdf->Cell(1, 0.5, "NOTA", 1, 0, "C");
                 $y += 0.5;
                 $c = 0;
                 $suma = 0;
                 $cont = 0;
                 for ($i = 0; $i < count($areas); $i++) {
                     $c++;
                     foreach ($areas as $a) {
                         $g = intval($grad->getIdGrado());
                         if ($a->getIdArea() == "FIL") {
                             if ($g > 5) {
                                 if ($a->getOrden() == $c) {
                                     $pdf->SetXY($x, $y);
                                     $pdf->SetFont("Arial", "BU", 9);
                                     if ($a->getIdArea() == "EF" || $a->getIdArea() == "EA" || $a->getIdArea() == "ER" || $a->getIdArea() == "EVD" || $a->getIdArea() == "FIL") {
                                         $pdf->Cell(5.5, 1.25, utf8_decode($a->getNombreArea()), 1, 0, "L");
                                     } else {
                                         $pdf->Cell(5.5, 0.5, utf8_decode($a->getNombreArea()), 1, 0, "L");
                                         $pdf->Cell(0.5, 0.5, utf8_decode(""), 1, 0, "L");
                                         $pdf->Cell(12, 0.5, utf8_decode(""), 1, 0, "L");
                                         $pdf->Cell(1, 0.5, utf8_decode(""), 1, 0, "L");
                                     }
                                     $mate = new Materia();
                                     $band = 0;
                                     foreach ($pens as $p) {
                                         $materias = $mate->leerMateriaPorId($p->getIdMateria());
                                         foreach ($materias as $materia) {
                                             $idMateria = $materia->getIdMateria();
                                             $nombreMateria = $materia->getNombreMateria();
                                             $horas = $materia->getHoras();
                                             $idArea = $materia->getIdArea();
                                             if ($idArea == $a->getIdArea()) {
                                                 $nota = new Nota();
                                                 $not = $nota->leerNotaEstudiante($estudiante->getIdPersona(), $idMateria);
                                                 $falla = new Falla();
                                                 $fal = $falla->leerFallaEstudiante($estudiante->getIdPersona(), $idMateria);
                                                 $logro = new Logro();
                                                 if ($periodo == "FINAL") {
                                                     $log = $logro->leerLogro("CUARTO", $grad->getIdGrado(), $idMateria);
                                                 } else {
                                                     $log = $logro->leerLogro($periodo, $grad->getIdGrado(), $idMateria);
                                                 }
                                                 $desempeño = "";
                                                 $cadena = "";
                                                 $band = 0;
                                                 $y += 0.5;
                                                 $pdf->SetXY($x, $y);
                                                 $pdf->SetFont("Arial", "B", 9);
                                                 if ($nombreMateria == "ARTISTICA" || $nombreMateria == "ETICA" || $nombreMateria == "RELIGION" || $nombreMateria == "EDUCACION FISICA" || $nombreMateria == "FILOSOFIA") {
                                                     //$pdf->MultiCell(5.5,1.25, utf8_decode($a->getNombreArea()),1,"L");
                                                     $band = 1;
                                                 } else {
                                                     $pdf->MultiCell(5.5, 1.25, utf8_decode($nombreMateria), 1, "L");
                                                 }
                                                 if ($band == 1) {
                                                     $pdf->SetXY($x + 5.5, $y - 0.5);
                                                 } else {
                                                     $pdf->SetXY($x + 5.5, $y);
                                                 }
                                                 $pdf->MultiCell(0.5, 1.25, $horas, 1, "L");
                                                 if ($log != NULL) {
                                                     if ($periodo == "PRIMERO") {
                                                         // $pdf->Cell(1, 1.5, $not->getPrimerP(), 1, 0, "C");
                                                         $suma = $suma + $not->getPrimerP();
                                                         $n = $not->getPrimerP();
                                                         if ($not->getPrimerP() <= 69) {
                                                             $cadena = $log->getBajo();
                                                             $desempeño = "Db";
                                                         }
                                                         if ($not->getPrimerP() <= 79 && $not->getPrimerP() > 69) {
                                                             $cadena = $log->getBasico();
                                                             $desempeño = "DB";
                                                         }
                                                         if ($not->getPrimerP() <= 94 && $not->getPrimerP() > 79) {
                                                             $cadena = $log->getAlto();
                                                             $desempeño = "DA";
                                                         }
                                                         if ($not->getPrimerP() > 94) {
                                                             $cadena = $log->getSuperior();
                                                             $desempeño = "DS";
                                                         }
                                                     } elseif ($periodo == "SEGUNDO") {
                                                         //$pdf->Cell(1, 1.5, $not->getSegundoP(), 1, 0, "C");
                                                         $suma = $suma + $not->getSegundoP();
                                                         $n = $not->getSegundoP();
                                                         if ($not->getSegundoP() <= 69) {
                                                             $cadena = $log->getBajo();
                                                             $desempeño = "Db";
                                                         }
                                                         if ($not->getSegundoP() <= 79 && $not->getSegundoP() > 69) {
                                                             $cadena = $log->getBasico();
                                                             $desempeño = "DB";
                                                         }
                                                         if ($not->getSegundoP() <= 94 && $not->getSegundoP() > 79) {
                                                             $cadena = $log->getAlto();
                                                             $desempeño = "DA";
                                                         }
                                                         if ($not->getSegundoP() > 94) {
                                                             $cadena = $log->getSuperior();
                                                             $desempeño = "DS";
                                                         }
                                                     } elseif ($periodo == "TERCERO") {
                                                         //$pdf->Cell(1, 1.5, $not->getTercerP(), 1, 0, "C");
                                                         $suma = $suma + $not->getTercerP();
                                                         $n = $not->getTercerP();
                                                         if ($not->getTercerP() <= 69) {
                                                             $cadena = $log->getBajo();
                                                             $desempeño = "Db";
                                                         }
                                                         if ($not->getTercerP() <= 79 && $not->getTercerP() > 69) {
                                                             $cadena = $log->getBasico();
                                                             $desempeño = "DB";
                                                         }
                                                         if ($not->getTercerP() <= 94 && $not->getTercerP() > 79) {
                                                             $cadena = $log->getAlto();
                                                             $desempeño = "DA";
                                                         }
                                                         if ($not->getTercerP() > 94) {
                                                             $cadena = $log->getSuperior();
                                                             $desempeño = "DS";
                                                         }
                                                     } elseif ($periodo == "CUARTO") {
                                                         //$pdf->Cell(1, 1.5, $not->getCuartoP();, 1, 0, "C");
                                                         $suma = $suma + $not->getCuartoP();
                                                         $n = $not->getCuartoP();
                                                         if ($not->getCuartoP() <= 69) {
                                                             $cadena = $log->getBajo();
                                                             $desempeño = "Db";
                                                         }
                                                         if ($not->getCuartoP() <= 79 && $not->getCuartoP() > 69) {
                                                             $cadena = $log->getBasico();
                                                             $desempeño = "DB";
                                                         }
                                                         if ($not->getCuartoP() <= 94 && $not->getCuartoP() > 79) {
                                                             $cadena = $log->getAlto();
                                                             $desempeño = "DA";
                                                         }
                                                         if ($not->getCuartoP() > 94) {
                                                             $cadena = $log->getSuperior();
                                                             $desempeño = "DS";
                                                         }
                                                     } elseif ($periodo == "FINAL") {
                                                         $def = $nota->calcularDef2($not->getPrimerP(), $not->getSegundoP(), $not->getTercerP(), $not->getCuartoP());
                                                         //$pdf->Cell(1, 1.5, $def, 1, 0, "C");
                                                         $n = $def;
                                                         $suma = $suma + $def;
                                                         if ($def < 69) {
                                                             $cadena = $log->getBajo();
                                                             $desempeño = "Db";
                                                         }
                                                         if ($def <= 79 && $def > 69) {
                                                             $cadena = $log->getBasico();
                                                             $desempeño = "DB";
                                                         }
                                                         if ($def <= 94 && $def > 79) {
                                                             $cadena = $log->getAlto();
                                                             $desempeño = "DA";
                                                         }
                                                         if ($def > 94) {
                                                             $cadena = $log->getSuperior();
                                                             $desempeño = "DS";
                                                         }
                                                     }
                                                     $cont++;
                                                     $pdf->SetFont("Arial", "", 7);
                                                     if ($band == 1) {
                                                         $pdf->SetXY($x + 6, $y - 0.5);
                                                     } else {
                                                         $pdf->SetXY($x + 6, $y);
                                                     }
                                                     $pdf->MultiCell(12, 0.417, strtoupper(utf8_decode($desempeño . ": " . $cadena)), 0, "L");
                                                     if ($band == 1) {
                                                         $pdf->SetXY($x + 6, $y - 0.5);
                                                     } else {
                                                         $pdf->SetXY($x + 6, $y);
                                                     }
                                                     $pdf->MultiCell(12, 1.25, "", 1, "L");
                                                     if ($band == 1) {
                                                         $pdf->SetXY($x + 18, $y - 0.5);
                                                     } else {
                                                         $pdf->SetXY($x + 18, $y);
                                                     }
                                                     $pdf->SetFont("Arial", "B", 7);
                                                     //MODIFICAR ESTA LINEA DE ACUERDO AL PERIODO
                                                     $pdf->MultiCell(12, 1.25, utf8_decode($n), 0, "L");
                                                     if ($band == 1) {
                                                         $pdf->SetXY($x + 18, $y - 0.5);
                                                     } else {
                                                         $pdf->SetXY($x + 18, $y);
                                                     }
                                                     $pdf->MultiCell(1, 1.25, "", 1, "L");
                                                 }
                                                 if ($band == 1) {
                                                     $y += 0.25;
                                                 } else {
                                                     $y += 0.75;
                                                 }
                                             }
                                         }
                                     }
                                     $y += 0.5;
                                 }
                             }
                         } elseif ($a->getIdArea() == "ET") {
                             if ($grad->getIdGrado() != "P" && $grad->getIdGrado() != "J") {
                                 if ($a->getOrden() == $c) {
                                     $pdf->SetXY($x, $y);
                                     $pdf->SetFont("Arial", "BU", 9);
                                     if ($a->getIdArea() == "EF" || $a->getIdArea() == "EA" || $a->getIdArea() == "ER" || $a->getIdArea() == "EVD" || $a->getIdArea() == "FIL") {
                                         $pdf->Cell(5.5, 1.25, utf8_decode($a->getNombreArea()), 1, 0, "L");
                                     } else {
                                         $pdf->Cell(5.5, 0.5, utf8_decode($a->getNombreArea()), 1, 0, "L");
                                         $pdf->Cell(0.5, 0.5, utf8_decode(""), 1, 0, "L");
                                         $pdf->Cell(12, 0.5, utf8_decode(""), 1, 0, "L");
                                         $pdf->Cell(1, 0.5, utf8_decode(""), 1, 0, "L");
                                     }
                                     $mate = new Materia();
                                     $band = 0;
                                     foreach ($pens as $p) {
                                         $materias = $mate->leerMateriaPorId($p->getIdMateria());
                                         foreach ($materias as $materia) {
                                             $idMateria = $materia->getIdMateria();
                                             $nombreMateria = $materia->getNombreMateria();
                                             $horas = $materia->getHoras();
                                             $idArea = $materia->getIdArea();
                                             if ($idArea == $a->getIdArea()) {
                                                 $nota = new Nota();
                                                 $not = $nota->leerNotaEstudiante($estudiante->getIdPersona(), $idMateria);
                                                 $falla = new Falla();
                                                 $fal = $falla->leerFallaEstudiante($estudiante->getIdPersona(), $idMateria);
                                                 $logro = new Logro();
                                                 if ($periodo == "FINAL") {
                                                     $log = $logro->leerLogro("CUARTO", $grad->getIdGrado(), $idMateria);
                                                 } else {
                                                     $log = $logro->leerLogro($periodo, $grad->getIdGrado(), $idMateria);
                                                 }
                                                 $desempeño = "";
                                                 $cadena = "";
                                                 $band = 0;
                                                 $y += 0.5;
                                                 $pdf->SetXY($x, $y);
                                                 $pdf->SetFont("Arial", "B", 9);
                                                 if ($nombreMateria == "ARTISTICA" || $nombreMateria == "ETICA" || $nombreMateria == "RELIGION" || $nombreMateria == "EDUCACION FISICA" || $nombreMateria == "FILOSOFIA") {
                                                     //$pdf->MultiCell(5.5,1.25, utf8_decode($a->getNombreArea()),1,"L");
                                                     $band = 1;
                                                 } else {
                                                     $pdf->MultiCell(5.5, 1.25, utf8_decode($nombreMateria), 1, "L");
                                                 }
                                                 if ($band == 1) {
                                                     $pdf->SetXY($x + 5.5, $y - 0.5);
                                                 } else {
                                                     $pdf->SetXY($x + 5.5, $y);
                                                 }
                                                 $pdf->MultiCell(0.5, 1.25, $horas, 1, "L");
                                                 if ($log != NULL) {
                                                     if ($periodo == "PRIMERO") {
                                                         // $pdf->Cell(1, 1.5, $not->getPrimerP(), 1, 0, "C");
                                                         $suma = $suma + $not->getPrimerP();
                                                         $n = $not->getPrimerP();
                                                         if ($not->getPrimerP() <= 69) {
                                                             $cadena = $log->getBajo();
                                                             $desempeño = "Db";
                                                         }
                                                         if ($not->getPrimerP() <= 79 && $not->getPrimerP() > 69) {
                                                             $cadena = $log->getBasico();
                                                             $desempeño = "DB";
                                                         }
                                                         if ($not->getPrimerP() <= 94 && $not->getPrimerP() > 79) {
                                                             $cadena = $log->getAlto();
                                                             $desempeño = "DA";
                                                         }
                                                         if ($not->getPrimerP() > 94) {
                                                             $cadena = $log->getSuperior();
                                                             $desempeño = "DS";
                                                         }
                                                     } elseif ($periodo == "SEGUNDO") {
                                                         //$pdf->Cell(1, 1.5, $not->getSegundoP(), 1, 0, "C");
                                                         $suma = $suma + $not->getSegundoP();
                                                         $n = $not->getSegundoP();
                                                         if ($not->getSegundoP() <= 69) {
                                                             $cadena = $log->getBajo();
                                                             $desempeño = "Db";
                                                         }
                                                         if ($not->getSegundoP() <= 79 && $not->getSegundoP() > 69) {
                                                             $cadena = $log->getBasico();
                                                             $desempeño = "DB";
                                                         }
                                                         if ($not->getSegundoP() <= 94 && $not->getSegundoP() > 79) {
                                                             $cadena = $log->getAlto();
                                                             $desempeño = "DA";
                                                         }
                                                         if ($not->getSegundoP() > 94) {
                                                             $cadena = $log->getSuperior();
                                                             $desempeño = "DS";
                                                         }
                                                     } elseif ($periodo == "TERCERO") {
                                                         //$pdf->Cell(1, 1.5, $not->getTercerP(), 1, 0, "C");
                                                         $suma = $suma + $not->getTercerP();
                                                         $n = $not->getTercerP();
                                                         if ($not->getTercerP() <= 69) {
                                                             $cadena = $log->getBajo();
                                                             $desempeño = "Db";
                                                         }
                                                         if ($not->getTercerP() <= 79 && $not->getTercerP() > 69) {
                                                             $cadena = $log->getBasico();
                                                             $desempeño = "DB";
                                                         }
                                                         if ($not->getTercerP() <= 94 && $not->getTercerP() > 79) {
                                                             $cadena = $log->getAlto();
                                                             $desempeño = "DA";
                                                         }
                                                         if ($not->getTercerP() > 94) {
                                                             $cadena = $log->getSuperior();
                                                             $desempeño = "DS";
                                                         }
                                                     } elseif ($periodo == "CUARTO") {
                                                         //$pdf->Cell(1, 1.5, $not->getCuartoP();, 1, 0, "C");
                                                         $suma = $suma + $not->getCuartoP();
                                                         $n = $not->getCuartoP();
                                                         if ($not->getCuartoP() <= 69) {
                                                             $cadena = $log->getBajo();
                                                             $desempeño = "Db";
                                                         }
                                                         if ($not->getCuartoP() <= 79 && $not->getCuartoP() > 69) {
                                                             $cadena = $log->getBasico();
                                                             $desempeño = "DB";
                                                         }
                                                         if ($not->getCuartoP() <= 94 && $not->getCuartoP() > 79) {
                                                             $cadena = $log->getAlto();
                                                             $desempeño = "DA";
                                                         }
                                                         if ($not->getCuartoP() > 94) {
                                                             $cadena = $log->getSuperior();
                                                             $desempeño = "DS";
                                                         }
                                                     } elseif ($periodo == "FINAL") {
                                                         $def = $nota->calcularDef2($not->getPrimerP(), $not->getSegundoP(), $not->getTercerP(), $not->getCuartoP());
                                                         //$pdf->Cell(1, 1.5, $def, 1, 0, "C");
                                                         $suma = $suma + $def;
                                                         $n = $def;
                                                         if ($def < 69) {
                                                             $cadena = $log->getBajo();
                                                             $desempeño = "Db";
                                                         }
                                                         if ($def <= 79 && $def > 69) {
                                                             $cadena = $log->getBasico();
                                                             $desempeño = "DB";
                                                         }
                                                         if ($def <= 94 && $def > 79) {
                                                             $cadena = $log->getAlto();
                                                             $desempeño = "DA";
                                                         }
                                                         if ($def > 94) {
                                                             $cadena = $log->getSuperior();
                                                             $desempeño = "DS";
                                                         }
                                                     }
                                                     $cont++;
                                                     $pdf->SetFont("Arial", "", 7);
                                                     if ($band == 1) {
                                                         $pdf->SetXY($x + 6, $y - 0.5);
                                                     } else {
                                                         $pdf->SetXY($x + 6, $y);
                                                     }
                                                     $pdf->MultiCell(12, 0.417, strtoupper(utf8_decode($desempeño . ": " . $cadena)), 0, "L");
                                                     if ($band == 1) {
                                                         $pdf->SetXY($x + 6, $y - 0.5);
                                                     } else {
                                                         $pdf->SetXY($x + 6, $y);
                                                     }
                                                     $pdf->MultiCell(12, 1.25, "", 1, "L");
                                                     if ($band == 1) {
                                                         $pdf->SetXY($x + 18, $y - 0.5);
                                                     } else {
                                                         $pdf->SetXY($x + 18, $y);
                                                     }
                                                     $pdf->SetFont("Arial", "B", 7);
                                                     //MODIFICAR ESTA LINEA DE ACUERDO AL PERIODO
                                                     $pdf->MultiCell(12, 1.25, utf8_decode($n), 0, "L");
                                                     if ($band == 1) {
                                                         $pdf->SetXY($x + 18, $y - 0.5);
                                                     } else {
                                                         $pdf->SetXY($x + 18, $y);
                                                     }
                                                     $pdf->MultiCell(1, 1.25, "", 1, "L");
                                                 }
                                                 if ($band == 1) {
                                                     $y += 0.25;
                                                 } else {
                                                     $y += 0.75;
                                                 }
                                             }
                                         }
                                     }
                                     $y += 0.5;
                                 }
                             }
                         } else {
                             if ($a->getOrden() == $c) {
                                 $pdf->SetXY($x, $y);
                                 $pdf->SetFont("Arial", "BU", 9);
                                 if ($a->getIdArea() == "EF" || $a->getIdArea() == "EA" || $a->getIdArea() == "ER" || $a->getIdArea() == "EVD" || $a->getIdArea() == "FIL") {
                                     $pdf->Cell(5.5, 1.25, utf8_decode($a->getNombreArea()), 1, 0, "L");
                                 } else {
                                     $pdf->Cell(5.5, 0.5, utf8_decode($a->getNombreArea()), 1, 0, "L");
                                     $pdf->Cell(0.5, 0.5, utf8_decode(""), 1, 0, "L");
                                     $pdf->Cell(12, 0.5, utf8_decode(""), 1, 0, "L");
                                     $pdf->Cell(1, 0.5, utf8_decode(""), 1, 0, "L");
                                 }
                                 $mate = new Materia();
                                 $band = 0;
                                 foreach ($pens as $p) {
                                     $materias = $mate->leerMateriaPorId($p->getIdMateria());
                                     foreach ($materias as $materia) {
                                         $idMateria = $materia->getIdMateria();
                                         $nombreMateria = $materia->getNombreMateria();
                                         $horas = $materia->getHoras();
                                         $idArea = $materia->getIdArea();
                                         if ($idArea == $a->getIdArea()) {
                                             $nota = new Nota();
                                             $not = $nota->leerNotaEstudiante($estudiante->getIdPersona(), $idMateria);
                                             $falla = new Falla();
                                             $fal = $falla->leerFallaEstudiante($estudiante->getIdPersona(), $idMateria);
                                             $logro = new Logro();
                                             if ($periodo == "FINAL") {
                                                 $log = $logro->leerLogro("CUARTO", $grad->getIdGrado(), $idMateria);
                                             } else {
                                                 $log = $logro->leerLogro($periodo, $grad->getIdGrado(), $idMateria);
                                             }
                                             $desempeño = "";
                                             $cadena = "";
                                             $band = 0;
                                             $y += 0.5;
                                             $pdf->SetXY($x, $y);
                                             $pdf->SetFont("Arial", "B", 9);
                                             if ($nombreMateria == "ARTISTICA" || $nombreMateria == "ETICA" || $nombreMateria == "RELIGION" || $nombreMateria == "EDUCACION FISICA" || $nombreMateria == "FILOSOFIA") {
                                                 //$pdf->MultiCell(5.5,1.25, utf8_decode($a->getNombreArea()),1,"L");
                                                 $band = 1;
                                             } else {
                                                 $pdf->MultiCell(5.5, 1.25, utf8_decode($nombreMateria), 1, "L");
                                             }
                                             if ($band == 1) {
                                                 $pdf->SetXY($x + 5.5, $y - 0.5);
                                             } else {
                                                 $pdf->SetXY($x + 5.5, $y);
                                             }
                                             $pdf->MultiCell(0.5, 1.25, $horas, 1, "L");
                                             if ($log != NULL) {
                                                 if ($periodo == "PRIMERO") {
                                                     // $pdf->Cell(1, 1.5, $not->getPrimerP(), 1, 0, "C");
                                                     $suma = $suma + $not->getPrimerP();
                                                     $n = $not->getPrimerP();
                                                     if ($not->getPrimerP() <= 69) {
                                                         $cadena = $log->getBajo();
                                                         $desempeño = "Db";
                                                     }
                                                     if ($not->getPrimerP() <= 79 && $not->getPrimerP() > 69) {
                                                         $cadena = $log->getBasico();
                                                         $desempeño = "DB";
                                                     }
                                                     if ($not->getPrimerP() <= 94 && $not->getPrimerP() > 79) {
                                                         $cadena = $log->getAlto();
                                                         $desempeño = "DA";
                                                     }
                                                     if ($not->getPrimerP() > 94) {
                                                         $cadena = $log->getSuperior();
                                                         $desempeño = "DS";
                                                     }
                                                 } elseif ($periodo == "SEGUNDO") {
                                                     //$pdf->Cell(1, 1.5, $not->getSegundoP(), 1, 0, "C");
                                                     $suma = $suma + $not->getSegundoP();
                                                     $n = $not->getSegundoP();
                                                     if ($not->getSegundoP() <= 69) {
                                                         $cadena = $log->getBajo();
                                                         $desempeño = "Db";
                                                     }
                                                     if ($not->getSegundoP() <= 79 && $not->getSegundoP() > 69) {
                                                         $cadena = $log->getBasico();
                                                         $desempeño = "DB";
                                                     }
                                                     if ($not->getSegundoP() <= 94 && $not->getSegundoP() > 79) {
                                                         $cadena = $log->getAlto();
                                                         $desempeño = "DA";
                                                     }
                                                     if ($not->getSegundoP() > 94) {
                                                         $cadena = $log->getSuperior();
                                                         $desempeño = "DS";
                                                     }
                                                 } elseif ($periodo == "TERCERO") {
                                                     //$pdf->Cell(1, 1.5, $not->getTercerP(), 1, 0, "C");
                                                     $suma = $suma + $not->getTercerP();
                                                     $n = $not->getTercerP();
                                                     if ($not->getTercerP() <= 69) {
                                                         $cadena = $log->getBajo();
                                                         $desempeño = "Db";
                                                     }
                                                     if ($not->getTercerP() <= 79 && $not->getTercerP() > 69) {
                                                         $cadena = $log->getBasico();
                                                         $desempeño = "DB";
                                                     }
                                                     if ($not->getTercerP() <= 94 && $not->getTercerP() > 79) {
                                                         $cadena = $log->getAlto();
                                                         $desempeño = "DA";
                                                     }
                                                     if ($not->getTercerP() > 94) {
                                                         $cadena = $log->getSuperior();
                                                         $desempeño = "DS";
                                                     }
                                                 } elseif ($periodo == "CUARTO") {
                                                     //$pdf->Cell(1, 1.5, $not->getCuartoP();, 1, 0, "C");
                                                     $suma = $suma + $not->getCuartoP();
                                                     $n = $not->getCuartoP();
                                                     if ($not->getCuartoP() <= 69) {
                                                         $cadena = $log->getBajo();
                                                         $desempeño = "Db";
                                                     }
                                                     if ($not->getCuartoP() <= 79 && $not->getCuartoP() > 69) {
                                                         $cadena = $log->getBasico();
                                                         $desempeño = "DB";
                                                     }
                                                     if ($not->getCuartoP() <= 94 && $not->getCuartoP() > 79) {
                                                         $cadena = $log->getAlto();
                                                         $desempeño = "DA";
                                                     }
                                                     if ($not->getCuartoP() > 94) {
                                                         $cadena = $log->getSuperior();
                                                         $desempeño = "DS";
                                                     }
                                                 } elseif ($periodo == "FINAL") {
                                                     $def = $nota->calcularDef2($not->getPrimerP(), $not->getSegundoP(), $not->getTercerP(), $not->getCuartoP());
                                                     //$pdf->Cell(1, 1.5, $def, 1, 0, "C");
                                                     $n = $def;
                                                     $suma = $suma + $def;
                                                     if ($def < 69) {
                                                         $cadena = $log->getBajo();
                                                         $desempeño = "Db";
                                                     }
                                                     if ($def <= 79 && $def > 69) {
                                                         $cadena = $log->getBasico();
                                                         $desempeño = "DB";
                                                     }
                                                     if ($def <= 94 && $def > 79) {
                                                         $cadena = $log->getAlto();
                                                         $desempeño = "DA";
                                                     }
                                                     if ($def > 94) {
                                                         $cadena = $log->getSuperior();
                                                         $desempeño = "DS";
                                                     }
                                                 }
                                                 $cont++;
                                                 $pdf->SetFont("Arial", "", 7);
                                                 if ($band == 1) {
                                                     $pdf->SetXY($x + 6, $y - 0.5);
                                                 } else {
                                                     $pdf->SetXY($x + 6, $y);
                                                 }
                                                 $pdf->MultiCell(12, 0.417, strtoupper(utf8_decode($desempeño . ": " . $cadena)), 0, "L");
                                                 if ($band == 1) {
                                                     $pdf->SetXY($x + 6, $y - 0.5);
                                                 } else {
                                                     $pdf->SetXY($x + 6, $y);
                                                 }
                                                 $pdf->MultiCell(12, 1.25, "", 1, "L");
                                                 if ($band == 1) {
                                                     $pdf->SetXY($x + 18, $y - 0.5);
                                                 } else {
                                                     $pdf->SetXY($x + 18, $y);
                                                 }
                                                 $pdf->SetFont("Arial", "B", 7);
                                                 //MODIFICAR ESTA LINEA DE ACUERDO AL PERIODO
                                                 $pdf->MultiCell(12, 0.417, utf8_decode($n), 0, "L");
                                                 if ($band == 1) {
                                                     $pdf->SetXY($x + 18, $y - 0.5);
                                                 } else {
                                                     $pdf->SetXY($x + 18, $y);
                                                 }
                                                 $pdf->MultiCell(1, 1.25, "", 1, "L");
                                             }
                                             if ($band == 1) {
                                                 $y += 0.25;
                                             } else {
                                                 $y += 0.75;
                                             }
                                         }
                                     }
                                 }
                                 $y += 0.5;
                             }
                             //FIN IF
                         }
                     }
                     //FOREACH AREAS
                 }
                 $prom = round($suma / $cont, 1);
                 $pdf->SetXY($x + 17.5, $y);
                 $pdf->Cell(1.5, 0.5, utf8_decode("PROM: " . $prom), 1, 0, "L");
                 $pdf->SetXY($x + 17.5, $y + 0.5);
                 $puest++;
                 $pdf->Cell(1.5, 0.5, utf8_decode("POS: " . $puest), 1, 0, "L");
                 $pdf->SetXY($x, $y);
                 $pdf->Cell(17.5, 1, "", 1, 0, "L");
                 $pdf->SetXY($x, $y);
                 $pdf->Cell(17.5, 0.5, "Observaciones:", 0, 0, "L");
                 $y += 1.5;
                 $pdf->SetXY($x, $y);
                 $pdf->SetFont("Arial", "B", 9);
                 $pdf->Cell(10, 0.5, "DIRECTOR DE GRUPO______________________", 0, 0, "C");
                 $pdf->Cell(10, 0.5, "RECTOR______________________", 0, 0, "C");
                 break;
             }
         }
         //FIn Estudiantes
     }
     $pdf->Output("Boletin " . $grad->getIdGrado(), "I");
 }