-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathupdate.php
182 lines (150 loc) · 3.46 KB
/
update.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
<!-- DEVELOPED BY krishna kakade
see more about developer krishna kakade here= krishnakakade1999.github.io-->
<?php
include("connection.php");
error_reporting(0);
?>
<!DOCTYPE html>
<html>
<head><title>Online Shoe Inventory</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
box-sizing: border-box;
}
input[type=text], select, textarea {
width: 100%;
padding: 12px;
border: 1px solid #ccc;
border-radius: 4px;
resize: vertical;
}
label {
padding: 12px 12px 12px 0;
display: inline-block;
}
input[type=submit] {
background-color: #4CAF50;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
float: center;
}
input[type=submit]:hover {
background-color: #45a049;
}
.container {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
}
.col-25 {
float: center;
width: 25%;
margin-top: 6px;
}
.col-75 {
float: center;
width: 75%;
margin-top: 6px;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
/* Responsive layout - when the screen is less than 600px wide, make the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 600px) {
.col-25, .col-75, input[type=submit] {
width: 100%;
margin-top: 0;
}
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover {
background-color: #111;
}
.h1{
font-size: 50px;
text-decoration: bold;
}
</style></head>
<body>
<ul>
<li><a href="file:///C:/Users/krishnakakade/Documents/DBMS.html">Home</a></li>
<li><a href="#view">View</a></li>
</ul>
<h1 align="center">Online Shoe Inventory </h1>
<div class="container">
<form action="" method="GET">
<div class="row">
<div class="col-25">
<label for="Company">Enter Shoe Company</label>
</div>
<div class="col-75">
<input type="" name="shoe" value="<?php echo $_GET['s'];?>">
</div>
<div class="row">
<div class="col-25">
<label for="size">Enter Shoe size</label>
</div>
<div class="col-75">
<input type="" name="shoe_size" value="<?php echo $_GET['s_size'];?>">
</div>
<div class="row">
<div class="col-25">
<label for="Colour">Enter Shoe Colour</label>
</div>
<div class="col-75">
<input type="" name="shoe_color" value="<?php echo $_GET['s_color'];?>">
</div>
</div>
<br>
<br>
<div class="row">
<input type="submit" name="submit" value="Update"></button>
</div>
<br/>
</form>
<?php
if($_GET['submit'])
{
$shoename= $_GET['shoe'];
$shoesize=$_GET['shoe_size'];
$shoecolor= $_GET['shoe_color'];
$query ="UPDATE shoe SET shoe=' $shoename',shoe_color='$shoecolor' WHERE shoe_size='$shoesize'";
$data=mysqli_query($conn,$query);
if($data)
{
echo "record updated .<a href='display.php'>Check here updated list here</a>";
}
else{
echo "record not updated";
}
}
else{
echo "<font color='grey'>Click on the Update button to save the changes ";
}
?>
</div>
</body>
</html>