forked from danclough/reaction-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
inputs.php
80 lines (79 loc) · 2.5 KB
/
inputs.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<?php if (isset($argArray['configure'])) {
echo "<title>Reaction Toolkit Configuration</title>";
} else {
echo "<title>Reaction Toolkit Dashboard</title>";
} ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="include/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="include/css/toolkit.css">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
</head>
<body role="document">
<?php include('include/pages/navbar.php'); ?>
<div class="container-fluid">
<div class="page-header">
<h1 class="center">Reaction Input Lookup</h1>
</div>
<?php
require_once('include/session_setup.php');
$objectFactory = new ObjectFactory();
$formBuilder = new FormBuilder();
$scriptName = basename($_SERVER['PHP_SELF']);
if (isset($_POST['re'])) {
$reactionID = $_POST['re'];
$reaction = $objectFactory->create(ObjectFactory::REACTION, $reactionID);
$reactionType = $reaction->getReactionType();
if ($reactionType == 3) {
$reactionName = $reaction->getOutput()->getName()." Alchemy";
} else {
$reactionName = $reaction->getOutput()->getName();
}
$inputs = $reaction->getInputs();
?> <div class="center">
<form class="form-inline" style="display:inline" method="post" action="<?php echo $scriptName; ?>">
<input type='hidden' name='reset' value='1'>
<button type='submit' class='btn btn-xs btn-danger'>Reset</button>
</form>
</div>
<div class="center">
<table class="table table-striped table-condensed">
<thead>
<tr>
<th colspan='2'>
<?php echo $reactionName; ?>
</th>
</tr>
<tr>
<th>Input</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
<?php foreach($inputs as $input) {
?>
<tr>
<td><?php
$thisInput = $objectFactory->create(ObjectFactory::TYPE, $input['typeID']);
echo $thisInput->getName();
?></td>
<td align=right><?php echo $input['inputQty']; ?></td>
</tr>
<?php }
?> </tbody>
</table>
</div>
<?php
} else {
?> <div class="center">
<?php $formBuilder->generateReactionSelectForm($scriptName,"Lookup"); ?>
</div>
<?php }
?> </div>
<script src="include/javascript/bootstrap.min.js"></script>
</body>
</html>