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


PHP event::get_instance_by_id方法代码示例

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


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

示例1: array

 $table = new htmlobject_table_identifiers_checked('event_id');
 $arHead = array();
 $arHead['event_icon'] = array();
 $arHead['event_icon']['title'] = '';
 $arHead['event_id'] = array();
 $arHead['event_id']['title'] = 'ID';
 $arHead['event_description'] = array();
 $arHead['event_description']['title'] = 'Description';
 $arBody = array();
 $event = new event();
 $event_list = $event->get_list();
 foreach ($event_list as $ev) {
     $events_all++;
     $event_id = $ev['value'];
     $g_event = new event();
     $g_event->get_instance_by_id($event_id);
     if ($g_event->priority <= 2 && $g_event->status == 0) {
         // fill in event-error
         $events_error++;
         if ($events_error < $max_show_error) {
             $arBody[] = array('event_icon' => "<img widht='16' height='16' src='/openqrm/base/img/error.png'>", 'event_id' => $g_event->id, 'event_description' => $g_event->description);
         }
     }
 }
 $table->id = 'Tabelle';
 $table->css = 'htmlobject_table';
 $table->border = 1;
 $table->cellspacing = 0;
 $table->cellpadding = 3;
 $table->sort = '';
 $table->head = $arHead;
开发者ID:kelubo,项目名称:OpenQRM,代码行数:31,代码来源:dc-overview.php

示例2: action

 function action()
 {
     $event = new event();
     $identifier = $this->response->html->request()->get($this->identifier_name);
     $msg = '';
     if ($identifier !== '') {
         foreach ($identifier as $id) {
             $event->get_instance_by_id($id);
             if ($event->priority == 9 && $event->source === 'License') {
                 continue;
             }
             $fields = array();
             $fields["event_status"] = 1;
             $event->update($id, $fields);
             $msg .= sprintf($this->lang['msg'], $id) . '<br>';
         }
     }
     $this->response->redirect($this->response->get_url($this->actions_name, 'select', $this->message_param, $msg));
 }
开发者ID:kelubo,项目名称:OpenQRM,代码行数:19,代码来源:event.acknowledge.class.php

示例3: select


//.........这里部分代码省略.........
             // 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)) {
                 $oq_cmd = $this->file->get_contents($cmd_file);
                 $oq_cmd = str_replace('"', '', $oq_cmd);
                 $oq_cmd_error = $this->file->get_contents($error_file);
                 $oq_cmd_error = str_replace('"', '', $oq_cmd_error);
                 // set the event to error in any way
                 $event_fields = array();
                 $event_fields["event_priority"] = 1;
                 $event->update($value['event_id'], $event_fields);
                 $event->get_instance_by_id($value['event_id']);
                 $icon = '<span class="pill red">error</span>';
                 // set the description
                 $description = "<a href=\"/openqrm/base/server/event/errors/" . $error_token . ".out\" title=\"" . $oq_cmd_error . "\" target=\"_BLANK\">Error</a> running openQRM <a href=\"/openqrm/base/server/event/errors/" . $error_token . ".cmd\" title=\"" . $oq_cmd . "\"target=\"_BLANK\">command</a>";
                 $a = $this->response->html->a();
                 $a->title = $this->lang['action_rerun'];
                 $a->label = $this->lang['action_rerun'];
                 $a->handler = 'onclick="wait();"';
                 $a->css = 'start pull-right';
                 $a->href = $this->response->get_url($this->actions_name, 'rerun') . '&token=' . $error_token . '&event_id=' . $event->id;
                 $rerun = $a->get_string();
                 $description .= $rerun;
             } else {
                 // we are currently re-running the token, do not show the links
                 $description = "Error running openQRM command<br><strong>Currently re-running token {$error_token}</strong>";
             }
         } else {
             $description = $value['event_description'];
         }
         $b[$i]['event_id'] = $value['event_id'];
         $b[$i]['event_priority'] = $icon;
         $b[$i]['event_time'] = date('Y/m/d H:i:s', $value['event_time']);
         $b[$i]['event_source'] = $value['event_source'];
         $b[$i]['event_description'] = $description;
         $i++;
     }
     $filter = array();
     $filter[] = array('', 'all');
     $filter[] = array($this->lang['filter_active'], 'active');
     $filter[] = array($this->lang['filter_warning'], 'warning');
     $filter[] = array($this->lang['filter_error'], 'error');
     $filter[] = array($this->lang['filter_acknowledge'], 'acknowledge');
     asort($filter);
     $select = $this->response->html->select();
     $select->add($filter, array(1, 0));
     $select->name = 'event_filter';
     $select->handler = 'onchange="wait();this.form.submit();return false;"';
     $select->selected = array($this->response->html->request()->get('event_filter'));
     $box = $this->response->html->box();
     $box->add($select);
     $box->id = 'events_filter';
     $box->css = 'htmlobject_box';
     $box->label = $this->lang['lang_filter'];
     $table->add_headrow($box->get_string());
     $table->id = 'Tabelle';
     $table->css = 'htmlobject_table';
     $table->border = 1;
     $table->cellspacing = 0;
     $table->form_action = $this->response->html->thisfile;
     $table->cellpadding = 3;
     $table->autosort = false;
     $table->sort_link = false;
     $table->head = $h;
     $table->body = $b;
     $table->actions_name = $this->actions_name;
     $table->actions = array(array('remove' => $this->lang['action_remove']), array('acknowledge' => $this->lang['action_acknowledge']));
     $table->identifier = 'event_id';
     $table->identifier_name = $this->identifier_name;
     $table->limit_select = array(array("value" => 100, "text" => 100), array("value" => 200, "text" => 200), array("value" => 400, "text" => 400), array("value" => 500, "text" => 500));
     return $table;
 }
开发者ID:kelubo,项目名称:OpenQRM,代码行数:101,代码来源:event.select.class.php

示例4: action

 function action()
 {
     global $OPENQRM_SERVER_BASE_DIR;
     $RootDir = $_SERVER["DOCUMENT_ROOT"] . '/openqrm/base/';
     $token = $this->response->html->request()->get('token');
     $event_id = $this->response->html->request()->get('event_id');
     $msg = '';
     if ($token !== '' && $event_id !== '') {
         $event = new event();
         $event->get_instance_by_id($event_id);
         $event->log("event-action", $_SERVER['REQUEST_TIME'], 5, "event-overview.php", "Re-Running command {$token}", "", "", 0, 0, 0);
         $command = "mv -f " . $OPENQRM_SERVER_BASE_DIR . "/openqrm/web/base/server/event/errors/" . $token . ".cmd " . $OPENQRM_SERVER_BASE_DIR . "/openqrm/var/spool/openqrm-queue." . $token . " && rm -f " . $OPENQRM_SERVER_BASE_DIR . "/openqrm/web/base/server/event/errors/" . $token . ".out";
         shell_exec($command);
         $fields = array();
         $fields["event_priority"] = 4;
         $event->update($event_id, $fields);
         $msg .= "Re-running token " . $token . " / Event ID " . $event_id . "<br>";
     }
     $this->response->redirect($this->response->get_url($this->actions_name, 'select', $this->message_param, $msg));
 }
开发者ID:kelubo,项目名称:OpenQRM,代码行数:20,代码来源:event.rerun.class.php

示例5: action

 function action()
 {
     $RootDir = $_SERVER["DOCUMENT_ROOT"] . '/openqrm/base/';
     $identifiers = $this->response->html->request()->get($this->identifier_name);
     $msg = '';
     if ($identifiers !== '') {
         foreach ($identifiers as $id) {
             $event = new event();
             $event->get_instance_by_id($id);
             if (strstr($event->description, "ERROR running token")) {
                 $error_token = str_replace("ERROR running token ", "", $event->description);
                 $cmd_file = $RootDir . "/server/event/errors/" . $error_token . ".cmd";
                 $error_file = $RootDir . "/server/event/errors/" . $error_token . ".out";
                 if ($this->file->exists($cmd_file)) {
                     $error = $this->file->remove($cmd_file);
                     if ($error !== '') {
                         $msg .= $error . '<br>';
                     }
                 }
                 if ($this->file->exists($error_file)) {
                     $error = $this->file->remove($error_file);
                     if ($error !== '') {
                         $msg .= $error . '<br>';
                     }
                 }
             }
             $event->remove($id);
             $msg .= sprintf($this->lang['msg'], $id) . '<br>';
         }
     }
     $this->response->redirect($this->response->get_url($this->actions_name, 'select', $this->message_param, $msg));
 }
开发者ID:kelubo,项目名称:OpenQRM,代码行数:32,代码来源:event.remove.class.php


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