-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheditNetworkForm.php
More file actions
58 lines (47 loc) · 1.86 KB
/
editNetworkForm.php
File metadata and controls
58 lines (47 loc) · 1.86 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
<?php
$id = $_GET['id'];
$q = "SELECT * FROM `ipamv6` WHERE `id`='".$id."' LIMIT 1;";
$res = $sql->query($q);
$row = $sql->array_result($res);
// "Root" network
$rootNetwork = new IPv6();
$rootNetwork->initBinary($row['network_bin'], $row['mask']);
?>
<form action="./" method="get" class="network-form">
<input type="hidden" name="action" value="storeEditedNetwork">
<input type="hidden" name="format" value="hex">
<input type="hidden" name="id" value="<?php echo $_GET['id']?>">
<div class="form-group">
<label for="network">Network:</label>
<input id="network" type="text" name="newNetwork" value="<?php echo $rootNetwork->getMyCompressedAddress(); ?>">
<span class="hint"></span>
</div>
<div class="form-group">
<label for="mask">netmask:</label>
<input id="mask" type="text" name="newMask" value="<?php echo $row['mask']; ?>">
<span class="hint"></span>
</div>
<div class="form-group">
<label for="description">description:</label>
<input id="description" type="text" name="newDescription" value="<?php echo $row['description']; ?>">
<span class="hint"></span>
</div>
<div class="form-group">
<label for="color">colour:</label>
<div class="color-input">
<script type="text/javascript" src="jscolor/jscolor.js"></script>
<input id="color" type="text" class="color {hash:true,pickerPosition:'right',pickerClosable:true}"
name="newColor" value="<?php echo $row['color']; ?>">
</div>
<span class="hint"></span>
</div>
<div class="form-group">
<label for="root">root:</label>
<input id="root" type="checkbox" name="newRoot" value="1" <?php if($row['root'] == "1"){echo "checked";}?>>
<span class="hint">If you select this network as "root" it will show up into the left panel.</span>
</div>
<div class="form-group submit-group">
<input type="submit" value="Save" class="btn btn-primary">
<span class="hint"></span>
</div>
</form>