-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckout.php
222 lines (125 loc) · 6.46 KB
/
checkout.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<?php
$active='Account';
include("includes/header.php");
?>
<div id="content">
<div class="container">
<div class="bc-icons-2">
<nav aria-label="breadcrumb">
<ol class="breadcrumb blue-grey lighten-4">
<li class="breadcrumb-item"><a class="black-text" href="index.php">Home</a><i
class="fa fa-angle-double-right mx-2" aria-hidden="true"></i></li>
<li class="breadcrumb-item"><a class="black-text" href="#">Shop</a><i
class="fa fa-angle-double-right mx-2" aria-hidden="true"></i></li>
<li class="breadcrumb-item active">Checkout</li>
</ol>
</nav>
</div>
<!-- col-md-12 Finish -->
<!-- col-md-3 Finish -->
<div class="col-md-9"><!-- col-md-9 Begin -->
<?php
if(!isset($_SESSION['customer_email'])){
include("customer/customer_login.php");
}else{
include('pay_option.php');
}
?>
</div>
<div class="col-md-3"><!-- col-md-3 Begin -->
<?php
include("includes/sidebar.php");
?>
<div id="order-summary" class="box"><!-- box Begin -->
<div class="box-header"><!-- box-header Begin -->
<h3>Order Summary</h3>
</div><!-- box-header Finish -->
<p class="text-muted"><!-- text-muted Begin -->
Shipping and additional costs are calculated based on value you have entered
</p><!-- text-muted Finish -->
<div class="table-responsive"><!-- table-responsive Begin -->
<table class="table"><!-- table Begin -->
<tbody><!-- tbody Begin -->
<tr><!-- tr Begin -->
<td> Order Sub-Total </td>
<th> Rs.<?php echo cal_price();?> </th>
</tr><!-- tr Finish -->
<tr><!-- tr Begin -->
<td>Delivery Charges </td>
<th>Rs. <?php echo delivery_price(); ?> </th>
</tr><!-- tr Finish -->
<tr><!-- tr Begin -->
<td> GST and Other Services </td>
<th>Rs. <?php
echo tax_price();
?> </th>
</tr><!-- tr Finish -->
<tr class="total"><!-- tr Begin -->
<td> Payable Amount </td>
<th>Rs. <?php echo total_price(); ?> </th>
</tr><!-- tr Finish -->
</tbody><!-- tbody Finish -->
</table><!-- table Finish -->
</div><!-- table-responsive Finish -->
</div><!-- box Finish -->
</div><!-- col-md-9 Finish -->
</div><!-- container Finish -->
</div><!-- #content Finish -->
<?php
include("footer.php");
?>
<script src="js/jquery-331.min.js"></script>
<script src="js/bootstrap-337.min.js"></script>
</body>
</html>
<?php
if(isset($_POST['register'])){
$c_name = $_POST['c_name'];
$c_email = $_POST['c_email'];
$c_pass = $_POST['c_pass'];
$c_country = $_POST['c_country'];
$c_city = $_POST['c_city'];
$c_contact = $_POST['c_contact'];
$c_address = $_POST['c_address'];
$c_image = $_FILES['c_image']['name'];
$c_image_tmp = $_FILES['c_image']['tmp_name'];
$c_ip = getRealIpUser();
move_uploaded_file($c_image_tmp,"customer/customer_images/$c_image");
$insert_customer = "insert into customer (customer_name,customer_email,customer_pass,customer_country,customer_city,customer_contact,customer_address,customer_image,customer_ip) values ('$c_name','$c_email','$c_pass','$c_country','$c_city','$c_contact','$c_address','$c_image','$c_ip')";
$run_customer = mysqli_query($con,$insert_customer);
$sel_cart = "select * from cart where ip_add='$c_ip'";
$run_cart = mysqli_query($con,$sel_cart);
$check_cart = mysqli_num_rows($run_cart);
if($check_cart>0){
/// If register have items in cart ///
$_SESSION['customer_email']=$c_email;
// $_SESSION['customer_name']= $c_name;
echo "<script>alert('You have been Registered Sucessfully')</script>";
echo "<script>window.open('index.php','_self')</script>";
}else{
/// If register without items in cart ///
$_SESSION['customer_email']=$c_email;
// $_SESSION['customer_name']= $c_name;
echo "<script>alert('You have been Registered Sucessfully')</script>";
echo "<script>window.open('index.php','_self')</script>";
}
}
?>
<style>
.bc-icons-2 .breadcrumb-item + .breadcrumb-item::before {
content: none; }
.bc-icons-2 .breadcrumb-item.active {
color: #455a64;
}
.blue-grey{
color: red;
}
.breadcrumb{
background-color: yellow;
font-size: 15px;
}
.breadcrumb-item{
margin:7px;
padding:0px;
font-size: 13px;
}</style>