-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduct_available.php
158 lines (126 loc) · 5.05 KB
/
product_available.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
<?php
include("assets/header_admin.php");
?>
<?php
session_start();
?>
<html>
<head>
<!-- CSS -->
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- JS -->
<script src="js/script.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery-3.7.1.min.js"></script>
<title>Products Available</title>
</head>
<?php
include("connection.php");
// error_reporting(0);
$userprofile = $_SESSION['email'];
if ($userprofile == true) {
} else {
header('location:login.php');
}
$email = $_SESSION['email'];
$query = "SELECT * FROM product_table";
$data = mysqli_query($conn, $query);
$total = mysqli_num_rows($data);
$result = mysqli_fetch_assoc($data);
// echo $email;
if ($total != 0) {
?>
<body data-bs-spy="scroll" data-bs-target=".navbar" data-bs-offset="100">
<section class="menu_section layout_padding2-top">
<h2>Products Available</h2>
<div class="container">
<table class="table layout_padding2-bottom">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Product</th>
<th scope="col">Description</th>
<th scope="col">Price</th>
<th scope="col">Image</th>
<th scope="col">Quantity Left</th>
</tr>
</thead>
<?php
while ($result = mysqli_fetch_assoc($data)) {
echo "<tr>
<td>" . $result['pid'] . "</td>
<td>" . $result['pname'] . "</td>
<td>" . $result['descrip'] . "</td>
<td>" . '₹' . $result['price'] . "</td>
<td><img src = '" . $result['image'] . "' height='75px' width='75px'></td>
<td>" . $result['pquantity'] . "</td>
</tr>
";
}
} else {
echo "No records found";
}
?>
</table>
</section>
<center>
<h6>Note: Products not listed here are unavailable currently, we will inform you when stock is available through social media.</h6>
</center>
<script>
function checkdelete() {
return confirm('Are you sure you want to delete this record?');
}
</script>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="exampleModalLabel">Delivery details</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="form-outline mb-3">
<input type="text" name="name" class="name-field form-control form-control-md" placeholder="Receiver's Name">
<small class="name-field-msg form-text text-danger ml-2"></small>
</div>
<div class="form-outline mb-3">
<input type="text" name="name" class="name-field form-control form-control-md" placeholder="Receiver's Contact Number">
<small class="name-field-msg form-text text-danger ml-2"></small>
</div>
<div class="form-outline mb-3">
<input type="text" name="email" id="email" class="email-field form-control form-control-md" placeholder="Address Line 1">
<small class="email-field-msg form-text text-danger ml-2"></small>
</div>
<div class="form-outline mb-3">
<input type="text" name="email" id="email" class="email-field form-control form-control-md" placeholder="Address Line 2">
<small class="email-field-msg form-text text-danger ml-2"></small>
</div>
<div class="form-outline mb-3">
<input type="text" name="email" id="email" class="email-field form-control form-control-md" placeholder="Address Line 3">
<small class="email-field-msg form-text text-danger ml-2"></small>
</div>
<div class="form-outline mb-3">
<input type="text" name="email" id="email" class="email-field form-control form-control-md" placeholder="PIN Code">
<small class="email-field-msg form-text text-danger ml-2"></small>
</div>
<div class="form-outline mb-3">
<input type="text" name="email" id="email" class="email-field form-control form-control-md" placeholder="City">
<small class="email-field-msg form-text text-danger ml-2"></small>
</div>
<div class="form-outline mb-3">
<input type="text" name="email" id="email" class="email-field form-control form-control-md" placeholder="State">
<small class="email-field-msg form-text text-danger ml-2"></small>
</div>
</div>
<div class="modal-footer">
<a href="payment.php">
<button type="button" class="btn btn-primary" style="background-color:#04AA6D;">Proceed to payment gateway</button>
</a>
</div>
</div>
</div>
</div>
</body>
</html>