Don't like ads? PRO users don't see any ads ;-)

Untitled

By: ausghostdog on Jun 1st, 2012  |  syntax: None  |  size: 5.06 KB  |  hits: 41  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. require_once "../database/dbconn.php";
  3. require_once "../includes/functions.php";
  4. $condb = connect();
  5. if (isset($_SESSION['loggedstaff']) || !isset($_SESSION['logged']));
  6.  
  7. {
  8.         session_start();
  9. }
  10.  
  11. ?>
  12.  
  13. <title>catalogue</title>
  14.  
  15. <link href="http://fonts.googleapis.com/css?family=Abel" rel="stylesheet" type="text/css" />
  16. <link href="../styles/default.css" rel="stylesheet" type="text/css" media="all" />
  17. </head>
  18. <body>
  19. <div id="wrapper">
  20.         <div id="wrapper-bgtop">
  21.                 <div id="wrapper-bgbtm">
  22.                         <div id="header">
  23.                                 <div id="logo">
  24.                                         <h1><a href="../index.php">Barzzar Ceramics</a></h1>
  25.                                         <p>Contempary desings, old school service</p>
  26.                                 </div>
  27.                                 <div id="search">
  28.                                        
  29.                                 </div>
  30.                         </div>
  31.                         <div id="menu">
  32.            
  33.                                                 <?php
  34.                                 if (!isset($_SESSION['logged']))
  35.                                         echo "
  36.                                                 <ul>
  37.                                                         <li class='active'><a href='../index.php' accesskey='1' title='Index'><span>Home</span></a></li>
  38.                                                         <li><a href='login.php' accesskey='2' title=''><span>Login</span></a></li>
  39.                                                         <li><a href='register.php' accesskey='3' title=''><span>register</span></a></li>
  40.                                                         <li><a href='catalogue.php' accesskey='4' title=''><span>catalogue</span></a></li>
  41.                                                         <li><a href='search.php' accesskey='4' title=''><span>search</span></a></li>
  42.                                                 </ul>";
  43.                                 else if (isset($_SESSION['logged']))
  44.                                         echo "
  45.                                                 <ul>
  46.                                                         <li><a href='../index.php' accesskey='1' title='Index'><span>Home</span></a></li>
  47.                                                         <li><a href='catalogue.php' accesskey='4' title=''><span>catalogue</span></a></li>
  48.                                                         <li><a href='../shoppingcart/shopcart.php' accesskey='3' title=''><span>cart</span></a></li>
  49.                                                         <li><a href='changepassword.php' accesskey='4' title=''><span>change password</span></a></li>
  50.                                                         <li><a href='orderdetails.php' accesskey='4' title=''><span>View orders</span></a></li>
  51.                                                         <li><a href='search.php' accesskey='4' title=''><span>search</span></a></li>
  52.                                                         <li><a href='logout.php' accesskey='4' title=''><span>logout</span></a></li>
  53.                                                 </ul>";
  54.                                 else if (isset($_SESSION['loggedstaff']))
  55.                                         echo "
  56.                                                 <ul>
  57.                                                         <li><a href='../admin/adminindex.php' accesskey='1' title='Index'><span>Home</span></a></li>
  58.                                                         <li><a href='catalogue.php' accesskey='4' title=''><span>catalogue</span></a></li>
  59.                                                         <li><a href='../admin/adminnewproduct.php' accesskey='3' title=''><span>new product</span></a></li>
  60.                                                         <li><a href='../admin/changeproduct.php' accesskey='3' title=''><span>update product</span></a></li>
  61.                                                         <li><a href='../admin/adminchangepassword.php' accesskey='4' title=''><span>change password</span></a></li>
  62.                                                         <li><a href='logout.php' accesskey='4' title=''><span>logout</span></a></li>
  63.                                                 </ul>"
  64.                                
  65.                                 ?>
  66.                                
  67.                 <!-- close of changed nav-->
  68.                 <!-- not logged session nav working to this point -->
  69.                                 </ul>
  70.                         </div>
  71.            
  72.                        
  73.                         <div id="page">
  74.                                 <div id="content">
  75.                                         <div class="post">
  76.                                                
  77.                                           <div class="entry">
  78.                                                         <p class="img-margin">&nbsp;</p>
  79.  
  80. <?php
  81.  
  82. if(!empty($error_message))
  83. {
  84.         echo '<p style="color:red">'. $error_message. '</p>';
  85. }
  86.  
  87.  
  88.  
  89. ?>
  90. <?php
  91.  
  92. if (isset($_SESSION['logged']))
  93.  
  94. $customer_id = $_SESSION['UserID'];
  95. ?>
  96. <?php
  97.  
  98.  
  99.  
  100.  
  101.         {
  102.                 $query = " SELECT * FROM tblproducts";
  103.  
  104. $result = mysqli_query($condb, $query) or die(mysqli_error());
  105.  
  106. while ($rows = mysqli_fetch_assoc($result)){
  107.  
  108. {
  109.        
  110.         ?>
  111.         <form method="post" action="../shoppingcart/processcart.php">
  112.     <table>
  113.     <tr>
  114.     <td>Product code</td>
  115.     <td><?php echo $rows['Product_code'];?></td>
  116.     </tr>
  117.    
  118.     <tr>
  119.     <td>product name</td>
  120.     <td><?php echo $rows['Product_name'];?></td>
  121.     </tr>
  122.    
  123.     <tr>
  124.     <td>Product description</td>
  125.     <td><?php echo $rows['Product_descroption'];?></td>
  126.     </tr>
  127.    
  128.     <tr>
  129.     <td>Product size</td>
  130.     <td><?php echo $rows['Product_size'];?></td>
  131.     </tr>
  132.    
  133.     <tr>
  134.     <td>Product price</td>
  135.     <td><?php echo $rows['Product_price'];?></td>
  136.     </tr>
  137.    
  138.     <tr>
  139.     <td>product image</td>
  140.     <td><img src="<?php echo IMAGEFOLDER.$rows['product_image']?>" height="100px" width="100px" /></td>
  141.     </tr>
  142.    
  143.     <input type="hidden" name="Product_code" value="<?php echo $rows['Product_code']; ?>" />
  144.         <input type="hidden" name="Product_price" value="<?php echo $rows['Product_price']; ?>" />
  145.     <input type="hidden" name="Product_name" value="<?php echo $rows['Product_name']; ?>" />
  146.     <?php if (isset($_SESSION['logged'])) echo"<td><input type='test' name='qtyordered' /></td>";?>
  147.    
  148.        
  149.  
  150.    <?php if (isset($_SESSION['logged'])) echo "<td><input type='submit' value='Add to cart'></td>";?>
  151.    
  152.  
  153.        
  154.         </table>
  155.         </form>
  156.         <?php
  157. }
  158.  
  159. $_SESSION['cart'] = true;
  160. if (isset($_SESSION['logged']))
  161. if (isset($_SESSION['cart']))
  162. {
  163.         echo '<a href="shopcart.php">View Shopping cart</a>';
  164. }
  165.  
  166. }
  167. ?>
  168.  
  169.  
  170.  
  171.  
  172.  <?php
  173.  
  174.         }
  175.  
  176.        
  177.  
  178. ?>
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.                                                 </div>
  186.                                         </div>
  187.                                 </div>
  188.                         </div>
  189.                 </div>
  190.         </div>
  191. </div>
  192. <div id="footer" class="container">
  193.         <p>&copy; admin login <a href="../admin/adminlogon.php">here</a></p>
  194. </div>
  195. </body>
  196. </html>