-
Notifications
You must be signed in to change notification settings - Fork 0
/
payment - Copy.php
executable file
·138 lines (89 loc) · 3.04 KB
/
payment - Copy.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?php
// include("checkout.php");
//session_start();
?>
<!DOCTYPE>
<html>
<body>
<h1 align="center">INVOICE</h1>
<?php
include("includes/db.php");
//include("functions/functions.php");
?>
<?php
$total = 0;
$ip = getIp();
global $con;
$create_query = "select * from cart where ip_add = '$ip'";
$run_query = mysqli_query($con,$create_query);
while($price = mysqli_fetch_array($run_query)){
$pro_id = $price['pii_id'];
$price_query = "select * from products where p_id = '$pro_id'";
$price_run_query = mysqli_query($con,$price_query);
while($pp_price = mysqli_fetch_array($price_run_query))
{
$final_price = array($pp_price['p_price']);
$product_title = $pp_price['p_title'];
$product_image = $pp_price['p_image'];
$single_price = $pp_price['p_price'];
$values = array_sum($final_price);
$total += $values;
$qty = $price['qty']
?>
<table>
<tr align="center">
<td style="font-size:35px;color:orange;font-family:cursive;"><?php echo $product_title; ?><br>
<img style="border:2px solid orange;margin-left:100px" src = "admin_area/product_images/<?php echo $product_image;?>" width="450" height="300"><br>
<?php
echo "QUANTITY: "." ".$price['qty'];
?><br>
<?php
echo " TOTAL: ".$total * $qty ;
?>
</td>
<tr>
<td>
</td>
</tr>
<?php
}
}
?>
</table>
<?php
if(isset($_SESSION['customer_email'])){
$email = $_SESSION['customer_email'];
$c_query = "select * from customer where customer_email = '$email';";
$c_run = mysqli_query($con,$c_query);
$c_data = mysqli_fetch_array($c_run);
echo " ID: ".$c_data['customer_id']."<br>";
echo " NAME: ".$c_data['customer_name']."<br>";
echo " EMAIL ID: ".$c_data['customer_email']."<br>";
echo " ADDRESS: ".$c_data['customer_address']."<br>";
echo " CITY: ".$c_data['customer_city']."<br>";
echo "CONTACT NO: ".$c_data['customer_contact']."<br>";
$today = getdate();
print_r('DATE:').print_r($today['mday'])." ".print_r($today['mon']).print_r($today['year']);
}
?>
<?php
if(isset($_POST['place_order']))
{
echo "<script>alert('ORDER PLACED SUCCESSFULLY');</script>";
echo "<script>window.open('submit.php','_self')</script>";
}
?>
<br>
<form method="post">
<input type = "submit" name="place_order" value="place order" style = "width: 301px;
/* align-items: flex-start; */
margin-left: 176px;
height: 34px;
font-size: 26px;
font-family: monospace;
color: tomato;
background-color: yellowgreen;
border-radius: 26px;">
</form>
</body>
</html>