Skip to content

Commit 021bb18

Browse files
authored
initial commit
1 parent 9f2ecca commit 021bb18

File tree

6 files changed

+451
-0
lines changed

6 files changed

+451
-0
lines changed

DBMS.php

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
<?php
2+
include("connection.php");
3+
error_reporting(0);
4+
?>
5+
6+
7+
<!DOCTYPE html>
8+
<html>
9+
<head><title>Online Shoe Inventory</title>
10+
<meta name="viewport" content="width=device-width, initial-scale=1">
11+
<style>
12+
* {
13+
box-sizing: border-box;
14+
}
15+
16+
input[type=text], select, textarea {
17+
width: 100%;
18+
padding: 12px;
19+
border: 1px solid #ccc;
20+
border-radius: 4px;
21+
resize: vertical;
22+
}
23+
24+
label {
25+
padding: 12px 12px 12px 0;
26+
display: inline-block;
27+
}
28+
29+
input[type=submit] {
30+
background-color: #4CAF50;
31+
color: white;
32+
padding: 12px 20px;
33+
border: none;
34+
border-radius: 4px;
35+
cursor: pointer;
36+
float: center;
37+
}
38+
39+
input[type=submit]:hover {
40+
background-color: #45a049;
41+
}
42+
43+
.container {
44+
border-radius: 5px;
45+
background-color: #f2f2f2;
46+
padding: 20px;
47+
}
48+
49+
.col-25 {
50+
float: center;
51+
width: 25%;
52+
margin-top: 6px;
53+
}
54+
55+
.col-75 {
56+
float: center;
57+
width: 75%;
58+
margin-top: 6px;
59+
}
60+
61+
/* Clear floats after the columns */
62+
.row:after {
63+
content: "";
64+
display: table;
65+
clear: both;
66+
}
67+
68+
/* 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 */
69+
@media screen and (max-width: 600px) {
70+
.col-25, .col-75, input[type=submit] {
71+
width: 100%;
72+
margin-top: 0;
73+
}
74+
}
75+
76+
ul {
77+
list-style-type: none;
78+
margin: 0;
79+
padding: 0;
80+
overflow: hidden;
81+
background-color: #333;
82+
}
83+
84+
li {
85+
float: left;
86+
}
87+
88+
li a {
89+
display: block;
90+
color: white;
91+
text-align: center;
92+
padding: 14px 16px;
93+
text-decoration: none;
94+
}
95+
96+
li a:hover {
97+
background-color: #111;
98+
}
99+
.h1{
100+
font-size: 50px;
101+
text-decoration: bold;
102+
}
103+
104+
</style></head>
105+
<body>
106+
<ul>
107+
<li><a href="file:///C:/Users/krishnakakade/Documents/DBMS.html">Home</a></li>
108+
<li><a href="#view">View</a></li>
109+
</ul>
110+
<h1 align="center">Online Shoe Inventory </h1>
111+
112+
<div class="container">
113+
<form action="" method="GET">
114+
<div class="row">
115+
<div class="col-25">
116+
117+
<label for="Company">Enter Shoe Company</label>
118+
</div>
119+
<div class="col-75">
120+
<input type="" name="shoe" value="">
121+
</div>
122+
<div class="row">
123+
<div class="col-25">
124+
125+
<label for="size">Enter Shoe size</label>
126+
</div>
127+
<div class="col-75">
128+
<input type="" name="size" value="">
129+
</div>
130+
<div class="row">
131+
<div class="col-25">
132+
<label for="Colour">Enter Shoe Colour</label>
133+
</div>
134+
<div class="col-75">
135+
<input type="" name="colour" value="">
136+
</div>
137+
</div>
138+
139+
<br>
140+
<br>
141+
142+
<div class="row">
143+
<input type="submit" value="insert"></button>
144+
</div>
145+
<br/>
146+
147+
148+
</form>
149+
150+
<?php
151+
152+
$sshoe=$_GET["shoe"];
153+
$ssize=$_GET["size"];
154+
$color=$_GET["colour"];
155+
156+
157+
$query="INSERT INTO shoe VALUES ('$sshoe','$ssize','$color')";
158+
$data=mysqli_query($conn,$query);
159+
160+
161+
if($data)
162+
{
163+
echo "Data is inserted into database";
164+
}
165+
166+
?>
167+
168+
169+
</div>
170+
</body>
171+
</html>

connection.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
$servername="localhost";
3+
$username="root";
4+
$password="";
5+
$dbname="website";
6+
7+
$conn=mysqli_connect($servername,$username,$password,$dbname);
8+
9+
if($conn)
10+
{
11+
echo "connected ";
12+
}
13+
else
14+
{
15+
die("connected not".mysqli_connect_error());
16+
}
17+
18+
19+
?>

delete.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
include("connection.php");
4+
#error_reporting(0);
5+
$query="DELETE FROM shoe WHERE shoe_color='klw'";
6+
$data=mysqli_query($conn,$query);
7+
if($data)
8+
{
9+
echo"data deleted ";
10+
11+
}
12+
else {
13+
echo"data not deleted";
14+
}
15+
if (isset($_GET['DELETE'])){
16+
$id=$_GET['shoe'];
17+
echo $id ;
18+
}
19+
?>

display.php

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<style >
2+
td{
3+
padding: 10px;
4+
}
5+
6+
</style>
7+
8+
<?php
9+
include("connection.php");
10+
error_reporting(0);
11+
$query="SELECT *FROM shoe";
12+
$data=mysqli_query($conn,$query);
13+
$total=mysqli_num_rows($data);
14+
15+
if($total!=0)
16+
{
17+
?>
18+
<table>
19+
<tr>
20+
<th>Shoe company</th>
21+
<th>Shoe size</th>
22+
<th>Shoe colour</th>
23+
<th colspan='2'>Operations</th>
24+
</tr>
25+
26+
<?php
27+
28+
while($result=mysqli_fetch_assoc($data))
29+
{
30+
31+
echo "<tr>
32+
<td>". $result['shoe']."</td>
33+
<td>".$result['shoe_size']."</td>
34+
<td>".$result['shoe_color']."</td>
35+
<td><a href='update.php?s=$result[shoe]&s_size=$result[shoe_size]&s_color=$result[shoe_color]'>Edit</a></td>
36+
<td><a href='delete.php?$result[shoe]'>DElETE</a></td>
37+
</tr>";
38+
}
39+
40+
}
41+
else
42+
{
43+
echo "No record found";
44+
}
45+
46+
?>
47+
</table>

hello.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
include("connection.php");
3+
4+
$query="INSERT INTO shoe VALUES ('bata','8','yellow')";
5+
$data=mysqli_query($conn,$query);
6+
7+
if($data)
8+
{
9+
echo "Data is inserted into database";
10+
}
11+
?>

0 commit comments

Comments
 (0)