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();
//-----
$htmlToDoc = new HtmlToDoc();
$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);//TODO
$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");
$xtpl->parse("main");
/*echo $stylesheet;
$xtpl->out("main");exit();*/
$content = $stylesheet." ".$xtpl->text();
$htmlToDoc->createDoc( $content, "reposicion", true );