-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy patholt_ip_pool_modal.php
97 lines (94 loc) · 3.1 KB
/
olt_ip_pool_modal.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
<?php
include_once("common.php");
include_once("classes/ip_pool_class.php");
include_once("classes/customers_class.php");
if ($user_class < "9")
exit();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$ip_pool_obj = new ip_pool();
$ip_pool_obj->get_data_olt_ip_pool();
$customers_obj = new customers();
?>
<form id="contact_form" action="ip_pool.php" method="post">
<?php if (null !== $ip_pool_obj->getBinding_id()) {
print "<input type=\"hidden\" name=\"binding_id\" value=\"". $ip_pool_obj->getBinding_id() ."\">";
}
?>
<div class="row">
<div class="col-md-5 col-md-offset-1">
<div class="form-group">
<label for="OLT">OLT</label>
<select class="form-control" id="select-olt2" name="olt_id">
<?php
print " <option value=\"\">Select</option>";
$rows = $customers_obj->get_Olt_models();
foreach ($rows as $row) {
if($ip_pool_obj->getOlt_id() == $row['ID']) {
print "<option value=\"" . $row['ID'] ."\" selected>" . $row['NAME'] . "</option>";
} else {
print "<option value=\"" . $row['ID'] ."\">" . $row['NAME'] . "</option>";
}
}
?>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4 col-md-offset-1">
<div class="form-group">
<label for="SERVICE">Service</label>
<select class="form-control" id="select-service" name="service_id">
<?php
print " <option value=\"\">Select</option>";
$rows = $customers_obj->get_Service();
foreach ($rows as $row) {
if($ip_pool_obj->getService_id() == $row['ID']) {
print "<option value=\"" . $row['ID'] ."\" selected>" . $row['NAME'] ." === ". $row['ID'] ."</option>";
} else {
print "<option value=\"" . $row['ID'] ."\">" . $row['NAME'] ." === ". $row['ID'] ."</option>";
}
}
?>
</select>
</div>
</div>
</div>
<div class=row>
<div class="col-md-6 col-md-offset-1">
<div class="form-group">
<label for="ip_pool">IP_POOL</label>
<select class="form-control" id="select-ip-pool" name="id">
<?php
print " <option value=\"\">Select</option>";
$rows = $ip_pool_obj->get_IP_pools();
foreach ($rows as $row) {
if($ip_pool_obj->getId() == $row['ID']) {
print "<option value=\"" . $row['ID'] ."\" selected>" . $row['SUBNET'] . "/" . $row['NETMASK'] . "</option>";
} else {
print "<option value=\"" . $row['ID'] ."\">" . $row['SUBNET'] . "/" . $row['NETMASK'] ."</option>";
}
}
?>
</select>
</div>
</div>
</div>
<div class=row>
<div class="form-group">
<div class="col-md-4 col-md-offset-4">
<?php
$edit = (isset($_GET['edit']) ? $_GET['edit'] : null);
if ($edit == "1" || null !== $ip_pool_obj->getId()) {
?>
<button type="submit" name="SUBMIT" class="btn btn-basic" value="EDIT_BINDING">EDIT</button>
<button type="submit" name="SUBMIT" class="btn btn-basic" value="DELETE_BINDING">DELETE</button>
<?php }else{ ?>
<button type="submit" name="SUBMIT" class="btn btn-basic" value="ADD_BINDING">ADD</button>
<?php } ?>
</div>
</div>
</div>
<?php
}
?>