Commit f40a9f73 authored by Ad Schellevis's avatar Ad Schellevis

(network insight) add multiple filter support

parent 77944999
......@@ -141,7 +141,18 @@ class NetworkinsightController extends ApiControllerBase
$result = array();
if ($this->request->isGet()) {
if ($this->request->get("filter_field") != null && $this->request->get("filter_value") != null) {
$data_filter = $this->request->get("filter_field") . "=" . $this->request->get("filter_value");
$filter_fields = explode(',', $this->request->get("filter_field"));
$filter_values = explode(',', $this->request->get("filter_value"));
$data_filter="";
foreach ($filter_fields as $field_indx => $filter_field) {
if ($data_filter != '') {
$data_filter .= ',';
}
if (isset($filter_values[$field_indx])) {
$data_filter .= $filter_field.'='.$filter_values[$field_indx] ;
}
}
$data_filter = "'{$data_filter}'";
} else {
// no filter, empty parameter
$data_filter = "''";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment