-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmanage_product.php
More file actions
264 lines (162 loc) · 7.4 KB
/
manage_product.php
File metadata and controls
264 lines (162 loc) · 7.4 KB
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
<?php
require_once './config/config.php';
require_once './core/Database.php';
require_once './core/Hash.php';
require_once './core/Session.php';
Session::init();
//$db = new Database(DB_TYPE, DB_HOST, DB_NAME, DB_USER, DB_PASS);
$db = new Database();
if (!isset($_SESSION['register_id'])) {
header('location:login.php');
} else {
$user_id = $_SESSION['register_id'];
$user_name = $db->prepare("SELECT `fullname` FROM `register` WHERE `register_id`='$user_id'");
$user_name->execute();
$name_ = $user_name->fetchAll();
/* gettin first letter of user full_name */
$user_added_prd = $db->prepare("SELECT * FROM `product_add` WHERE `register_id`='$user_id' and `status`=1");
$user_added_prd->execute();
$prd = $user_added_prd->fetchAll();
?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="./public/css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
<link href="./public/css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="./public/css/font-awesome.css" rel="stylesheet" type="text/css" media="all" />
<link href="../public/css/font-awesome.min.css" rel="stylesheet" type="text/css" media="all" />
<div class="clearfix"></div>
<div class="col-md-10 col-sm-8 sub_main_head_child_child" id="sub_main_head_child_product_display">
<!--edit_personal_info-->
<div class="col-md-12 col-sm-12 profile_info_head">
<div class="col-md-4 col-sm-12 profile_info_label">
Added Products
</div>
<div class="col-md-1 col-sm-12 profile_info_label">
<a id="edit_prd" href="#">Edit</a>
</div>
<div class="col-md-1 col-sm-12 profile_info_label">
<a id="cancel_edit_prd" href="#">Cancel</a>
</div>
<div class="col-md-1 col-sm-12 profile_info_label">
<a id="del_edit_prd" href="#" data-toggle="modal" data-target="#modalDelete">Delete</a>
</div>
<!-- Modal test-->
<div id="modalDelete" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title" style=" text-align-last: center;color: orangered;">DELETE</h4>
</div>
<div class="modal-body">
Hello <?php echo strtoupper($name_[0]['fullname']); ?>, You Want to delete Product?
</div>
<div class="modal-footer">
<button type="button" id="yes_delete" class="btn btn-default" data-dismiss="modal">Yes</button>
<button type="button" id="no_delete" class="btn btn-default" data-dismiss="modal">No</button>
</div>
</div>
</div>
</div>
<!-- Modal test end-->
<div class="col-md-offset-4">
</div>
<div class="clearfix"></div>
</div>
<div class="col-md-12 col-sm-12 profile_info_edit">
<div class="col-md-4 col-sm-12 product_select">
<select name="get_value" class="form-control" id="user_edit_product">
<option value="-1" disabled selected>Select Product</option>
<?php foreach ($prd as $each_prd_info) { ?>
<option value=<?php echo $each_prd_info['prd_id']; ?>><?php echo $each_prd_info['prd_name']; ?></option>
<?php } ?>
</select>
</div>
<div class="col-md-1">
</div>
</div>
<div class="col-md-12 prd_edit_panel" id="edit_prd_panel">
</div>
<div class="clearfix"></div>
<!--edit_menu_on_click_edit-->
<div class="col-md-6" id="edit_user_product">
<div class="row space side">
<div class="col-sm-12 col-md-12">
<div class="col-sm-4 col-md-12">
Product Name
</div>
<div class="col-sm-6 col-md-12">
<input type="text" id="prod_name" class="form-control" placeholder="Enter Product Name" name="product_name" onchange="pr_name()">
</div>
</div>
<div class="col-sm-12 col-md-12">
<div class="col-sm-4 col-md-12">
Price
</div>
<div class="col-sm-6 col-md-12">
<input type="text" class="form-control" id="prod_price" name="price" placeholder="Enter the price of the product in INR" onchange="pr_price()" >
</div>
</div>
</div>
<div class="row space side">
<div class="col-sm-12 col-md-12">
<div class="col-sm-4 col-md-12" >
Stock
</div>
<div class="col-sm-6 col-md-12">
<input type="text" class="form-control" id="prod_stock" name="stock" placeholder="Stock in KG" onchange="pr_stock()" >
</div>
</div>
</div>
<div class="row space side">
<div class="col-sm-12 col-md-12">
<div class="col-sm-4 col-md-12" >
Description
</div>
<div class="col-sm-6 col-md-12">
<input type="text" class="form-control" id="prod_desc" name="description" placeholder="Optional Description">
</div>
</div>
</div>
<div class="col-md-12 col-sm-10 user_prd_edit_save">
<div class="col-md-2 col-sm-8 edit_prd_submit">
<input type="submit" value="Save" id="edit_prd_submit">
</div>
<div class="col-md-offset-10">
</div>
</div>
</div>
</div>
<!--closed_edit_menu_on_click_edit-->
<div class="col-md-offset-2">
</div>
<div class="clearfix"></div>
<hr/>
<div class="clearfix"></div>
<div class="col-md-12 col-sm-8 description">
<p id="edit_desc">
<b>FAQs</b>
<br/><hr/>
<b>What happens when I Edit Added product?</b><br/>
Your Product information that you have already given will be change, likewise. You'll receive all your product related information on your account.
<hr/>
<b>When will my Farmous account be updated with new changes?</b><br/>
It happens as soon as you save the product details.
<hr/>
</p>
<img src="images/myProfileFooter_0cedbe.png" style="width: 100%">
<br/><br/>
</div>
</div>
</div>
<div class="clearfix">
</div>
<div id="footer_space">
</div>
<br/>
<br/>
<br/>
<?php
}
?>
<script src="public/js/execute.js"></script>