Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shopping cart page
- <?php
- session_start();
- include("cart/db.php");
- include("cart/functions.php");
- include('config.php');
- $email=$_SESSION['email'];
- $uid=$_SESSION['id'];
- echo $size=$_REQUEST['size'];
- $id=$_REQUEST['id'];
- if($_REQUEST['command']=='delete' && $_REQUEST['id']>0){
- remove_product($_REQUEST['id']);
- }
- else if($_REQUEST['command']=='clear'){
- unset($_SESSION['cart']);
- }
- else if($_REQUEST['command']=='update'){
- $max=count($_SESSION['cart']);
- for($i=0;$i<$max;$i++){
- $id=$_SESSION['cart'][$i]['id'];
- $q=intval($_REQUEST['qty'.$id]);
- if($q>0 && $q<=999){
- $_SESSION['cart'][$i]['qty']=$q;
- }
- else{
- $msg='Some proudcts not updated!, quantity must be a number between 1 and 999';
- }
- }
- }
- if(isset($_REQUEST['order']))
- {
- $email=$_SESSION['email'];
- $uid=$_SESSION['id'];
- $size=$_POST['size'];
- $total=$_POST['total'];
- $length = count($_POST['product']);
- for($i=0; $i<$length; $i++) {
- $queryproduct=mysql_query("INSERT INTO shoppingcart VALUES ('','','".$_POST['ids'][$i]."','$uid','$email','".$_POST['itemcode'][$i]."','".$_POST['product'][$i]."','".$_POST['image'][$i]."','".$_POST['price'][$i]."','$size','".$_POST['qty'][$i]."','".$_POST['amt'][$i]."','$total')") or die("Order Query Problem");
- }
- }
- if($queryproduct)
- {
- header('Location:login.php');
- }
- else
- {
- //header('Location:shoppingcart.php');
- }
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml"><head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />
- <title>EDGE.PK</title>
- <script language="javascript">
- function del(id){
- if(confirm('Do you really mean to delete this item')){
- document.form1.id.value=id;
- document.form1.command.value='delete';
- document.form1.submit();
- }
- }
- function clear_cart(){
- if(confirm('This will empty your shopping cart, continue?')){
- document.form1.command.value='clear';
- document.form1.submit();
- }
- }
- function update_cart(){
- document.form1.command.value='update';
- document.form1.submit();
- }
- </script>
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
- <script type="text/javascript" src="topslider/lib/jquery.jcarousel.min.js"></script>
- <link rel="stylesheet" type="text/css" href="topslider/css/skin.css" />
- <link rel="stylesheet" type="text/css" href="topslider/css/product-slider-skin.css" />
- <script type="text/javascript">
- function redirectWithValues() {
- var sStr2 = "search.php?color="+ encodeURI(document.color1.color.value);
- window.location.href = sStr2;
- return false;
- }
- </script>
- <style>
- .button1{
- background-color:#000;
- color:#FFF;
- width: 150px;
- height: 35px;
- padding: 9px 10px 10px 0px;
- margin-left: -12px;
- font-family:Arial,Helvetica,sans-serif;
- font-size:12px;
- }
- .button2{
- background-color:#000;
- color:#FFF;
- width: 96px;
- height: 35px;
- padding: 9px 6px 10px 0px;
- margin-left: -12px;
- font-family:Arial,Helvetica,sans-serif;
- font-size:12px;
- }
- .button3{
- background-color:#000;
- color:#FFF;
- width: 111px;
- height: 35px;
- padding: 9px 10px 10px 0px;
- margin-left: -12px;
- font-family:Arial,Helvetica,sans-serif;
- font-size:12px;
- }
- .button4{
- background-color:#000;
- color:#FFF;
- width: 100px;
- height: 35px;
- padding: 9px 1px 10px 0px;
- margin-left: -12px;
- font-family:Arial,Helvetica,sans-serif;
- font-size:12px;
- }
- .button5{
- background-color:#000;
- color:#FFF;
- width: 100px;
- height: 35px;
- padding: 9px 1px 10px 0px;
- margin-left: -12px;
- font-family:Arial,Helvetica,sans-serif;
- font-size:12px;
- }
- </style>
- <!-- CSS =====================================================================================-->
- <link href='http://fonts.googleapis.com/css?family=Telex' rel='stylesheet' type='text/css' />
- <link rel="stylesheet" type="text/css" href="products2/css/styles.css" media="all" />
- <link rel="stylesheet" type="text/css" href="products2/css/skin.css" media="all" />
- <link rel="stylesheet" type="text/css" href="products2/css/cloud-zoom.css" media="all" />
- <link rel="stylesheet" type="text/css" href="products2/css/light_box.css" media="all" />
- <link rel="stylesheet" type="text/css" href="products2/css/mix.css" media="all" />
- <link rel="stylesheet" type="text/css" href="products2/css/banner.css" media="all" />
- <link rel="stylesheet" type="text/css" href="products2/css/magicat.css" media="all" />
- <script type="text/javascript" src="products2/js/jquery.mix.js"></script>
- <link rel="stylesheet" href="products/css/main-stylesheet.css" type="text/css" />
- <!-- Scripts =====================================================================================-->
- <link rel="stylesheet" type="text/css" href="tipuesearch/example.css">
- <link rel="stylesheet" type="text/css" href="tipuesearch/tipuesearch.css">
- <div id="fb-root"></div>
- <script>(function(d, s, id) {
- var js, fjs = d.getElementsByTagName(s)[0];
- if (d.getElementById(id)) return;
- js = d.createElement(s); js.id = id;
- js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=261350910648005";
- fjs.parentNode.insertBefore(js, fjs);
- }(document, 'script', 'facebook-jssdk'));</script>
- <link href="css/style.css" rel="stylesheet" type="text/css" />
- <link href="css/nav-menus.css" rel="stylesheet" type="text/css" />
- <link href="css/jqtransform.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="js/stuHover.js"></script>
- <script type="text/javascript" src="js/jquery.flow.1.2.auto.js"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- $("#myController").jFlow({
- slides: "#slides",
- controller: ".jFlowControl", // must be class, use . sign
- slideWrapper : "#jFlowSlide", // must be id, use # sign
- selectedWrapper: "jFlowSelected", // just pure text, no sign
- auto: true, //auto change slide, default true
- width: "575px",
- height: "530px",
- duration: 600,
- prev: ".jFlowPrev", // must be class, use . sign
- next: ".jFlowNext" // must be class, use . sign
- });
- });
- </script>
- <STYLE TYPE="text/css">
- <!--
- #dek {POSITION:absolute;VISIBILITY:hidden;Z-INDEX:200;}
- //-->
- </STYLE>
- <style>
- body {overflow-x:hidden;}
- #tabMenu {margin:0;padding:0 0 0 15px;list-style:none;}
- #tabMenu li {float:left;height:39px;;width:39px;cursor:pointer;cursor:hand;margin-top:16px;background-color: black;margin-left: -14px;}
- li.posts {background:url(images/home.png) no-repeat 0 -32px;}
- li.mouseover {background-position:0 0;}
- li.mouseout {background-position:0 -32px;}
- li.selected {background-position:0 0;}
- .box {width:545px}
- *html .boxTop {margin-bottom:-2px;}
- .boxBody {background-color:#282828;}
- .boxBody div {display:none;}
- .boxBody div.show {display:block;}
- .boxBody #category a {display:block;}
- *html .boxBody div ul {margin-left:10px;padding-left:15px;}
- .boxBody div li {border-bottom:1px dotted #8e8e8e; padding:4px 0;cursor:hand;cursor:pointer;}
- .boxBody div ul li.last {border-bottom:none}
- .boxBody div li span {font-size:8px;font-style:italic; color:#888;}
- #three_columns .content.clearfix .main_content div table tr td {
- font-family: Verdana, Geneva, sans-serif;
- }
- </style>
- </head>
- <body>
- <div class="wrap" id="three_columns" style="height:250px !important">
- <?php include('top-header.php');?>
- <?php include('menu.php'); ?>
- <div style="width:50px;"><img src="images/signup.png" style="margin-left:1px; margin-top:-19px;" />
- <div style="margin-left: 460px; margin-top: -36px;"> <div class="box newsletter_box">
- <form action="01-Red-01-Home-Page.html">
- <input name="email" type="text" tabindex="1" onblur="if (this.value==''){this.value='E-mail Address'};" onfocus="if(this.value=='E-mail Address'){this.value=''};" value="E-mail Address" style="margin-top: 5px;" />
- <div align="right">
- <input name="subscribe" type="submit" value="Subscribe" class="button" />
- </div>
- </form>
- </div></div></div>
- <div class="content clearfix">
- <?php include('left_column.php'); ?>
- <form name="form1" method="post">
- <input type="hidden" name="id" />
- <input type="hidden" name="command" />
- <div class="main_content">
- <div align="center">
- <table style="background-color:#F0F0F0; border:solid 1px; width:800px;">
- <?php
- if(is_array($_SESSION['cart'])){
- echo '<tr bgcolor="#FFFFFF" style="font-weight:bold"><td align="center"><font style="font-family:Arial,Helvetica,sans-serif; font-size:14px; color:#000;">Product Name</font></td>
- <td align="center"><font style="font-family:Arial,Helvetica,sans-serif; font-size:14px; color:#000;">Product Image</font></td>
- <td><font style="font-family:Arial,Helvetica,sans-serif; font-size:14px; color:#000;">Price</font></td>
- <td><div style="margin-left:27px;"><font style="font-family:Arial,Helvetica,sans-serif; font-size:14px; color:#000;">Size</font></div></td>
- <td><font style="font-family:Arial,Helvetica,sans-serif; font-size:14px; color:#000;">Amount</font></td>
- <td><font style="font-family:Arial,Helvetica,sans-serif; font-size:14px; color:#000;">Options</font></td></tr>';
- $max=count($_SESSION['cart']);
- for($i=0;$i<$max;$i++){
- $id=$_SESSION['cart'][$i]['id'];
- $products=$_SESSION['cart'][$i]['product'];
- $q=$_SESSION['cart'][$i]['qty'];
- $product=get_product_name($id);
- $image=get_product_image($id);
- $ids=get_id($id);
- $itemcode=get_itemcode($id);
- if($q==0) continue;
- ?>
- <tr bgcolor="#FFFFFF"><td align="center"><font style="font-family:Arial,Helvetica,sans-serif; font-size:15px; color:#000;"><input type="hidden" name="itemcode[]" value="<?php echo $itemcode?>" /><input type="hidden" name="ids[]" value="<?php echo $ids?>" /><input type="hidden" name="product[]" value="<?php echo $product?>" /><?php echo $product?></font></td><td align="center"><input type="hidden" name="image[]" id="image" value="<?php echo $image?>" /><img name="image" id="image" src="admin/uploads/small0_<?php echo $image?>" width="150" height="150"></td>
- <td><font style="font-family:Arial,Helvetica,sans-serif; font-size:15px; color:#000;"><input type="hidden" name="price[]" id="price" value="<?php echo get_price($id)?>" />Rs.<?php echo get_price($id)?></font></td>
- <td><?php //echo $size ?><input type="hidden" name="size" value="<?php //echo $size?>" /></td>
- <td><font style="font-family:Arial,Helvetica,sans-serif; font-size:15px; color:#000;"><input type="hidden" name="amt[]" value="<?php echo get_price($id)*$q?>"/> Rs.<?php echo get_price($id)*$q?></font></td>
- <td><font style="font-family:Arial,Helvetica,sans-serif; font-size:15px; color:#000;"><a href="javascript:del(<?php echo $id?>)"><input type="button" class="button5" value="Remove" /></a></font></td></tr>
- <?php
- }
- ?>
- <tr><td colspan="6" align="right"><b><font style="font-family:Arial,Helvetica,sans-serif; font-size:15px; color:#000;"><input type="hidden" name="total" id="total" value="<?php echo get_order_total()?>" />Order Total: Rs.<?php echo get_order_total()?></font></b></td></tr>
- <tr><td colspan="6" align="right"><font style="font-family:Arial,Helvetica,sans-serif; font-size:14px; color:#000; !important">Cash On Delivery & Free Shipping</font></td></tr>
- <tr><td colspan="6" align="right"><?php $query1=mysql_query("SELECT * FROM category ORDER BY id ") or die ('Product Query Problem');
- $row4=mysql_fetch_array($query1);$ids=$row4['id'];$cat_name=$row4['categories'];?><input type="button" class="button1" value="Continue Shopping" onclick="window.location='product.php'" /><input type="button" class="button2" value="Clear Cart" onclick="clear_cart()"><input type="button" class="button3" value="Update Cart" onclick="update_cart()"><input type="submit" class="button4" name="order" id="order" value="Place Order"></td></tr>
- <?php
- }
- else{
- echo "<tr bgColor='#FFFFFF'><td><font style='font-family:Arial,Helvetica,sans-serif; font-size:15px; color:#000;'>There are no items in your shopping cart!</font></td>";
- }
- ?>
- </table>
- </div>
- </div></form>
- </div>
- <div id="wrap">
- <div id="products" class="jcarousel-skin-tango">
- <div class="jcarousel-clip">
- <?php
- $directory= "data/uploads/topslider/";
- echo '<ul class="jcarousel-list">';
- foreach(glob($directory . '*') as $filename) {
- echo '<li class="jcarousel-item"><img src="'.$filename.'" width="150" height="150" alt="" /></li>';
- }
- echo '</ul>';
- ?>
- </div>
- <div disabled="disabled" class="jcarousel-prev jcarousel-prev-disabled"></div>
- <div class="message"><div class="text">EDGE.PK<br/><span style="font-size:19px;letter-spacing: -1px; ">Top
- Products</span><br/><span style="font-size:10px;letter-spacing: 4px; ">.............</span></div></div>
- <div class="jcarousel-next"></div>
- </div>
- </div>
- <?php include('footer.php'); ?>
- </div>
- <script type="text/javascript">
- jQuery(document).ready(function() {
- jQuery('#products').jcarousel({
- start: 1
- });
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement