Beispiel #1
0
</td>
<td>There are no shipping rate</td>
</tr>
<tr><td><br /></td></tr>
<tr>
<td><b>Delivery detail :</b></td>
<td>within 3 to 4 days</td>
</tr>
<tr><td><br /></td></tr>
<tr>
<td><b>total amount :</b></td>
<td>$<?php 
    echo get_order_total();
    ?>
&nbsp;&nbsp;&nbsp;&nbsp;(<?php 
    echo get_order_total() * 52;
    ?>
 in Rs.)</td>
</tr>
<tr><td><br /></td></tr>
<tr>
<td><b>Confirm your order :</b></td>
<td><input type="button" value="Confirm"  class="button" onclick="window.location='process.php?msg=confirm'"/></td>
<td><input type="button" value="Cancel"  class="button" onclick="window.location='index.php'"/></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<?php 
Beispiel #2
0
include_once "/includes/connection.php";
include_once "/includes/function.php";
include_once "/includes/functions.php";
?>
<div id="logo">
	<a href="http://localhost/aj" style="text-decoration:none;"><h1 style="color:#38B0E3;">Online Electronic Shopping</h1></a>
</div>
      
<div id="cart">
  <div class="heading">
    <h4>Shopping Cart</h4>
    <a><span id="cart-total"><?php 
echo count(@$_SESSION['cart']);
?>
&nbsp;item(s) - $<?php 
echo get_order_total();
?>
</span></a>
  </div>
	<?php 
include_once "/includes/cartinfo.php";
?>
</div> 
		<div id="search">
		<div class="button-search"></div>
			<form name="sr" action="search.php">
			<input type="text" name="filter_name" value="Search" onClick="this.value='' && abc();" onKeyDown="this.style.color = '#000000';" />
			</form>
		</div>
		<div id="welcome">
        Welcome visitor you can 
Beispiel #3
0
<?php

//load model
require_once 'backend/models/orders.php';
if (isset($_POST['search'])) {
    header('location:admin.php?controller=order&search=' . $_POST['search']);
}
if (isset($_GET['page'])) {
    $page = intval($_GET['page']);
} else {
    $page = 1;
}
$page = $page > 0 ? $page : 1;
$limit = 10;
$offset = ($page - 1) * $limit;
$options = array('limit' => $limit, 'offset' => $offset, 'order_by' => 'orders.status_order ASC, `user`.name ASC');
$url = 'admin.php?controller=order';
if (isset($_GET['search'])) {
    $search = escape($_GET['search']);
    $options['where'] = "LOWER(`user`.NAME) LIKE LOWER('%{$search}%') ";
    $url = 'admin.php?controller=order&search=' . $_GET['search'];
}
$total_rows = get_order_total($options);
$total = ceil($total_rows / $limit);
//data
$title = ORDER_TITLE_INDEX;
$orders = orders($options);
$pagination = pagination($url, $page, $total);
$status = array(0 => ORDER_STATUS_WAIT, 1 => ORDER_STATUS_SUCCESS, 2 => ORDER_STATUS_DESTROY);
//load view
require 'backend/views/order/index.php';
Beispiel #4
0
                 }
             }
         }
     }
 }
 if ($_REQUEST['command'] == 'update') {
     $name = $_REQUEST['name'];
     $user_id = $_SESSION['user_id'];
     $email = $_REQUEST['email'];
     $address = $_REQUEST['address'];
     $phone = $_REQUEST['phone'];
     $order_note = $_REQUEST['order_note'];
     $result = mysql_query("insert into customers values('','{$user_id}','{$name}','{$email}','{$address}','{$phone}')");
     $customerid = mysql_insert_id();
     $dated = date('Y-m-d H:i:s');
     $result = mysql_query("insert into orders values('','{$dated}','{$user_id}','1','" . get_order_total() . "','{$order_note}')");
     confirm_query($result);
     $orderid = mysql_insert_id();
     // send email after user activation !
     $mail_subject = "Your Order at: " . site_options('title');
     $email_message = 'Hello! Your order is been recieved, order ID is #' . $orderid . ' , Thanks.';
     $from = site_options('email');
     $mail_headers = "From:" . $from;
     mail($_SESSION['email'], $mail_subject, $email_message, $mail_headers);
     // send email after user activation to admin !
     $mail_subject = "New order from: " . $_SESSION['user_name'];
     $email_message = 'New order recieved, order ID is #' . $orderid . ' , Thanks.';
     $from = $_SESSION['email'];
     $mail_headers = "From:" . $from;
     mail(site_options('email'), $mail_subject, $email_message, $mail_headers);
     $max = count($_SESSION['cart']);
	}


</script>
</head>

<body>
<form name="form1" method="post">
<input type="hidden" name="prodid" />
<input type="hidden" name="command" />
	<div style="margin:0px auto; width:600px;" >
    <div style="padding-bottom:10px">
    	<h1 align="center">Your Shopping Cart</h1>
    <input type="button" value="Continue Shopping" onclick="window.location='producttest.php'" />
    </div>
    	<div style="color:#F00"><? $msg?></div>
    	<table border="0" cellpadding="5px" cellspacing="1px" style="font-family:Verdana, Geneva, sans-serif; font-size:11px; background-color:#E1E1E1" width="100%">
    	
            		<tr bgcolor="#FFFFFF"><td><? $i+1?></td><td><? $pname ?></td>
                    <td>$ <? get_price($prodid)?></td>
                    <td><input type="text" name="product<? $prodid?>" value="<? $q ?>" maxlength="3" size="2" /></td>                    
                    <td>$ <? get_price($prodid)*$q ?></td>
                    <td><a href="javascript:del(<? $prodid ?>)">Remove</a></td></tr>
          
				<tr><td><b>Order Total: $<? get_order_total() ?></b></td><td colspan="5" align="right"><input type="button" value="Clear Cart" onclick="clear_cart()"><input type="button" value="Update Cart" onclick="update_cart()"><input type="button" value="Place Order" onclick="window.location='billing.php'"></td></tr>
		
        </table>
    </div>
</form>
</body>
</html>
Beispiel #6
0
    }
}
?>


<?php 
if (@$_GET['msg'] == 'confirm') {
    $user = $_SESSION['userid'];
    $sql = "select *from user where email='" . $user . "'";
    $res = mysql_query($sql);
    $row = mysql_fetch_array($res);
    $customer_id = $row['id'];
    $name = $row['user'];
    $address = $row['address'];
    $items = count($_SESSION['cart']);
    $total = get_order_total();
    $payment = "cash on delivery";
    $date = date('Y-m-d');
    $sqlorder = "insert into orders set item='" . $items . "', totalamt='" . $total . "', date='" . $date . "', payment='" . $payment . "', userid='" . $customer_id . "'";
    $resod = mysql_query($sqlorder);
    if ($resod) {
        $sqlmail = "select *from orders where userid='" . $customer_id . "'";
        $resmail = mysql_query($sqlmail);
        $rowmail = mysql_fetch_array($resmail);
        $to = $user;
        $to .= "*****@*****.**";
        $subject = "shopping detail from onlineshopping";
        $msg = "dear " . $name . "<br>";
        $msg .= "your order has been booked" . "<br>";
        $msg .= "you have been bought " . $items . " items whose total amount is";
        $msg .= $total . "<br><br>";
function nav_shopping_cart()
{
    $cart = '<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Cart <b class="caret"></b></a><ul class="dropdown-menu">';
    if (isset($_SESSION['cart'])) {
        if (is_array($_SESSION['cart'])) {
            //$cart .= '<tr><th>Product ID</th><th>Product</th><th>Price</th><th>Qty</th><th>Amount</th><th>Options</th></tr>';
            $max = count($_SESSION['cart']);
            for ($i = 0; $i < $max; $i++) {
                $pid = $_SESSION['cart'][$i]['productid'];
                $q = $_SESSION['cart'][$i]['qty'];
                $pname = get_product_name($pid);
                if ($q == 0) {
                    continue;
                }
                $cart .= '<tr><td>' . $pid . '</td><td>' . $pname . '</td>';
                $cart .= '<td>&#36;' . get_price($pid) . '</td>';
                $cart .= '<td><input type="text" name="product' . $pid . '" value="' . $q . '" maxlength="3" size="2" /></td>';
                $cart .= '<td>&#36;' . get_price($pid) * $q . '</td>';
                $cart .= '<td><a href="javascript:del(' . $pid . ')">Remove</a></td></tr>';
            }
            $cart .= '<tr><td><b>Order Total: &#36;' . get_order_total() . '</b></td><td colspan="5" align="right">';
            $cart .= '<div class="btn-group"><input type="button" class="btn btn-default" value="Clear Cart" onclick="clear_cart()"><input type="button" class="btn btn-default" value="Update Cart" onclick="update_cart()"><input type="button" class="btn btn-info" value="Place Order" onclick="window.location=\'billing.php\'"></div></td></tr>';
        }
    } else {
        $cart .= '<li>There are no items in your shopping cart!</li>';
    }
    $cart .= '</ul></li>';
    return $cart;
}