".$ban['content'].""; #echo "
"; } if($page == "business.php"){ include("template-content-category-bus.php"); }else{ include("template-content-category.php"); } } ##its a category##### #####PAGE SECTION##### else{ $_SESSION['current_page'] = detect_uri(); $pagenameid2 = mysql_query("SELECT * FROM pages where lcase(page_name) = '".strtolower($pname)."'"); $pagerow2 = mysql_fetch_assoc($pagenameid2); $nameid = $pagerow2['id']; $datatable = "pages"; $pagetype = "id"; ## save the page to a session if(isset($pagerow2['catid'])){ if(is_numeric($pagerow2['catid'])){ $sql = "SELECT catid FROM catid where catid = ".$pagerow2['catid']; $catid = mysql_fetch_assoc(mysql_query($sql)); if(isset($catid['catid'])) $_SESSION['parentid'] = $catid['catid']; } } ## CONTENT $pageresult = mysql_query("SELECT * FROM pages where ".$pagetype." = '".$nameid."'"); $row = mysql_fetch_assoc($pageresult); $title = $row['title']; $topbanner = $row['banner1']; $des = $row['col1']; $ttemp = $row['title']; ##add expansion class if($pname=='What Our Customers Think' || $pname=='What Our Clients Think'){ $desarr = explode("[testimonial]", $des); $ctr=0; $des=''; foreach ($desarr as $key => $value) { if($ctr>0){ $des.="
".$value."
"; }else $des.=$value; $ctr++; } } $descrip = explode("%split%", $des); foreach ($descrip as $key => $value) { $descrip[$key] = html_entity_decode($value); } $descri2=''; if(isset($descrip[1]))$descri2 = str_replace ("../files", "files", $descrip[1]); $descriptiontwo = $descri2; $descriptionthree=''; if(isset($descrip[2]))$descriptionthree = $descrip[2]; // piece2 if ( $descrip[0] == '') { $descriptionone ='

'.$title.'

'; } else { $descri1 = str_replace ("../files", "files", $descrip[0]); if(strrpos($descri1, "[business gallery]")){ $url = siteurl."display-bus-gallery.php"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $gall = curl_exec($ch); curl_close($ch); $descri1 = str_replace("[business gallery]",$gall , $descri1); } elseif(strrpos($descri1, "[home gallery]")){ $url = siteurl."display-home-gallery.php"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $gall = curl_exec($ch); curl_close($ch); $descri1 = str_replace("[home gallery]",$gall , $descri1); } $descriptionone =''.$descri1.''; } $template = $row['template']; if ($template == '3') { $col1 = '240'; $col2 = '200'; $col3 = '100'; $col2style = 'thin2'; } if ($template == '1') { $col1 = '718'; $col2 = ''; $col2style = 'thin2'; } if ($template == '2') { $col1 = '261'; $col2 = '414'; $col2style = 'thin'; } $rightbanner = ''; #### right side banners $pagename = basename($_SERVER['REQUEST_URI']); $pagestring = substr($pagename, 0, -4); $pageoutput = str_replace("-", ' ', $pagestring); $banner = mysql_query("SELECT * FROM pages WHERE page_name = '".$pageoutput."' ORDER BY `ord` ASC"); //displaying the page row $bannerrow = mysql_fetch_assoc($banner); $sql= "SELECT * FROM bannerList WHERE page_id = '".$bannerrow['id']."' and enabled=1 ORDER BY `ord` ASC"; $bannerlist = mysql_query($sql); while($banrow = mysql_fetch_array( $bannerlist )){ $bannerinfo = mysql_query("SELECT * FROM banner WHERE id = '".$banrow['banner_id']."'"); $ban = mysql_fetch_assoc($bannerinfo); $rightbanner.= "
".$ban['content']."
"; #echo "
"; } ### right side list of pages $treatn =""; if(strpos($descriptionone, "[contact form]")){ define('FUNCTIONS_FOLDER', rootpath . 'functions/'); require_once(FUNCTIONS_FOLDER . 'Email.php'); require_once(FUNCTIONS_FOLDER . 'ContactEmailDatabase.php'); $email = new Email(); if ($email->isValid($_POST)) { $email->send(Email::STD_MAIL_ADDRESS); $email->send($email->getClientEmailAddress()); $email->saveEmailContent(ContactEmailDatabase::getInstance()); } if ($email->isSent()) { header('Location: '.siteurl.'Thank-You.php'); } $styles = ""; $contactform = file_get_contents(rootpath."/contact-form.php"); $descriptionone = str_replace('[contact form]', $contactform, $descriptionone); } ###get right template for Contact us and showroom and about us $mn = strtolower(trim($pname)); if ($row['type'] == 'b' ) { include("template-content-business.php"); } else{ include("template-content-home.php"); } } #####PAGE SECTION##### ?>