forked from yashbhangdia/Farmers-portal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
customer.php
205 lines (180 loc) · 6.39 KB
/
customer.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
<?php
include('./php/config.php');
session_start();
if(!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !==true)
{
header("location: index.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Customer</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta http-equiv="X-UA-Compatible"content="IE=edge,chrome=1">
<meta name="HandheldFriendly" content="true">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<link rel="stylesheet" type="text/css" href="./css/customstyle1.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark fixed-top">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#"><img src="./assets/Logokrishi.png" class="img-responsive"></a>
</div>
<div class="navtoggle">
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="navbar-toggler-icon"></span>
</button>
</div>
<div id="navbar" class="collapse navbar-collapse stroke">
<ul class="navbar-nav ml-auto">
<li class="nav-item"><a class="nav-link" href="#shop">Shop</a></li>
<li class="nav-item"><a class="nav-link" href="cart.php">Cart</a></li>
<li class="nav-item"><a class="nav-link" href="profile.php">Profile</a></li>
<li class="nav-item"><a class="nav-link" href="./php/logout.php">Log Out</a></li>
</ul>
</div>
</div>
</nav>
<div class="image">
<h1 class="heading">Products Made With Love</h1>
<p><a href="#shop"><button class="btn btn-large buy">Shop Now</button></a></p>
</div>
<div id="about" class="about row m-0">
<div class="col-lg-3">
<div class="row m-0">
<div class="col-lg-4">
<h1>01</h1>
</div>
<div class="col-lg-5 abouticon">
<img src="./assets/vegetable.svg" class="img-responsive" width="100%">
</div>
</div>
<div>
<h4>ALWAYS FRESH</h4>
</div>
<div>
<p>We are confident in the quality of its products and the consistency of its supply.</p>
</div>
</div>
<div class="col-lg-3">
<div class="row">
<div class="col-lg-4"><h1>02</h1></div>
<div class="col-lg-5 abouticon">
<img src="./assets/plant.svg" class="img-responsive" width="100%">
</div>
</div>
<div>
<h4>100% ORGANIC</h4>
</div>
<div>
<p>Our organic farm fresh products are tested at certified laboratories.</p>
</div>
</div>
<div class="col-lg-3">
<div class="row">
<div class="col-lg-4"><h1>03</h1></div>
<div class="col-lg-5 abouticon">
<img src="./assets/fertilizer.svg" class="img-responsive" width="100%">
</div>
</div>
<div>
<h4>NO ADDITIVES</h4>
</div>
<div>
<p>Reduce human and animal health hazards and ensure sustainability.</p>
</div>
</div>
<div class="col-lg-3">
<div class="row">
<div class="col-lg-4"><h1>04</h1></div>
<div class="col-lg-5 abouticon">
<img src="./assets/orchard.svg" class="img-responsive" width="100%">
</div>
</div>
<div>
<h4>MODERN FARM</h4>
</div>
<div>
<p>New and advanced technologies to increase yield and reduce the risk of crop failure.</p>
</div>
</div>
</div>
<div class="container-fluid" id="shop" style="padding-top: 10%;">
<div class="heading">
<h1 align="center">OUR PRODUCTS</h1>
</div>
<div class="subhead">
<p>Fresh from the Farm!</p>
</div>
</div>
<?php
require_once "./php/config.php";
$results = mysqli_query($conn, "SELECT * from product");
?>
<div class="container-fluid py-3">
<!-- <div class="row prod m-0"> -->
<?php
$i=0;
while($row = mysqli_fetch_array($results))
{
if($i%3==0)
{ ?>
<div class="row prod m-0 py-3">
<?php } ?>
<div class="product col-lg-4">
<div class="card">
<img class="card-img-top" src="./assets/<?php echo $row["prodname"]; ?>.png" alt="Card image cap">
<div class="card-body">
<h5 class="card-title" id=<?php echo $row['prodid']; ?> > <?php echo $row['prodname']; ?> </h5>
<p class="card-text py-2"><?php
$prodid = $row['prodid'];
$res = mysqli_query($conn, "SELECT * from myshop where prodid='$prodid' and price = (select min(price) from myshop where prodid='$prodid' and flag=1) and flag=1");
$row1 = mysqli_fetch_array($res);
if($row1)
{
echo "₹",$row1['price'], " per kg"; ?>
<form id="addcart" action="./php/addtocart.php" method="post">
<button name="add" class="btn addtocart" value="<?php echo $row['prodid'],",",$row1['farmerid'],",",$row1['price']; ?>" onclick="adding('<?php echo $row['prodname']; ?>')">
<span><i class="fa fa-shopping-cart fa-lg" aria-hidden="true"></i></span>
</button>
</form>
<?php
}
else
{
echo "Out Of Stock";
}
?></p>
</div>
</div>
</div>
<?php if($i%3==2)
{ ?>
</div>
<?php } ?>
<?php $i++; ?>
<?php } ?>
</div>
<div class="container-fluid text-center mt-5">
<a href="cart.php"><button class="btn" style="font-weight: 600; padding: 20px; background-color: #ffcd3c;">GO TO CART <span><i class="fa fa-shopping-cart fa-lg" aria-hidden="true"></i></span></button></a>
</div>
<div class="container-fluid py-2 mt-5" style="background-color: #216353; font-weight: 600;">
<div class="col-lg-12 text-center">
© 2020 Copyright <a href="#" style="text-decoration: none; color: inherit">KrishiMitra</a>
</div>
</div>
<script type="text/javascript">
function adding(prod)
{
alert("1 kg "+prod+" added to cart");
}
</script>
<script type="text/javascript" src="./scripts/customscript.js"></script>
</body>
</html>