-
Notifications
You must be signed in to change notification settings - Fork 0
/
store_order.php
101 lines (63 loc) · 2.37 KB
/
store_order.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php session_start();
?>
<!--PABALLO MOLATI 1818416-->
<!DOCTYPE html>
<head>
<meta charset="uft-8">
<meta name="viewpoint" content="width=device-width, initial-scale=1.0">
<title> Sk'haftine store order page </title>
<link rel="stylesheet" type="text/css" href="thestyle.css">
</head>
<body onload="alert('Click on "client welcome page" LINK to view orders, etc.....')">
<div class="header">
<h1>SK'HAFTINI WEB APP</h1>
<ul>
<li><a class="active2" href="#">order confirmation.....</a></li>
<li><a href="home_page.html"> Home </a></li>
<li><a href="c_log_collect.php"><button> CLIENT WELCOME PAGE</button> </a></li>
</ul>
</div>
<section>
<?php
$s="Placed";
$a = $_SESSION["unique_no"];
// $n = $_SESSION["down"];
//$nn = $_SESSION["vip"];
$names=$_SESSION["restaurant_name"];
//$names=$n . $nn;
//$names = str_replace('.',' ',$names);
$c = $_SESSION["name"];
$d = $_SESSION["quantity"];
$e = $_SESSION["price"];
$location=$_SESSION["location"];
$ordertype=$_SESSION["order_type"];
$dbServername = "localhost";
$dbUsername = "root";
$dbPassword = "";
$dbName = "skhafthini";
$aVar = mysqli_connect($dbServername,$dbUsername,$dbPassword,$dbName);
{
echo "<h1> Data base connected</h1>";
}
$query="INSERT INTO orders
(order_id,phone_number,quantity,price,restaurant_name,meal_name,order_status,order_type,location)
VALUES
(null,'".$a."','".$d."','".$e."','".$names."','".$c."','".$s."','".$ordertype."','".$location."')";
$query = mysqli_query($aVar,$query)or die('');
echo "<h1>ORDER PLACED...!</h1>";
?>
</section>
<footer>
<p>Copyright©:Sk'haftini Web App 2020 | Designed by Paballo Molati</p>
</footer>
</body>
</html>
<?php
/* Distroy sessions data only*/
if(isset($_SESSION["card_no"])){unset($_SESSION["card_no"]);}
if(isset($_SESSION["name"])) {unset($_SESSION["name"]);}
if(isset($_SESSION["distance"])) {unset($_SESSION["distance"]);}
if(isset($_SESSION["quantity"])) {unset($_SESSION["quantity"]);}
if(isset($_SESSION["price"])) {unset($_SESSION["price"]);}
if(isset($_SESSION["vip"])){unset($_SESSION["names"]);}
?>