-
Notifications
You must be signed in to change notification settings - Fork 0
/
form6.php
187 lines (158 loc) · 5.9 KB
/
form6.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
<!--
Author: Khalil Greenidge
Email: [email protected]
Created: 30/04/2015
-->
<?php
session_start();
if(empty($_SESSION["login"])){
header("Location: login.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>HEDU IMS | Current Inventory</title>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<link rel="shortcut icon" href="dist/img/logo.gif" />
<link href="dist/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<!-- Ionicons -->
<link href="http://code.ionicframework.com/ionicons/2.0.0/css/ionicons.min.css" rel="stylesheet" type="text/css" />
<!-- Theme style -->
<link href="dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
<!-- AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. -->
<link href="dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<script>
function showResult(str) {
if (str.length==0) {
document.getElementById("livesearch").innerHTML="";
document.getElementById("livesearch").style.border="0px";
return;
}
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else { // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("livesearch").innerHTML=xmlhttp.responseText;
document.getElementById("livesearch").style.border="1px solid #A5ACB2";
}
}
xmlhttp.open("GET","livesearch.php?q="+str,true);
xmlhttp.send();
}
</script>
</head>
<body class="skin-blue">
<!-- Site wrapper -->
<div class="wrapper">
<!-- header logo: style can be found in header.less -->
<header class="main-header">
<?php include "header.php"; ?>
</header>
<!-- =============================================== -->
<!-- Left side column. contains the sidebar -->
<aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
<!-- search form -->
<form action="search.php" method="get" class="sidebar-form">
<div class="input-group">
<input type="text" name="key" autocomplete="off" onkeyup="showResult(this.value)" required class="form-control" placeholder="Search Serial#, Service Tag, Type"/>
<span class="input-group-btn">
<button type='submit' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i></button>
</span>
</div>
<div id="livesearch"></div>
</form>
<!-- /.search form -->
<!-- sidebar menu: : style can be found in sidebar.less -->
<?php
if($_SESSION["user"] == "admin"){
include "adminmenu.php";
}
else{
include "menu.php";
}
?>
</section>
<!-- /.sidebar -->
</aside>
<!-- =============================================== -->
<!-- Right side column. Contains the navbar and content of the page -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
View All Items
</h1>
</section>
<!-- Main content -->
<section class="content">
Current Inventory for H.E.D.U <button style="width: auto" class="btn bg-olive btn-block" onclick="window.print()">Print</button>
<br/><br/>
<?php
//VARIABLES
$type = "";
$con = mysqli_connect("localhost", "root", "");
$db = mysqli_select_db($con, "heduis");
$rs = mysqli_query($con, "SELECT * FROM stock ORDER BY type");
if(!$con || !$db || !$rs ){
die('Error: '.mysqli_error());
}
else{
echo "
<table class=\"table\">
<tr>
<th>Service Tag/Serial #</th>
<th>Name</th>
<th>Brand</th>
<th>Model</th>
<th>Type</th>
<th>Loaned</th>
<th>Comment</th>
</tr>
";
while($row = mysqli_fetch_array($rs)){
echo "<tr>";
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['brand'] . "</td>";
echo "<td>" . $row['model'] . "</td>";
echo "<td>" . $row['type'] . "</td>";
echo "<td>" . $row['loaned'] . "</td>";
echo "<td>" . $row['Comment'] . "</td>";
echo "</tr>";
}
echo "</table>";
echo "There are <b>".mysqli_num_rows($rs). "</b> assets at the Higher Education Development Unit";
mysqli_close($con);
}
?>
</section><!-- /.content -->
</div><!-- /.content-wrapper -->
<footer class="main-footer">
<?php include "footer.php";?>
</footer>
</div><!-- ./wrapper -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js" type="text/javascript"></script>
<!-- AdminLTE App -->
<script src="dist/js/app.min.js" type="text/javascript"></script>
<!-- AdminLTE for demo purposes -->
<script src="dist/js/demo.js" type="text/javascript"></script>
</body>
</html>