forked from Jmurrietasmith/EqManage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfetchCheckoutEq.php
More file actions
30 lines (27 loc) · 978 Bytes
/
fetchCheckoutEq.php
File metadata and controls
30 lines (27 loc) · 978 Bytes
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
<?php
session_start();
if(!isset($_SESSION['loggedin'])){
header('Location: login.php');
exit();
}
if ($_SESSION['username'] != 'administrator'){
header('Location: index.php?adminonly=1');
}
include('serverconnect.php');
$result = mysqli_query($db,"select distinct e.equipment, e.barcodeID, e.id
from equipment e
inner join log l
on e.id = l.equipment_id
where l.returnDate IS NULL and l.checkoutDate IS NULL");
echo "<select id=\"eqselect\" style=\"width: 100%; text-align: left;margin-bottom: 10px\" >";
echo "<option value=\"\">Select equipment</option>";
while ($row = mysqli_fetch_array($result)){
$equipmentName = $row['equipment'];
$equipmentID = $row['id'];
$barcodeID = $row['barcodeID'];
echo "<option value='$equipmentID' data-checkoutRequestsID='$equipmentID'>$barcodeID | $equipmentName </option>";
};
echo " </select>";
echo "<script src=\"assets/js/select2.min.js\"></script>
<script src=\"assets/js/adminScript.js\"></script>";
?>