-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregitem.php
More file actions
164 lines (137 loc) · 3.32 KB
/
regitem.php
File metadata and controls
164 lines (137 loc) · 3.32 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
<!DOCTYPE html>
<html>
<head>
<title>Book item </title>
<style>
* {
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
<?php
session_start();
?>
/* Style the header */
header {
background-color: #666;
padding: 30px;
text-align: center;
font-size: 35px;
color: white;
}
/* Create two columns/boxes that floats next to each other */
nav {
float: left;
width: 30%;
height: 300px; /* only for demonstration, should be removed */
background: #ccc;
padding: 20px;
}
/* Style the list inside the menu */
nav ul {
list-style-type: none;
padding: 0;
}
article {
float: left;
padding: 20px;
width: 70%;
background-color: #f1f1f1;
height: 300px; /* only for demonstration, should be removed */
}
/* Clear floats after the columns */
section:after {
content: "";
display: table;
clear: both;
}
/* Style the footer */
footer {
background-color: #777;
padding: 10px;
text-align: center;
color: white;
}
/* Responsive layout - makes the two columns/boxes stack on top of each other instead of next to each other, on small screens */
@media (max-width: 600px) {
nav, article {
width: 100%;
height: auto;
}
}
</style>
</head>
<body
<div id="frm">
<header>
<h2>Book Item</h2>
<ul class="navbar-nav nav-dropdown" data-app-modern-menu="true"><li class="nav-item">
<a class="nav-link link text-white display-4" href="reqitemadmin.php">
Request For items:
</a>
</li></ul>
</header>
<footer>
<form action="item.php" method="POST">
<p>
Product Name<input type="text" name="name">
Product Quantity<input type="text" name="quan">
Issue Date<input type="date" name="issuedate">
Return Date<input type="date" name="returndate">
<!--
<label><b>Project Title:</b></label>
<input type="text" id="protitle" name="protitle"/>
</p>
<p>
<label><b>Model number:</b></label>
<input type="text" id="mdnum" name="mdnum"/>
</p>
<p>
<label><b>Name:</b></label>
<input type="text" id="name" name="name"/>
</p>
<p>
<label><b>Quantity:</b></label>
<input type="text" id="quan" name="quan"/>
</p>
<p>
<input type="date" name="issuedate">
</p>
<p>
<input type="date" name="returndate">
</p>
<p>
-->
<input type="submit" id="btn" name="items"/>
</form>
</div>
</footer>
<nav>
</nav>
<article>
<?php
$db_username = 'root';
$db_password = '';
$db_name = 'users';
$db_host = 'localhost';
//connect to MySql
$mysqli = new mysqli($db_host, $db_username, $db_password,$db_name);
if ($mysqli->connect_error) {
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
}
$sql = "SELECT DISTINCT name FROM product";
$result = $mysqli->query($sql);
if ($result->num_rows > 0) {
// output data of each row
$count=0;
while($row = $result->fetch_assoc()) {
$count=$count+1;
//echo " <br><b>Item No :</b> ".$count."<br>"."<br> NAME: ". $row["Name"]. "<br> Model Number: ". $row["modelnumber"]."<br> Quantity: ". $row["quantity"]."<br>";
echo "<br><b>Item No :<b>".$count.$row["name"];
}
}
?>
</article>
</body>
</html>