Example #1
0
}
if (isset($_GET['status']) && $_GET['status'] != '') {
    $status = $_GET['status'];
    $sql2 = " AND od_status = '{$status}'";
    $queryString = "&status={$status}";
} else {
    $status = '';
    $sql2 = '';
    $queryString = '';
}
// for paging
// how many rows to show per page
$rowsPerPage = 10;
$sql = "SELECT o.od_id, o.od_shipping_first_name, od_shipping_last_name, od_date, od_status,\r\n               SUM(pd_price * od_qty) + od_shipping_cost AS od_amount\r\n\t    FROM tbl_order o, tbl_order_item oi, tbl_product p \r\n\t\tWHERE oi.pd_id = p.pd_id and o.od_id = oi.od_id {$sql2}\r\n\t\tGROUP BY od_id\r\n\t\tORDER BY od_id DESC";
$result = dbQuery(getPagingQuery($sql, $rowsPerPage));
$pagingLink = getPagingLink($sql, $rowsPerPage, $queryString);
$orderStatus = array('New', 'Paid', 'Shipped', 'Completed', 'Cancelled');
$orderOption = '';
foreach ($orderStatus as $stat) {
    $orderOption .= "<option value=\"{$stat}\"";
    if ($stat == $status) {
        $orderOption .= " selected";
    }
    $orderOption .= ">{$stat}</option>\r\n";
}
?>
 
<p>&nbsp;</p>
<form action="processOrder.php" method="post"  name="frmOrderList" id="frmOrderList">
 <table width="100%" border="0" cellspacing="0" cellpadding="2" class="text">
 <tr align="center"> 
Example #2
0
 function pagination($id)
 {
     return getPagingLink($id, 'pages', 5, '', 'page/index/');
 }
Example #3
0
<?php

if (!defined('WEB_ROOT')) {
    exit;
}
$productsPerRow = 2;
$productsPerPage = 4;
//$productList    = getProductList($catId);
$children = array_merge(array($catId), getChildCategories(NULL, $catId));
$children = ' (' . implode(', ', $children) . ')';
$sql = "SELECT pd_id, pd_name, pd_price, pd_thumbnail, pd_qty, c.cat_id\r\n\t\tFROM tbl_product pd, tbl_category c\r\n\t\tWHERE pd.cat_id = c.cat_id AND pd.cat_id IN {$children} \r\n\t\tORDER BY pd_name";
$result = dbQuery(getPagingQuery($sql, $productsPerPage));
$pagingLink = getPagingLink($sql, $productsPerPage, "c={$catId}");
$numProduct = dbNumRows($result);
// the product images are arranged in a table. to make sure
// each image gets equal space set the cell width here
$columnWidth = (int) (100 / $productsPerRow);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="20">
<?php 
if ($numProduct > 0) {
    $i = 0;
    while ($row = dbFetchAssoc($result)) {
        extract($row);
        if ($pd_thumbnail) {
            $pd_thumbnail = WEB_ROOT . 'images/product/' . $pd_thumbnail;
        } else {
            $pd_thumbnail = WEB_ROOT . 'images/no-image-small.png';
        }
        if ($i % $productsPerRow == 0) {
            echo '<tr>';
Example #4
0
<?php

if (!defined('WEB_ROOT')) {
    exit;
}
// for paging
// how many rows to show per page
$rowsPerPage = 100;
$sql = "SELECT topics.topic_id as tid, topics.name as tname,courses.name as cname,courses.course_id as cid FROM topics left join courses_topics on topics.topic_id=courses_topics.topic_id left join courses on courses.course_id=courses_topics.course_id ORDER BY topics.topic_id";
$result = dbQuery(getPagingQuery($sql, $rowsPerPage));
$pagingLink = getPagingLink($sql, $rowsPerPage, '');
?>
 
<p>&nbsp;</p>
<form action="processTopics.php?action=addTopic" method="post"  name="frmListTopic" id="frmListTopic">
 <table width="100%" border="0" cellspacing="0" cellpadding="2" class="text">
 </table>
<br>
 <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="text">
  <tr align="center" id="listTableHeader"> 
   <td>Topic Name</td>
<!--   <td width="75">Thumbnail</td>-->
   <td width="275">Courses</td>
  </tr>
  <?php 
$parentId = 0;
if (dbNumRows($result) > 0) {
    $i = 0;
    while ($row = dbFetchAssoc($result)) {
        extract($row);
        if ($i % 2) {
 function pagination($id)
 {
     return getPagingLink($id, 'admin', 5, '', 'admins/index/');
 }