-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinventory.php
More file actions
147 lines (135 loc) · 4.83 KB
/
inventory.php
File metadata and controls
147 lines (135 loc) · 4.83 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
<?php
require_once('connectvars.php');
require_once('appfunctions.php');
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
$form_type = mysqli_real_escape_string($dbc, trim($_GET['type']));
$page_title = 'Inventory';
$page_access = 'All';
include('header.php');
//include other scripts needed here
echo '<script src="js/inventory_scripts.js"></script>';
//end header
echo '</head>';
//start body
echo '<body>';
//include nav bar
include('navbar-teachers.php');
?>
<div class="bd-pageheader bg-primary text-white pt-4 pb-4">
<div class="container">
<h1>
Classes
</h1>
<p class="lead">
Manage and submit lesson plans, weekly assessment data, and inventory
</p>
</div>
</div>
<div class="container mt-5 mb-5">
<div class="row">
<div class="col-12">
<h1>
Inventory
</h1>
<p class="lead">
Use this page to manage inventory
</p>
<form method="post" action="service.php">
<input type="hidden" name="action" value="verifyInventory">
<input type="hidden" name="username" value="<?php echo $_SESSION['username']; ?>">
<?php
if (strpos('Principal Dept Head Admin Superintendent', $_SESSION['access']) !== false) {
?>
<p>
<a class="btn btn-outline-primary" href="inventoryreport.php">Inventory Report</a>
<a class="btn btn-outline-primary" href="inventoryscan.php">Inventory Scan</a>
</p>
<!--
<div class="form-group row">
<label for="location" class="col-sm-3 col-form-label">Location</label>
<div class="col-sm-9">
<select id="location" class="form-control" name="location">
<option></option>
<option value="1">001 - District Office</option>
<option value="4">004 - Chambers Middle School</option>
<option value="8">008 - Sanders Elementary School</option>
<option value="12">012 - Simmons High School</option>
</select>
</div>
</div>
-->
<div class="form-group row">
<label for="room" class="col-sm-3 col-form-label">Room</label>
<div class="col-sm-9">
<select id="room" class="form-control" name="room">
<option></option>
<?php
$query = "SELECT room FROM inventory GROUP BY room ORDER BY room";
$result = mysqli_query($dbc, $query);
while ($row = mysqli_fetch_array($result)) {
echo '<option value="' . $row['room'] . '">' . $row['room'] . '</option>';
}
?>
</select>
</div>
</div>
<?php
}
else {
$location = $_SESSION['school'];
switch ($location) {
case 'Sanders':
echo '<input type="hidden" name="location" id="location" value="8">';
break;
case 'Simmons':
echo '<input type="hidden" name="location" id="location" value="12">';
break;
default:
echo '<input type="hidden" name="location" id="location" value="1">';
}
$username = $_SESSION['username'];
$query = "SELECT room FROM staff_list WHERE username = '$username'";
$result = mysqli_query($dbc, $query);
$room = mysqli_fetch_array($result)['room'];
echo '<input type="hidden" name="room" value="' . $room . '" id="room">';
}
?>
<table class="table table-striped" id="inventoryTbl">
<thead>
<tr>
<th>Room</th>
<th>Item No.</th>
<th>Name/Title</th>
<th>Class</th>
<th>Serial No.</th>
<th>Condition</th>
<th>Status</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<div id="lostDiv" style="display: none;" class="alert alert-danger" role="alert">
<h5>Lost or Stolen Items</h5>
If you have any missing or lost items, please contact your principal and Ms. Latarsha Brown immediately. You will need to complete a Fixed Asset Lost or Stolen Property Affadavit within the next 24 hours (if you have not already done so for this item).
</div>
<h5>
Ackowledgement
</h5>
<p>
By clicking Submit, I acknowledge that I understand that the assets listed above may not be moved to another room without first completing a Fixed Assets Transfer Form and having this approved by my principal, supervisor, and the Business Director.
</p>
<div id="alert" class="alert" role="alert">
</div>
<a class="btn btn-primary disabled" id="btnSubmitForm" href="#!">Submit</a>
<a class="btn btn-danger" href="classes.php">Cancel</a>
</form>
</div>
</div>
</div>
<?php
mysqli_close($dbc);
//include footer
include('footer.php');
?>