예제 #1
0
파일: reports.php 프로젝트: AviMoto/webekci
function rule_report($tmp, $page)
{
    global $RS;
    list($filter, $fwhere) = Filter::getFilter($_POST, $_GET);
    $filters = Filter::getFilters();
    foreach ($fwhere as $w) {
        $where .= $w;
    }
    $total_row =& Report::countRuleRecords($where);
    $navigation = new Navigation($_POST['start'], $_POST['rows'], $_POST['begin'], $_POST['first'], $total_row);
    $start = $navigation->getNavigationStart();
    $rows = $navigation->getNavigationRows();
    $begin = $navigation->getNavigationBegin();
    $first = $navigation->getNavigationFirst();
    $wlimit .= $navigation->getNavigationWhere();
    $audits_a =& Report::getRuleRecords($where, $wlimit);
    $audit_logs = array();
    $total_rows = 0;
    foreach ($audits_a as $alog) {
        $audit_logs[] = array('rule_id' => $alog->getRuleID(), 'rule_id_count' => $alog->getRuleIDCount());
        $total_rows++;
    }
    $tmp->assign('rows', $rows);
    $tmp->assign('ceil', ceil($total_row / $rows));
    $tmp->assign('total_row', $total_row);
    $tmp->assign('begin', $begin);
    $tmp->assign('start', $start);
    $tmp->assign('filters', $filters);
    $tmp->assign('filter', $filter);
    $tmp->assign('data', $audit_logs);
    $tmp->assign('tab_page', $page);
    $tmp->assign('tab', 'rule');
    $tmp->display('reports.tpl');
}
예제 #2
0
파일: rules.php 프로젝트: AviMoto/webekci
function white_list($tmp, $page)
{
    global $RS;
    $wlist_filter = $_POST['wlist_filter'];
    if ($wlist_filter) {
        $where .= " AND WL.WhiteListType={$wlist_filter}";
    }
    $total_row =& Rule::countWhiteListRecord($where);
    $navigation = new Navigation($_POST['start'], $_POST['rows'], $_POST['begin'], $_POST['first'], $total_row);
    $start = $navigation->getNavigationStart();
    $rows = $navigation->getNavigationRows();
    $begin = $navigation->getNavigationBegin();
    $first = $navigation->getNavigationFirst();
    $wlimit .= $navigation->getNavigationWhere();
    $wlists =& Rule::getAllWhiteLists($where, $wlimit);
    $rules = array();
    foreach ($wlists as $white_list) {
        $white_lists[] = array('wl_id' => $white_list->getWhiteListRecordID(), 'wl_type' => $RS['LIST_WHITE_LIST_TYPE'][$white_list->getWhiteListType()], 'wl_data' => $white_list->getWhiteListData(), 'wl_isactive' => $white_list->getWhiteListActive());
    }
    $filters['wlist_filter'] = array_values($RS['LIST_WHITE_LIST_TYPE']);
    $tmp->assign('rows', $rows);
    $tmp->assign('ceil', ceil($total_row / $rows));
    $tmp->assign('total_row', $total_row);
    $tmp->assign('begin', $begin);
    $tmp->assign('start', $start);
    $tmp->assign('filters', $filters);
    $tmp->assign('wl_type_id', $_POST['wlist_filter']);
    $tmp->assign('data', $white_lists);
    $tmp->assign('tab_page', $page);
    $tmp->assign('tab', 'wlist');
}