/** * This function is used to get wishlist * @param array $result * . * * @return string */ function showWishList($result = '') { include_once 'classes/Display/DUserAccount.php'; $userid = $_SESSION['user_id']; $pagesize = 10; if (isset($_GET['page'])) { $start = trim($_GET['page'] - 1) * $pagesize; $end = $pagesize; } else { $start = 0; $end = $pagesize; } $total = 0; $sqlselect = "SELECT a.product_id,image,title,msrp,date_format(date_added,'%e/%c/%Y') as adate FROM `wishlist_table` a, products_table b where a.product_id=b.product_id and a.user_id=" . $userid . " order by date_added desc"; $query = new Bin_Query(); $query->executeQuery($sqlselect); $total = ceil($query->totrows / $pagesize); include 'classes/Lib/Paging.php'; $tmp = new Lib_Paging('classic', array('totalpages' => $total, 'length' => 10), 'pagination'); $this->data['paging'] = $tmp->output; $this->data['prev'] = $tmp->prev; $this->data['next'] = $tmp->next; $sqlselect = "SELECT a.product_id,image,title,msrp,date_format(date_added,'%e/%c/%Y') as adate FROM `wishlist_table` a, products_table b where a.product_id=b.product_id and a.user_id=" . $userid . " order by date_added desc LIMIT {$start},{$end}"; $obj = new Bin_Query(); $obj->executeQuery($sqlselect); return Display_DUserAccount::showWishList($obj->records, $this->data['paging'], $this->data['prev'], $this->data['next'], $start, $result); }