tieneAcceso()){
echo "";
exit();
}
unset($objValida);
if(!isset($_GET["id"])){
echo "";
exit();
}
$periodo_id = $_SESSION["periodo_id"];
$profesor = $_GET["id"];
//Obtiene datos de reposición
$stmt = $pdo->prepare('Select * from fs_reposicion(:id, :per, NULL, NULL, NULL, NULL, NULL, 0, NULL)');
$stmt->bindParam(":id", $profesor);
$stmt->bindParam(":per", $periodo_id);
if(!$stmt->execute()){
header("Location:".$pag."?error=4");
//print_r($stmt->errorInfo());
exit();
}
$reposicion_rs = $stmt->fetch();
$stmt->closeCursor();
if(empty($reposicion_rs["HorarioGrupo_id"]) || $reposicion_rs["ReposicionEstado_id"] < 2){
//echo "Error";
echo "";
exit();
}
//$reposicion_rs["Horario_id"]
//Obtiene datos de horario original
$stmt = $pdo->prepare('Select * from fs_horario(:id)');
$stmt->bindParam(":id", $reposicion_rs["HorarioGrupo_id"]);
if(!$stmt->execute()){
header("Location:".$pag."?error=4");
//print_r($stmt->errorInfo());
exit();
}
$horario_rs = $stmt->fetch();
$stmt->closeCursor();
//-----
// Create new Spreadsheet object
$spreadsheet = new Spreadsheet();
// Set document properties
$spreadsheet->getProperties()->setCreator('Ingeniería La Salle')
->setLastModifiedBy('Ingeniería La Salle')
->setTitle('Asistencias profesores')
->setDescription('Reporte de asistencia de profesores.');
// Rename worksheet
$spreadsheet->getActiveSheet()->setTitle('Asistencias');
$headerStyle = new Style();
$headerStyle->applyFromArray(
[
'fill' => [
'fillType' => Fill::FILL_SOLID,
'color' => ['argb' => 'FF001d68'],
],
'borders' => [
'bottom' => ['borderStyle' => Border::BORDER_THIN],
'right' => ['borderStyle' => Border::BORDER_MEDIUM],
],
'font' => [
'bold' => true,
'color' => ['argb' => 'FFFFFFFF'],
]
]
);
// Add some data
$spreadsheet->setActiveSheetIndex(0)
->setCellValue('A1', 'Dependencia')
->setCellValue('B1', 'Nivel')
->setCellValue('C1', 'Programa académico')
->setCellValue('D1', 'Ciclo')
->setCellValue('E1', 'Bloque')
->setCellValue('F1', 'Plan')
->setCellValue('G1', 'Grupo')
->setCellValue('H1', 'Asignatura')
->setCellValue('I1', 'Docente')
->setCellValue('J1', 'Día')
->setCellValue('K1', 'Bloque horario')
->setCellValue('L1', 'Espacio actual')
->setCellValue('M1', 'Espacio requerido')
->setCellValue('N1', 'Motivo del cambio');
$spreadsheet->getActiveSheet()->duplicateStyle($headerStyle, 'A1:N1');
$highestRow = count($profesores_rs)+1;
$defaultConfig = (new Mpdf\Config\ConfigVariables())->getDefaults();
$fontDirs = $defaultConfig['fontDir'];
$defaultFontConfig = (new Mpdf\Config\FontVariables())->getDefaults();
$fontData = $defaultFontConfig['fontdata'];
$defaultConfig = (new Mpdf\Config\ConfigVariables())->getDefaults();
$fontDirs = $defaultConfig['fontDir'];
$defaultFontConfig = (new Mpdf\Config\FontVariables())->getDefaults();
$fontData = $defaultFontConfig['fontdata'];
$mpdf = new \Mpdf\Mpdf([
'mode' => 'utf-8',
'format' => [215, 279],
'orientation' => 'P',
'fontDir' => array_merge($fontDirs, [
__DIR__ . '/../../fonts/indivisaFont/ttf',
]),
'fontdata' => $fontData + [
'indivisa-display' => [
'R' => 'IndivisaDisplaySans-Regular.ttf',
],
'indivisa-title' => [
'R' => 'IndivisaDisplaySerif-RegularItalic.ttf',
],
'indivisa-text' => [
'R' => 'IndivisaTextSans-Regular.ttf',
]
],
'default_font' => 'indivisa-text'
]);
$stylesheet = "";
$xtpl = new XTemplate('../tpl/reposicion.tpl.html');
$xtpl->assign("TITULO1", "FACULTAD");
$xtpl->assign("VALOR1", "FACULTAD DE INGENIERÍA");
$xtpl->assign("TITULO2", "CARRERA");
$xtpl->assign("VALOR2", mb_strtoupper($reposicion_rs["Carrera_desc"]));
$xtpl->parse("main.tabla.renglon.data4");
$xtpl->parse("main.tabla.renglon");
$xtpl->assign("TITULO", "PROFESOR");
$xtpl->assign("VALOR", mb_strtoupper($reposicion_rs["Usuario_nombre"]." ".$reposicion_rs["Usuario_apellidos"]));
$xtpl->parse("main.tabla.renglon.data2");
$xtpl->parse("main.tabla.renglon");
$salon = $horario_rs["Salon_desc"];
if($salon == ""){
$salon = "Pendiente";
}else{
if(!empty($horario_rs["Salon_desc_larga"]))
$salon = $horario_rs["Salon_desc_larga"];
}
$xtpl->assign("TITULO1", "SEMESTRE");
$xtpl->assign("VALOR1", $reposicion_rs["Materia_semestre"]);
$xtpl->assign("TITULO2", "SALON HABITUAL");
$xtpl->assign("VALOR2", $salon);
$xtpl->parse("main.tabla.renglon.data4");
$xtpl->parse("main.tabla.renglon");
$xtpl->assign("TITULO", "ASIGNATURA");
$xtpl->assign("VALOR", mb_strtoupper($reposicion_rs["Materia_desc"]));
$xtpl->parse("main.tabla.renglon.data2");
$xtpl->parse("main.tabla.renglon");
$xtpl->parse("main.tabla");
$xtpl->assign("TITULO1", "FECHA DE SOLICITUD");
$xtpl->assign("VALOR1", date("d/m/Y"));
$xtpl->assign("TITULO2", "NÚMERO DE ALUMNOS");
$xtpl->assign("VALOR2", $reposicion_rs["Reposicion_alumnos"]);
$xtpl->parse("main.tabla.renglon.data4");
$xtpl->parse("main.tabla.renglon");
$xtpl->assign("TITULO1", "FECHA DE INASISTENCIA");
$xtpl->assign("VALOR1", date("d/m/Y", strtotime($reposicion_rs["Reposicion_fecha_falta"])));
$xtpl->assign("TITULO2", "HORARIO DE CLASE");
$xtpl->assign("VALOR2", substr($horario_rs["Horario_hora"],0,-3)." a ".substr($horario_rs["Horario_hora_final"],0,-3)." hrs");
$xtpl->parse("main.tabla.renglon.data4");
$xtpl->parse("main.tabla.renglon");
$xtpl->assign("TITULO1", "FECHA DE REPOSICIÓN");
$xtpl->assign("VALOR1", date("d/m/Y", strtotime($reposicion_rs["Reposicion_fecha_nueva"])) );
$xtpl->assign("TITULO2", "HORARIO DE CLASE");
$xtpl->assign("VALOR2", date("H:i", strtotime($reposicion_rs["Reposicion_fecha_nueva"]))." A ".date("H:i", strtotime($reposicion_rs["Reposicion_fecha_nueva"].' +'.$horario_rs["Horario_duracion"].'minutes'))." hrs");
$xtpl->parse("main.tabla.renglon.data4");
$xtpl->parse("main.tabla.renglon");
$xtpl->parse("main.tabla");
$obs = "Ninguna";
if(!empty($reposicion_rs["Reposicion_comentario"])){
$obs = $reposicion_rs["Reposicion_comentario"];
}
$xtpl->assign("TITULO", "OBSERVACIONES");
$xtpl->assign("VALOR", $obs);
$xtpl->parse("main.tabla.renglon.data2");
$xtpl->parse("main.tabla.renglon");
$xtpl->parse("main.tabla");
$nombres = array("Rosa Lilia Salazar Trejo", "Ivonne Valdez Medina","María Fernanda Miranda Temahuay","David Cardoso de la Cruz","Fabricio Campos Villaseñor","Gilberto Adolfo Reyes Piñón","Juan Manuel Sánchez Durán");
foreach($nombres as $nom){
$xtpl->assign("NOMBRE", $nom);
$xtpl->parse("main.auxiliar");
}
$xtpl->parse("main");
/*echo $stylesheet;
$xtpl->out("main");exit();*/
$mpdf->useActiveForms = true;
$mpdf->WriteHTML($stylesheet);
$mpdf->WriteHTML($xtpl->text("main"));
$mpdf->Output("reposicion.pdf", 'I');