-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathadmin-inventory.html
308 lines (269 loc) · 13.2 KB
/
admin-inventory.html
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<?php
session_start();
if($_SESSION["admin"] == NULL ){
header("location: admin-sign-in.html");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>PetShop - Inventory</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700" rel="stylesheet">
<link rel="stylesheet" href="css/open-iconic-bootstrap.min.css">
<link rel="stylesheet" href="css/animate.css">
<link rel="stylesheet" href="css/owl.carousel.min.css">
<link rel="stylesheet" href="css/owl.theme.default.min.css">
<link rel="stylesheet" href="css/magnific-popup.css">
<link rel="stylesheet" href="css/aos.css">
<link rel="stylesheet" href="css/ionicons.min.css">
<link rel="stylesheet" href="css/bootstrap-datepicker.css">
<link rel="stylesheet" href="css/jquery.timepicker.css">
<link rel="stylesheet" href="css/flaticon.css">
<link rel="stylesheet" href="css/icomoon.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark ftco_navbar bg-dark ftco-navbar-light ftco-navbar-light-2" id="ftco-navbar">
<div class="container">
<a class="navbar-brand" href="#">Petshop</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#ftco-nav" aria-controls="ftco-nav" aria-expanded="false" aria-label="Toggle navigation">
<span class="oi oi-menu"></span> Menu
</button>
<div class="collapse navbar-collapse" id="ftco-nav">
<ul class="navbar-nav ml-auto">
<li class="nav-item"><a href="phps/logout.php">LOGOUT</a></li>
</div>
</li>
</ul>
</div>
</div>
</nav>
<div class="hero-wrap hero-bread" style="background-image: url('images/bg_6.jpg');">
<div class="col-md-15">
<div class="row no-gutters slider-text align-items-center justify-content-center" style="background-color: white;margin-bottom: 30px; opacity: 0.9;">
<div class="col-md-9 ftco-animate text-center">
<h1 class="mb-0 bread">Inventory</h1>
<p class="breadcrumbs">
<span><a href="admin-pets.html">Pets</a></span> |
<span class="mr-1" style="color: brown;">Inventory</span> |
<span><a href="admin-orders.html">Orders</a></span>
</p>
</div>
</div>
</div>
</div>
<?php include 'phps/show-inventory.php';?>
<!-- loader -->
<div id="ftco-loader" class="show fullscreen"><svg class="circular" width="48px" height="48px"><circle class="path-bg" cx="24" cy="24" r="22" fill="none" stroke-width="4" stroke="#eeeeee"/><circle class="path" cx="24" cy="24" r="22" fill="none" stroke-width="4" stroke-miterlimit="10" stroke="#F96D00"/></svg></div>
<!-- //loader -->
<!-- update inventory modal -->
<div class="modal fade" id="updateInventory" tabindex="-1" role="dialog" aria-labelledby="updateInventoryLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Update prduct</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="phps/updateInventory.php" method="POST" id="update_inventory_form" enctype="multipart/form-data">
<div class="form-group" style="display: none;">
<label for="recipient-name" class="col-form-label">Product ID</label>
<input type="text" class="form-control border" placeholder=" " name="update_prod_id" id="update_prod_id" required="">
</div>
<div class="form-group">
<label for="recipient-name" class="col-form-label">Product Name</label>
<input type="text" class="form-control border" placeholder=" " name="update_prod_name" id="update_prod_name" required="">
</div>
<div class="form-group">
<label for="recipient-name" class="col-form-label">Pet</label>
<select class="form-control border" name="update_pet_name" id="update_pet_name" required="">
<?php $operation="update"; include "phps/pet_list.php"; ?>
</select>
</div>
<div class="form-group">
<label for="recipient-name" class="col-form-label">Company</label>
<input type="text" class="form-control border" placeholder=" " name="update_company_name" id="update_company_name" required="">
</div>
<div class="form-group">
<label for="recipient-name" class="col-form-label">Price</label>
<input type="text" class="form-control border" placeholder=" " name="update_price" id="update_price" required="">
</div>
<div class="form-group">
<label for="recipient-name" class="col-form-label">Quantity</label>
<input type="text" class="form-control border" placeholder=" " name="update_quantity" id="update_quantity" required="">
</div>
<div class="form-group">
<label for="recipient-name" class="col-form-label">Image File</label> <br/>
<label for="update_file_name" class="btn btn-primary py-2 px-4">Upload Image</label>
<input type="file" placeholder=" " name="update_file_name" id="update_file_name" style="visibility: hidden;">
<p id="update_file_name_label"></p>
</div>
<div class="right-w3l">
<input type="submit" class="btn btn-primary py-2 px-4" value="update">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- //Update inventory modal -->
<!-- add new inventory modal -->
<div class="modal fade" id="addNewInventory" tabindex="-1" role="dialog" aria-labelledby="addNewInventoryLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Add new product</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="phps/addNewInventory.php" method="POST" id="add_new_inventory_form" enctype="multipart/form-data">
<div class="form-group">
<label for="recipient-name" class="col-form-label">Product Name</label>
<input type="text" class="form-control border" placeholder=" " name="prod_name" id="prod_name" required="">
</div>
<div class="form-group">
<label for="recipient-name" class="col-form-label">Pet</label>
<select class="form-control border" name="pet_name" id="pet_name" required="">
<?php $operation="add"; include "phps/pet_list.php"; ?>
</select>
</div>
<div class="form-group">
<label for="recipient-name" class="col-form-label">Company</label>
<input type="text" class="form-control border" placeholder=" " name="company_name" id="company_name" required="">
</div>
<div class="form-group">
<label for="recipient-name" class="col-form-label">Price</label>
<input type="text" class="form-control border" placeholder=" " name="price" id="price" required="">
</div>
<div class="form-group">
<label for="recipient-name" class="col-form-label">Quantity</label>
<input type="text" class="form-control border" placeholder=" " name="quantity" id="quantity" required="">
</div>
<div class="form-group">
<label for="recipient-name" class="col-form-label">Image File</label> <br/>
<label for="file_name" class="btn btn-primary py-2 px-4">Upload Image</label>
<input type="file" placeholder=" " name="file_name" id="file_name" required="Please select image" style="visibility: hidden;">
<p id="file_name_label"></p>
</div>
<div class="right-w3l">
<input type="submit" class="btn btn-primary py-2 px-4" value="save">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- //add new inventory modal -->
<!-- delete inventory modal -->
<div class="modal fade" id="deleteInventoryModal" tabindex="-1" role="dialog" aria-labelledby="deleteInventoryModal" aria-hidden="">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Warning</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="phps/deleteProduct.php" method="GET">
<h3>
Are you sure want to delete product?
</h3>
(Make sure you have shipped pending orders or you won't be able to ship those orders.) <br/><br/>
<div class="form-group" style="display: none;">
<input type="text" class="form-control border" placeholder=" " name="delete_prod_id" id="delete_prod_id" required="">
</div>
<div class="right-w3l">
<input type="submit" class="btn btn-primary py-2 px-4" value="delete">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- //delete inventory modal -->
<!-- show message modal -->
<?php include "phps/show-message.php" ?>
<!-- //show message modal -->
<script src="js/jquery.min.js"></script>
<script src="js/jquery-migrate-3.0.1.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.easing.1.3.js"></script>
<script src="js/jquery.waypoints.min.js"></script>
<script src="js/jquery.stellar.min.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/jquery.magnific-popup.min.js"></script>
<script src="js/aos.js"></script>
<script src="js/jquery.animateNumber.min.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script src="js/scrollax.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBVWaKrjvy3MaE7SQ74_uJiULgl1JY0H2s&sensor=false"></script>
<script src="js/google-map.js"></script>
<script src="js/main.js"></script>
<script>
$(document).ready(function(){
var quantitiy=0;
$('.quantity-right-plus').click(function(e){
// Stop acting like a button
e.preventDefault();
// Get the field name
var quantity = parseInt($('#quantity').val());
// If is not undefined
$('#quantity').val(quantity + 1);
// Increment
});
$('.quantity-left-minus').click(function(e){
// Stop acting like a button
e.preventDefault();
// Get the field name
var quantity = parseInt($('#quantity').val());
// If is not undefined
// Increment
if(quantity>0){
$('#quantity').val(quantity - 1);
}
});
});
$(window).load(function () {
$('#messageModal').modal('show');
});
document.querySelector("#file_name").onchange = function(){
document.getElementById("file_name_label").textContent = this.files[0].name;
}
document.querySelector("#update_file_name").onchange = function(){
document.getElementById("update_file_name_label").textContent = this.files[0].name;
}
</script>
<script>
function update_form_variables(prod_id, prod_name, pet_name, company_name, price, quantity) {
var prod_id_textbox = document.getElementById("update_prod_id");
var prod_name_textbox = document.getElementById("update_prod_name");
var pet_name_option = document.getElementById(pet_name);
var company_name_textbox = document.getElementById("update_company_name");
var price_textbox = document.getElementById("update_price");
var quantity_textbox = document.getElementById("update_quantity");
prod_id_textbox.value=prod_id;
prod_name_textbox.value=prod_name;
pet_name_option.setAttribute("selected",true);
company_name_textbox.value=company_name;
price_textbox.value=price;
quantity_textbox.value=quantity;
}
function delete_form_variables(prod_id) {
var prod_id_textbox = document.getElementById("delete_prod_id");
prod_id_textbox.value=prod_id;
}
</script>
</body>
</html>