Skip to content

Commit

Permalink
Update Alarm.php
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovikov authored Sep 26, 2016
1 parent b6f2027 commit 4e1f556
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions api/RestApi/Alarm.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,14 @@ public function doAlarmList($timestamp, $param){
$calldata = array();
$arrwhere = "";

foreach($param['filter'] as $key=>$filter) {

$search[$key]['type'] = getVar('type', NULL, $filter, 'string');
$search[$key]['source_ip'] = getVar('source_ip', NULL, $filter, 'string');

$callwhere = generateWhere($search[$key], 1, $db, 0);
if(count($callwhere)) $calldata[] = "(". implode(" AND ", $callwhere). ")";
if(isset($param['filter']))
{
foreach($param['filter'] as $key=>$filter) {
$search[$key]['type'] = getVar('type', NULL, $filter, 'string');
$search[$key]['source_ip'] = getVar('source_ip', NULL, $filter, 'string');
$callwhere = generateWhere($search[$key], 1, $db, 0);
if(count($callwhere)) $calldata[] = "(". implode(" AND ", $callwhere). ")";
}
}

if(count($calldata)) $arrwhere = " AND (". implode(" OR ", $calldata). ")";
Expand Down

0 comments on commit 4e1f556

Please sign in to comment.