当前位置: 首页>>代码示例>>PHP>>正文


PHP event::get_count方法代码示例

本文整理汇总了PHP中event::get_count方法的典型用法代码示例。如果您正苦于以下问题:PHP event::get_count方法的具体用法?PHP event::get_count怎么用?PHP event::get_count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在event的用法示例。


在下文中一共展示了event::get_count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: appliance

 function get_top_status()
 {
     $appliance = new appliance();
     $appliance_all = $appliance->get_count();
     $appliance_active = $appliance->get_count_active();
     $resource = new resource();
     $resource_all = $resource->get_count("all");
     $resource_active = $resource->get_count("online");
     $resource_inactive = $resource->get_count("offline");
     $resource_error = $resource->get_count("error");
     $event = new event();
     $event_error_count = $event->get_count('error');
     $event_active_count = $event->get_count('active');
     echo $appliance_all . "@" . $appliance_active . "@" . $resource_all . "@" . $resource_active . "@" . $resource_inactive . "@" . $resource_error . "@" . $event_error_count . "@" . $event_active_count;
 }
开发者ID:kelubo,项目名称:OpenQRM,代码行数:15,代码来源:openqrm.api.class.php

示例2: select

 function select()
 {
     $h = array();
     $h['event_id']['title'] = $this->lang['table_id'];
     $h['event_id']['hidden'] = true;
     $h['event_id']['sortable'] = false;
     $h['event_priority']['title'] = $this->lang['table_state'];
     $h['event_time']['title'] = $this->lang['table_date'];
     $h['event_source']['title'] = $this->lang['table_source'];
     $h['event_description']['title'] = $this->lang['table_description'];
     $h['event_description']['sortable'] = false;
     $event = new event();
     $b = array();
     $table = $this->response->html->tablebuilder('events', $this->response->get_array($this->actions_name, 'select'));
     $table->offset = 0;
     $table->limit = 100;
     $table->sort = 'event_time';
     $table->order = 'DESC';
     switch ($this->response->html->request()->get('event_filter')) {
         case '':
         case 'all':
             $table->max = $event->get_count();
             break;
         case 'active':
             $table->max = $event->get_count('active');
             break;
         case 'error':
             $table->max = $event->get_count('error');
             break;
         case 'acknowledge':
             $table->max = $event->get_count('acknowledge');
             break;
         case 'warning':
             $table->max = $event->get_count('warning');
             break;
     }
     $table->init();
     switch ($this->response->html->request()->get('event_filter')) {
         case '':
         case 'all':
             $events = $event->display_overview($table->offset, $table->limit, $table->sort, $table->order);
             break;
         case 'active':
             $events = $event->display_overview($table->offset, $table->limit, $table->sort, $table->order, 'active');
             break;
         case 'error':
             $events = $event->display_overview($table->offset, $table->limit, $table->sort, $table->order, 'error');
             break;
         case 'acknowledge':
             $events = $event->display_overview($table->offset, $table->limit, $table->sort, $table->order, 'acknowledge');
             break;
         case 'warning':
             $events = $event->display_overview($table->offset, $table->limit, $table->sort, $table->order, 'warning');
             break;
     }
     $RootDir = $_SERVER["DOCUMENT_ROOT"] . '/openqrm/base/';
     $i = 0;
     foreach ($events as $key => $value) {
         $icon = "transition.png";
         switch ($value['event_priority']) {
             case 0:
                 $icon = '<span class="pill off">off</span>';
                 break;
             case 1:
             case 2:
             case 3:
                 $icon = '<span class="pill red">error</span>';
                 break;
                 // error event
             // error event
             case 4:
             case 5:
             case 6:
             case 7:
             case 8:
                 $icon = '<span class="pill green">notice</span>';
                 break;
                 // undefined event
             // undefined event
             case 9:
                 $icon = '<span class="pill yellow">running</span>';
                 break;
                 // active event
             // active event
             case 10:
                 $icon = '<span class="pill green">ok</span>';
                 break;
                 // notice event
         }
         if ($value['event_status'] === '1') {
             $icon = '<span class="pill green">ack</span>';
             // acknowledged event
         }
         $description = '';
         if (strstr($value['event_description'], "ERROR running token")) {
             $error_token = str_replace("ERROR running token ", "", $value['event_description']);
             $cmd_file = $this->rootdir . "/server/event/errors/" . $error_token . ".cmd";
             $error_file = $this->rootdir . "/server/event/errors/" . $error_token . ".out";
             // get command and error strings
             if ($this->file->exists($cmd_file) && $this->file->exists($error_file)) {
//.........这里部分代码省略.........
开发者ID:kelubo,项目名称:OpenQRM,代码行数:101,代码来源:event.select.class.php


注:本文中的event::get_count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。