Beispiel #1
0
<?php

if (file_exists("../lib/glob.php")) {
    include_once '../lib/glob.php';
    include_once '../lib/lib.php';
} else {
    include_once 'lib/glob.php';
    include_once 'lib/lib.php';
}
$query = "SELECT PUB_DATE,ID, PROD_NAME, imgLink, QTY_HND, RETAIL, UPC\n\t\tFROM bz_bookstore\n\t\tWHERE PUB_DATE <= NOW()\n\t\tORDER BY PUB_DATE DESC \n\t\tLIMIT 24\n\t\t";
$result = mysql_query($query);
$bookArr = array();
$i = 0;
while ($row = mysql_fetch_assoc($result)) {
    $bookArr[$i]["PUB_DATE"] = $row["PUB_DATE"];
    $bookArr[$i]["ID"] = $row["ID"];
    $bookArr[$i]["PROD_NAME"] = $row["PROD_NAME"];
    $bookArr[$i]["imgLink"] = $row["imgLink"];
    $bookArr[$i]["QTY_HND"] = $row["QTY_HND"];
    $bookArr[$i]["RETAIL"] = $row["RETAIL"];
    $bookArr[$i]["UPC"] = $row["UPC"];
    $i++;
}
for ($i = 0; $i < count($bookArr); $i++) {
    lib_book_display($bookArr[$i]["ID"], $bookArr[$i]["PROD_NAME"], $bookArr[$i]["imgLink"], $bookArr[$i]["QTY_HND"], $bookArr[$i]["RETAIL"], $bookArr[$i]["UPC"], $xStatus->status);
}
 public function displayGRIDPage()
 {
     if ($this->itemNum == 0) {
         echo "<h3>對不起, 沒有結果! 暫時沒有這樣的書.</h3>";
     } else {
         $lowerBound = ($this->curPage - 1) * $this->itemDisplayPerPage;
         $upperBound = $this->curPage * $this->itemDisplayPerPage <= $this->itemNum ? $this->curPage * $this->itemDisplayPerPage : $this->itemNum;
         for ($i = $lowerBound; $i < $upperBound; $i++) {
             lib_book_display($this->itemArr[$i]["ID"], $this->itemArr[$i]["PROD_NAME"], $this->itemArr[$i]["imgLink"], $this->itemArr[$i]["QTY_HND"], $this->itemArr[$i]["RETAIL"], $this->itemArr[$i]["UPC"], $this->xStatus->status);
         }
     }
 }