modify("-30 day"); $post_s_dxt = $post_s_dategx->format("Y-m-d H:i:s"); $q1 = "select product_item.id, product_item.item_code, product_item.item_name, product_item.item_thumbnail, product_item.item_currency, product_item.item_price, product_item.item_tax_rate, product_item.shipping_freight, product_item.item_discount, product_item.date from product_item left join main_cat on main_cat.id = product_item.item_similar_id where product_item.date >= '$post_s_dxt' and product_item.status='Y' and product_item.public_private='0' order by product_item.item_code asc"; $result3 = mysql_query($q1); $total_pagesx = mysql_num_rows($result3); $qux_cnt = $total_pagesx; $targetpage = $_SERVER['PHP_SELF']; $limit = 9; $pagem = $_GET['pagem']; if($pagem) $start = ($pagem - 1) * $limit; else $start = 0; /* Get data. */ $sql = "$q1 LIMIT $start, $limit"; $result3 = mysql_query($sql); $qux_cnt = mysql_num_rows($result3); /* Setup page vars for display. */ if ($pagem == 0) $pagem = 1; $prev = $pagem - 1; $next = $pagem + 1; $lastpage = ceil($total_pagesx/$limit); $lpm1 = $lastpage - 1; $pagination = ""; if($lastpage > 1) { $pagination .= "
"; //previous button if ($pagem > 1) $pagination.= " previous"; else $pagination.= " previous"; //pages if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up { for ($counter = 1; $counter <= $lastpage; $counter++) { if ($counter == $pagem) $pagination.= "$counter"; else $pagination.= "$counter"; } } elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some { //close to beginning; only hide later pages if($pagem < 1 + ($adjacents * 2)) { for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) { if ($counter == $pagem) $pagination.= "$counter"; else $pagination.= "$counter"; } $pagination.= "..."; $pagination.= "$lpm1"; $pagination.= "$lastpage"; } //in middle; hide some front and some back elseif($lastpage - ($adjacents * 2) > $pagem && $pagem > ($adjacents * 2)) { $pagination.= "1"; $pagination.= "2"; $pagination.= "..."; for ($counter = $pagem - $adjacents; $counter <= $pagem + $adjacents; $counter++) { if ($counter == $pagem) $pagination.= "$counter"; else $pagination.= "$counter"; } $pagination.= "..."; $pagination.= "$lpm1"; $pagination.= "$lastpage"; } //close to end; only hide early pages else { $pagination.= "1"; $pagination.= "2"; $pagination.= "..."; for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++) { if ($counter == $pagem) $pagination.= "$counter"; else $pagination.= "$counter"; } } } //next button if ($pagem < $counter - 1) $pagination.= "next "; else $pagination.= "next "; $pagination.= "
\n"; } // PAGINATION ENDS if ($qux_cnt > 0){ ?>

Showing - Items...
$pagination"; ?>
0){ $xmcy = 1; while ($cma1_rows = mysql_fetch_array($result3)){ extract($cma1_rows); $actual_amount = ""; $total_xp_price = ""; $zam_dis = ""; if ($item_thumbnail == ""){ $image_path = "$domain_path/images/no_pics.gif"; } else { $image_path = "$domain_path/product_images/$item_thumbnail"; } if ($item_currency == "Rs"){ $item_currency = $item_currency."."; } if ($item_discount == "Y"){ $hsm2 = mysql_query("select discount_value, discount_type, actual_amount, total_amount_after_discount, from_date, to_date from product_discount where product_item_id = '$id' and status = 'Y' limit 1"); $hsm2_rows = mysql_num_rows($hsm2); if ($hsm2_rows > 0){ while ($hsm3 = mysql_fetch_object($hsm2)){ $from_date = $hsm3->from_date; $to_date = $hsm3->to_date; $cd_date = date("Y-m-d H:i:s",time()); if ($from_date <= $cd_date && $to_date >= $cd_date){ $discount_value = $hsm3->discount_value; $discount_type = $hsm3->discount_type; $actual_amount = $hsm3->actual_amount; $item_price = $hsm3->total_amount_after_discount; $total_xp_price = $item_price; } } } } if ($item_tax_rate > "0.00" || $item_tax_rate > "0"){ $item_price_px = $item_price * ($item_tax_rate / 100); $item_tax_final = $item_price + $item_price_px; if ($shipping_freight > "0.00" || $shipping_freight > "0"){ $sh_fr = $item_price * ($shipping_freight / 100); $sh_fr_final = $item_price + $sh_fr; } $total_amt = $item_tax_final + $sh_fr_final; } else if ($shipping_freight > "0" && $item_tax_rate <= "0"){ $sh_fr = $item_price * ($shipping_freight / 100); $total_amt = $item_price + $sh_fr; } else { $total_amt = $item_price; } ?>  "; } if ($xmcy == 3){ echo ""; echo ""; $xmcy = 0; } $xmcy++; } } if ($xmcy < 4){ echo ""; } ?>

Showing - Items...
There are no items added so far."; } ?> 0){ include('custom_form.php'); } ?>