amin007

troli - index.php

Mar 4th, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.72 KB | None | 0 0
  1. <?php
  2. // Include MySQL class
  3. require_once('inc/mysql.class.php');
  4. // Include database connection
  5. require_once('inc/global.inc.php');
  6. // Include functions
  7. require_once('inc/functions.inc.php');
  8. // Start the session
  9. session_start();
  10. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  11.    
  12. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  13. <head>
  14.     <title>Senarai Kek</title>
  15.     <link rel="stylesheet" href="css/styles.css" />
  16. </head>
  17.  
  18. <body>
  19.  
  20. <div id="shoppingcart">
  21.  
  22. <h1>Senarai Pesanan Anda | <a href="../logout.php">Keluar...</a></h1>
  23.  
  24. <?php
  25. echo writeShoppingCart();
  26. ?>
  27.  
  28. </div>
  29.  
  30. <div  id="booklist">
  31.  
  32. <h1>Senarai Kek Dalam Kedai Kami</h1>
  33.  
  34. <?php
  35. $myTable='senaraikek';
  36. $myJoin='hargakek';
  37. $medan='T.idkek, namakek, kategori, T.catatan,oum,saiz,harga';
  38.  
  39. $sql='
  40.     SELECT ' . $medan . ' FROM
  41.     ' . $myTable . ' T RIGHT JOIN ' . $myJoin . ' J
  42.     ON T.idkek = J.idkek ';
  43.  
  44. $result = $db->query($sql);
  45.  
  46. $output[] = '<table>' . "\r";
  47.  
  48. while ($row = $result->fetch())
  49. {
  50.     $output[] = '<tr><td>' . "\r" .
  51.         '<img src="../images/' . $row['kategori'] . '/' .  $row['idkek'] . '.jpg" ' .
  52.         'alt="' . $row['namakek'] . '" width="100" height="100">' .
  53.         '</td><td><ul>' . "\r" .
  54.         '<li>' . $row['idkek'] . '=' . $row['namakek'] . '</li>' . "\r" .
  55.         '<li>'.$row['catatan'].'</li>' . "\r" .
  56.         '<li> 1 ' . $row['oum'] . ' ' . $row['saiz'] . '=RM ' . $row['harga'] . '</li>' .  "\r" .
  57.         '<li><a href="cart.php?action=add&idkek=' . $row['idkek'] . '|' .
  58.         $row['saiz'] . '">Tambah Dalam Bakul</a></li>' . "\r" .
  59.         '</ul>' . "\r" .
  60.         '</td></tr>' . "\r";
  61. }
  62.  
  63. $output[] = '</table>' . "\r";
  64.  
  65. echo join('',$output);
  66. ?>
  67.  
  68. </div>
  69.  
  70. </body>
  71. </html>
Advertisement
Add Comment
Please, Sign In to add comment