123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574 |
- <?php
- ini_set('display_errors', 1);
- error_reporting(E_ALL);
- require_once './ims-blti/blti.php';
- setlocale(LC_TIME, 'es_MX.UTF-8');
- require_once("../include/nocache.php");
- require_once("../include/bd_pdo.php");
- require_once("../include/util.php");
- include_once('../include/xTemplate/xtemplate.class.php'); // including mpdf.php
- include_once('../include/mpdf/autoload.php'); // including mpdf.php
- $lti = new BLTI("Pl4n&Syll4bus", false, false);// Secreto compartido
- function getRGBA_color($hex, $a=0){
- list($r, $g, $b) = sscanf($hex, "#%02x%02x%02x");
- $style = "rgba($r,$g, $b,";
- $style .= "$a)";
- return $style;
- }
- function buscaVacacion($fecha, $vacacionesArr){
- $i=0;
- foreach($vacacionesArr as $vacacion){
- if ($vacacion["fecha"] == $fecha){
- return $i;
- }
- $i++;
- }
- return false;
- }
- function getSesiones($arr, $num){
- foreach($arr as $ses){
- if($ses["sesion"] == $num ){
- return $ses["subsesiones"];
- }
- }
- return array();
- }
- //-------
- $electiva = false;
- if (!$lti->valid) {//si está fuera de moodle consulta por variables get (para pruebas)
- $errorDesc = $lti->message;
- $errorDesc .="- No se pueden obtener los datos del curso para generar el pdf.";
- echo $errorDesc;
- exit();
- }// LTI de conexión a moodle
- $clave_ulsa = intval(substr($lti->info["ext_user_username"], 2));//clave como entero
- if(substr_count($lti->info["context_label"], "-")<3){
- echo "<h1>Error</h1><p>No se puede hacer la consulta porque el shortaname no es válido.</p>";
- exit();
- }
- $tmp = explode("-", $lti->info["context_label"]);//Shortname
- $gpo_nom = $tmp[0];
- if($gpo_nom == "ELECTIVA"){
- $electiva = true;
- }
- $iniciales = $tmp[1];
- $mat = $tmp[3];
- $periodo_id = $lti->info["custom_periodo"]; //Obtenerlo de parametros
- $submateria = false;
- if($gpo_nom != "ELECTIVA"){ //No es electiva
- //Obtiene id gpo a partir de nombre
- $stmt = $pdo->prepare('SELECT * FROM fs_grupo(NULL, :per, :nombre)');
- $stmt->bindParam(":per", $periodo_id);
- $stmt->bindParam(":nombre", $gpo_nom);
- if(!$stmt->execute()){
- echo "Error al consultar la clave de usuario";
- exit();
- }else{
- $gpo_rs = $stmt->fetch();
- if(empty($gpo_rs)){
- echo "No existe el grupo";
- exit();
- }
- $gpo = $gpo_rs["Grupo_id"];
- }
- $stmt->closeCursor();
- //----------
-
- $stmt = $pdo->prepare('Select * from fs_profesoresmateriagrupo(:per, :mat, :gpo, NULL, NULL, NULL)');
- $stmt->bindParam(":mat", $mat);
- $stmt->bindParam(":per", $periodo_id);
- $stmt->bindParam(":gpo", $gpo);
-
- if(!$stmt->execute()){
- $t = $stmt->errorInfo();
- echo "Ocurrió un error al obtener los datos de los profesores ".$t[2];
- exit();
- }
-
- $profesor_rs = $stmt->fetchAll();
- $stmt->closeCursor();
- $usr = $profesor_rs[0]["Usuario_id"];
- $usr_nombre = $profesor_rs[0]["Usuario_nombre"]." ".$profesor_rs[0]["Usuario_apellidos"];
- //----------
- //echo "Select * from fs_syllabus_datos($periodo_id, $usr, $mat, $gpo, NULL ) limit 1"; exit();
-
- $stmt = $pdo->prepare('Select * from fs_syllabus(:periodo, :prof, :mat, :gpo, NULL ) limit 1');
- $stmt->bindParam(":periodo", $periodo_id);
- $stmt->bindParam(":mat", $mat);
- $stmt->bindParam(":gpo", $gpo);
- $syllabus_rs = [];
- foreach ($profesor_rs as $pr){
- $usr = $pr["Usuario_id"];
- $usr_nombre = $pr["Usuario_nombre"]." ".$pr["Usuario_apellidos"];
- $stmt->bindParam(":prof", $usr);
- if(!$stmt->execute()){
- $errorDesc = "Error al cargar los datos del alumno";
- echo $errorDesc;
- print_r($stmt->errorInfo());
- exit();
- }
- //$syllabus_rs = $stmt->fetch();
- $s_rs = $stmt->fetch();
- if(!empty($s_rs)){
- //break;
- $syllabus_rs[] = $s_rs;
- }
- }
- $stmt->closeCursor();
-
- }else{//Es electiva
- $usr = $tmp[4];//Último campo del shortname es is del usuario de electiva
- $stmt = $pdo->prepare('Select * from fs_usuario(:id)');
- $stmt->bindParam(":id", $usr);
- if(!$stmt->execute()){
- $t = $stmt->errorInfo();
- echo "Ocurrió un error al obtener los datos de los profesores ".$t[2];
- exit();
- }
- $profesor_rs = $stmt->fetch();
- $stmt->closeCursor();
- $usr_nombre = $profesor_rs["Usuario_nombre"]." ".$profesor_rs["Usuario_apellidos"];
- //----------
- //echo "Select * from fs_syllabus_datos($periodo_id, $usr, NULL, NULL, $mat ) limit 1"; exit();
- $stmt = $pdo->prepare('Select * from fs_syllabus_datos(:periodo, :prof, NULL, NULL, :sub ) limit 1');
- $stmt->bindParam(":periodo", $periodo_id);
- $stmt->bindParam(":prof", $usr);
- $stmt->bindParam(":sub", $mat);
-
- if(!$stmt->execute()){
- $errorDesc = "Error al cargar los datos del alumno";
- echo $errorDesc;
- print_r($stmt->errorInfo());
- exit();
- }
- $syllabus_rs = [];
- $s_rs = $stmt->fetch();
- $syllabus_rs[] = $s_rs;
- $gpo = $s_rs["Grupo_id"];
- $stmt->closeCursor();
- $submateria = true;
- }
-
-
- // -------------
- $stmt = $pdo->prepare('Select * from fs_periodo(:periodo, NULL, NULL, NULL )');
- $stmt->bindParam(":periodo", $periodo_id);
- if(!$stmt->execute()){
- $errorDesc = "Error al cargar los datos del alumno";
- echo $errorDesc;
- print_r($stmt->errorInfo());
- exit();
- }
- $periodo_rs = $stmt->fetch();
- $stmt->closeCursor();
- $fecha_min = $periodo_rs["Periodo_fecha_inicial"];
- $fecha_max = $periodo_rs["Periodo_fecha_final"];
- //Obtiene materias de profesor
- if(!$submateria){
-
- $stmt = $pdo->prepare('Select * from fs_materiadias(:usr, :mat, :gpo, NULL)');
- $stmt->bindParam(":mat", $mat);
- }else{
- //echo "Select * from fs_materiadias($usr, NULL, $gpo, $mat)";
- $stmt = $pdo->prepare('Select * from fs_materiadias(:usr, NULL, :gpo, :sub)');
- $stmt->bindParam(":sub", $mat);
- }
- //echo "Select * from fs_materiadias($usr, $mat, $gpo, $sub)"; exit();
- $stmt->bindParam(":usr", $usr);
- $stmt->bindParam(":gpo", $gpo);
- if(!$stmt->execute()){
- //print_r($stmt->errorInfo());
- $errorDesc = "Ocurrió un error al cargar los días de las materias";
- echo $errorDesc;
- exit();
- }else{
- $rs = $stmt->fetchAll();
- $diasMatArr = array();
- foreach($rs as $dia){
- $diasMatArr[] = array( "dia"=> $dia["Dia_id"], "hora"=>substr($dia["Horario_hora"],0, 5));
- }
- }
- $stmt->closeCursor();
- $stmt = null;
- //-----
- // ---- Obtiene fechas de vacaciones
- $stmt = $pdo->prepare('select * from fs_calendarioevento_categoria(:fini, :ffin, 2, :periodo)');
- $stmt->bindParam(":fini", $fecha_min);
- $stmt->bindParam(":ffin", $fecha_max);
- $stmt->bindParam(":periodo", $periodo_id);
- if(!$stmt->execute()){
- $errorDesc = "Ocurrió un error al cargar las fechas de vacaciones";
- }else{
- $vacaciones_rs = $stmt->fetchAll();
- }
- $stmt->closeCursor();
- $stmt = null;
- $vacacionesArr = array();//Guarda los días individuales de vacaciones
- foreach($vacaciones_rs as $evento){
- $fecha = fechaGuion($evento["CalendarioEvento_fecha"]);
- switch($evento["CalendarioRepeticion_id"]){
- case 1: //diario
- while (strtotime($fecha) <= strtotime($evento["CalendarioReglas_fecha_final"])) {
- $vacacionesArr[] = array("fecha"=> $fecha, "titulo"=>$evento["CalendarioEvento_titulo"]);
- $fecha = date ("Y-m-d", strtotime("+1 day", strtotime($fecha)));
- }
- break;
- case 2: //semanal
- $diasArr = explode(",", $evento["CalendarioReglas_dias_str"]);
- while (strtotime($fecha) <= strtotime($evento["CalendarioReglas_fecha_final"])) {
- if(in_array(date("w", strtotime($fecha)), $diasArr) ){//si es el día que quiero
- $vacacionesArr[] = array("fecha"=> $fecha, "titulo"=>$evento["CalendarioEvento_titulo"]);
- }
- $fecha = date ("Y-m-d", strtotime("+1 day", strtotime($fecha)));
- }
- break;
- case 3://mensual
- $diasArr = explode(",", $evento["CalendarioReglas_dias_str"]);
- //reglas
- $weekTxt = array(1=>"first", 2=>"second", 3=>"third", 4=>"fourth", -1=>"last");
- $dayname = array("sun", "mon", "tue", "wed", "thu", "fri", "sat");
- $fecha = date ("Y-m-01", strtotime($fecha));//empieza a revisar en el primer día del mes
- $semana = $evento["CalendarioReglas_semana"];
- while (strtotime($fecha) <= strtotime($evento["CalendarioReglas_fecha_final"])) {
- foreach($diasArr as $d){
- //echo "-->". intval(date("w", strtotime($fecha)))." == ". intval($d)."[".$fecha."]";
- if($semana == 1 && intval(date("w", strtotime($fecha))) == intval($d) ){//si el día actual es el que quiero lo guarda
- $vacacionesArr[] = array("fecha"=> $fecha, "titulo"=>$evento["CalendarioEvento_titulo"]);
- }else{//si no calcula siguiente día
- if(intval(date("w", strtotime($fecha))) == intval($d)){
- $fechaTmp = date ("Y-m-d", strtotime($weekTxt[$semana-1]." ".$dayname[$d], strtotime($fecha)));
- }else{
- $fechaTmp = date ("Y-m-d", strtotime($weekTxt[$semana]." ".$dayname[$d], strtotime($fecha)));
- }
- $vacacionesArr[] = array("fecha"=> $fecha, "titulo"=>$evento["CalendarioEvento_titulo"]);
- }
- }
- $fecha = date ("Y-m-01", strtotime("+1 month", strtotime($fecha)));//siguiente mes primer día
- }
- break;
- default: //no se repite
- $vacacionesArr[] = array("fecha"=> $fecha, "titulo"=>$evento["CalendarioEvento_titulo"]);
- }
- }
- //----- Calcula fechas de clases
- $MESES = array(1=>"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
- $DIAS = array("Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado");
-
- $calendario = array();
- $fechasArr = array();
- $fecha = $fecha_min;
- $semOld=1;
- $cont = 0;
- if(count($diasMatArr)==0){
- echo "<h3>No hay días registrados</h3>";
- exit();
- }
-
- while (strtotime($fecha) <= strtotime($fecha_max)) {
- if(date("w", strtotime($fecha)) == $diasMatArr[$cont%count($diasMatArr)]["dia"]) {//si es el día que quiero
-
- if($semOld != floor($cont/count($diasMatArr))+1){
- $sem = floor($cont/count($diasMatArr))+1;
- $semOld = $sem;
- $calendario[] = array("semana"=>$sem-1, "fechas"=>$fechasArr);
- $fechasArr = array();
- }
- $vacPos = buscaVacacion($fecha, $vacacionesArr);
-
- if($vacPos === false){//no vacaciones
- $fechasArr[] = array("numSesion"=>$cont+1, "fecha"=>fechaSlash($fecha)." ".$diasMatArr[$cont%count($diasMatArr)]["hora"], "mes"=>date("n", strtotime($fecha)), "habil"=>true, "dia"=>$DIAS[date("w", strtotime($fecha))-1], "titulo"=>"");
-
- //Si el día de la fecha no es el día del siguiente evento O se reinicia el arreglo de días
- if(date("w", strtotime($fecha)) != $diasMatArr[$cont%count($diasMatArr)]["dia"] || ($cont+1)%count($diasMatArr)==0){
- $fecha = date ("Y-m-d", strtotime("+1 day", strtotime($fecha)));
- }
- }else{//vacaciones
- $fechasArr[] = array("numSesion"=> 0,"fecha"=>fechaSlash($fecha), "mes"=>date("n", strtotime($fecha)), "habil"=>false, "dia"=>$DIAS[date("w", strtotime($fecha))-1], "titulo"=>$vacacionesArr[$vacPos]["titulo"]);
- $aux = $cont/count($diasMatArr);//para que sean de la misma semana
- //mientras sea el mismodía de la misma semana
- if(date("w", strtotime($fecha)) != $diasMatArr[$cont%count($diasMatArr)]["dia"] || ($cont+1)%count($diasMatArr)==0){
- while(date("w", strtotime($fecha)) == $diasMatArr[$cont%count($diasMatArr)]["dia"] && ($cont+1)%count($diasMatArr)!=0){
- $cont++;
- }
- $fecha = date ("Y-m-d", strtotime("+1 day", strtotime($fecha)));
- }
- }
- $cont++;
-
- }else{
- $fecha = date ("Y-m-d", strtotime("+1 day", strtotime($fecha)));
- }
- }
- if($semOld != floor($cont/count($diasMatArr))){
- $sem = floor($cont/count($diasMatArr))+1;
- }else{
- $sem = floor($cont/count($diasMatArr));
- }
- $calendario[] = array("semana"=>$sem, "fechas"=>$fechasArr);
- //$mesMin = $calendario[0]["fechas"][0]["mes"];
- //$mesMax = $calendario[count($calendario)-1]["fechas"][0]["mes"];
- $cont = 1;
- $i=0;
- $j=0;
- for($i=0; $i< count($calendario); $i++){
- for($j=0; $j< count($calendario[$i]["fechas"]); $j++){
- if($calendario[$i]["fechas"][$j]["habil"]){
- $calendario[$i]["fechas"][$j]["numSesion"] = $cont;
- $cont++;
- }
- }
-
- }
- //---Obtiebe contenido de sesiones plan cátedra
- if($electiva){
- $stmt = $pdo->prepare('Select * from fs_sesioncatedra(:mat, :usr, :gpo, :sub, NULL)');
- $stmt->bindParam(":sub", $mat);
- }else{
- $stmt = $pdo->prepare('Select * from fs_sesioncatedra(:mat, :usr, :gpo, NULL, NULL)');
- }
- $stmt->bindParam(":mat", $mat);
- $stmt->bindParam(":usr", $usr);
- $stmt->bindParam(":gpo", $gpo);
- if(!$stmt->execute()){
- //print_r($stmt->errorInfo());
- $errorDesc = "Ocurrió un error al cargar las sesiones del plan de cátedra";
- }else{
- $rs = $stmt->fetchAll();
-
- $sesionesArr = array();
- $ses_old = -1;
- //$subsesionArr = array();
- $i = -1;
- foreach($rs as $ses){
-
- if($ses_old != $ses["SesionCatedra_numero"]){
- $i++;
- $sesionesArr[$i]=array("sesion"=>$ses["SesionCatedra_numero"], "subsesiones"=>array());
- $ses_old = $ses["SesionCatedra_numero"];
- }
- $sesionesArr[$i]["subsesiones"][] = array("desc"=>$ses["SesionCatedra_desc"], "tipo_id"=>$ses["SesionCatedraTipo_id"], "tipo"=>$ses["SesionCatedraTipo_desc"], "color"=>$ses["SesionCatedraTipo_color"]);
- //$diasMatArr[] = array( "dia"=> $dia["Dia_id"], "hora"=>substr($dia["Horario_hora"],0, 5));
- }
- }
- //print_r($sesionesArr); exit();
- $stmt->closeCursor();
- $stmt = null;
- if($electiva){
- //echo "SELECT * FROM fs_submateria_materia($gpo, $usr, $mat)";exit();
- $stmt = $pdo->prepare('SELECT * FROM fs_submateria_materia(:gpo, :usr, :sub)');
- $stmt->bindParam(":gpo", $gpo);
- $stmt->bindParam(":usr", $usr);
- $stmt->bindParam(":sub", $mat);
- if(!$stmt->execute()){
- $errorDesc = "Error al cargar los datos de la materia";
- echo $errorDesc;
- print_r($stmt->errorInfo());
- exit();
- }
- $submat_rs = $stmt->fetch();
- //$stmt = $pdo->prepare('Select * from fs_horariogrupo(:gpo, NULL, false) AS hg INNER JOIN "Dia" d ON hg."Dia_id" = d."Dia_id" WHERE "Materia_id" = :mat ORDER BY d."Dia_id", hg."Horario_hora"');
- $stmt = $pdo->prepare('Select "Hora_inicio" AS "Horario_hora", "Dia_desc", "Salon_desc", "Salon_desc_larga" from fs_mihorario(:usr, :per, 3) as hg INNER JOIN "Dia" d ON hg."Dia_id" = d."Dia_id" where "TipoHorario_id" = 3 and hg."Materia_id" = :mat ORDER BY d."Dia_id", "Hora_inicio"');
- $stmt->bindParam(":usr", $usr);
- $stmt->bindParam(":per", $periodo_id);
- $stmt->bindParam(":mat", $submat_rs["Materia_id"]);
- }else{
- $stmt = $pdo->prepare('Select * from fs_horariogrupo(:gpo, NULL, false) AS hg INNER JOIN "Dia" d ON hg."Dia_id" = d."Dia_id" WHERE "Materia_id" = :mat ORDER BY d."Dia_id", hg."Horario_hora"');
- $stmt->bindParam(":mat", $mat);
- $stmt->bindParam(":gpo", $gpo);
- }
- if(!$stmt->execute()){
- $errorDesc = "Error al cargar los datos del horario";
- echo $errorDesc;
- print_r($stmt->errorInfo());
- exit();
- }
- $horario_rs = $stmt->fetchAll();
- $stmt->closeCursor();
- //---Tipo de sesiones plan cátedra
- $stmt = $pdo->prepare('Select * from fs_sesioncatedra_tipo(NULL)');
- if(!$stmt->execute()){
- //print_r($stmt->errorInfo());
- $errorDesc = "Ocurrió un error al cargar los días de las materias";
- }else{
- $tipoSesionArr = $stmt->fetchAll();
- }
- $stmt->closeCursor();
- $stmt = null;
- //-----
- $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',
- 'margin_left' => 14,
- 'margin_right' => 14,
- 'margin_top' => 27,
- 'margin_bottom' => 27,
- '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',
- ]);
- //$mpdf->SetDisplayMode('fullpage');
- $stylesheet = "<style>";
- $stylesheet .= file_get_contents('../css/indivisa.css'); // external css
- $stylesheet .= file_get_contents('../apsa/css/syllabus.css'); // external css
- $stylesheet .= "</style>";
- $xtpl = new XTemplate('../apsa/tpl/plancatedra.tpl.html');
- foreach($syllabus_rs as $data){
- $mat_nombre = isset($data["Submateria_desc"])?$data["Submateria_desc"]:$data["Materia_desc"];
- $xtpl->assign("MATERIA", $mat_nombre." ".$gpo_nom);
- $xtpl->assign("SEMESTRE", $data["Materia_semestre"]);
- $xtpl->assign("PERIODO", $periodo_rs["Periodo_desc"]);
- $xtpl->assign("PROFESOR", $usr_nombre);
- foreach($horario_rs as $h){
- $hora = substr($h["Horario_hora"], 0, 5);
- if($h["Salon_desc"]==""){
- $salon = "Salón pendiente";
- }else{
- $salon = $h["Salon_desc"];
- if($h["Salon_desc_larga"] != ""){
- $salon .=" (".$h["Salon_desc_larga"].")";
- }
- }
- $xtpl->assign("DIA", $h["Dia_desc"]);
- $xtpl->assign("HORA", $hora);
- $xtpl->assign("SALON", $salon);
- $xtpl->parse("main.content.fechas");
- }
- foreach($tipoSesionArr as $tses){
- $xtpl->assign("COLOR", $tses["SesionCatedraTipo_color"]);
- $xtpl->assign("TIPO", $tses["SesionCatedraTipo_desc"]);
- $xtpl->parse("main.content.tipo");
- }
-
- //---
- $mes_old = 0;
- $i=0;
- foreach($calendario as $semana){
-
- foreach($semana["fechas"] as $dia){
- if($mes_old != $dia["mes"]){
- $mes_old = $dia["mes"];
- $xtpl->assign("MES", mb_strtoupper($MESES[$mes_old]));
- $xtpl->parse("main.content.sesion.mes");
- $xtpl->parse("main.content.sesion");
- }
- $fechaArr = explode(" ",$dia["dia"]." ".fechaSlash($dia["fecha"]));
- if(count($fechaArr) == 2){
- $fechaArr[] = "00:00:00";
- }
- $xtpl->assign("FECHA_DIA", $fechaArr[0]);
- $xtpl->assign("FECHA", $fechaArr[1]);
- if($dia["habil"]){
- $xtpl->assign("HORA", $fechaArr[2]);
- $xtpl->assign("SEMANA", $semana["semana"]);
- $xtpl->assign("SESION", $dia["numSesion"]);
- $sesArr = getSesiones($sesionesArr, $dia["numSesion"]);
- if(count($sesArr) > 0){
-
- foreach($sesArr as $ses){
- if($ses["tipo_id"] == 1)
- $xtpl->assign("COLOR", getRGBA_color($ses["color"], 0.0));
- else
- $xtpl->assign("COLOR", getRGBA_color($ses["color"], 0.3));
- $xtpl->assign("DESC", $ses["desc"]);
- $xtpl->parse("main.content.sesion.regular.tema");
- }
- $xtpl->parse("main.content.sesion.regular");
- }else{
- $xtpl->assign("COLOR", getRGBA_color("#ffffff", 0));
- $xtpl->assign("DESC", "");
- $xtpl->parse("main.content.sesion.regular");
- }
- }else{
- $xtpl->assign("HORA", "");
- $xtpl->assign("DESC", $dia["titulo"]);
- $xtpl->parse("main.content.sesion.vacacion");
- }
- $xtpl->parse("main.content.sesion");
- }
- }
- /*$i++;
- if($i < count($syllabus_rs)){
- $xtpl->parse("main.content.pagebreak");
- }*/
- $xtpl->parse("main.content");
- }
- $xtpl->parse("main");
- //echo $stylesheet;
- //$xtpl->out("main"); exit;
- $header = '<table style="width:100%"><tr>
- <td><img src="../img/logopdf.png" width="40mm" class=""></td>
- <td align="right"><h1 class="titulo">PLAN DE CÁTEDRA | FACULTAD DE INGENIERÍA</h1></td>
- </tr></table>';
- $mpdf->SHYlang = 'es';
- $mpdf-> SetTitle('Plan de cátedra -' . $mat_nombre);
- $mpdf-> SetAuthor('Facultad de Ingeniería. © Universidad La Salle A.C. '.date("Y").' Todos los derechos Reservados.');
- $mpdf->SetHTMLHeader($header);//se pone como fondo
- $mpdf->SetHTMLFooter('<img src="../img/footer_docs.png" >');//se pone como fondo
- $mpdf->WriteHTML($stylesheet);
- if(!isset($errorDesc))
- $mpdf->WriteHTML($xtpl->text("main"));
- else
- $mpdf->WriteHTML($errorDesc);
- $mpdf->Output("planCátedra_".getIniciales($mat_nombre)."_".$gpo_nom.".pdf", 'I');
- ?>
|