-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathadd-product.php
227 lines (217 loc) · 9.46 KB
/
add-product.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
223
224
225
226
227
<?php
session_start();
if(!isset($_SESSION['store_id'])) {
header("location:login.php");
exit();
}else{
include('config/db.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Pharmacy</title>
<!-- All CSS -->
<?php include("part/all-css.php");?>
<!-- All CSS end -->
<style>
.select2-container--default .select2-results__option--highlighted[aria-selected] {
background-color: #138496;
color: #fff;
}
</style>
</head>
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">
<!-- Navbar -->
<?php include("part/navbar.php");?>
<!-- Navbar end -->
<!-- Sidebar -->
<?php include("part/sidebar.php");?>
<!-- Sidebar end -->
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Main content -->
<section class="container-fluid">
<div class="row">
<!-- medicine form start -->
<div class="card card-default col-md-12 col-lg-9">
<div class="card-header py-2">
<div class="d-flex justify-content-between align-items-center">
<div>
<h4 class="fs-17 font-weight-600 mb-0">New Product</h4>
</div>
<div class="text-right">
<a href="manage-products.php" class="btn btn-info btn-sm mr-1">Manage Product</a>
</div>
</div>
</div>
<div class="card-body">
<form action="actions/addProduct.php" method="POST" enctype="multipart/form-data">
<div class="card-body">
<div class="form-group">
<label>Brand</label>
<div class="d-flex">
<select class="form-control select2" name="brand_product">
<option value="" selected="selected">Select Type</option>
<?php
$sql = $conn->query("SELECT * FROM `manufacturer` WHERE `store` = '$_SESSION[store_id]'");
while($row = mysqli_fetch_assoc($sql)){
?>
<option class="text-capitalize" value="<?php echo $row['id']; ?>"><?php echo ucfirst($row['name']); ?></option>
<?php
}
?>
</select>
<a href="add-brand.php" class="btn btn-info"><i class="fas fa-plus"></i></a>
</div>
</div>
<div class="form-group">
<label>Category</label>
<div class="d-flex">
<select class="form-control select2" name="category_product">
<option value="" selected="selected">Select Type</option>
<?php
$sql = $conn->query("SELECT * FROM `medicine_category` WHERE `store` = '$_SESSION[store_id]'");
while($row = mysqli_fetch_assoc($sql)){
?>
<option class="text-capitalize" value="<?php echo $row['id']; ?>"><?php echo ucfirst($row['category']); ?></option>
<?php
}
?>
</select>
<a href="add-category.php" class="btn btn-info"><i class="fas fa-plus"></i></a>
</div>
</div>
<div class="form-group">
<label for="name">From Abroad </label><br>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="customRadioInline1" name="abroad" value="no" class="custom-control-input" checked>
<label class="custom-control-label" for="customRadioInline1">NO</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="customRadioInline2" name="abroad" value="yes" class="custom-control-input">
<label class="custom-control-label" for="customRadioInline2">YES</label>
</div>
</div>
<div class="form-group">
<label for="name">Name</label>
<input type="text" class="form-control" id="name" placeholder="Enter Product Name" name="product_name" required>
</div>
<div class="form-group">
<label for="name">Strength</label>
<div class="row">
<div class="col-sm-12 col-md-8">
<input type="text" class="form-control" id="strength" placeholder="" name="strength">
</div>
<div class="col-sm-12 col-md-4">
<select class="form-control select2 medicine-unit-select" name="unit">
<option value="" selected="selected"></option>
<option>g</option>
<option>mg</option>
<option>mcg</option>
<option>L</option>
<option>ml</option>
<option>kg</option>
<option>cc</option>
<option>mol</option>
<option>mmol</option>
</select>
</div>
</div>
</div>
<div class="form-group">
<label for="name">Code</label>
<input type="text" class="form-control" id="code" placeholder="Enter Product Code" name="product_code">
</div>
<div class="form-group">
<label for="name">Shelf</label>
<input type="text" class="form-control" id="shelf" placeholder="Enter Product Shelf" name="shelf">
</div>
<div class="form-group">
<label for="stock">Opening Stock</label>
<input type="number" class="form-control" id="stock" placeholder="Product Initial Stock" name="new_stock" required>
</div>
<div class="form-group">
<label for="product-price">Cost</label>
<input type="text" class="form-control" id="cost" placeholder="Enter Product Cost" name="cost" required>
</div>
<div class="form-group">
<label for="product-price">Price</label>
<input type="text" class="form-control" id="price" placeholder="Enter Product Price" name="product_price" required>
</div>
<div class="form-group">
<label>Product Details</label>
<textarea class="form-control" rows="3" placeholder="Enter ..." name="details"></textarea>
</div>
<div class="form-group">
<label>Expire Date</label>
<input type="date" class="form-control" name="expiredate" value="">
</div>
<div class="form-group">
<label>Product Image</label>
<div class="row">
<div class="col-6">
<div class="custom-file">
<input type="file" class="custom-file-input" id="customFile" name="uploadfile" oninput="img_preview.src=window.URL.createObjectURL(this.files[0])">
<label class="custom-file-label">Choose file</label><br>
</div>
</div>
<div class="col-6">
<img id="img_preview" src="" alt="product image" height="200px" width="200px;" >
</div>
</div>
</div>
</div>
<div class="form-group pl-3">
<button type="submit" class="btn btn-info" name="submit">Submit</button>
</div>
</form>
</div>
</div>
<!-- medicine form end -->
<!-- ads start -->
<div class="d-none d-lg-block col-lg-3">
<div class="card">
<a href="#"> <img src="dist/img/clinic.jpg" alt="" class="img-fluid"> </a>
</div>
</div>
<!-- ads end -->
</div>
</div>
</section>
<!-- Main content end -->
</div>
<!-- Footer -->
<?php include("part/footer.php");?>
<!-- Footer End -->
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
</aside>
<!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
<!-- Alert -->
<?php include("part/alert.php");?>
<!-- Alert end -->
<!-- All JS -->
<?php include("part/all-js.php");?>
<!-- All JS end -->
<script>
$(function() {
//Initialize Select2 Elements
$(".select2").select2();
//Initialize Select2 Elements
$(".select2bs4").select2({
theme: "bootstrap4",
});
$('.medicine-unit-select').select2({
placeholder: "Select medicine unit"
});
});
</script>
</body>
</html>