-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
161 lines (115 loc) · 4.91 KB
/
index.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
<?php
require('header.inc.php');
require('connection.inc.php');
require('functions.inc.php');
$cart_pname='';
$cart_cust_name='';
$qty='';
$user_name='';
$user_mobile='';
$user_address='';
$category_query ="select * from categories where categories_status=1";
$cat_res=mysqli_query($connection,$category_query);
$cat_arr=array();
while($row=mysqli_fetch_assoc($cat_res)){
$cat_arr[]=$row;
}
if(isset($_POST['add_to_cart'])){
$cart_product_name=get_safe_value($connection,$_POST['cart_pname']);
$cart_user_email=get_safe_value($connection,$_POST['cart_cust_name']);
$cart_qty=get_safe_value($connection,$_POST['qty']);
$pp_price=get_safe_value($connection,$_POST['p_price']);
$user_data_query = mysqli_query($connection,"select * from userlogindata where user_email='$cart_user_email'");
$res = mysqli_fetch_assoc($user_data_query);
extract($res);
$cust_sname= $user_name;
$cust_sphone= $user_mobile;
$cust_saddress= $user_address;
$order_sstatus='';
$payment_sstatus='';
mysqli_query($connection,"insert into cart(order_name,cust_name,cust_email,cust_phone,cust_address,order_quantity,pr_price,order_status,payment_status) values('$cart_product_name','$cust_sname','$cart_user_email','$cust_sphone','$cust_saddress','$cart_qty','$pp_price','$order_sstatus','$payment_sstatus')");
}
?>
<table class="table_fp"> <!-- Category And Banner -->
<tr>
<td>
<div class="vertical-menu" style="top: 0px;">
<a href="#" style="background-color: grey;" >CATEGORY</a>
<?php
foreach($cat_arr as $list){
?>
<a href="#<?php echo $list['categorie_sname'] ?>"><?php echo $list['categorie_sname'] ?></a>
<?php
}
?>
</div>
</td>
<td style="width: 100%;">
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active carousel-img" >
<img class="d-block w-100" src="banner2.jpg" alt="First slide" style="height: 432px; width: 100%;">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="banner2.jpg" alt="Second slide" style="height: 432px; width: 100%;">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="banner2.jpg" alt="Third slide" style="height: 432px; width: 100%;">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span></a>
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span></a>
</div>
</td>
</tr>
</table>
<!-- Category And Banner End-->
<section id="FrontPage" >
<!-- Main Products Mix -->
<div class="container">
<div id="Starters"></div><br><br><br><br>
<div class="title" >
<div class="page-header" style="font-family: 'Courgette', cursive; ">
<h1>Starters</h1>
</div> <!-- blank -->
</div>
<div class="row">
<?php
$category_starter ="select * from products where product_status =1 ";
$cat_star=mysqli_query($connection,$category_starter);
$cat_arrs=array();
while($row=mysqli_fetch_assoc($cat_star)){
$cat_arrs[]=$row;
}
?>
<?php
foreach($cat_arrs as $list){
?>
<div class="col-md-3">
<form method="POST">
<div class="card text-center">
<img src=<?php echo $list['product_image'] ?> >
<div class="card-body">
<h5 class="card-title"><?php echo $list['product_name'] ?></h5>
<p class="card-text"><?php echo "Price:".$list['product_selling_price'] ?></p>
Quantity:<input name="qty" type="number" min="0" max="3" value="1" required style="width: 20%;">
<input name="cart_pname" type="hidden" value="<?php echo $list['product_name'] ?>" >
<input name="cart_cust_name" type="hidden" >
<input name="p_price" type="hidden" value="<?php echo $list['product_selling_price'] ?>">
</p>
<button type="submit" name="add_to_cart" style="border:1px solid orange; border-radius: 15px; padding: 5px; color: red; text-decoration: none;">Add To Cart</button>
</div>
</div>
</form>
</div>
<?php
}
?>
</div>
</div> <!-- container End -->
</section>
<?php
require('footer.inc.php');
?>