-
Notifications
You must be signed in to change notification settings - Fork 0
/
editProduct_selectProduct.php
543 lines (476 loc) · 18.3 KB
/
editProduct_selectProduct.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
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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
<?php session_start(); ?>
<?php
$xristis;
if(isset($_SESSION['login_admin'])){
$xristis = $_SESSION['login_admin'];
}
else{
$xristis = "Σύνδεση";
header("Location: index.php");
die;
}
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Επεξεργασία Προϊόντος - Επιλογή Προϊόντος</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/form.css" rel="stylesheet" type="text/css" media="all" />
<link href='http://fonts.googleapis.com/css?family=Exo+2' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="js/jquery1.min.js"></script>
<!-- start menu -->
<link href="css/megamenu.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="js/megamenu.js"></script>
<script>$(document).ready(function(){$(".megamenu").megamenu();});</script>
<!--start slider -->
<link rel="stylesheet" href="css/fwslider.css" media="all">
<script src="js/jquery-ui.min.js"></script>
<script src="js/css3-mediaqueries.js"></script>
<script src="js/fwslider.js"></script>
<!--end slider -->
<script src="js/jquery.easydropdown.js"></script>
<script src="selectedDropdown.js"></script>
<script>
function check() {
var frm = document.forms["editProduct"];
if (frm.product.value == "" ){
alert ('Διαλέξτε το προϊόν που θέλετε να επεξεργαστείτε!');
return false;
}
}
</script>
</head>
<body style="color: #FFFFFF; ">
<div class="header-top" >
<div class="wrap">
<div class="header-top-left">
<div class="box1">
<select tabindex="4" class="dropdown">
<option value="" class="label" value="">Νόμισμα :</option>
<option value="1">€ Ευρώ</option>
</select>
</div>
<div class="clear"></div>
</div>
<div class="cssmenu">
<ul>
<?php
if(isset($_SESSION['login_user'])){
$xristis=$_SESSION['login_user'];
echo "<li class='active'><a href='profile.php'>$xristis</a></li> |";
echo "<li><a href='kalathiProionta.php'>Καλάθι/Αγορά</a></li> |";
echo "<li><a href='showOrdersOfUser.php'>Παραγγελίες</a></li> |";
echo "<li><a href='profile.php'>Προφίλ</a></li> |";
echo "<li><a href='logout.php'>Αποσύνδεση</a></li>";
}else{
if(isset($_SESSION['login_admin'])){
echo "<li><a href='logout.php'>Αποσύνδεση</a></li>";
}else{
echo "<li><a href='login.php'>Σύνδεση</a></li> |";
echo "<li><a href='register.php'>Εγγραφή</a></li>";
}
}
?>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
<div class="header-bottom">
<div class="wrap" style="width: 98%">
<div class="header-bottom-left">
<div class="logo">
<a href="index.php">
<img src="images/trofima.jpg"></a>
</div>
<div class="menu">
</div>
</div>
<div class="header-bottom-right" style="width: 34%">
<div class="search">
<form id='anazitisi' method="POST" action="searchServer.php" accept-charset="UTF-8"> <!--method='post'-->
<input type="text" name="search" id="search" class="auto-style4" value="Αναζήτηση" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Αναζήτηση';}" style="width: 159px">
<input type="submit" value="Subscribe" id="submit" name="submit">
<div id="response"> </div>
</form>
</div>
<div class="tag-list">
<ul class="icon1 sub-icon1 profile_img">
<li>
<ul class="sub-icon1 list">
<li><h3>sed diam nonummy</h3><a href=""></a></li>
<li><p>Lorem ipsum dolor sit amet, consectetuer <a href="">adipiscing elit, sed diam</a></p></li>
</ul>
</li>
</ul>
<ul class="icon1 sub-icon1 profile_img">
<?php
$servername = "localhost";
$username = "cyfoodmuseum";
$password = "9m8ESxZD";
$dbname = "cyfoodmuseum";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
//@mysql_select_db($dbname) or die ("No database");
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
echo "Connection faild";
}
if (!$conn->set_charset("utf8")) {
printf("Error loading character set utf8: %s\n", $conn->error);
} else {
//printf("Current character set: %s\n", $conn->character_set_name());
}//die;
if(isset($_SESSION['login_user'])){
$xristis=$_SESSION['login_user'];
$posotitakalathi="SELECT * FROM `USERACTIONFORCART` where `UserCode`='$xristis'";
$queryCart=$conn->query($posotitakalathi);
if($queryCart->num_rows > 0){
echo "<li><a class='active-icon c2' href='kalathiProionta.php'> </a>";
echo "<ul class='sub-icon1 list'>";
echo "<li><h3>$queryCart->num_rows Προϊόντα</h3><a href=''></a></li>";
echo "<li><p>Δες τα προϊόντα στο καλάθι σου και κάνε τις Αγορές σου!<a href=''></a></p></li>";
echo "</ul>";
echo "</li>";
}else{
echo "<li><a class='active-icon c2' href='checkout.php'> </a>";
echo "<ul class='sub-icon1 list'>";
echo "<li><h3>Αδειο Καλαθι</h3><a href=''></a></li>";
echo "<li><p>Δεν υπάρχουν προϊόντα στο καλάθι σου<a href=''></a></p></li>";
echo "</ul>";
echo "</li>";
}
}else{
echo "<li><a class='active-icon c2' href=''> </a>";
echo "<ul class='sub-icon1 list'>";
echo "<li><h3>Συνδεθείτε</h3><a href=''></a></li>";
echo "<li><p>Γίνεται μέλος στο καταστημά μας, προσθέστε προϊόντα στο καλάθι σας και κάνετε τις αγορές σας!<a href=''></a></p></li>";
echo "</ul>";
echo "</li>";
}
?>
</ul>
<?php
if(isset($_SESSION['login_user'])){
$xristis=$_SESSION['login_user'];
$posotitakalathi="SELECT * FROM `USERACTIONFORCART` where `UserCode`='$xristis'";
$queryCart=$conn->query($posotitakalathi);
if($queryCart->num_rows > 0){
echo "<ul class='last'><li><a href='kalathiProionta.php'>ΚΑΛΑΘΙ($queryCart->num_rows)</a></li></ul>";
}else{
echo "<ul class='last'><li><a href='checkout.php'>ΚΑΛΑΘΙ(0)</a></li></ul>";
}
}else{
echo "<ul class='last'><li><a href=''>ΚΑΛΑΘΙ</a></li></ul>";
}
mysqli_close($conn);
?>
</div>
</div>
<div class="clear"></div>
<ul class="megamenu skyblue" >
<li class="active grid"><a href="index.php">ΑΡΧΙΚΗ</a></li>
<li><a class="color4" href="#">ΤΡΟΦΙΜΑ</a>
<div class="megapanel">
<div class="row">
<div class="col1">
<div class="h_nav">
<h4>Κατηγορίες Τροφίμων</h4>
<ul>
<?php
$servername = "localhost";
$username = "cyfoodmuseum";
$password = "9m8ESxZD";
$dbname = "cyfoodmuseum";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
//@mysql_select_db($dbname) or die ("No database");
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
echo "Connection faild";
}
if (!$conn->set_charset("utf8")) {
printf("Error loading character set utf8: %s\n", $conn->error);
} else {
//printf("Current character set: %s\n", $conn->character_set_name());
}//die;
$queryCat="SELECT * FROM `CATEGORY` WHERE `SubCategory`='1';";
$trofima=$conn->query($queryCat);
if ($trofima->num_rows>0){
while($row = $trofima->fetch_assoc()) {
$category=$row['CodeCat'];
$onomasia=$row['NameCat'];
echo '<li><a href="categorySearch.php?cat='.urlencode($category).'">'.$onomasia.'</a></li>';
}
}
?>
</ul>
</div>
</div>
</div>
</div>
</li>
<li><a class="color6" href="#">ΥΛΙΚΑ</a>
<div class="megapanel">
<div class="col1">
<div class="h_nav">
<h4>Υλικά</h4>
<ul>
<?php
$queryCatY="SELECT * FROM `CATEGORY` WHERE `SubCategory`='2';";
$ilika=$conn->query($queryCatY);
if ($ilika->num_rows>0){
while($row2 = $ilika->fetch_assoc()) {
$category=$row2['CodeCat'];
$onomasia=$row2['NameCat'];
echo '<li><a href="categorySearch.php?cat='.urlencode($category).'">'.$onomasia.'</a></li>';
}
}
?>
</ul>
</div>
</div>
</div>
</li>
<?php
$katigories="SELECT * FROM `CATEGORY` WHERE `SubCategory`='3';";
$all=$conn->query($katigories);
if ($all->num_rows>0){
while($row3 = $all->fetch_assoc()) {
$category=$row3['CodeCat'];
$onomasia=$row3['NameCat'];
//echo '<li><a href="categorySearch.php?cat='.urlencode($category).'">"$onomasia"</a></li>';
mysqli_close($conn);
echo '<li><a class="color7" href="categorySearch.php?cat='.urlencode($category).'">'.$onomasia.'</a></li>';
}
}
mysqli_close($conn);
?>
<li><a class="color7" href="prosfores.php">Προσφορες</a></li>
<li><a class="color7" href="estiatoria.php">εστιατορια</a></li>
<li><a class="color7" href="sintages.php">Συνταγες</a></li>
</ul>
<?php
if (isset($_SESSION['login_admin'])){
echo "<ul class='megamenu skyblue' >";
echo "<li><a class='color4' href='#'>ΡΥΘΜΙΣΕΙΣ</a>";
echo "<div class='megapanel'>";
echo "<div class='row'>";
echo "<div class='col1'>";
echo "<div class='h_nav'>";
echo "<h4>Ρυθμίσεις Προϊόντων</h4>";
echo "<ul>";
echo "<li><a href='addProduct_dropdown.php'>Προσθήκη Προϊόντος</a></li>";
echo "<li><a href='removeProduct.php'>Διαγραφή Προϊόντος</a></li>";
echo "<li><a href='editProduct_selectCategory.php'>Επεξεργασία Προϊόντος</a></li>";
echo "</ul>";
echo "</div>";
echo "</div>";
echo "<div class='col1'>";
echo "<div class='h_nav'>";
echo "<h4>Ρυθμίσεις Μελών</h4>";
echo "<ul>";
echo "<li><a href='manageUsers.php'>Προβολή και Διαγραφή Μέλους</a></li>";
echo "</ul>";
echo "</div>";
echo "</div>";
echo "</div>";
echo "<div class='row'>";
echo "<div class='col1'>";
echo "<div class='h_nav'>";
echo "<h4>Ρυθμίσεις Κατηγοριών</h4>";
echo "<ul>";
echo "<li><a href='addCategory.php'>Προσθήκη Κατηγορίας</a></li>";
echo "<li><a href='removeCategory.php'>Διαγραφή Κατηγορίας</a></li>";
echo "<li><a href='editCategory_selectCategory.php'>Επεξεργασία Κατηγορίας</a></li>";
echo "</ul>";
echo "</div>";
echo "</div>";
echo "<div class='col1'>";
echo "<div class='h_nav'>";
echo "<h4>Ρυθμίσεις Παραγγελιών</h4>";
echo "<ul>";
echo "<li><a href='manageOrdersNotCompleted.php'>Επεξεργασία Παραγγελιών που δεν έχουν ολοκληρωθεί</a></li>";
echo "<li><a href='manageOrdersCompletedOrCanceled.php'>Προβολή Ολοκληρωμένων/Ακυρωμένων Παραγγελιών</a></li>";
echo "</ul>";
echo "</div>";
echo "</div>";
echo "</div>";
echo "<div class='row'>";
echo "<div class='col1'>";
echo "<div class='h_nav'>";
echo "<h4>Ρυθμίσεις Προμηθευτών</h4>";
echo "<ul>";
echo "<li><a href='addSupplier.php'>Προσθήκη Προμηθευτή</a></li>";
echo "<li><a href='removeSupplier.php'>Διαγραφή Προμηθευτή</a></li>";
echo "<li><a href='editSupplier_selectSupplier.php'>Επεξεργασία Προμηθευτή</a></li>";
echo "</ul>";
echo "</div>";
echo "</div>";
echo "<div class='col1'>";
echo "<div class='h_nav'>";
echo "<h4>Ρυθμίσεις Κουπονιών</h4>";
echo "<ul>";
echo "<li><a href='addCoupon.php'>Προσθήκη Κουπονιού</a></li>";
echo "<li><a href='deleteCoupon_select.php'>Διαγραφή Κουπονιού με δυνατότητα προβολής</a></li>";
echo "</ul>";
echo "</div>";
echo "</div>";
echo "</div>";
echo "<div class='row'>";
echo "<div class='col1'>";
echo "<div class='h_nav'>";
echo "<h4>Ρυθμίσεις Προσφορών</h4>";
echo "<ul>";
echo "<li><a href='addOffer_selectProduct.php'>Προσθήκη Προσφοράς</a></li>";
echo "<li><a href='removeOffer_selectProduct.php'>Αφαίρεση Προσφοράς - Επαναφορά Αρχικής Τιμής</a></li>";
echo "</ul>";
echo "</div>";
echo "</div>";
echo "<div class='col1'>";
echo "<div class='h_nav'>";
echo "<h4>Προσθήκη Συνταγών</h4>";
echo "<ul>";
echo "<li><a href='addSintagi.php'>Προσθήκη Συνταγών</a></li>";
echo "<li><a href='deleteSintagi.php'>Διαγραφή Συνταγής</a></li>";
echo "</ul>";
echo "</div>";
echo "</div>";
echo "</div>";
echo "<div class='row'>";
echo "<div class='col1'>";
echo "<div class='h_nav'>";
echo "<h4>Διάφορα</h4>";
echo "<ul>";
echo "<li><a href='addAdmin.php'>Προσθήκη Διαχειριστή</a></li>";
echo "<li><a href='changePasswordAdmin.php'>Αλλαγή Κωδικού Πρόσβασης</a></li>";
echo "<li><a href='addSlide_select.php'>Προσθήκη φωτογραφιών για Slide αρχικής</a></li>";
echo "</ul>";
echo "</div> ";
echo "</div>";
echo "</div>";
echo "</div>";
echo "</li> ";
echo "</ul>";
}
?>
<div class="clear"></div>
<br>
</div>
</div>
<div class="login">
<div class="wrap" style="width: 77%">
<ul class="breadcrumb breadcrumb__t"><a class="home" href="addProduct_dropdown.php"> Προσθήκη Νέου Προϊόντος </a> /<a class="home" href="removeProduct.php">Διαγράφη Προϊόντος</a>/Επεξεργασία Προϊόντος</ul>
<form id='editProduct' onsubmit="return check();" method="post" accept-charset="utf8" action="editProduct_showProduct.php" >
<div>
<br>
<select name="product" style="width: 600px; height: 37px">
<option value="">Διάλεξε το προϊόν που θέλεις να επεξεργαστείς</option>
<?php
$servername = "localhost";
$username = "cyfoodmuseum";
$password = "9m8ESxZD";
$dbname = "cyfoodmuseum";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if (!$conn->set_charset("utf8")) {
printf("Error loading character set utf8: %s\n", $conn->error);
die;
}
parse_url(file_get_contents("php://input"), $_POST);
$CodeCategory = $_POST['category'];
$querys = "SELECT * FROM `PRODUCT` where CodeOfCategory = '$CodeCategory' ";
$result = $conn->query($querys);
//echo "$CodeCategory";
if($result->num_rows > 0){
echo '<br>';
while($row = $result->fetch_assoc()) {
$nameProduct = $row["Name"];
$codeProduct = $row["Code"];
echo '<option value="' . $codeProduct . '">';
echo $nameProduct ;
echo '</option>';
}
}
mysqli_close($conn);
?>
</select>
</div>
<br>
<div class="submit" >
<input type="submit" value="Επεξεργασία"></div>
</form>
</div>
<div class="clear"></div>
<br>
<br>
</div>
</div>
<!--</div>-->
<!--</div>-->
<div class="footer">
<div class="footer-middle">
<div class="wrap">
<div class="section group example">
<div class="col_1_of_f_1 span_1_of_f_1" >
<div class="section group example">
<div class="col_1_of_f_2 span_1_of_f_2">
<h2>ΠΛΗΡΟΦΟΡΙΕς</h2>
<ul class="f-list1">
<li><a href="about.php">Ποιοι Είμαστε</a></li>
<!-- <li><a href="terms.html">Όροι Χρήσης</a></li>-->
<li><a href="delivery.php">Τρόποι Πληρωμής και Παραγγελιών</a></li>
</ul>
<div class="clear"></div>
</div>
</div>
</div>
<div class="col_1_of_f_1 span_1_of_f_1">
<div class="section group example">
<div class="col_1_of_f_2 span_1_of_f_2">
<h2>ΕΠΙΚΟΙΝΩΝΙΑ</h2>
<div class="company_address">
<p>Εικονικό Μουσείο Κυπριακών Τροφίμων και Διατροφής</p>
<p>Κύπρος</p>
<p>Κινητό Τηλέφωνο: 99 05 98 20</p>
<p>Fax: 22 77 06 76</p>
<p style="" >Email: <span>[email protected]</span></p>
<!--style="height: 24px"-->
</div>
</div>
</div>
</div>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<div class="clear"></div>
<div class="clear"></div>
<br>
<div class="auto-style1">
<img src="images/3.png" width="58"><span class="auto-style1">Καλέστε
μας στο: 99 05 98 20 </span>
<a href="https://www.facebook.com/pages/Cyprus-Food-Virtual-Museum/104034939677867?fref=ts" target="_blank"><img src="images/find_us_facebook_logo.gif" class="auto-style2" height="57" width="143"></a>
</div>
</div>
<div class="footer-bottom">
<div class="wrap">
<div class="f-list2">
<ul>
<li>Copyright: CyFoodMuseum Team, CS-ucy</li>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</body>
</html>