0) { $pageid = str_replace("pg-","",$arr[sizeof($arr)-1]); $uniqueid = $arr[sizeof($arr)-2]; } else if(strpos($varuri,"/locationmap")>0) { $locid = $arr[sizeof($arr)-1]; $uniqueid = $arr[sizeof($arr)-2]; } else { $uniqueid = $arr[sizeof($arr)-1]; } //get the module attached with this link $strsql = "SELECT ma_module . * , ma_web_menu_items . * FROM `ma_web_menu_items` LEFT OUTER JOIN ma_module ON ma_web_menu_items.module_code_id = ma_module.module_code_int WHERE ma_web_menu_items.items_unique_id = '" . $uniqueid . "'"; $cntbanner = 0; $arr = db_get_all($strsql); $clientarea = "user.index"; if (sizeof($arr)>0) { if ($arr[0]["tag"] == "article") { $clientarea = "user.article"; $articleid = $arr[0]["article_code_int"]; $arrcontent = $oarticle->getListById($articleid); $id=$arrcontent[0]["mod_article_code_int"]; $sdisplayname=$arrcontent[0]["mod_article_name_vc"]; $catlist=$oarticle->getArticleList($id); $cnt=sizeof($catlist); $smarty->assign('cnt', $cnt); $smarty->assign('catlist', $catlist); $article_title = $arrcontent[0]["article_name_vc"]; $article_short_content = $arrcontent[0]["article_short_desc"]; $article_content = $arrcontent[0]["article_desc"]; $article_img = $arrcontent[0]["thumb_image"]; $arrbn=$arrcontent[0]['banner_image']; //$arrtitle=$arrbanner[0]['banner_name_vc']; $smarty->assign('arrbn',$arrbn); $smarty->assign('displaytitle',$article_title); $smarty->assign('displaycontent', $article_content); $smarty->assign('displayimg', $article_img); $smarty->assign('sdisplayname', $sdisplayname); $modid=$arr[0]["module_code_int"]; $arrbanner=$obanner->getbannerId($modid); $arrbn1=$arrbanner[0]['thumb_image']; $smarty->assign('arrbn1', $arrbn1); } else if ($arr[0]["tag"] == "contactus") { $ocontact1 = new CContactus(); $modid=$arr[0]["module_code_int"]; $arrbanner=$obanner->getbannerId($modid); $arrbn=$arrbanner[0]['thumb_image']; $smarty->assign('arrbn', $arrbn); $arrcontact1 = $ocontact1->getList(); $smarty->assign('allcontact',$arrcontact1); $arrbranch = $ocontact1->getBranches(); $smarty->assign('arrbranch',$arrbranch); $clientarea = "user.contactus"; } else if ($arr[0]["tag"] == "blog") { $clientarea = "user.blog.list"; } } if($uniqueid=="terms-conditions") { $articleid = $arr[0]["article_code_int"]; $arrcontent = $oarticle->getListById($articleid); $article_title = $arrcontent[0]["article_name_vc"]; $article_short_content = $arrcontent[0]["article_short_desc"]; $article_content = $arrcontent[0]["article_desc"]; $article_image = $arrcontent[0]["thumb_image"]; $smarty->assign('displaytitle',$article_title); $smarty->assign('displaycontent', $article_content); $smarty->assign('displayimage', $article_image); $clientarea = "user.article"; } if($uniqueid=="inquiry") { $min_number = 1; $max_number = 15; $random_number1 = mt_rand($min_number, $max_number); $random_number2 = mt_rand($min_number, $max_number); $smarty->assign('random_number1',$random_number1); $smarty->assign('random_number2',$random_number2); $modid=$arr[0]["module_code_int"]; $arrbanner=$obanner->getbannerId($modid); $arrbn=$arrbanner[0]['thumb_image']; $smarty->assign('arrbn', $arrbn); $arrtitle=$arrbanner[0]['banner_name_vc']; $smarty->assign('arrtitle', $arrtitle); $article_pgtitle = $arrbanner[0]["title"]; $smarty->assign('pagetitle', $article_pgtitle); $clientarea = "user.inquiry"; } if($uniqueid=="resources") { $clientarea = "user.resources"; } if($uniqueid=="Quality") { $clientarea = "user.quality"; } if($uniqueid=="Videos") { $arrvideo=$ovideo->getvideoalbum(); $smarty->assign('arrvideo',$arrvideo); $clientarea = "user.video"; } if($uniqueid=="tracking") { $modid=$arr[0]["module_code_int"]; $arrbanner=$obanner->getbannerId($modid); $arrbn=$arrbanner[0]['thumb_image']; $smarty->assign('arrbn', $arrbn); $arrtitle=$arrbanner[0]['banner_name_vc']; $smarty->assign('arrtitle', $arrtitle); $article_pgtitle = $arrbanner[0]["title"]; $smarty->assign('pagetitle', $article_pgtitle); $clientarea = "user.tracking"; } if($uniqueid=="currency_convertor") $clientarea = "user.currency_convertor"; if($uniqueid=="volumetric_weight_calculator") { $clientarea = "user.vweight_calculator"; } if($uniqueid=="world_clock") { $clientarea = "user.world_clock"; } if($uniqueid=="special_offer") { $clientarea = "user.special_offer"; } if(isset($_POST['vwc_submit'])) { $clientarea = "user.vweight_calculator"; $length=$_POST['length']; $width=$_POST['width_d']; $height=$_POST['height']; $result=$length*$width*$height/5000; $smarty->assign('result',$result); } if($uniqueid=="documents") { $arrdocuments = $odocuments->getalllist(); $smarty->assign('arrdocuments',$arrdocuments); $clientarea = "user.documents"; } if($uniqueid=="gallery") { $arrgallerydata = $ophotosingle->getall(); $smarty->assign('arrgallerydata',$arrgallerydata); $clientarea = "user.gallery-detail"; } if($uniqueid=="sitemap") $clientarea = "user.sitemap"; if($uniqueid=="sitemap") $clientarea = "user.sitemap"; if($uniqueid=="product_catalog") { $clientarea = "user.maincat"; //get the data for categories $arrcatrightmenu = $oprodcat->getProductCatByParent(0); $arrcat = $oprodcat->getProductCatByParent(0); $smarty->assign('categoryname',"Products"); $smarty->assign('arrcat',$arrcat); $smarty->assign('arrcatrightmenu',$arrcatrightmenu); } if($uniqueid=="thanks") $clientarea = "user.thanks"; if(isset($_POST['track_submit'])) { $trackno=$_POST['txttrack']; $atrackno=explode("\n",$trackno); $size_arr = sizeof($atrackno); if (sizeof($atrackno) > 1) { $smarty->assign('message7','Multiple Size Element'); $que_comma= str_replace("\n", "," ,"$trackno"); $items = preg_split("/[,\\s]+/", $que_comma); $sqlItems = array(); foreach ($items as $item) { $sqlItems[] = "'" . mysql_real_escape_string($item) . "'"; } // Add new list to SQL $quecomma_quote .= implode(",", $sqlItems); $arrtarck=$otrack->gettrack($quecomma_quote); $smarty->assign('arrtarck',$arrtarck); $docket_no=$arrtarck[0]['tr_ccode']; $smarty->assign('docket_no',$docket_no); } else { $arrtarck=$otrack->gettrack($trackno); $smarty->assign('arrtarck',$arrtarck); $docket_no=$arrtarck[0]['tr_ccode']; $smarty->assign('docket_no',$docket_no); } $clientarea = "user.track_detail"; } if (strpos($uniqueid,"~Track")>0){ $arrprodval = explode("~",$uniqueid); $trackno = $arrprodval[1]; if($trackno!='') { $arrtarck=$otrack->gettrack($trackno); $smarty->assign('arrtarck',$arrtarck); $docket_no=$arrtarck[0]['tr_ccode']; $smarty->assign('docket_no',$docket_no); $clientarea = "user.track_detail"; } } //check the id for product category $arrprod = $oprodcat->getProductCatByUniqueID($uniqueid); if (sizeof($arrprod)>=1) { //check if this category has a sub-category $arrcat = $oprodcat->getProductCatByParent($arrprod[0]['cat_id']); $arrcnt=sizeof($arrcat); $smarty->assign('arrcnt',$arrcnt); if (sizeof($arrcat)>1) { $clientarea = "user.maincat"; $smarty->assign('categoryname',$arrprod[0]['cat_name']); $arrcatrightmenu = $oprodcat->getProductCatByParent(0); $smarty->assign('arrcatrightmenu',$arrcatrightmenu); $smarty->assign('arrcat',$arrcat); } else { $clientarea = "user.product.list"; //get the data of the products for the category $arrproducts = $oproduct->getProductListByCategory($arrprod[0]['cat_id']); $arrproduct = $oproduct->getProductListByCategory($arrprod[0]['cat_id']); $brand_code_int = $arrproduct[0]["brand_code_int"]; $arrproductData = $oproduct->getProductListByCategory1($arrprod[0]['cat_id']); $smarty->assign('categoryname',$arrprod[0]['cat_name']); $smarty->assign('catdesc',$arrprod[0]['cat_desc']); $smarty->assign('arrproduct',$arrproducts); $smarty->assign('arrproductData',$arrproductData); $arrcatrightmenu = $oprodcat->getProductCatByParent(0); $smarty->assign('arrcatrightmenu',$arrcatrightmenu); } } if ($uniqueid=="search-product") { $arrprodz = $oproduct->searchproduct($_POST); $smarty->assign('arrprodz',$arrprodz); $clientarea = "user.product.search"; } if(isset($_POST['sbmt'])) { $name=$_POST['txtname']; $category=$_POST['txtservices']; $desc=$_POST['txtfeedback']; $arrinsert=$otesty1->insert_testy($name,$category,$desc); $smarty->assign('arrinsert',$arrinsert); } //check the id for product if ($uniqueid != "") { $arrprod1 = $oproduct->getProductListByUniqueID($uniqueid); $arrbannerz= $obanner->getbanneruniqueid($uniqueid); $smarty->assign('arrbannerz',$arrbannerz); $smarty->assign('productname',$arrprod1[0]['prod_name']); $smarty->assign('catname',$arrprod1[0]['cat_name']); $smarty->assign('productuniqueid',$arrprod1[0]['product_uniqueid']); if (sizeof($arrprod1)>=1) { $clientarea = "user.product.list.detail"; $article_pgtitle = $arrprod1[0]["title"]; $smarty->assign('pagetitle', $article_pgtitle); $article_pagekeywords = $arrprod1[0]["keywords"]; $smarty->assign('pagekeywords', $article_pagekeywords); $article_pagedescription = $arrprod1[0]["description"]; $smarty->assign('pagedescription', $article_pagedescription); $prodid = $arrprod1[0]["prod_id"]; $arrcatrightmenu = $oprodcat->getProductCatByParent(0); $smarty->assign('arrcatrightmenu',$arrcatrightmenu); $smarty->assign('proddata1',$arrprod1); $arrgallery = $oprogallery->getProductGallery($prodid); $smarty->assign('arrgallery',$arrgallery); } } if ($clientarea == "user.index") { $arrpage = $oarticle->getListByUniqueId($uniqueid); $ocontact1 = new CContactus(); $arrcontact1 = $ocontact1->getHeadOffice(); $smarty->assign('allcontact',$arrcontact1); $arrresorses = "SELECT * FROM `ma_web_menu_items` WHERE `items_parcat_id`='195'"; $arrresque = db_get_all($arrresorses); $smarty->assign('arrresorce',$arrresque); if (sizeof($arrpage)>=1){ $clientarea = "user.article"; $article_title = $arrpage[0]["article_name_vc"]; $article_content = $arrpage[0]["article_desc"]; $article_image = $arrpage[0]["thumb_image"]; $arrbn = $arrpage[0]["banner_image"]; $smarty->assign('displaytitle',$article_title); $smarty->assign('displaycontent', $article_content); $smarty->assign('displayimage', $article_image); $smarty->assign('arrbn', $arrbn); } } $pos=strpos($uniqueid,"-"); $len=strlen($uniqueid); $photoid=substr($uniqueid,$pos+1,$len); $str=substr($uniqueid,0,$pos+1); if($str=="gallery-") { $arrgdetail=$ophotosingle->getphotobyphotoID($photoid); $smarty->assign('arrgdetail', $arrgdetail); $arrtitle=$osinglephoto->getListById($photoid); $smarty->assign('gdisplayname', $arrtitle[0]['photos_name_vc']); $clientarea = "user.gallery-detail"; } if ($clientarea == "user.index") { $uniqueid = "index"; /*$arrwelcome = $oarticle->getListByUniqueId("services"); $article_title = $arrwelcome[0]["article_name_vc"]; $article_content = $arrwelcome[0]["article_desc"]; $article_image = $arrwelcome[0]["thumb_image"]; $article_uniqueid = $arrwelcome[0]["article_unique_id"];*/ /*$smarty->assign('displaytitle',$article_title); $smarty->assign('displaycontent', $article_content); $smarty->assign('displayimage', $article_image); $smarty->assign('article_uniqueid',$article_uniqueid);*/ $arrwelcome = $oarticle->getListByUniqueId("welcome-content"); $article_title = $arrwelcome[0]["article_name_vc"]; $article_content = $arrwelcome[0]["article_desc"]; $article_image = $arrwelcome[0]["thumb_image"]; $article_short_desc = $arrwelcome[0]["article_short_desc"]; $smarty->assign('displaytitle',$article_title); $smarty->assign('displaycontent', $article_content); $smarty->assign('displayshort_w', $article_short_desc); $smarty->assign('displayimage', $article_image); } if ($clientarea == "user.index") { $clientarea1 = "user.testimonial"; $arrtestimonial1 = $otesty1->getalllist(2); $smarty->assign('alltestimonial1',$arrtestimonial1); } //for rightside menus $arrcat = $oprodcat->getProductCatByParent(0); function getProductsByCategory($param1, &$smarty) { // Some code goes here //$recval = 0; global $oproduct; foreach($param1 as $rec){ $recval = $rec; } //get the data from category information $ores = $oproduct->getProductListByCategory($recval); $smarty->assign('recmst1cnt',count($ores)); $smarty->assign('recmst1',$ores); } $smarty->register_function('getProdByCategory', 'getProductsByCategory'); $smarty->assign('prodmenu',$arrcat); $smarty->assign('uniqueid',$uniqueid); $smarty->assign('appinitialpath',CNF_APP_INITIAL_PATH); $smarty->assign('sourcepath',CNF_APP_RESOURCE_PATH."system/upload/"); $smarty->assign('clientarea',$clientarea); $smarty->display('user.mainframe.uiframe.tpl'); ?>