Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(!isset($_SESSION))
- {
- session_start();
- }
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <!--
- Supremacy4T by 4Templates | http://www.4templates.com/free/ | @4templates
- Licensed under the Creative Commons Attribution 3.0 License
- -->
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Home</title>
- <link href="http://fonts.googleapis.com/css?family=Abel" rel="stylesheet" type="text/css" />
- <link href="../styles/default.css" rel="stylesheet" type="text/css" media="all" />
- </head>
- <body>
- <div id="wrapper">
- <div id="wrapper-bgtop">
- <div id="wrapper-bgbtm">
- <div id="header">
- <div id="logo">
- <h1><a href="#">Barzzar Ceramics</a></h1>
- <p>Contempary desings, old school service</p>
- </div>
- <div id="search">
- </div>
- </div>
- <div id="menu">
- <?php
- if (!isset($_SESSION['logged']) && !isset($_SESSION['logged_admin']))
- echo "
- <ul>
- <li class='active'><a href='../index.php' accesskey='1' title='Index'><span>Home</span></a></li>
- <li><a href='login.php' accesskey='2' title=''><span>Login</span></a></li>
- <li><a href='register.php' accesskey='3' title=''><span>register</span></a></li>
- <li><a href='catalogue.php' accesskey='4' title=''><span>catalogue</span></a></li>
- </ul>";
- elseif (isset($_SESSION['logged']) ||isset($_SESSION['logged_admin']))
- echo "
- <ul>
- <li><a href='../index.php' accesskey='1' title='Index'><span>Home</span></a></li>
- <li><a href='catalogue.php' accesskey='4' title=''><span>catalogue</span></a></li>
- <li><a href='#' accesskey='3' title=''><span>cart</span></a></li>
- <li><a href='changepassword.php' accesskey='4' title=''><span>change password</span></a></li>
- <li><a href='#' accesskey='4' title=''><span>View orders</span></a></li>
- <li><a href='logout.php' accesskey='4' title=''><span>logout</span></a></li>
- </ul>"
- ?>
- <!-- close of changed nav-->
- <!-- not logged session nav working to this point -->
- </ul>
- </div>
- <div id="page">
- <div id="content">
- <div class="post">
- <div class="entry">
- <p class="img-margin"> </p>
- <?php
- if (!empty($error_message))
- {
- echo '<p style = "color:red">' .$error_message . '</p>';
- }
- require_once "../database/dbconn.php";
- $session_id = session_id();
- $customer_id = 1;
- $_SESSION['custid'] = $customer_id;
- {
- $query = " SELECT * FROM tblproducts";
- $result = mysql_query($query) or die(mysql_error());
- while ($rows = mysql_fetch_assoc($result)){
- {
- ?>
- <form method="post" action="processcart.php">
- <table>
- <tr>
- <td>Product code</td>
- <td><?php echo $rows['Product_code'];?></td>
- </tr>
- <tr>
- <td>product name</td>
- <td><?php echo $rows['Product_name'];?></td>
- </tr>
- <tr>
- <td>Product description</td>
- <td><?php echo $rows['Product_descroption'];?></td>
- </tr>
- <tr>
- <td>Product size</td>
- <td><?php echo $rows['Product_size'];?></td>
- </tr>
- <tr>
- <td>Product price</td>
- <td><?php echo $rows['Product_price'];?></td>
- </tr>
- <input type="hidden" name="product_id" value="<?php echo $rows['product_id']; ?>" />
- <input type="hidden" name="price" value="<?php echo $rows['price']; ?>" />
- <input type="hidden" name="product_name" value="<?php echo $rows['product_name']; ?>" />
- <td><input type="test" name="qtyordered" /></td>
- <td><input type="submit" value="Add to cart" /></td>
- </tr>
- </table>
- </form>
- <?php
- }
- $_SESSION['cart'] = true;
- if (isset($_SESSION['cart']))
- {
- echo '<a href="shopcart.php">View Shopping cart</A>';
- }
- }
- ?>
- <?php
- }
- ?>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div id="footer" class="container">
- <p>© Your Website Name | Supremacy4T by <a href="http://www.4templates.com/free/">4Templates</a> | Photos by <a href="http://fotogrph.com/">Fotogrph</a></p>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment