-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlabd3.php
246 lines (215 loc) · 8.52 KB
/
labd3.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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<?php include('labd2.php');
//$foliono = "";
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSS-->
<link rel="stylesheet" type="text/css" href="css/main.css">
<title>IMS</title>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries-->
<!--if lt IE 9
script(src='https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js')
script(src='https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js')
-->
<script language="javascript" type="text/javascript">
function printDiv(divID) {
//Get the HTML of div
var divElements = document.getElementById(divID).innerHTML;
//Get the HTML of whole page
var oldPage = document.body.innerHTML;
//Reset the page's HTML with div's HTML only
document.body.innerHTML =
"<html><head><title></title></head><body>"+
'University Of Jaffna'+"<br>"+
'Faculty of Science'+"<br>"+
Date()+
divElements + "</body>";
//Print Page
window.print();
//Restore orignal HTML
document.body.innerHTML = oldPage;
}
</script>
</head>
<body class="sidebar-mini fixed">
<div class="wrapper">
<!-- Navbar-->
<header class="main-header hidden-print"><a href="home.php" class="logo">IMS</a>
<nav class="navbar navbar-static-top">
<!-- Sidebar toggle button--><a href="#" data-toggle="offcanvas" class="sidebar-toggle"></a>
<!-- Navbar Right Menu-->
<div class="navbar-custom-menu">
<ul class="top-nav">
<!--Notification Menu-->
<!-- User Menu-->
<li class="not-head" >
<?php
// ob_start();
// session_start();
require_once 'dbconfig.php';
// if session is not set this will redirect to login page
if( !isset($_SESSION['user']) ) {
header("Location: index.php");
exit;
}
// select loggedin users detail
$id =$_SESSION['user'];
$sql = "SELECT * FROM signup WHERE username='$id'";
$res=mysqli_query($conn,$sql);
$userRow=mysqli_fetch_array($res);
$name = $userRow['username'];
echo "$name"
?>
</li>
<li class="dropdown"><a href="#" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" class="dropdown-toggle"><i class="fa fa-user fa-lg"></i></a>
<ul class="dropdown-menu settings-menu">
<li><a href="logout.php?logout"><i class="fa fa-sign-out fa-lg"></i> Logout</a></li>
</ul>
</li>
</ul>
</div>
</nav>
</header>
<!-- Side-Nav-->
<aside class="main-sidebar hidden-print">
<section class="sidebar">
<div class="user-panel">
<div class="pull-left image"><img src="images/logo.jpg" alt="User Image" class="img-circle"></div>
<div class="pull-left info">
<p class="designation">University of Jaffna.</p>
</div>
</div>
<!-- Sidebar Menu-->
<ul class="sidebar-menu">
<li class="active"><a href="home.php"><i class="fa fa-dashboard"></i><span>Home</span></a></li>
<li class="treeview"><a href="#"><i class="fa fa-th-list"></i><span>Inventory</span><i class="fa fa-angle-right"></i></a>
<ul class="treeview-menu">
<li><a href="lab.php"><i class="fa fa-circle-o"></i>Lab</a></li>
<li><a href="office.php"><i class="fa fa-circle-o"></i>Office</a></li>
<li><a href="fur.php"><i class="fa fa-circle-o"></i>Furniture</a></li>
<li><a href="consu.php"><i class="fa fa-circle-o"></i>Consumble</a></li>
</ul>
</li>
<li class="treeview"><a href="#"><i class="fa fa-th-list"></i><span>Maintenance</span><i class="fa fa-angle-right"></i></a>
<ul class="treeview-menu">
<li class="treeview"><a href="#"><i class="fa fa-th-list"></i><span>Send</span><i class="fa fa-angle-right"></i></a>
<ul class="treeview-menu">
<li><a href="loan.php"><i class="fa fa-circle-o"></i>Loan</a></li>
<li><a href="trans.php"><i class="fa fa-circle-o"></i>Transfer</a></li>
</ul>
<li class="treeview"><a href="#"><i class="fa fa-th-list"></i><span>Received</span><i class="fa fa-angle-right"></i></a>
<ul class="treeview-menu">
<li><a href="loan_rcvd.php"><i class="fa fa-circle-o"></i>Loan</a></li>
<li><a href="trans_rcvd.php"><i class="fa fa-circle-o"></i>Transfer</a></li>
</ul>
</ul>
</li>
<li class="treeview"><a href="about.php"><i class="fa fa-th-list"></i><span>About</span><i class="fa fa-angle-right"></i></a>
</ul>
</section>
</aside>
<div class="content-wrapper">
<div class="page-title">
<div>
<h1>Details on Lab Equipment</h1>
<ul class="breadcrumb side">
<li><i class="fa fa-home fa-lg"></i></li>
<li>Inventory</li>
<li class="active"><a href="lab.php">Lab Equipment</a></li>
</ul>
</div>
<div><a href="labd.php" class="btn btn-primary btn-flat"><i class="fa fa-lg fa-plus"></i></a></div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card">
<form id="form1" runat="server">
<div class="card-body">
<div id="printablediv">
<div class="body">
<div class="table-responsive">
<?php if (isset($_SESSION['message'])): ?>
<div class="msg">
<?php
echo $_SESSION['message'];
unset($_SESSION['message']);
?>
</div>
<?php endif ?>
<?php
if(isset($_POST['foliono'])){
$foliono = trim($_POST['foliono']);
$foliono = strip_tags($foliono);
$foliono = htmlspecialchars($foliono);
}
$results = mysqli_query($db, "SELECT * FROM lab WHERE foliono='$foliono'");
// $results = mysqli_query($db, "SELECT * FROM lab ");
?>
<table class='table table-bordered table-striped table-hover js-basic-example dataTable'>
<thead>
<tr>
<th>Identification No</th>
<th>Folio No</th>
<th>Serial</th>
<th>Inventory Date</th>
<th>Warrenty</th>
<th>Type</th>
<th>Make</th>
<th>Model</th>
<th>Year of Manufacture</th>
<th>Status</th>
<th>Description</th>
<th colspan="2">Action</th>
</tr>
</thead>
<?php while ($row = mysqli_fetch_array($results)) { ?>
<tr>
<td><?php echo $row['idno']; ?></td>
<td><?php echo $row['foliono']; ?></td>
<td><?php echo $row['serial']; ?></td>
<td><?php echo $row['intdate']; ?></td>
<td><?php echo $row['warrenty']; ?></td>
<td><?php echo $row['type']; ?></td>
<td><?php echo $row['make']; ?></td>
<td><?php echo $row['model']; ?></td>
<td><?php echo $row['yrmanu']; ?></td>
<td><?php echo $row['state']; ?></td>
<td><?php echo $row['discpt']; ?> </td>
<td>
<a href= "labd.php?edit=<?php echo $row['lab_id']; ?>"><i class="fa fa-lg fa-edit"></i></a>
</td>
<td>
<a onClick="javascript: return confirm('Please confirm deletion')" href="labd2.php?del=<?php echo $row['lab_id']; ?>"><i class="fa fa-lg fa-trash"></i></a>
</td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="row hidden-print mt-20">
<div class="col-xs-12 text-right"><a onclick="javascript:printDiv('printablediv')" class="btn btn-primary"><i class="fa fa-print"></i> Print</a></div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Javascripts-->
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/essential-plugins.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/plugins/pace.min.js"></script>
<script src="js/main.js"></script>
<script type="text/javascript" src="js/plugins/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="js/plugins/dataTables.bootstrap.min.js"></script>
<script type="text/javascript">$('#sampleTable').DataTable();</script>
</body>
</html>