}
    //
    if ($txtSearch != '') {
        $qrystring .= ' AND ( p.product_name like "%' . addslashes($txtSearch) . '%" || p.product_description like "%' . addslashes($txtSearch) . '%") AND  ';
    }
}
// end if search
$query1 = rtrim($qrystring, " AND");
$query = $sql . $query1;
if (!isset($pagenum)) {
    $pagenum = 1;
}
$result = mysql_query($query) or die(mysql_error());
$totalrows = mysql_num_rows($result);
$limit = 12;
$sql_qr = dopaging($query, '', $limit);
$result = mysql_query($sql_qr) or die(mysql_error());
$prodimagedir = "products/";
$totalRowCount = $totalrows;
?>

   <div class="pcm_productlisting_topbox">

   <div class="pcm_page_limit" style="float: left;">
	<?php 
/*echo $showproductlisting;*/
?>
       <input type="hidden" name="startlimit" id ="startlimit" value="<?php 
echo $paginglimit;
?>
">
    }
    // switch
}
$sql = " SELECT f.*, u.user_name,u.first_name,u.last_name FROM " . $tableprefix . "artist_feedbacks f\n\tINNER JOIN " . $tableprefix . "users u ON f.user_id = u.user_id\n\tWHERE f.artist_id = '" . addslashes($artistid) . "' AND f.published='Y' order by date_added DESC   ";
$sess_back = $_SERVER["PHP_SELF"] . "?begin=" . $begin . "&num=" . $num . "&numBegin=" . $numBegin . "&cmbSearchType=" . $cmbSearchType . "&txtSearch=" . $txtSearch;
$_SESSION["gbackurl"] = $sess_back;
$totalrows = mysql_num_rows(mysql_query($sql));
$limit = getPaginationLimit();
if ($limit == 0) {
    $limit = 10;
}
$page = isset($_GET['page']) ? trim($_GET['page']) : 1;
if (empty($page)) {
    $page = 1;
}
$sql_qr = dopaging($sql, '', $limit);
$rs = mysql_query($sql_qr);
$navigate = pageBrowser($totalrows, 10, 10, "&artistid=" . addslashes($artistid) . "&productid=" . addslashes($productid) . "&cmbSearchType={$cmbSearchType}&txtSearch={$txtSearch}", $_GET[numBegin], $_GET[start], $_GET[begin], $_GET[num]);
$sql = $sql . $navigate[0];
//$rs = mysql_query($sql);
/*display the active template*/
$active_template = displayTemplate();
include "includes/htmltop.php";
/* Top File Name */
include_once "includes/" . $active_template[0];
?>
<script language="JavaScript" type="text/JavaScript">
function clickSearch()
{
	document.frmFeedbacks.submit();
}
}
$currency_attributes = displayCurrencyType();
$Query_Wish_Products = "SELECT w.*, p.product_id,p.product_name,(p.product_price+po.additional_price) AS product_price,po.*,p.product_artist_id,p.eMadetoOrder,po.image_small,po.image_big,p.eMadetoOrder,\n             (SELECT pm.vimage_name FROM " . $tableprefix . "product_view_images pm where pm.nimage_productid=p.product_id LIMIT 0,1)AS smallimage\n\t\t\t\t\tFROM " . $tableprefix . "wishlist w\n                                        INNER JOIN " . $tableprefix . "product_options po ON po.product_option_id = w.nProductOptionId\n                                        INNER JOIN " . $tableprefix . "products p ON p.product_id = po.product_id\n                                        INNER JOIN " . $tableprefix . "categories c ON c.category_id  = p.product_category\n\t\t\t\t\tWHERE w.nUserId = '" . addslashes($userid) . "' AND  c.vEnable='Y' AND po.product_stock > 0 AND p.vapproved='Y'";
//echo $Query_Wish_Products;
$wishListResult = mysql_query($Query_Wish_Products);
//echo "<pre>";print_r($result);
$totalrows = mysql_num_rows($wishListResult);
$limit = getPaginationLimit();
if ($limit == 0) {
    $limit = 10;
}
$page = isset($_GET['page']) ? trim($_GET['page']) : 1;
if (empty($page)) {
    $page = 1;
}
$sql_qr = dopaging($Query_Wish_Products, '', $limit);
//echo $sql_qr;
$resultWishItems = mysql_query($sql_qr);
/*display the active template*/
$wishListNumRows = mysql_num_rows($wishListResult);
$active_template = displayTemplate();
$prodimagedir = SITE_URL . "/products/";
include "includes/htmltop.php";
/* Top File Name */
include_once "includes/" . $active_template[0];
?>
<script language="JavaScript" type="text/JavaScript">
    function clickSearch()
    {
        document.frmFeedbacks.submit();
    }
				<div align="left" class="main_body">
							<!--mainbody area start -->
			
						<div align="left" id="body_left_area">
							<!--body left area start -->
							
							<!--categories area start -->
			
			<?php 
$limit = getPaginationLimit();
if ($limit == 0) {
    $limit = 12;
}
$sql_category = " SELECT * FROM " . $tableprefix . "categories WHERE parent_id LIKE " . GetSQLValueString($catid, "text") . " ORDER BY category_name ";
$sql_qr = dopaging($sql_category, '', $limit);
$totalrows = mysql_num_rows(mysql_query($sql_category));
$result_category = mysql_query($sql_qr) or die(mysql_error());
?>
			
			
			<!--categories area end -->	
			
			<!--body left area end -->
						</div>
 
		   <!--center content area start-->		

		 <form name="frmCatalog" action="<?php 
echo $_SERVER["PHP_SELF"];
?>
 public static function getPaginationResult($sql, $limit = 10)
 {
     $sql_qr = dopaging($sql, '', $limit);
     $result = DbHelper::execute($sql_qr);
     return $result;
 }