[go: up one dir, main page]

Menu

[r37]: / edit.php  Maximize  Restore  History

Download this file

80 lines (76 with data), 2.4 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
<?
require_once 'functions.php';
if(!$is_admin){
header("Location: ".$_SERVER['HTTP_REFERER']);
}
if(!isset($_GET['machine'])){
if(!isset($_POST)){
die();
}
else {
$mid=$_POST['mid'];
foreach($_POST['service'] as $service){
updateService($service);
}
}
}
else {
$mid=$_GET['machine'];
}
$machine=getMachine($mid);
$services=getServicesOfMachine($mid);
?>
<html>
<body>
<form action='edit.php' method='post'>
<table align='center'>
<thead>
<tr>
<td colspan='6' style='text-align:center' >Services for <?php echo $machine->display." ( ".$machine->host." )"; ?></td>
</tr>
</thead>
<tr>
<td>Protocol</td>
<td>Port</td>
<td>Interval</td>
<td>Count</td>
<td>Service Name</td>
<td>Del</td>
</tr>
<?php foreach($services as $service): ?>
<tr>
<td><?php echo getListOfProtocols($service->id,$service->protocol) ?> </td>
<td><input type='text' name='<?php echo "service[".$service->id."][port]"; ?>' value='<?php echo $service->port ?>' /> </td>
<td><input type='text' name='<?php echo "service[".$service->id."][interval]"; ?>' value='<?php echo $service->interval ?>' /> </td>
<td>
<input type='text' name='<?php echo "service[".$service->id."][count]"; ?>' value='<?php echo $service->count ?>' />
<input type='hidden' name='<?php echo "service[".$service->id."][id]"; ?>' value='<?php echo $service->id?>' />
</td>
<td><input type='text' name='<?php echo "service[".$service->id."][service_name]"; ?>' value='<?php echo $service->service_name ?>' /> </td>
<td><input type='checkbox' name='<?php echo "service[".$service->id."][del]"; ?>' /> </td>
</tr>
<?php endforeach ?>
<tr>
<td colspan='6'><hr/></td>
</tr>
<tr>
<td><?php echo getListOfProtocols('new','http') ?> </td>
<td><input type='text' name="service[new][port]"/> </td>
<td><input type='text' name="service[new][interval]"/> </td>
<td>
<input type='text' name='service[new][count]' />
<input type='hidden' name='service[new][mid]' value='<?php echo $mid?>' />
</td>
<td><input type='text' name='<?php echo "service[new][service_name]"; ?>' /> </td>
<td></td>
</tr>
<tfoot>
<tr>
<td colspan='4'><input type='submit' value="Update" /></td>
</tr>
</tfoot>
</table>
<input type='hidden' name='mid' value='<?php echo $mid?>' />
</form>
</body>
</html>