-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditFilter2.php
More file actions
36 lines (29 loc) · 834 Bytes
/
editFilter2.php
File metadata and controls
36 lines (29 loc) · 834 Bytes
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
<?
require("sessionCheck.php");
require("config.php");
require_once('model/MP.php');
require_once('model/Filter.php');
if ( isset($_POST['cancel']) ){
header("Location: listFilters.php?SID=$sid");
exit;
}
$mp = MP::from_mampid($_POST['mp']);
if ( $mp == null ){
die("No measurement point named {$_GET['MAMPid']}!");
}
$FILTER_ID=$_POST["filter_id"];
$OLD_FILTER_ID=$_POST["old_filter_id"];
$fields = $_POST;
unset($fields['old_filter_id']);
unset($fields['mp']);
unset($fields['action']);
foreach ($fields as $key => $value){
if ( strcmp(substr($key, -10), '_selection') == 0 || strcmp(substr($key, -3), '_cb') == 0 ){
unset($fields[$key]);
}
}
$filter = new Filter($mp, $fields);
$filter->commit($OLD_FILTER_ID > 0 ? $OLD_FILTER_ID : null);
$mp->reload_filter($FILTER_ID);
header("Location: listFilters.php");
?>