本文整理汇总了PHP中event::display_overview方法的典型用法代码示例。如果您正苦于以下问题:PHP event::display_overview方法的具体用法?PHP event::display_overview怎么用?PHP event::display_overview使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类event
的用法示例。
在下文中一共展示了event::display_overview方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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)) {
//.........这里部分代码省略.........
示例2: getEventStatus
$table->sort = '';
$table->head = $arHead;
$table->body = $arBody;
$table->max = $max_show_cr;
// set template
$e = new Template_PHPLIB();
$e->debug = false;
$e->setFile('tplfile', $RootDir . '/server/aa_server/tpl/cloud-summary.tpl.php');
$e->setVar(array('cr_all' => $cr_all, 'cr_active' => $cr_active, 'cloud_users' => $cloud_users, 'cloud_errors' => $cloud_errors, 'cloud_table' => $table->get_string(), 'max_show_cr' => $max_show_cr));
$disp = $e->parse('out', 'tplfile');
echo $disp;
exit(0);
break;
case 'get_eventlist':
$event = new event();
$event_list = $event->display_overview(0, 10, 'event_time', 'desc');
// $offset, $limit, $sort, $order, $mode = null
echo json_encode($event_list);
exit(0);
break;
}
}
/**
* Method to map event_priority to status strings.
*
* @todo Should be moved to event object
* @param int $event_priority
* @return string status string
*/
function getEventStatus($event_priority)
{
示例3: eventlist
function eventlist()
{
// check permissions
$this->controller->openqrm->init();
$class = 'event_controller';
$path = $this->controller->openqrm->get('webdir') . '/server/event/class/event.controller.class.php';
$role = $this->controller->openqrm->role($this->response);
require_once $path;
$controller = new $class($this->controller->openqrm, $this->response);
$_REQUEST[$controller->actions_name] = 'select';
$data = $role->check_permission($controller, true);
if ($data === true) {
$event = new event();
$event_list = $event->display_overview(0, 14, 'event_time', 'desc');
// $offset, $limit, $sort, $order, $mode = null
echo json_encode($event_list);
} else {
$msg = array(array('event_priority' => '9', 'event_source' => 'Permissions', 'event_time' => time(), 'event_description' => 'Permission denied for action <i>select</i> on controller <i>events</i>'));
echo json_encode($msg);
}
exit(0);
}