PlanCatedra.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. <?php
  2. class PlanCatedra{
  3. private $pdo, $mpdf;
  4. private $mat, $gpo, $gpo_nom, $sub, $usr, $usr_nombre;
  5. private $xtpl_text;
  6. private $mat_nombre, $errorDesc="";
  7. private $MESES = array(1=>"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
  8. private $DIAS = array("Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado");
  9. function __construct($pdo){
  10. $this->pdo = $pdo;
  11. }
  12. function generaCalendario($usr, $usr_nombre, $mat, $gpo, $gpo_nom, $sub, $debug=false ){
  13. $xtpl = new XTemplate('../tpl/plancatedra.tpl.html');
  14. $this->mat = $mat;
  15. $this->gpo = $gpo;
  16. $this->gpo_nom = $gpo_nom;
  17. $this->sub = $sub;
  18. $this->usr = $usr;
  19. $this->usr_nombre = $usr_nombre;
  20. //-------------------------
  21. //Obtiene materias de profesor
  22. if(empty($sub)){
  23. $stmt = $this->pdo->prepare('Select * from fs_materiadias(:usr, :mat, :gpo, NULL)');
  24. }else{
  25. $stmt = $this->pdo->prepare('Select * from fs_materiadias(:usr, :mat, :gpo, :sub)');
  26. $stmt->bindParam(":sub", $sub);
  27. //echo "Select * from fs_materiadias($usr, $mat, $gpo, $sub)"; exit();
  28. }
  29. $stmt->bindParam(":usr", $usr);
  30. $stmt->bindParam(":mat", $mat);
  31. $stmt->bindParam(":gpo", $gpo);
  32. if(!$stmt->execute()){
  33. //print_r($stmt->errorInfo());
  34. $this->errorDesc = "Ocurrió un error al cargar los días de las materias";
  35. }else{
  36. $rs = $stmt->fetchAll();
  37. $diasMatArr = array();
  38. foreach($rs as $dia){
  39. $diasMatArr[] = array( "dia"=> $dia["Dia_id"], "hora"=>substr($dia["Horario_hora"],0, 5));
  40. }
  41. }
  42. $stmt->closeCursor();
  43. $stmt = null;
  44. if($debug){
  45. print_r($diasMatArr);exit();
  46. }
  47. //Obtiene fechas de periodo
  48. $stmt = $this->pdo->prepare('Select * from fs_periodo(:periodo, NULL, NULL, true)');
  49. $stmt->bindParam(":periodo", $_SESSION["periodo_id"]);
  50. if(!$stmt->execute()){
  51. //print_r($stmt->errorInfo());
  52. $this->errorDesc = "Ocurrió un error al cargar los datos del periodo";
  53. }else{
  54. $periodo_rs = $stmt->fetch();
  55. }
  56. $stmt->closeCursor();
  57. $fecha_min = $periodo_rs["Periodo_fecha_inicial"];
  58. $fecha_max = $periodo_rs["Periodo_fecha_final"];
  59. // ---- Obtiene fechas de vacaciones
  60. $stmt = $this->pdo->prepare('select * from fs_calendarioevento_categoria(:fini, :ffin, 2, :periodo)');
  61. $stmt->bindParam(":fini", $fecha_min);
  62. $stmt->bindParam(":ffin", $fecha_max);
  63. $stmt->bindParam(":periodo", $_SESSION["periodo_id"]);
  64. if(!$stmt->execute()){
  65. $this->errorDesc = "Ocurrió un error al cargar las fechas de vacaciones";
  66. }else{
  67. $vacaciones_rs = $stmt->fetchAll();
  68. }
  69. $stmt->closeCursor();
  70. $stmt = null;
  71. $vacacionesArr = array();//Guarda los días individuales de vacaciones
  72. foreach($vacaciones_rs as $evento){
  73. $fecha = fechaGuion($evento["CalendarioEvento_fecha"]);
  74. switch($evento["CalendarioRepeticion_id"]){
  75. case 1: //diario
  76. while (strtotime($fecha) <= strtotime($evento["CalendarioReglas_fecha_final"])) {
  77. $vacacionesArr[] = array("fecha"=> $fecha, "titulo"=>$evento["CalendarioEvento_titulo"]);
  78. $fecha = date ("Y-m-d", strtotime("+1 day", strtotime($fecha)));
  79. }
  80. break;
  81. case 2: //semanal
  82. $diasArr = explode(",", $evento["CalendarioReglas_dias_str"]);
  83. while (strtotime($fecha) <= strtotime($evento["CalendarioReglas_fecha_final"])) {
  84. if(in_array(date("w", strtotime($fecha)), $diasArr) ){//si es el día que quiero
  85. $vacacionesArr[] = array("fecha"=> $fecha, "titulo"=>$evento["CalendarioEvento_titulo"]);
  86. }
  87. $fecha = date ("Y-m-d", strtotime("+1 day", strtotime($fecha)));
  88. }
  89. break;
  90. case 3://mensual
  91. $diasArr = explode(",", $evento["CalendarioReglas_dias_str"]);
  92. //reglas
  93. $weekTxt = array(1=>"first", 2=>"second", 3=>"third", 4=>"fourth", -1=>"last");
  94. $dayname = array("sun", "mon", "tue", "wed", "thu", "fri", "sat");
  95. $fecha = date ("Y-m-01", strtotime($fecha));//empieza a revisar en el primer día del mes
  96. $semana = $evento["CalendarioReglas_semana"];
  97. while (strtotime($fecha) <= strtotime($evento["CalendarioReglas_fecha_final"])) {
  98. foreach($diasArr as $d){
  99. //echo "-->". intval(date("w", strtotime($fecha)))." == ". intval($d)."[".$fecha."]";
  100. if($semana == 1 && intval(date("w", strtotime($fecha))) == intval($d) ){//si el día actual es el que quiero lo guarda
  101. $vacacionesArr[] = array("fecha"=> $fecha, "titulo"=>$evento["CalendarioEvento_titulo"]);
  102. }else{//si no calcula siguiente día
  103. if(intval(date("w", strtotime($fecha))) == intval($d)){
  104. $fechaTmp = date ("Y-m-d", strtotime($weekTxt[$semana-1]." ".$dayname[$d], strtotime($fecha)));
  105. }else{
  106. $fechaTmp = date ("Y-m-d", strtotime($weekTxt[$semana]." ".$dayname[$d], strtotime($fecha)));
  107. }
  108. $vacacionesArr[] = array("fecha"=> $fecha, "titulo"=>$evento["CalendarioEvento_titulo"]);
  109. }
  110. }
  111. $fecha = date ("Y-m-01", strtotime("+1 month", strtotime($fecha)));//siguiente mes primer día
  112. }
  113. break;
  114. default: //no se repite
  115. $vacacionesArr[] = array("fecha"=> $fecha, "titulo"=>$evento["CalendarioEvento_titulo"]);
  116. }
  117. }
  118. //----- Calcula fechas de clases
  119. $calendario = array();
  120. $fechasArr = array();
  121. $fecha = $fecha_min;
  122. $semOld=1;
  123. $cont = 0;
  124. while (strtotime($fecha) <= strtotime($fecha_max)) {
  125. if(date("w", strtotime($fecha)) == $diasMatArr[$cont%count($diasMatArr)]["dia"]) {//si es el día que quiero
  126. if($semOld != floor($cont/count($diasMatArr))+1){
  127. $sem = floor($cont/count($diasMatArr))+1;
  128. $semOld = $sem;
  129. $calendario[] = array("semana"=>$sem-1, "fechas"=>$fechasArr);
  130. $fechasArr = array();
  131. }
  132. $vacPos = $this->buscaVacacion($fecha, $vacacionesArr);
  133. if($vacPos === false){//no vacaciones
  134. $fechasArr[] = array("numSesion"=>$cont+1, "fecha"=>fechaSlash($fecha)." ".$diasMatArr[$cont%count($diasMatArr)]["hora"], "mes"=>date("n", strtotime($fecha)), "habil"=>true, "dia"=>$this->DIAS[date("w", strtotime($fecha))-1], "titulo"=>"");
  135. //Si el día de la fecha no es el día del siguiente evento O se reinicia el arreglo de días
  136. if(date("w", strtotime($fecha)) != $diasMatArr[$cont%count($diasMatArr)]["dia"] || ($cont+1)%count($diasMatArr)==0){
  137. $fecha = date ("Y-m-d", strtotime("+1 day", strtotime($fecha)));
  138. }
  139. }else{//vacaciones
  140. $fechasArr[] = array("numSesion"=> 0,"fecha"=>fechaSlash($fecha), "mes"=>date("n", strtotime($fecha)), "habil"=>false, "dia"=>$this->DIAS[date("w", strtotime($fecha))-1], "titulo"=>$vacacionesArr[$vacPos]["titulo"]);
  141. $aux = $cont/count($diasMatArr);//para que sean de la misma semana
  142. //mientras sea el mismodía de la misma semana
  143. if(date("w", strtotime($fecha)) != $diasMatArr[$cont%count($diasMatArr)]["dia"] || ($cont+1)%count($diasMatArr)==0){
  144. while(date("w", strtotime($fecha)) == $diasMatArr[$cont%count($diasMatArr)]["dia"] && ($cont+1)%count($diasMatArr)!=0){
  145. $cont++;
  146. }
  147. $fecha = date ("Y-m-d", strtotime("+1 day", strtotime($fecha)));
  148. }
  149. }
  150. $cont++;
  151. }else{
  152. $fecha = date ("Y-m-d", strtotime("+1 day", strtotime($fecha)));
  153. }
  154. }
  155. if($semOld != floor($cont/count($diasMatArr))){
  156. $sem = floor($cont/count($diasMatArr))+1;
  157. }else{
  158. $sem = floor($cont/count($diasMatArr));
  159. }
  160. $calendario[] = array("semana"=>$sem, "fechas"=>$fechasArr);
  161. $cont = 1;
  162. $i=0;
  163. $j=0;
  164. for($i=0; $i< count($calendario); $i++){
  165. for($j=0; $j< count($calendario[$i]["fechas"]); $j++){
  166. if($calendario[$i]["fechas"][$j]["habil"]){
  167. $calendario[$i]["fechas"][$j]["numSesion"] = $cont;
  168. $cont++;
  169. }
  170. }
  171. }
  172. //---Obtiebe contenido de sesiones plan cátedra
  173. if(isset($_POST["sub"]) && $_POST["sub"]!= ""){
  174. $sub = filter_input(INPUT_POST, "sub", FILTER_SANITIZE_NUMBER_INT);//limpia texto
  175. $stmt = $this->pdo->prepare('Select * from fs_sesioncatedra(:mat, :usr, :gpo, :sub, NULL)');
  176. $stmt->bindParam(":sub", $sub);
  177. }else{
  178. $stmt = $this->pdo->prepare('Select * from fs_sesioncatedra(:mat, :usr, :gpo, NULL, NULL)');
  179. }
  180. $stmt->bindParam(":usr", $usr);
  181. $stmt->bindParam(":mat", $mat);
  182. $stmt->bindParam(":gpo", $gpo);
  183. if(!$stmt->execute()){
  184. //print_r($stmt->errorInfo());
  185. $this->errorDesc = "Ocurrió un error al cargar las sesiones del plan de cátedra";
  186. }else{
  187. $rs = $stmt->fetchAll();
  188. $sesionesArr = array();
  189. $ses_old = -1;
  190. $i = -1;
  191. foreach($rs as $ses){
  192. if($ses_old != $ses["SesionCatedra_numero"]){
  193. $i++;
  194. $sesionesArr[$i]=array("sesion"=>$ses["SesionCatedra_numero"], "subsesiones"=>array());
  195. $ses_old = $ses["SesionCatedra_numero"];
  196. }
  197. $sesionesArr[$i]["subsesiones"][] = array("desc"=>$ses["SesionCatedra_desc"], "tipo_id"=>$ses["SesionCatedraTipo_id"], "tipo"=>$ses["SesionCatedraTipo_desc"], "color"=>$ses["SesionCatedraTipo_color"]);
  198. //$diasMatArr[] = array( "dia"=> $dia["Dia_id"], "hora"=>substr($dia["Horario_hora"],0, 5));
  199. }
  200. }
  201. /*if($debug ){
  202. print_r($sesionesArr); exit();
  203. }*/
  204. $stmt->closeCursor();
  205. $stmt = null;
  206. if(isset($sub)){
  207. $stmt = $this->pdo->prepare('SELECT hg."Horario_hora", s."Salon_desc", s."Salon_desc_larga", d."Dia_desc"
  208. from fs_horariogrupo(:gpo, NULL, false) AS hg INNER JOIN "Dia" d ON hg."Dia_id" = d."Dia_id"
  209. INNER JOIN "Submateria_HorarioGrupo_Profesor" shgp ON hg."HorarioGrupo_id" = shgp."HorarioGrupo_id" AND shgp."Submateria_id" = :sub
  210. INNER JOIN "Salon" s ON shgp."Salon_id" = s."Salon_id" WHERE "Materia_id" = :mat ORDER BY d."Dia_id", hg."Horario_hora"' );
  211. $stmt->bindParam(":sub", $sub);
  212. }else{
  213. $stmt = $this->pdo->prepare('SELECT hg."Horario_hora", hg."Salon_desc", hg."Salon_desc_larga", d."Dia_desc"
  214. 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"' );
  215. }
  216. $stmt->bindParam(":gpo", $gpo);
  217. $stmt->bindParam(":mat", $mat);
  218. if(!$stmt->execute()){
  219. //header("Location: ".$this->pag."?error=3");
  220. return false;
  221. // print_r($stmt->errorInfo());
  222. exit();
  223. }
  224. $horario_rs = $stmt->fetchAll();
  225. $stmt->closeCursor();
  226. //print_r($horario_rs); exit;
  227. //---Tipo de sesiones plan cátedra
  228. $stmt = $this->pdo->prepare('Select * from fs_sesioncatedra_tipo(NULL)');
  229. if(!$stmt->execute()){
  230. //print_r($stmt->errorInfo());
  231. $this->errorDesc = "Ocurrió un error al cargar los días de las materias";
  232. }else{
  233. $tipoSesionArr = $stmt->fetchAll();
  234. }
  235. $stmt->closeCursor();
  236. $stmt = null;
  237. //--Nombre de materia
  238. $mat_nombre = "";
  239. $mat_sem = "";
  240. if(!isset($sub)){
  241. $stmt = $this->pdo->prepare('Select "Materia_desc", "Materia_semestre" from fs_materia(:mat, NULL, NULL,NULL,NULL,0,NULL)');
  242. $stmt->bindParam(":mat", $mat);
  243. if(!$stmt->execute()){
  244. return false;
  245. //header("Location: ".$this->pag."?error=3");
  246. exit();
  247. }
  248. $mat_rs = $stmt->fetch();
  249. $stmt->closeCursor();
  250. $mat_nombre = $mat_rs["Materia_desc"];
  251. $mat_sem = $mat_rs["Materia_semestre"];
  252. unset($mat_rs);
  253. }else{
  254. $stmt = $this->pdo->prepare('Select "Submateria_desc", "Materia_semestre" from fs_submateria(:mat, :sub)');
  255. $stmt->bindParam(":mat", $mat);
  256. $stmt->bindParam(":sub", $sub);
  257. if(!$stmt->execute()){
  258. //header("Location: ".$this->pag."?error=3");
  259. return false;
  260. exit();
  261. }
  262. $mat_rs = $stmt->fetch();
  263. $stmt->closeCursor();
  264. $mat_nombre = $mat_rs["Submateria_desc"];
  265. $mat_sem = $mat_rs["Materia_semestre"];
  266. unset($mat_rs);
  267. }
  268. //-----
  269. $defaultConfig = (new Mpdf\Config\ConfigVariables())->getDefaults();
  270. $fontDirs = $defaultConfig['fontDir'];
  271. $defaultFontConfig = (new Mpdf\Config\FontVariables())->getDefaults();
  272. $fontData = $defaultFontConfig['fontdata'];
  273. $this->mpdf = new \Mpdf\Mpdf([
  274. 'mode' => 'utf-8',
  275. 'format' => [215, 279],
  276. 'orientation' => 'P',
  277. 'margin_left' => 14,
  278. 'margin_right' => 14,
  279. 'margin_top' => 27,
  280. 'margin_bottom' => 27,
  281. 'fontDir' => array_merge($fontDirs, [
  282. __DIR__ . '/../../fonts/indivisaFont/ttf',
  283. ]),
  284. 'fontdata' => $fontData + [
  285. 'indivisa-display' => [
  286. 'R' => 'IndivisaDisplaySans-Regular.ttf',
  287. ],
  288. 'indivisa-title' => [
  289. 'R' => 'IndivisaDisplaySerif-RegularItalic.ttf',
  290. ],
  291. 'indivisa-text' => [
  292. 'R' => 'IndivisaTextSans-Regular.ttf',
  293. ]
  294. ],
  295. 'default_font' => 'indivisa-text',
  296. ]);
  297. //$this->mpdf->SetDisplayMode('fullpage');
  298. $xtpl->assign("MATERIA", $mat_nombre." ".$gpo_nom);
  299. $xtpl->assign("SEMESTRE", $mat_sem);
  300. $xtpl->assign("PERIODO", $periodo_rs["Periodo_desc"]);
  301. $xtpl->assign("PROFESOR", $usr_nombre);
  302. foreach($horario_rs as $h){
  303. $hora = substr($h["Horario_hora"], 0, 5);
  304. if($h["Salon_desc"]==""){
  305. $salon = "Salón pendiente";
  306. }else{
  307. $salon = $h["Salon_desc"];
  308. if($h["Salon_desc_larga"] != ""){
  309. $salon .=" (".$h["Salon_desc_larga"].")";
  310. }
  311. }
  312. $xtpl->assign("DIA", $h["Dia_desc"]);
  313. $xtpl->assign("HORA", $hora);
  314. $xtpl->assign("SALON", $salon);
  315. $xtpl->parse("main.content.fechas");
  316. }
  317. foreach($tipoSesionArr as $tses){
  318. $xtpl->assign("COLOR", $tses["SesionCatedraTipo_color"]);
  319. $xtpl->assign("TIPO", $tses["SesionCatedraTipo_desc"]);
  320. $xtpl->parse("main.content.tipo");
  321. }
  322. //---
  323. $mes_old = 0;
  324. foreach($calendario as $semana){
  325. foreach($semana["fechas"] as $dia){
  326. if($mes_old != $dia["mes"]){
  327. $mes_old = $dia["mes"];
  328. $xtpl->assign("MES", mb_strtoupper($this->MESES[$mes_old]));
  329. $xtpl->parse("main.content.sesion.mes");
  330. $xtpl->parse("main.content.sesion");
  331. }
  332. $fechaArr = explode(" ",$dia["dia"]." ".fechaSlash($dia["fecha"]));
  333. if(count($fechaArr) == 2){
  334. $fechaArr[] = "00:00:00";
  335. }
  336. $xtpl->assign("FECHA_DIA", $fechaArr[0]);
  337. $xtpl->assign("FECHA", $fechaArr[1]);
  338. if($dia["habil"]){
  339. $xtpl->assign("HORA", $fechaArr[2]);
  340. $xtpl->assign("SEMANA", $semana["semana"]);
  341. $xtpl->assign("SESION", $dia["numSesion"]);
  342. $sesArr = $this->obtieneSesiones($sesionesArr, $dia["numSesion"]);
  343. if(count($sesArr) > 0){
  344. foreach($sesArr as $ses){
  345. if($ses["tipo_id"] == 1)
  346. $xtpl->assign("COLOR", $this->getRGBA_color($ses["color"], 0.0));
  347. else
  348. $xtpl->assign("COLOR", $this->getRGBA_color($ses["color"], 0.3));
  349. $xtpl->assign("DESC", $ses["desc"]);
  350. $xtpl->parse("main.content.sesion.regular.tema");
  351. }
  352. $xtpl->parse("main.content.sesion.regular");
  353. }else{
  354. $xtpl->assign("COLOR", $this->getRGBA_color("#ffffff", 0));
  355. $xtpl->assign("DESC", "");
  356. $xtpl->parse("main.content.sesion.regular");
  357. }
  358. }else{
  359. $xtpl->assign("HORA", "");
  360. $xtpl->assign("DESC", $dia["titulo"]);
  361. $xtpl->parse("main.content.sesion.vacacion");
  362. }
  363. $xtpl->parse("main.content.sesion");
  364. }
  365. }
  366. $xtpl->parse("main.content");
  367. $xtpl->parse("main");
  368. $this->xtpl_text = $xtpl->text("main");
  369. $this->mat_nombre = $mat_nombre;
  370. return true;
  371. }
  372. function getPlan(){
  373. return $this->xtpl_text;
  374. }
  375. /**
  376. * Genera el pdf del plan de cátedra
  377. * @param string $stylesheet Estilos css
  378. * @param string $stylesheet Si es true se guarda en: /var/www/html/apsa/files/plancatedra/
  379. */
  380. function pdfPlan($stylesheet, $save=false){
  381. $header = '<table style="width:100%"><tr>
  382. <td><img src="../../img/logopdf.png" width="40mm" class=""></td>
  383. <td align="right"><h1 class="titulo">PLAN DE CÁTEDRA | FACULTAD DE INGENIERÍA</h1></td>
  384. </tr></table>';
  385. $this->mpdf->SHYlang = 'es';
  386. $this->mpdf-> SetTitle('Plan de cátedra -' . $this->mat_nombre);
  387. $this->mpdf-> SetAuthor('Facultad de Ingeniería. © Universidad La Salle A.C. '.date("Y").' Todos los derechos Reservados.');
  388. $this->mpdf->SetHTMLHeader($header);//se pone como fondo
  389. $this->mpdf->SetHTMLFooter('<img src="../../img/footer_docs.png" >');//se pone como fondo
  390. $this->mpdf->WriteHTML($stylesheet);
  391. if($this->errorDesc == "")
  392. $this->mpdf->WriteHTML($this->xtpl_text);
  393. else
  394. $this->mpdf->WriteHTML($this->errorDesc);
  395. if(!$save)
  396. $this->mpdf->Output("planCátedra_".getIniciales($this->mat_nombre)."_".$this->gpo_nom.".pdf", 'I');
  397. else{
  398. $target_dir = "/var/www/html/apsa/files/plancatedra/".$_SESSION["periodo_id"];
  399. if (file_exists($target_dir)===false) {
  400. mkdir($target_dir, 0755, true);
  401. }
  402. $this->mpdf->Output($target_dir."/planCatedra_".getIniciales($this->mat_nombre)."_".$this->gpo_nom."_".date("Ymd_His").".pdf", 'F');
  403. }
  404. }
  405. private function getRGBA_color($hex, $a=0){
  406. list($r, $g, $b) = sscanf($hex, "#%02x%02x%02x");
  407. $style = "rgba($r,$g, $b,";
  408. $style .= "$a)";
  409. return $style;
  410. }
  411. private function buscaVacacion($fecha, $vacacionesArr){
  412. $i=0;
  413. foreach($vacacionesArr as $vacacion){
  414. if ($vacacion["fecha"] == $fecha){
  415. return $i;
  416. }
  417. $i++;
  418. }
  419. return false;
  420. }
  421. private function obtieneSesiones($arr, $num){
  422. foreach($arr as $ses){
  423. if($ses["sesion"] == $num ){
  424. return $ses["subsesiones"];
  425. }
  426. }
  427. return array();
  428. }
  429. }
  430. ?>