-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathedit.php
141 lines (125 loc) · 5.09 KB
/
edit.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
<?php
include('session.php');
if($start == 1 || $start == 2){
$id=$_GET['id'];
$query=mysqli_query($conn,"SELECT `id`, `type`, `model`, `quantity`, `cost` FROM `products` WHERE id = '$id'");
$row=mysqli_fetch_array($query);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!--==================== UNICONS ====================-->
<link
rel="stylesheet"
href="https://unicons.iconscout.com/release/v4.0.0/css/line.css"
/>
<!--==================== SWIPER CSS ====================-->
<link
rel="stylesheet"
href="https://www.rahcode.com/assets/css/swiper-bundle.min.css"
/>
<!--==================== CSS ====================-->
<link
rel="stylesheet"
href="https://www.rahcode.com/assets/css/styles.css"
/>
<title>edit</title>
</head>
<body>
<!--==================== HEADER ====================-->
<header class="header" id="header">
<nav class="nav container">
<a href="/" class="nav__logo">inventory.php</a>
<div class="nav__menu" id="nav-menu">
<ul class="nav__list grid">
<li class="nav__item">
<a href="#" class="nav__link">
<i class="uil uil-at nav__icon"></i>
Hello "<?php echo $user ?>"
</a>
</li>
<?php
if($start == 1){
?>
<li class="nav__item">
<a href="users.php" class="nav__link">
<i class="uil uil-user nav__icon"></i>
Users
</a>
</li>
<li class="nav__item">
<a href="docs/" class="nav__link">
<i class="uil uil-arrow-circle-up nav__icon"></i>
Update
</a>
</li>
<?php
}
?>
<li class="nav__item">
<a href="logout.php" class="nav__link">
<i class="uil uil-signout nav__icon"></i>
Logout
</a>
</li>
</ul>
<i class="uil uil-times nav__close" id="nav-close"></i>
</div>
<div class="nav__btns">
<!-- Theme change button -->
<i class="uil uil-moon change-theme" id="theme-button"></i>
<div class="nav__toggle" id="nav-toggle">
<i class="uil uil-apps"></i>
</div>
</div>
</nav>
</header>
<!--==================== MAIN ====================-->
<main class="main">
<!--==================== CONTACT ME ====================-->
<section class="contact section" id="contact">
<h2 class="section__title">Edit</h2>
<span class="section__subtitle">Product</span>
<div class="contact__container container grid">
<div>
<form method="post" action="update.php?id=<?php echo $id; ?>" class="contact__form grid">
<div class="contact__inputs grid">
<div class="contact__content">
<label for="" class="contact__labe">Type/Brand</label>
<input type="text" class="contact__input" name="type" value="<?php echo $row['type']; ?>" />
</div>
<div class="contact__content">
<label for="" class="contact__labe">Model</label>
<input type="text" class="contact__input" name="model" value="<?php echo $row['model']; ?>" />
</div>
<div class="contact__content">
<label for="" class="contact__labe">Quantity</label>
<input type="number" class="contact__input" name="quantity" value="<?php echo $row['quantity']; ?>" />
</div>
<div class="contact__content">
<label for="" class="contact__labe">Cost</label>
<input type="number" class="contact__input" name="cost" value="<?php echo $row['cost']; ?>" />
</div>
<input type="submit" value="Edit" class="button button--flex" />
</div>
</form>
</div>
</div>
</section>
</main>
<!--==================== FOOTER ====================-->
<footer class="footer" id="foot">
</footer>
<!--==================== SWIPER JS ====================-->
<script src="https://www.rahcode.com/assets/js/swiper-bundle.min.js"></script>
<!--==================== MAIN JS ====================-->
<script src="https://www.rahcode.com/assets/js/main.js" type="module"></script>
</body>
</html>
<?php
}else{
echo "<script> alert('You are not allowed to do this');window.location= 'inventory.php' </script>";
}
?>