customerType; } //catalog items per page $_itemsPerPageArray=array(6,9,12); if(!isset($_SESSION['itemsPerPage'])||!in_array($_SESSION['itemsPerPage'],$_itemsPerPageArray)) $_SESSION['itemsPerPage']=$_itemsPerPageArray[0]; if(isset($_REQUEST['ipp'])&&in_array($_REQUEST['ipp'],$_itemsPerPageArray)) $_SESSION['itemsPerPage']=$_REQUEST['ipp']; $_itemsPerPage=$_SESSION['itemsPerPage']; $orderStatuces = array(1=>"New", 2=>"Paid", 3=>"Shipped", 4=>"Complete", 0=>"Declined"); $rateTypes = array("Fixed", "Variable", "Fixed - Open", "Variable - Open", "Cash Back", "HELOC"); $iAmArr = array("Buying a home", "Renewing", "Refinancing", "Accessing home equity"); $timeToCall = array("Call anytime", "Call in the morning", "Call in the afternoon", "Call in the evening"); $lookingFor = array("Pre-approval", "Purchase", "Renewal", "Refinance", "Debt consolidation", "Not sure"); $amounts = array("Less than $100,000", "$100,000 - $150,000", "$150,000 - $200,000", "$200,000 - $250,000", "$250,000 - $300,000", "$300,000 - $350,000", "$350,000 - $400,000", "$400,000 - $450,000", "$450,000 - $500,000", "$500,000 - $550,000", "$550,000 - $600,000", "$600,000 - $650,000", "$650,000 - $700,000", "$700,000 - $750,000", "$750,000 - $800,000", "$800,000 - $850,000", "$850,000 - $900,000", "$900,000 - $950,000", "$950,000 - $1,000,000", "More than $1,000,000"); $distanceArr = array("5" => "5 km", "10" => "10 km", "25" => "25 km", "50" => "50 km", "100" => "100 km"); $_lng = !empty($_REQUEST['lng'])?$_REQUEST['lng']:(isset($_SESSION['lng'])?$_SESSION['lng']:"eng"); if($_lng=='fr') { $_SESSION['lng'] = 'fr'; $lng = '_fr'; } elseif($_lng=='eng') { $_SESSION['lng'] = 'eng'; $lng=''; } ########################## STRIPE VARIABLES ################################################### //test if(get_option('stripeLive')=='1') { define("SECRET_KEY","sk_live_4LFh3ptdvcnWUznp9Vgw5X1k"); define("PUBLIC_KEY","pk_live_4LFhNhZfoIoyJ42J7gSLiaeH"); } else { define("PUBLIC_KEY","pk_test_vJsFX9ZYp3CvFY8OXnUUrx70"); define("SECRET_KEY","sk_test_0Fv6gCJqnIwf8TmT87p6VXnn"); } define("CURR","$"); // currrency symbol define("CURR_NAME","CAD"); // currrency name define("ORIGINAL_ZIP","L3R9T5"); // currrency name function _l($text) { global $lng, $core; $text = addslashes($text); $l = $lng == '_fr' ? "_fr" : "_eng"; $sql = "SELECT * FROM dictionary WHERE title='$text'"; $res = $core->query($sql); if ($res->count) { print stripslashes($res->result_row('title' . $l)); } else { print stripslashes($text); } } function __autoload($class_name) { if(is_file(HOME.'/includes/classes/'.strtolower($class_name) . '.class.php')) require_once (HOME.'/includes/classes/'.strtolower($class_name) . '.class.php'); else if(is_file(ADMIN_PATH.'/includes/'.strtolower($class_name) . '.class.php')) require_once (ADMIN_PATH.'/classes/Class_'.$class_name . '.php'); else ; } function getExcerpt($str,$words=70) { return preg_replace("/^\W*((\w[\w'-]*\b\W*){1,".$words."}).*/ms", '\\1',strip_tags($str)); } function __($str,$isMenu=0) { $result=mysql_query("select * from dictionary where english='".mysql_real_escape_string($str)."' and isMenu=".$isMenu." limit 0,1") or die(mysql_error()); if(mysql_num_rows($result)==0) { mysql_query("insert into dictionary set english='".mysql_real_escape_string($str)."', isMenu=".$isMenu) or die(mysql_error()); return $str; } else { $row=mysql_fetch_object($result); switch($_SESSION['lang']) { case 'ru': //russian if($row->russian=='') //return ''.$str.''; return $str; else return $row->russian; break; case 'lv': //latvian if($row->latvian=='') //return ''.$str.''; return $str; else return $row->latvian; break; default: //english return $str; break; } } } function get_option($str) { $result=mysql_query("select * from settings limit 0,1") or die(mysql_error()); if(mysql_num_rows($result)==0) { return 'option error! - no db -'; } else { $row=mysql_fetch_object($result); if(isset($row->$str)) return $row->$str; else return 'option error! - '.$str.' -'; } } function get_permalink($id) { $result=mysql_query("select * from content where id='".$id."'") or die(mysql_error()); if(mysql_num_rows($result)==0) { return '/'; } else { $row=mysql_fetch_object($result); return '/'.$row->seo_slug; } } function get_content($seo) { $result=mysql_query("select * from content where seo_slug='".$seo."'") or die(mysql_error()); if(mysql_num_rows($result)==0) { return false; } else { $row=mysql_fetch_object($result); return $row; } } function get_content_by_id($id,$lang='en') { if($lang=='en') $result=mysql_query("select * from content where id='".$id."'") or die(mysql_error()); else { //check if already is the id $result=mysql_query("select * from content where id='".$id."'") or die(mysql_error()); $row=mysql_fetch_object($result); if($row->lang==$lang) return $row; else $result=mysql_query("select * from content where lang='".$lang."' and translation_of='".$id."'") or die(mysql_error()); } if(mysql_num_rows($result)==0) { return false; } else { $row=mysql_fetch_object($result); return $row; } } function get_about_by_id($id,$lang='en') { if($lang=='en') $result=mysql_query("select * from about where id='".$id."'") or die(mysql_error()); else { //check if already is the id $result=mysql_query("select * from about where id='".$id."'") or die(mysql_error()); $row=mysql_fetch_object($result); if($row->lang==$lang) return $row; else $result=mysql_query("select * from about where lang='".$lang."' and translation_of='".$id."'") or die(mysql_error()); } if(mysql_num_rows($result)==0) { return false; } else { $row=mysql_fetch_object($result); return $row; } } function get_service_by_id($id,$lang='en') { if($lang=='en') $result=mysql_query("select * from services where id='".$id."'") or die(mysql_error()); else { //check if already is the id $result=mysql_query("select * from services where id='".$id."'") or die(mysql_error()); $row=mysql_fetch_object($result); if($row->lang==$lang) return $row; else $result=mysql_query("select * from services where lang='".$lang."' and translation_of='".$id."'") or die(mysql_error()); } if(mysql_num_rows($result)==0) { return false; } else { $row=mysql_fetch_object($result); return $row; } } function get_block_by_id($id,$lang='en') { if($lang=='en') $result=mysql_query("select * from content_blocks where id='".$id."'") or die(mysql_error()); else { //check if already is the id $result=mysql_query("select * from content_blocks where id='".$id."'") or die(mysql_error()); $row=mysql_fetch_object($result); if($row->lang==$lang) return $row; else $result=mysql_query("select * from content_blocks where lang='".$lang."' and translation_of='".$id."'") or die(mysql_error()); } if(mysql_num_rows($result)==0) { return false; } else { $row=mysql_fetch_object($result); return $row; } } function get_project_by_id($id,$lang='en') { if($lang=='en') $result=mysql_query("select * from projects where id_projects='".$id."'") or die(mysql_error()); else { //check if already is the id $result=mysql_query("select * from projects where id_projects='".$id."'") or die(mysql_error()); $row=mysql_fetch_object($result); if($row->lang==$lang) return $row; else $result=mysql_query("select * from projects where lang='".$lang."' and translation_of='".$id."'") or die(mysql_error()); } if(mysql_num_rows($result)==0) { return false; } else { $row=mysql_fetch_object($result); return $row; } } function result_type_price( $priceType) { if($priceType!='') { if($priceType=='m2') echo ' / m2'; else echo ' / '.$priceType; } } function get_object_by_id($id,$lang='en') { if($lang=='en') $result=mysql_query("select * from projects_objects where id_object='".$id."'") or die(mysql_error()); else { //check if already is the id $result=mysql_query("select * from projects_objects where id_object='".$id."'") or die(mysql_error()); $row=mysql_fetch_object($result); if($row->lang==$lang) return $row; else $result=mysql_query("select * from projects_objects where lang='".$lang."' and translation_of='".$id."'") or die(mysql_error()); } if(mysql_num_rows($result)==0) { return false; } else { $row=mysql_fetch_object($result); return $row; } } function showCatLi($rowCat,$counter) { global $core; global $idCustomer; if($counter%3==0) $classItem='featured_list_box_margin2 margin-ipad'; else $classItem='featured_list_box_margin1'; ?>