getMaxResult(); $page=$_GET['page']; if(!$page) { $page=1; } if(isset($_POST['search'])) { $search_name=$_POST['txtsearch']; } else { $search_name=$_GET['txtsearch']; } $idproductstree=$_GET['idproductstree']; //*********************selecting category product details********************************// $get_conf_attrib=$category_products->getProduct_Id($idproductstree,$page,$max_results); $total_results = $get_conf_attrib["total"]; $total_pages = ceil($total_results / $max_results); $resultsToList = $get_conf_attrib["result"]; $product_details_list = array(); while ($row = mysql_fetch_assoc($resultsToList['result'])) { $prod_id=$row["idProduct"]; $getproduct_details=$category_products->product_details($prod_id); $name=$getproduct_details[0]; $shortdesc=$getproduct_details[1]; if(!$shortdesc) { $shortdesc=' '; } $price=$getproduct_details[2]; $img=$getproduct_details[3]; if(!$img) { $img="productdetails_bg.png"; } $tree = array( 'productname' => $name, 'shortdesc' => $shortdesc, 'prod_id' => $prod_id, 'product_price' => $price, 'product_image' => $img ); array_push($product_details_list, $tree); } if($_GET['cmd']=='current') { $count=$_GET['count']; $count=$count; $next=$page+1; $previous=$page-1; $j=$_GET['j']; $test='previous'; } else if($_GET['cmd']=='next') { $count=$_GET['count']; $count=$count+1; $next=$page+1; $j=$_GET['j']; $j=$j+1; $test='previous'; } else if($_GET['cmd']=='previous') { $count=$_GET['count']; $j=$_GET['j']; $j=$j-1; $previous=$page-1; $test='previous'; } else { $count=$category_products->getPaginationCount(); $j=0; if($count > $total_pages) { $count=$total_pages; } } $product_category_details=$category_products->getCategoryDetails($idproductstree); $product_category_id=$product_category_details[0]; $product_category=$product_category_details[1]; include_once 'templates/category_products.tpl.php'; ?>