-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions_gpc.php
More file actions
91 lines (87 loc) · 2.61 KB
/
Copy pathoptions_gpc.php
File metadata and controls
91 lines (87 loc) · 2.61 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
<?php
include('components/config.php');
$options = ['gpc_Gwgc', 'gpc_Environment', 'gpc_Tier', 'gpc_Item', 'gpc_Ami', 'gpc_halb', 'gpc_OS', 'gpc_Ops', 'gpc_Phase'];
$result = $user->getOptions('gpc_Options', $options);
$optionheaders = [
'GW / GC',
'Environment',
'Tier',
'Item',
'AWS AMI',
'HA / LB Required',
'OS Spec Required',
'Operating Requirements',
'Phase'
];
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_POST['add'])) {
$user->addOption('gpc_Options', $_POST['add'], $_POST['value']);
}
else if (isset($_POST["delete"])) {
$user->deleteOption('gpc_Options', $_POST["delete"]);
}
$result = $user->getOptions('gpc_Options', $options);
}
include('components/sidebar.php')
?>
<!-- page content -->
<div class="right_col" role="main">
<div class="">
<div class="page-title">
<div class="title_left">
<h3>GPC Asset Management Options </h3>
</div>
</div>
<div class="clearfix"></div>
<?php foreach ($options as $header=>$option) {
echo '
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="x_panel" style="height: auto;">
<div class="x_title">
<h2>'.$optionheaders[$header].'</h2>
<ul class="nav navbar-right panel_toolbox">
<li class="pull-right"><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
</li>
</ul>
<div class="clearfix"></div>
</div>
<div class="x_content" style="display: none;">
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th>Field</th>
<th>Option</th>
</tr>
</thead>
<tbody>
';
foreach($result[$option] as $row) {
echo '<tr>';
echo '<form id="demo-form2" data-parsley-validate class="form-horizontal form-label-left" method="post">';
echo '<td>'.$row['gpc_Options_Name'].'</td>';
echo '<input type="hidden" name="delete" value="'.$row['gpc_Options_Id'].'">';
echo '<td><button type="submit" class="btn btn-danger btn-xs"><i class="fa fa-trash"></i> Delete</button></td>';
echo '</form>';
echo '</tr>';
};
echo '
<form id="demo-form2" data-parsley-validate class="form-horizontal form-label-left" method="post">
<td><input type="text" placeholder="Field to add" required="required" class="form-control" name="value"></td>
<input type="hidden" name="add" value="'$option'">
<td><button type="submit" class="btn btn-success btn-xs"><i class="fa fa-save"></i> Add</button></td>
</form>
</tr>
</tbody>
</table>
</div>
</div>
</div>';
};
?>
</div>
</div>
<!-- /page content -->
<?php
include 'components/footer.php';
include 'components/closing.php';
?>