-
Notifications
You must be signed in to change notification settings - Fork 2
/
rack_view.php
146 lines (129 loc) · 4.2 KB
/
rack_view.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
<?php
require 'lib/global.php';
if($USER->auth>0) {
if(isset($_GET['id'])) {
if($position=parsePosition($_GET['id'])) {
$rack=getRack($position['rack_id']);
if(!$rack['error']) {
$rack_id=renderRackID($rack['data']);
$table_content=new htmlTable('Content in rack '.$rack['data']['rack_name'],array('class' => 'rack'));
$table_content->addData(parseRackLayout($rack['layout']));
$table_layout=new htmlTable('Layout of rack'.$rack['data']['rack_name'],array('class' => 'rack'));
$table_layout->addData(parseRackLayout($rack['layout'],FALSE));
$log=new htmlTable('Log',array('class' => 'log'));
$log->addData(parseLog($rack['data']['log']));
$loghtml=$log->render();
} else {
// Storage ID does not exist
}
} else {
// Invalid ID format
}
}
} else {
header('Location:index.php');
}
// Render Page
//=================================================================================================
?>
<!doctype html>
<html class="no-js" lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PlateJuggler</title>
<link rel="stylesheet" href="css/foundation.css">
<link rel="stylesheet" href="css/app.css">
<link rel="stylesheet" href="css/icons/foundation-icons.css" />
</head>
<body>
<?php require '_menu.php'; ?>
<div class="row">
<br>
<div class="large-4 columns">
<img alt="<?php echo $rack_id; ?>" src="barcode.php?text=<?php echo $rack_id; ?>&print=true&size=100">
</div>
<div class="large-4 columns">
<table class="unstriped">
<tr>
<td><strong>ID</strong></td>
<td><code><?php echo $rack_id; ?></code></td>
</tr>
<tr>
<td><strong>Name</strong></td>
<td><?php echo $rack['data']['rack_name']; ?></td>
</tr>
<tr>
<td><strong>Storage unit</strong></td>
<td><?php echo $rack['storage']['storage_name']; ?> <a href="storage_view.php?id=<?php echo renderStorageID($rack['storage']) ?>"><code><?php echo renderStorageID($rack['storage']) ?></code></a></td>
</tr>
<tr>
<td><strong>Status</strong></td>
<td><?php echo formatStorageStatus($rack['data']['rack_status']); ?></td>
</tr>
</table>
</div>
<div class="large-4 columns">
<table class="unstriped">
<tr>
<td><strong>Columns</strong></td>
<td><?php echo $rack['data']['cols']; ?></td>
</tr>
<tr>
<td><strong>Rows</strong></td>
<td><?php echo $rack['data']['rows']; ?></td>
</tr>
<tr>
<td><strong>Slots</strong></td>
<td><?php echo $rack['data']['slots']; ?></td>
</tr>
</table>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<div class="card">
<div class="card-divider">
<strong>Description</strong>
</div>
<div class="card-section">
<?php echo $rack['data']['rack_description']; ?>
</div>
<ul class="tabs" data-tabs id="example-tabs">
<li class="tabs-title is-active"><a href="#panel1" aria-selected="true">Rack content</a></li>
<li class="tabs-title"><a href="#panel2">Rack layout</a></li>
</ul>
<div class="tabs-content" data-tabs-content="example-tabs">
<div class="tabs-panel is-active" id="panel1">
<?php echo $table_content->render(); ?>
</div>
<div class="tabs-panel" id="panel2">
<?php echo $table_layout->render(); ?>
</div>
</div>
</div>
<div class="card">
<div class="card-divider">
<strong>Tools</strong>
</div>
<div class="card-section">
<div class="button-group">
<a href="rack_edit.php?id=<?php echo $rack_id; ?>" class="button"><i class="fi-widget"></i> Edit rack</a>
<a href="rack_move.php?id=<?php echo $rack_id; ?>" class="button"><i class="fi-plus"></i> Move rack</a>
</div>
</div>
</div>
<?php echo $loghtml; ?>
</div>
</div>
<script src="js/vendor/jquery.js"></script>
<script src="js/vendor/what-input.js"></script>
<script src="js/vendor/foundation.js"></script>
<script src="js/vendor/foundation.core.js"></script>
<script src="js/vendor/foundation.tabs.js"></script>
<script src="js/vendor/foundation.util.keyboard.js"></script>
<script src="js/vendor/foundation.util.timerAndImageLoader.js"></script>
<script src="js/app.js"></script>
</body>
</html>