/
storageroom.php
105 lines (94 loc) · 2.86 KB
/
storageroom.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
<?php
require_once( 'db.inc.php' );
require_once( 'facilities.inc.php' );
$subheader=__("Storage Room Maintenance");
if(!$person->ReadAccess){
// No soup for you.
header('Location: '.redirect());
exit;
}
$dev=new Device();
if ( isset( $_POST["submit"]) && isset( $_POST["deviceid"]) ) {
$dispID = $_POST["dispositionid"];
$dList = Disposition::getDisposition( $dispID );
if ( count( $dList ) == 1 ) {
$devList = $_POST["deviceid"];
foreach( $devList as $d ) {
$dev->DeviceID = $d;
$dev->GetDevice();
$dev->Dispose( $dispID );
}
}
}
$dc=new DataCenter();
$dList = Disposition::getDisposition();
// Cabinet -1 is the Storage Area
$dev->Cabinet=-1;
$dc->DataCenterID=0;
if (isset($_GET['dc'])){
$dev->Position=$_GET['dc'];
$dc->DataCenterID=$_GET['dc'];
$dc->GetDataCenter();
$srname=sprintf(__("%s Storage Room"), $dc->Name);
}else{
$dev->Position=0;
$srname=__("General Storage Room");
}
$devList=$dev->ViewDevicesByCabinet(false,true);
?>
<!doctype html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><?php echo __("Storage Room Maintenance");?></title>
<link rel="stylesheet" href="css/inventory.php" type="text/css">
<link rel="stylesheet" href="css/jquery-ui.css" type="text/css">
<!--[if lt IE 9]>
<link rel="stylesheet" href="css/ie.css" type="text/css">
<![endif]-->
<script type="text/javascript" src="scripts/jquery.min.js"></script>
<script type="text/javascript" src="scripts/jquery-ui.min.js"></script>
</head>
<body>
<?php include( 'header.inc.php' ); ?>
<div class="page storage">
<?php
include( 'sidebar.inc.php' );
?>
<div class="main">
<?php echo '
<div class="center"><div>
<form method="POST">
<div class="table">
<div class="title" id="title">',$srname,'</div>
<div>
<div>',__("Device"),'</div>
<div>',__("Asset Tag"),'</div>
<div>',__("Serial No."),'</div>
<div></div>
</div>';
foreach($devList as $devID=>$device){
// filter the list of devices in storage rooms to only show the devices for this room
if($device->Position==$dc->DataCenterID){
echo "<div><div><a href=\"devices.php?DeviceID=$device->DeviceID\">$device->Label</a></div><div>$device->AssetTag</div><div>$device->SerialNo</div><div><input type=\"checkbox\" name=\"deviceid[]\" value=\"$device->DeviceID\"></div></div>\n";
}
}
print "<div><div>";
print __("Dispose of selected devices to:");
print "</div><div><select name=\"dispositionid\">";
foreach( $dList as $disp ) {
if ( $disp->Status == "Active" ) {
print "<option value=$disp->DispositionID>$disp->Name</option>";
}
}
print "</select></div><div><input type=\"submit\" name=\"submit\" value=\"Go\"></div>";
print "</div></div>";
?>
</form>
</div> <!-- END div.table -->
</div></div>
</div><!-- END div.main -->
</div><!-- END div.page -->
</body>
</html>