	<?php
function getGallery(){
	global $DB;
	$sql = "SELECT * FROM ".$DB->pre."home_gallery WHERE status=1";
	$data = $DB->dbRows($sql);
	$str = "";
	foreach($data as $v){
		$str .='<a class="fancybox" rel="gallery1" href="'.SITEURL.'/uploads/home_gallery/'.$v['homeImg'].'">
			<img src="'.SITEURL.'/core/image.inc.php?path=home_gallery/'.$v['homeImg'].'&w=720&h=478&type=crop'.'" alt="" />
			</a>';
	}
	return $str;
}
function addToCart1111(){
	@session_start();
	global $DB;
	$data = json_decode($_REQUEST['productID']);
	$productID = $data->productID;
	$sql = 'SELECT P.*,C.categoryTitle FROM '.$DB->pre.'product as P 
			LEFT JOIN '.$DB->pre.'category as C on P.categoryID = C.categoryID
			WHERE P.productID='.$data->productID;
	$d = $DB->dbRow($sql);
	
	if(!isset($_SESSION["PRODUCTCART"]))
			$_SESSION['PRODUCTCART'] = array();
			
	$productQty = intval($_REQUEST['qty']);
	$discountPrice = $d["prodDistPrice"];
	$productPrice = $d["prodPrice"];
	$productName = $d['prodTitle'];
	$categoryTitle = $d['categoryTitle'];
	
	if(count($_SESSION["PRODUCTCART"]) > 0){
			$qty = $_SESSION["PRODUCTCART"][$productID]['productQty'];
			$_SESSION["PRODUCTCART"][$productID] = array("productQty"=>($productQty), "productID"=>$productID, "categoryTitle"=>$categoryTitle, "productName"=>$productName, "productPrice"=>$productPrice, "discountPrice"=>$discountPrice, "productImage"=>$d['prodImg1']);
		}else{
			$_SESSION["PRODUCTCART"][$productID] = array("productQty"=>($productQty), "productID"=>$productID, "categoryTitle"=>$categoryTitle, "productName"=>$productName, "productPrice"=>$productPrice, "discountPrice"=>$discountPrice,   "productImage"=>$d['prodImg1']);
		}
	
}
switch($_REQUEST['xAction']){
	case 'getPageData':
					include("../../connectdb.inc.php");
					echo getPageData();
					break;
	case 'addToCart1111':
					include("../../connectdb.inc.php");
					echo addToCart();
					break;
}
?>