本文整理汇总了PHP中Operator类的典型用法代码示例。如果您正苦于以下问题:PHP Operator类的具体用法?PHP Operator怎么用?PHP Operator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Operator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showMeetingUI
function showMeetingUI()
{
$db = Database::getInstance();
$cxn = $db->getConnection();
$operator = new Operator();
$operator->createOperatorList();
if ($this->meetingid != '') {
$q = "SELECT *,DATE_FORMAT(Meeting_Date,'%d-%m-%Y') as mdt,Participants FROM Meeting\n\tWHERE Meeting_ID={$this->meetingid}";
if (!($res = $cxn->query($q))) {
exit("error (showMeetingUI): {$cxn->error}");
}
$n = $res->num_rows;
if ($n > 0) {
$r = mysqli_fetch_assoc($res);
$this->conductedby = $r['Conductedby'];
$this->meetingdatedb = $r['Meeting_Date'];
$this->participants = $r['Participants'];
$this->meetingdatedb = $r['Meeting_Date'];
$this->meetingdate = $r['mdt'];
$this->agenda = $r['Agenda'];
$this->participants = $r['Participants'];
$qp = "SELECT * FROM Meeting_Points WHERE Meeting_ID={$this->meetingid}";
if (!($resp = $cxn->query($qp))) {
exit("error (showMeetingUI2) {$qp}: {$cxn->error}");
}
$i = 0;
while ($rr = mysqli_fetch_assoc($resp)) {
$this->pointsdiscussed[$i] = $rr['Point_Discussed'];
$this->meetingpointid[$i] = $rr['Meeting_Point_ID'];
$i++;
}
}
}
echo '<fieldset><legend>Meeting Details</legend>';
$sel = new selectlist("Conductedby", $operator->getOperatorList(), 'Meeting Conducted By', 'Operator_ID', 'Operator_Name', 'class="required"', $this->conductedby, '1');
echo '<p><label>Meeting Date</label><input id="meetingdate" name="meetingdate" class="required" value="' . $this->meetingdate . '"><input id="meetingdatedb" name="meetingdatedb" type="hidden" value="' . $this->meetingdatedb . '"></p>';
echo '<p><label>Meeting Agenda</label><textarea id="agenda" name="agenda" cols="45" rows="5" class="required">' . $this->agenda . '</textarea></p>';
echo '<p><label>Meeting Participants</label></p>';
$operator->createOperatorGrid($this->participants);
echo '</fieldset>';
echo '<table id="points" width="100%" class="u"><tr><th align="center">Points Discussed</th><th>';
echo '<th><input type="button" id="addpoint" value="Add Row"></th></tr>';
if (isset($this->meetingpointid)) {
$i = 0;
$j = count($this->pointsdiscussed);
while ($i < $j) {
echo '<tr><td colspan="2"><textarea id="pointsdiscussed[' . $i . ']" name="pointsdiscussed[' . $i . ']" rows="3" cols="40" class="required">' . $this->pointsdiscussed[$i] . '</textarea></td>
<input type="hidden" id="meetingpointid[' . $i . ']" name="meetingpointid[' . $i . ']" value="' . $this->meetingpointid[$i] . '"></tr>';
$i++;
}
} else {
echo '<tr><td colspan="2"><textarea id="pointsdiscussed[0]" name="pointsdiscussed[0]" rows="3" cols="40" class="required"></textarea></td></tr>';
}
echo '</table>';
}
示例2: compare
public function compare(Operator $op)
{
if ($this->priority < $op->getPriority()) {
return -1;
} else {
if ($this->priority > $op->getPriority()) {
return 1;
} else {
return 0;
}
}
}
示例3: CreateOperator
function CreateOperator($_loginId, $_fullName, $_email, $_permissions, $_webspace, $_passwordMD5, $_administrator, $_groups, $_language)
{
$operator = new Operator(getId(USER_ID_LENGTH), $_loginId);
$operator->Load();
$operator->Fullname = $_fullName;
$operator->Email = $_email;
$operator->PermissionSet = $_permissions;
$operator->Webspace = $_webspace;
$operator->Password = $_passwordMD5;
$operator->Level = $_administrator ? 1 : 0;
$operator->Groups = $_groups;
$operator->Language = $_language;
$operator->Save(true);
return $operator;
}
示例4: loginAction
public function loginAction()
{
if ($this->isLogin()) {
$this->redirect(\Func\url('/', true));
}
if ($this->isAjax()) {
$data = $this->request->getPost();
if (empty($data)) {
$this->pageError('param');
}
$modelForm = new OperatorForm('login');
if ($result = $modelForm->validate($data)) {
if ($info = $modelForm->login()) {
if ($info->status == Operator::STATUS_FREEZE) {
$this->error('该账号已冻结');
}
$_sess = ['oid' => $info->oid, 'username' => $info->username, 'rid' => $info->rid, 'rname' => Role::getNameById($info->rid), 'bname' => Branch::getNameById($info->bid), 'bid' => $info->bid, 'auth' => Operator::getAuthByRid($info->rid), 'expire' => time() + $this->getConfig('session', 'expire')];
$this->session->set('operator', $_sess);
$this->success(['msg' => '登录成功', 'redirect' => ['url' => \Func\url('/'), 'seconds' => 0]]);
} else {
$this->error('账号或密码错误');
}
}
$error = $modelForm->getErrors();
if ($error) {
$this->error($error);
}
$this->error('参数错误');
}
$this->single('login');
}
示例5: getInstance
static function getInstance()
{
if (self::$instance == NULL) {
self::$instance = new Operator();
}
return self::$instance;
}
示例6: render
public function render()
{
$operands = array();
foreach ($this->_operands as $opr) {
if ($opr instanceof Expression) {
$opr_rendered = $opr->render();
$num_oprs = $opr->getNumOperands();
if ($num_oprs > 1) {
$opr_rendered = '(' . $opr_rendered . ')';
}
$opr = $opr_rendered;
}
$operands[] = $opr;
}
$operator = Operator::toHtml($this->_operator);
if (false !== ($decorator = $this->getDecorator('operator'))) {
$operator = $decorator->decorate($operator);
}
switch (sizeof($operands)) {
case 1:
$format = '%s %s';
$params = array($operator, $operands[0]);
break;
case 2:
$format = '%s %s %s';
$params = array($operands[0], $operator, $operands[1]);
break;
}
$expression = vsprintf($format, $params);
if (false !== ($decorator = $this->getDecorator('expression'))) {
$expression = $decorator->decorate($expression);
}
return $expression;
}
示例7: currentOperatorHasAnyOfPermissions
public static function currentOperatorHasAnyOfPermissions($requested_permissions_arr)
{
$current_user_has_any_of_permissions = Auth::currentUserHasAnyOfPermissions($requested_permissions_arr);
if ($current_user_has_any_of_permissions) {
return true;
}
$current_user_id = Auth::currentUserId();
if (!$current_user_id) {
//error_log('Auth: no current user');
return false;
}
// check operator permissions
$current_operator_ids_arr = Operator::getIdsArrForUserIdByCreatedAtDesc($current_user_id);
if (empty($current_operator_ids_arr)) {
//error_log('Auth: no operators for user ' . $current_user_id);
return false;
}
$current_operator_id = $current_operator_ids_arr[0];
$operator_permissions_ids_arr = OperatorPermission::getIdsArrForOperatorIdByCreatedAtDesc($current_operator_id);
$assigned_permissions_titles_arr = [];
foreach ($operator_permissions_ids_arr as $operator_permission_id) {
$operator_permission_obj = OperatorPermission::factory($operator_permission_id);
$permission_id = $operator_permission_obj->getPermissionId();
$permission_obj = Permission::factory($permission_id);
$assigned_permissions_titles_arr[] = $permission_obj->getTitle();
if (in_array($permission_obj->getTitle(), $requested_permissions_arr)) {
return true;
}
}
//error_log('Auth: no permissions for operator ' . $current_operator_id . ' (' . implode(',', $operator_permissions_ids_arr) . ') (' . implode(',', $assigned_permissions_titles_arr) . ') matched requested list: ' . implode(',', $requested_permissions_arr));
return false;
}
示例8: execute
public function execute()
{
global $gvPath;
$code = $_POST['code'];
$password = $_POST['password'];
session_destroy();
unset($_SESSION);
session_start();
if ($this->isValidSysAdminLogin($code, $password)) {
global $gvEditableConfs;
$_SESSION['userLevel'] = Page::SYSADMIN_USER;
if ($code == $gvEditableConfs[0]->getDefault() && $password == $gvEditableConfs[1]->getDefault()) {
// Access with default credentials. Redirect to settings.
$redirect = new RedirectOutput($gvPath . "/application/adminSettings");
} else {
$redirect = new RedirectOutput($gvPath . "/application/adminPage");
}
return $redirect;
}
if (Operator::isValidLogin($code, $password)) {
Operator::clearTableForLogout($code);
try {
Session::loginOperator($code);
} catch (UnknownDeskException $e) {
global $gvPath;
$errorPage = new ErrorPageOutput("Sportello non riconosciuto", "Il presente computer non è stato registrato come sportello.<br />" . "Indirizzo IP da registrare: " . $_SERVER['REMOTE_ADDR'], "<a href=\"{$gvPath}/application/loginPage\">Torna indietro</a>");
return $errorPage;
}
$redirect = new RedirectOutput($gvPath . "/application/opPage");
return $redirect;
}
// Login failed
$this->errorMessage = "Codice o password non validi!";
return true;
}
示例9: GroupBuilder
function GroupBuilder($_internalUsers, $_internalGroups, $_config, $_reqGroup = "", $_reqOperator = "", $allowCom = true)
{
$this->ReqGroup = !empty($_GET[GET_EXTERN_GROUP]) ? base64UrlDecode($_GET[GET_EXTERN_GROUP]) : $_reqGroup;
$this->ReqOperator = !empty($_GET[GET_EXTERN_INTERN_USER_ID]) ? base64UrlDecode($_GET[GET_EXTERN_INTERN_USER_ID]) : $_reqOperator;
$this->InternalUsers = $_internalUsers;
$this->InternalGroups = $_internalGroups;
$this->Config = $_config;
$this->GroupValues["groups_online"] = array();
$this->GroupValues["groups_offline"] = array();
$this->GroupValues["groups_online_amounts"] = array();
$this->GroupValues["groups_output"] = array();
$this->GroupValues["groups_hidden"] = array();
$this->GroupValues["set_by_get_user"] = null;
$this->GroupValues["set_by_get_group"] = null;
$this->GroupValues["set_by_cookie"] = null;
$this->GroupValues["set_by_standard"] = null;
$this->GroupValues["set_by_online"] = null;
$this->GroupValues["req_for_user"] = !empty($this->ReqOperator);
$this->GroupValues["req_for_group"] = !empty($this->ReqGroup);
$this->Parameters = getTargetParameters($allowCom);
if ($this->Parameters["include_group"] != null || $this->Parameters["include_user"] != null) {
foreach ($_internalGroups as $gid => $group) {
if (!($this->Parameters["include_group"] != null && in_array($gid, $this->Parameters["include_group"]))) {
if (!($this->Parameters["include_user"] != null && in_array($gid, $_internalUsers[Operator::GetSystemId($this->Parameters["include_user"])]->GetGroupList(false)))) {
$this->GroupValues["groups_hidden"][] = $gid;
}
}
}
}
if ($this->Parameters["exclude"] != null) {
$this->GroupValues["groups_hidden"] = $this->Parameters["exclude"];
}
}
示例10: processActions
function processActions()
{
global $BROWSER, $CONFIG;
$actionData = "";
$BROWSER->GetActions();
if ($BROWSER->Request != null && $BROWSER->Request->Status == REQUEST_STATUS_ACTIVE) {
$requestUser = new Operator($BROWSER->Request->SenderSessId, $BROWSER->Request->SenderUserId);
$requestUser->Load();
if ($requestUser->LastActive < time() - $CONFIG["timeout_clients"] || $requestUser->Status == USER_STATUS_OFFLINE) {
$BROWSER->Request->Destroy();
$actionData .= "lz_tracking_close_request();";
}
if (isset($_GET[GET_TRACK_REQUEST_DECLINED]) || isset($_GET[GET_TRACK_REQUEST_ACCEPTED])) {
if (isset($_GET[GET_TRACK_REQUEST_DECLINED])) {
$BROWSER->Request->Decline();
}
if (isset($_GET[GET_TRACK_REQUEST_ACCEPTED])) {
$BROWSER->Request->Accept();
}
$actionData .= "lz_tracking_close_request();";
}
} else {
if ($BROWSER->Request != null && $BROWSER->Request->Status != REQUEST_STATUS_ACTIVE) {
$actionData .= "lz_tracking_close_request();";
}
}
if ($BROWSER->Request != null && $BROWSER->Request->Status == REQUEST_STATUS_ACTIVE && !isset($_GET[GET_TRACK_REQUEST_ACTIVE])) {
$height = !@file_exists(FILE_INVITATIONLOGO) ? 220 : 302;
$actionData .= $BROWSER->Request->GetCommand(getInvitationTemplate($BROWSER->Request->Id, $BROWSER->Request->SenderUserId, $BROWSER->UserId, $BROWSER->Request->SenderFullname, $BROWSER->Request->SenderGroupId), htmlentities($BROWSER->Request->Text, ENT_QUOTES, "UTF-8"), 302, $height);
} else {
if ($BROWSER->Request != null && $BROWSER->Request->Status == REQUEST_STATUS_ACCEPTED) {
// hold
}
}
if ($BROWSER->Guide != null) {
$actionData .= $BROWSER->Guide->GetCommand();
$BROWSER->Guide->Destroy();
}
if ($BROWSER->Alerts != null) {
foreach ($BROWSER->Alerts as $alert) {
$actionData .= $alert->GetCommand();
$alert->Destroy();
}
$actionData = str_replace("<!--server-->", LIVEZILLA_URL, $actionData);
}
return $actionData;
}
示例11: loadModel
public function loadModel($id)
{
$model = Operator::model()->findByPk($id);
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
示例12: logoutOperator
public static function logoutOperator()
{
$_SESSION['userLevel'] = Page::NORMAL_USER;
Operator::clearTableForLogout($_SESSION['op_code']);
unset($_SESSION['op_code']);
unset($_SESSION['desk_number']);
unset($_SESSION['td_served']);
}
示例13: build_edit_emergency_popup
function build_edit_emergency_popup($id)
{
$db_functions_obj = new DbFunctions();
$helper_obj = new Helper();
$emergency_info = $db_functions_obj->get_emergency_by_id($id);
global $base_path;
$operator = new Operator();
$output = "<div class='popup-header'>" . $helper_obj->t("Edit Emergency Call") . "</div>";
$output .= "<form class='form-horizontal form-validate form-vertical form-bordered' name='edit_emergency' id='edit_emergency' method='post' action='{$base_path}" . "edit_emergency'>";
$output .= "<div class='control-group'>\n <label class='control-label' for='textarea'>name</label>\n <div class='controls'>\n <input id='textfield' class='input-xlarge' type='text' data-rule-required='true' value='{$emergency_info->name}' placeholder='{$emergency_info->name}' name='name'>\n </div>\n </div>";
$output .= "<div class='control-group'>\n <label class='control-label' for='numberfield'>phone</label>\n <div class='controls'>\n <input id='numberfield' class='input-xlarge' type='text' data-rule-number='true' data-rule-required='true' value='{$emergency_info->phone}' placeholder='{$emergency_info->phone}' name='phone'>\n </div>\n </div>";
$output .= $operator->build_country_list('emergency', $emergency_info->country_id);
$output .= "<input type='hidden' name='emergency_id' value='" . $emergency_info->id . "'>";
$output .= "<input class='btn btn-primary' type='submit' value='" . $helper_obj->t("Save") . "'>";
$output .= "</form>";
$output .= "<script>\n \$(document).ready(function() { \n \$(\"#emergency_textfield\").datepicker(); \n \n \$('#edit_emergency').ajaxForm(function(res) { \n var isvalid = \$(\"#edit_emergency\").valid();\n if (isvalid) { \n var data = res.split(\"***#***\"); \n \$('#emergency_' + data[1]).after(data[0]);\n \$('#emergency_' + data[1]).remove(); \n closePopup();\n } \n }); \n });\n </script>";
return $output;
}
示例14: perms
/**
*/
public function perms()
{
$perms = array('accountcodes' => array('title' => _("Account Codes")));
$accountcodes = Operator::getAccountCodes();
foreach ($accountcodes as $accountcode) {
$perms['accountcodes:' . $accountcode] = array('title' => $accountcode);
}
return $perms;
}
示例15: __construct
public function __construct($title, &$vars)
{
parent::__construct($title, $vars);
$graphtypes = Operator::getGraphInfo();
$graphs = array();
foreach ($graphtypes as $type => $info) {
$graphs[$type] = $info['title'];
}
$this->addVariable(_("Graph"), 'graph', 'enum', true, false, null, array($graphs));
}