Expand|Select|Wrap|Line Numbers
- <?php
- include_once("classes/ets.php");
- include_once("classes/em_documents.php");
- include_once("classes/em_sections.php");
- include_once("classes/em_attachment.php");
- include_once("classes/site_tools.php");
- $mainblocks = array();
- $obj_em_sections = new em_sections();
- $obj_em_sections->set_debug(true);
- if ($_GET["cid"]!="") {
- $arr_course_group = $obj_em_sections->fetch('id='.$_GET["cid"]);
- } else {
- $arr_course_group = $obj_em_sections->fetch_byparent(3,"ordernum");
- }
- foreach ($arr_course_group as $group) {
- $arr_tree = $obj_em_sections->fetch_tree($group->id);
- if (count($arr_tree)>0) {
- $tmpgrp->title = $group->descript;
- $tmpgrp->id = $group->id;
- $folder_tree = array();
- $arr_tree2 = $arr_tree;
- $arr_withchildren = array();
- foreach ($arr_tree as $tree) {
- $tmpitem->level = $tree[1];
- $tmpitem->id = $tree[0]->id;
- for ($i=0;$i<$tree[1];$i++) {
- $prefix .= " ";
- }
- //determine if this is id has children
- foreach ($arr_tree2 as $tree2) {
- if ($tree2[0]->parent_id==$tmpitem->id) {
- array_push($arr_withchildren,$tmpitem->id);
- }
- }
- $arr_withchildren = array_unique($arr_withchildren);
- if (in_array($tmpitem->id,$arr_withchildren)) {
- //no link required
- $tmpitem->title = $tree[0]->descript;
- $tmpitem->fullpage->title = "";
- $tmpitem->fullpage->url = "";
- } else {
- $tmpitem->title = "";
- $tmpitem->fullpage->title = $tree[0]->descript;
- $tmpitem->fullpage->url = "?cid=".$tree[0]->id;
- }
- $tmpitem->tabs = $prefix;
- array_push($folder_tree,$tmpitem);
- $prefix="";
- }
- $tmpgrp->folders = $folder_tree;
- array_push($mainblocks,$tmpgrp);
- $tmpgrp="";
- } else {
- if ($_GET["cid"]!="") {
- $arr_subsects = array($_GET['cid']);
- $courses = array();
- $obj_em_sections = new em_sections();
- $return_array = $obj_em_sections->fetch("id=".$_GET['cid']);
- if (count($return_array)>0) {
- foreach ($return_array as $section) {
- $tmpgrp->title = $section->descript;
- $tmpgrp->id = $section->id;
- }
- }
- $obj_em_documents = new em_documents();
- $obj_em_documents->set_debug(false);
- $arr_courses = "";
- $orderby = "title";
- $arr_courses = $obj_em_documents->fetch_bysectiontree("intrash=0 AND isonline='TRUE'",$arr_subsects,$orderby);
- if (count($arr_courses)>0) {
- foreach ($arr_courses as $course) {
- if (site_tools::is_published($course->publish_on) && !site_tools::is_expired($course->remove_on)) {
- if ($course->redirecturl!="") {
- //display the alternate URL
- $arr_urlbits = explode(",",$course->redirecturl);
- if (count($arr_urlbits)>0) {
- list($width,$height) = explode("x",$arr_urlbits[1]);
- $tmpcourse->alturlpopup->title = $course->title;
- $tmpcourse->alturlpopup->w = $width;
- $tmpcourse->alturlpopup->h = $height;
- $tmpcourse->alturlpopup->url = $arr_urlbits[0];
- } else {
- // no parameters given, open full window
- $tmpcourse->fullpage->title = $course->title;
- $tmpcourse->fullpage->url = $arr_urlbits[0];
- $tmpcourse->fullpage->target = "_blank";
- }
- } else {
- //display the default URL
- $tmpcourse->defaultpopup->title = $course->title;
- $tmpcourse->defaultpopup->id = $course->id;
- }
- array_push($courses,$tmpcourse);
- $tmpcourse="";
- }
- }
- } else {
- $courses[0]->descript = "No courses available at this time.";
- }
- $tmpgrp->folders = $courses;
- array_push($mainblocks, $tmpgrp);
- $tmpgrp="";
- }
- }
- }
- $page->mainblocks = $mainblocks;
- printt($page,'templates/php_ourbiz.tpl');
- ?>
The result of array mainblock is
Expand|Select|Wrap|Line Numbers
- Array ( [0] => stdClass Object ( [title] => Skills Development [id] => 17 [folders] => Array ( [0] => stdClass Object ( [level] => 1 [id] => 32 [title] => [fullpage] => stdClass Object ( [title] => Information Technology (IT) Literacy Skills [url] => ?cid=32 ) [tabs] => ) [1] => stdClass Object ( [level] => 1 [id] => 33 [title] => Language & Communication Skills [fullpage] => stdClass Object ( [title] => [url] => ) [tabs] => ) [2] => stdClass Object ( [level] => 2 [id] => 40 [title] => [fullpage] => stdClass Object ( [title] => Communication Skills [url] => ?cid=40 ) [tabs] => ) [3] => stdClass Object ( [level] => 2 [id] => 42 [title] => [fullpage] => stdClass Object ( [title] => Language Skills [url] => ?cid=42 ) [tabs] => ) [4] => stdClass Object ( [level] => 2 [id] => 41 [title] => [fullpage] => stdClass Object ( [title] => Presentation Skills [url] => ?cid=41 ) [tabs] => ) [5] => stdClass Object ( [level] => 1 [id] => 20 [title] => Skills in Hospitality [fullpage] => stdClass Object ( [title] => [url] => ) [tabs] => ) [6] => stdClass Object ( [level] => 2 [id] => 49 [title] => [fullpage] => stdClass Object ( [title] => Culinary Skills [url] => ?cid=49 ) [tabs] => ) [7] => stdClass Object ( [level] => 2 [id] => 34 [title] => [fullpage] => stdClass Object ( [title] => Customer Service [url] => ?cid=34 ) [tabs] => ) [8] => stdClass Object ( [level] => 2 [id] => 57 [title] => [fullpage] => stdClass Object ( [title] => Food & Beverage Operations [url] => ?cid=57 ) [tabs] => ) [9] => stdClass Object ( [level] => 2 [id] => 21 [title] => National Skills Recognition System (NSRS) [fullpage] => stdClass Object ( [title] => [url] => ) [tabs] => ) [10] => stdClass Object ( [level] => 3 [id] => 22 [title] => [fullpage] => stdClass Object ( [title] => Food & Beverage Services [url] => ?cid=22 ) [tabs] => ) [11] => stdClass Object ( [level] => 3 [id] => 35 [title] => [fullpage] => stdClass Object ( [title] => Food Preparation & Production [url] => ?cid=35 ) [tabs] => ) [12] => stdClass Object ( [level] => 3 [id] => 36 [title] => [fullpage] => stdClass Object ( [title] => Hotel Supervisory And Management [url] => ?cid=36 ) [tabs] => ) [13] => stdClass Object ( [level] => 3 [id] => 37 [title] => [fullpage] => stdClass Object ( [title] => Rooms [url] => ?cid=37 ) [tabs] => ) [14] => stdClass Object ( [level] => 2 [id] => 39 [title] => [fullpage] => stdClass Object ( [title] => Technical Service [url] => ?cid=39 ) [tabs] => ) [15] => stdClass Object ( [level] => 2 [id] => 45 [title] => [fullpage] => stdClass Object ( [title] => Train-The-Trainer [url] => ?cid=45 ) [tabs] => ) [16] => stdClass Object ( [level] => 1 [id] => 60 [title] => [fullpage] => stdClass Object ( [title] => Workforce Skills Qualifications (WSQ) [url] => ?cid=60 ) [tabs] => ) ) ) [1] => stdClass Object ( [title] => Academic Development [id] => 18 [folders] => Array ( [0] => stdClass Object ( [level] => 1 [id] => 56 [title] => [fullpage] => stdClass Object ( [title] => Certificate Programmes [url] => ?cid=56 ) [tabs] => ) [1] => stdClass Object ( [level] => 1 [id] => 29 [title] => [fullpage] => stdClass Object ( [title] => Diploma Programmes [url] => ?cid=29 ) [tabs] => ) [2] => stdClass Object ( [level] => 1 [id] => 28 [title] => [fullpage] => stdClass Object ( [title] => NITEC Programmes [url] => ?cid=28 ) [tabs] => ) ) ) [2] => stdClass Object ( [title] => Executive Development [id] => 19 [folders] => Array ( [0] => stdClass Object ( [level] => 1 [id] => 31 [title] => [fullpage] => stdClass Object ( [title] => Leadership [url] => ?cid=31 ) [tabs] => ) [1] => stdClass Object ( [level] => 1 [id] => 26 [title] => [fullpage] => stdClass Object ( [title] => Marketing & Sales [url] => ?cid=26 ) [tabs] => ) [2] => stdClass Object ( [level] => 1 [id] => 30 [title] => [fullpage] => stdClass Object ( [title] => Soft Skills [url] => ?cid=30 ) [tabs] => ) [3] => stdClass Object ( [level] => 1 [id] => 54 [title] => [fullpage] => stdClass Object ( [title] => Technical Knowledge [url] => ?cid=54 ) [tabs] => ) ) ) [3] => stdClass Object ( [title] => Professional Development [id] => 27 [folders] => Array ( [0] => stdClass Object ( [level] => 1 [id] => 38 [title] => [fullpage] => stdClass Object ( [title] => Raffles Professional Development (RPD) Programmes [url] => ?cid=38 ) [tabs] => ) ) ) [4] => stdClass Object ( [title] => Children's Programme [id] => 46 [folders] => Array ( [0] => stdClass Object ( [level] => 1 [id] => 48 [title] => [fullpage] => stdClass Object ( [title] => Children Courses [url] => ?cid=48 ) [tabs] => ) ) ) [5] => stdClass Object ( [title] => Innovative Programmes [id] => 52 [folders] => Array ( [0] => stdClass Object ( [level] => 1 [id] => 53 [title] => [fullpage] => stdClass Object ( [title] => Innovation [url] => ?cid=53 ) [tabs] => ) ) ) )
Expand|Select|Wrap|Line Numbers
- {mask:main}
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <script language="JavaScript">
- {#
- <!--
- function MM_preloadImages() { //v3.0
- var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
- var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
- if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
- }
- function MM_findObj(n, d) { //v4.0
- var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
- d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
- if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
- for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
- if(!x && document.getElementById) x=document.getElementById(n); return x;
- }
- function MM_swapImage() { //v3.0
- var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
- if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
- }
- function MM_openBrWindow(theURL,winName,features) { //v2.0
- window.open(theURL,winName,features);
- }
- //-->
- #}
- </script>
- <title>Raffles International Training Centre</title>
- <link rel="stylesheet" href="css/main.css" type="text/css">
- </head>
- <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"
- img src="images/spacer.gif" width="5" height="8" onLoad="MM_swapImage('skilldev','','images/sidemenu_arrow.jpg','academicdev','','images/spacer.gif','exedev','','images/spacer.gif','profdev','','images/spacer.gif',1)">
- <script type="text/javascript" language="JavaScript1.2" src="js/sect_stm31.js"></script>
- <script type="text/javascript" language="JavaScript1.2" src="js/sect_navi_menu.js"></script>
- <TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0>
- <TR>
- <TD width="188">
- <div id="Layer1" style="position:absolute; width:397px; height:19px; z-index:1; left: 390px; top: -3px"><a class="sidemenu" href="http://www.rafflesinternational.com" target="_blank">Raffles International Limited</a> <font color="#FF6600" size="1" face="Verdana, Arial, Helvetica, sans-serif">|</font> <a class="sidemenu" href="http://www.rkpl.com" target="_blank">Raffles Knowledge Private Limited</a></div>
- <IMG SRC="images/aboutus_01.jpg" WIDTH=188 HEIGHT=158 ALT="" align="absbottom"></TD>
- <TD background="images/sect_titlebg.gif">
- <div align="left"><img src="images/title_aboutus.jpg" width="582" height="158" align="absbottom">
- </div>
- </TD>
- </TR>
- </TABLE>
- <table width="100%" cellspacing="0" cellpadding="0" border="0" height="500">
- <tr>
- <td width="155" bgcolor="#ffffff" valign="top" >
- <!--//START: LEFT_TOPNAV//-->
- <table border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td><img src="images/spacer.gif" width="188" height="1" border="0"></td>
- </tr>
- </table>
- <!--//Start : Sidemenu//-->
- <table border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td><img src="images/spacer.gif" width="188" height="1" border="0"></td>
- </tr>
- </table>
- <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
- <tr>
- <td width="7%"><img src="images/spacer.gif" width="9" height="10" align="middle"></td>
- <td width="93%"> </td>
- </tr>
- <tr>
- <td width="7%" height="16"><img src="images/spacer.gif" width="9" height="10" align="middle" name="skilldev"></td>
- <td width="93%" height="2"><a class="sidemenu" href="our_biz.php#17">Skills Development</a></td>
- </tr>
- <td width="7%" height="16"><img src="images/spacer.gif" width="9" height="10" align="middle" name="academicdev"></td>
- <td width="93%" height="2"><a class="sidemenu" href="our_biz.php#18">Academic Development</a></td>
- </tr><td width="7%" height="16"><img src="images/spacer.gif" width="9" height="10" align="middle" name="exedev"></td>
- <td width="93%" height="2"><a class="sidemenu" href="our_biz.php#19">Executive Development</a></td>
- </tr><td width="7%" height="16"><img src="images/spacer.gif" width="9" height="10" align="middle" name="profdev"></td>
- <td width="93%" height="2"><a class="sidemenu" href="our_biz.php#27">Professional Development</a></td>
- </tr>
- <tr>
- </tr>
- </table>
- </td>
- <td width="100%" bgcolor="#EDEDF0" valign="top">
- <a name="#top">
- <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
- <tr>
- <td align="center"><img src="/images/spacer.gif" height="10" width="1"></td>
- </tr>
- <tr>
- <td valign="top" height="656">
- <p><span class="font11_333333"><b class="font12_CC0003">Our Business </b>
- </span></p>
- {mask:mainblocks}
- <a name="#{id}">
- <table width="98%" border="0" cellpadding="2" align="center" cellspacing="0">
- <tr>
- <td class="font11_003399" bgcolor="#2C2C83" height="25"><b class="font13_ffffff"> {title} </b></td>
- </tr>
- <tr>
- <td bgcolor="#DCE3EF">
- <ul>
- {mask:folders}{tabs}<img src="images/squarebullet.gif" vspace="2"> <span class="font11_333333">{fullpage}{alturlpopup}{defaultpopup}{title}</span><br>
- {/mask}
- </ul>
- </td>
- </tr>
- <tr>
- <td bgcolor="EDEDF0" class="font11_333333" height="3"><img src="images/spacer.gif" width="1" height="3"></td>
- </tr>
- </table>
- <p>
- {/mask}
- </td>
- </tr>
- </table>
- <!--//END: CONTENT_BODY//-->
- <!--//START: page_frame_2.tpl//-->
- <tr>
- <td colspan="2" bgcolor="#999999" height="1"><img src="images/spacer.gif" width="100%" height="1"></td>
- </tr>
- <!--//END: page_frame_2.tpl//-->
- <!--//END: PAGE_CONTENT//-->
- <p>
- <!--//START: PAGE_FOOTER//-->
- <table border="0" cellspacing="0" cellpadding="0" width="90%" align="center">
- <tr>
- <td> </td>
- </tr>
- <tr><td align="center" class="footer">Copyright © 2004 Raffles International Training Centre, Singapore.
- All Rights Reserved. <a class="footer" href="home_terms.shtml">Terms and
- Conditions</a><br>Designed And Created By :<a class="footer" href="http://www.1-net.com.sg" target="_blank">1-Net Singapore</a></td></tr>
- </table>
- <!--//END: PAGE_FOOTER//-->
- </table></body>
- </html>
- {/mask}
- {mask:defaultpopup}
- <a class="paralink" href=javascript:; onClick=window.open('our_biz_course.php?cid={id}','nb','width=520,height=400,scrollbars,')>{title}</a>
- {/mask}
- {mask:alturlpopup}
- <a class="paralink" href=javascript:; onClick=window.open('{url}','nb','width={w},height={h},scrollbars')>{title}</a>
- {/mask}
- {mask:fullpage}
- <a href="{url}" target="{target}" class="paralink">{title}</a>
- {/mask}
- It seems there are some problem of displaying the line in the template:
- Code:
- {mask:folders}{tabs}<img src="images/squarebullet.gif" vspace="2"> <span class="font11_333333">{fullpage}{alturlpopup}{defaultpopup}{title}</span><br>
Thanks
Grace