ausghostdog

Untitled

May 16th, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.30 KB | None | 0 0
  1. <?php
  2. if(!isset($_SESSION))
  3. {
  4. session_start();
  5. }
  6.  
  7.  
  8. ?>
  9. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  10. <!--
  11. Supremacy4T by 4Templates | http://www.4templates.com/free/ | @4templates
  12. Licensed under the Creative Commons Attribution 3.0 License
  13. -->
  14. <html xmlns="http://www.w3.org/1999/xhtml">
  15. <head>
  16. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  17. <title>Home</title>
  18.  
  19. <link href="http://fonts.googleapis.com/css?family=Abel" rel="stylesheet" type="text/css" />
  20. <link href="../styles/default.css" rel="stylesheet" type="text/css" media="all" />
  21. </head>
  22. <body>
  23. <div id="wrapper">
  24. <div id="wrapper-bgtop">
  25. <div id="wrapper-bgbtm">
  26. <div id="header">
  27. <div id="logo">
  28. <h1><a href="#">Barzzar Ceramics</a></h1>
  29. <p>Contempary desings, old school service</p>
  30. </div>
  31. <div id="search">
  32.  
  33. </div>
  34. </div>
  35. <div id="menu">
  36.  
  37. <?php
  38. if (!isset($_SESSION['logged']) && !isset($_SESSION['logged_admin']))
  39. echo "
  40. <ul>
  41.  
  42. <li class='active'><a href='../index.php' accesskey='1' title='Index'><span>Home</span></a></li>
  43. <li><a href='login.php' accesskey='2' title=''><span>Login</span></a></li>
  44. <li><a href='register.php' accesskey='3' title=''><span>register</span></a></li>
  45. <li><a href='catalogue.php' accesskey='4' title=''><span>catalogue</span></a></li>
  46. </ul>";
  47. elseif (isset($_SESSION['logged']) ||isset($_SESSION['logged_admin']))
  48. echo "
  49. <ul>
  50. <li><a href='../index.php' accesskey='1' title='Index'><span>Home</span></a></li>
  51. <li><a href='catalogue.php' accesskey='4' title=''><span>catalogue</span></a></li>
  52. <li><a href='#' accesskey='3' title=''><span>cart</span></a></li>
  53. <li><a href='changepassword.php' accesskey='4' title=''><span>change password</span></a></li>
  54. <li><a href='#' accesskey='4' title=''><span>View orders</span></a></li>
  55. <li><a href='logout.php' accesskey='4' title=''><span>logout</span></a></li>
  56. </ul>"
  57. ?>
  58.  
  59. <!-- close of changed nav-->
  60. <!-- not logged session nav working to this point -->
  61. </ul>
  62. </div>
  63.  
  64.  
  65. <div id="page">
  66. <div id="content">
  67. <div class="post">
  68.  
  69. <div class="entry">
  70. <p class="img-margin">&nbsp;</p>
  71.  
  72. <?php
  73.  
  74. if (!empty($error_message))
  75. {
  76. echo '<p style = "color:red">' .$error_message . '</p>';
  77. }
  78.  
  79. require_once "../database/dbconn.php";
  80.  
  81. $session_id = session_id();
  82.  
  83. $customer_id = 1;
  84.  
  85. $_SESSION['custid'] = $customer_id;
  86.  
  87. {
  88. $query = " SELECT * FROM tblproducts";
  89.  
  90. $result = mysql_query($query) or die(mysql_error());
  91.  
  92. while ($rows = mysql_fetch_assoc($result)){
  93.  
  94. {
  95.  
  96. ?>
  97. <form method="post" action="processcart.php">
  98. <table>
  99. <tr>
  100. <td>Product code</td>
  101. <td><?php echo $rows['Product_code'];?></td>
  102. </tr>
  103.  
  104. <tr>
  105. <td>product name</td>
  106. <td><?php echo $rows['Product_name'];?></td>
  107. </tr>
  108.  
  109. <tr>
  110. <td>Product description</td>
  111. <td><?php echo $rows['Product_descroption'];?></td>
  112. </tr>
  113.  
  114. <tr>
  115. <td>Product size</td>
  116. <td><?php echo $rows['Product_size'];?></td>
  117. </tr>
  118.  
  119. <tr>
  120. <td>Product price</td>
  121. <td><?php echo $rows['Product_price'];?></td>
  122. </tr>
  123.  
  124. <input type="hidden" name="product_id" value="<?php echo $rows['product_id']; ?>" />
  125. <input type="hidden" name="price" value="<?php echo $rows['price']; ?>" />
  126. <input type="hidden" name="product_name" value="<?php echo $rows['product_name']; ?>" />
  127. <td><input type="test" name="qtyordered" /></td>
  128.  
  129. <td><input type="submit" value="Add to cart" /></td>
  130.  
  131. </tr>
  132. </table>
  133. </form>
  134. <?php
  135. }
  136.  
  137. $_SESSION['cart'] = true;
  138.  
  139. if (isset($_SESSION['cart']))
  140. {
  141. echo '<a href="shopcart.php">View Shopping cart</A>';
  142. }
  143.  
  144. }
  145. ?>
  146.  
  147.  
  148.  
  149.  
  150. <?php
  151.  
  152. }
  153.  
  154.  
  155.  
  156. ?>
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. <div id="footer" class="container">
  171. <p>&copy; Your Website Name&nbsp;&nbsp;|&nbsp;&nbsp;Supremacy4T by <a href="http://www.4templates.com/free/">4Templates</a>&nbsp;&nbsp;|&nbsp;&nbsp;Photos by <a href="http://fotogrph.com/">Fotogrph</a></p>
  172. </div>
  173. </body>
  174. </html>
Advertisement
Add Comment
Please, Sign In to add comment