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


PHP freelancer::GetUid方法代码示例

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


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

示例1: SaveStatus

function SaveStatus($text, $statusType, $login = NULL)
{
    session_start();
    $freelancer = new freelancer();
    $text = addslashes(substr(stripslashes(trim($text)), 0, 200));
    close_tags($text, 's');
    $freelancer->status_text = antispam(htmlspecialchars(htmlspecialchars_decode(change_q_x(trim($text), true, false), ENT_QUOTES), ENT_QUOTES));
    $freelancer->status_type = intval($statusType);
    if ($freelancer->statusToStr($statusType)) {
        $stdStatus = "";
        $objResponse = new xajaxResponse();
        $uid = hasPermissions('users') && $login != $_SESSION['login'] ? $freelancer->GetUid($err, $login) : get_uid(false);
        $pro = hasPermissions('users') && $login != $_SESSION['login'] ? is_pro(true, $uid) : is_pro();
        $error = $freelancer->Update($uid, $res);
        if (!$freelancer->status_text) {
            $freelancer->status_text = $stdStatus;
        }
        $freelancer->status_text = stripslashes($freelancer->status_text);
        switch ($freelancer->status_type) {
            case 1:
                $status_cls = 'b-status b-status_busy';
                break;
            case 2:
                $status_cls = 'b-status b-status_abs';
                break;
            case -1:
                $status_cls = 'b-status b-status_no';
                break;
            default:
                $status_cls = 'b-status b-status_free';
        }
        if (!$noassign) {
            require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/stop_words.php';
            $stop_words = new stop_words(hasPermissions('users'));
            $sStatusText = $pro ? $freelancer->status_text : $stop_words->replace($freelancer->status_text);
            //$GLOBALS['xajax']->setCharEncoding("windows-1251");
            $jsobj = json_encode(array('data' => iconv('CP1251', 'UTF8', $freelancer->status_text)));
            $objResponse->assign("statusText", "innerHTML", $freelancer->status_text == $stdStatus ? "" : reformat($sStatusText, 40, 0, 1, 25));
            $objResponse->assign("statusTitle", "innerHTML", $freelancer->statusToStr($statusType));
            //            $objResponse->assign("statusTitle", "style.display", $statusType > -1 ? '' : 'none');
            $objResponse->script("statusType = {$statusType};\n\t\t\t                      statusTxt = document.getElementById('statusText').innerHTML;\n\t\t\t                      statusTxtSrc = {$jsobj};");
        }
        $objResponse->script("\$('bstatus').erase('class');\n             \$('bstatus').addClass('{$status_cls}');");
    }
    return $objResponse;
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:46,代码来源:status.server.php

示例2: initFromRequest

 /**
  * Проверяет пользовательский запрос на создание/редактирование СБР. Инициализирует данные в соответствии с переданными значениями.
  * 
  * @param array $request данные запроса (гет, пост).
  * @param array $files   массив $_FILES с вложениями к каждому этапу.
  * @param sbr   $old     старый экземпляр сделки. Передается при редактировании.
  *
  * @return bool нет ошибок?
  */
 public function initFromRequest($request, $files = null, $old = null)
 {
     $this->data['is_draft'] = $request['draft'] ? 't' : 'f';
     if (!isset($request['frl_login_added'])) {
         $request['frl_login_added'] = '';
     }
     if ($request['project_id']) {
         $this->checkProject($request['project_id']);
     }
     if (!isset($request['scheme_type'])) {
         $request['scheme_type'] = '';
     }
     if ($old) {
         if (!$request['cost_sys']) {
             $request['cost_sys'] = array($old->cost_sys);
         }
         if (!$request['scheme_type']) {
             $request['scheme_type'] = $old->scheme_type;
         }
     }
     foreach ($request as $field => $value) {
         if (is_scalar($value)) {
             $value = trim(stripslashes($value));
         }
         switch ($field) {
             case 'name':
                 if (is_empty_html($value)) {
                     $this->error[$field] = 'Пожалуйста, заполните это поле';
                 }
                 $value = substr($value, 0, self::NAME_LENGTH);
                 break;
             case 'frl_login_added':
                 if (!$this->isDraft()) {
                     if (!$value || $value == 'логин') {
                         $this->error['frl_login'] = 'Необходимо добавить исполнителя';
                     }
                 }
                 if (!$this->error['frl_login']) {
                     $frl = new freelancer();
                     $this->data['frl_id'] = $frl->GetUid($err, $value);
                 }
                 break;
             case 'cost_sys':
                 $value = is_array($value) ? (int) current($value) : null;
                 $reqvs = $this->getUserReqvs();
                 if (!in_array($value, array(exrates::YM, exrates::WMR, exrates::BANK))) {
                     $this->error['cost_sys_err'] = 'Недопустимая валюта резервирования';
                     $value = exrates::BANK;
                 }
                 if (($value == exrates::YM || $value == exrates::WMR) && $reqvs['form_type'] == sbr::FT_JURI) {
                     $this->error['cost_sys_err'] = 'Резервирование через Яндекс.Деньги или WebMoney доступно только физическим лицам';
                 }
                 break;
             case 'project_id':
                 $value = $this->project['id'];
                 break;
             case 'id':
                 $value = intvalPgSql($value);
                 break;
             case 'scheme_type':
                 $value = intvalPgSql($value);
                 if ($value && (!self::$scheme_types[$value] || $value == self::SCHEME_OLD && (!$old || $old->scheme_type != self::SCHEME_OLD))) {
                     $this->error['scheme_type_err'] = 'Неверный тип договора';
                 }
                 break;
             case 'version':
                 $value = (int) $value > 32767 ? 32767 : (int) $value;
                 break;
             case 'frl_refuse_reason':
                 $value = substr($value, 0, self::SBR_REASONS_LENGTH);
                 break;
             default:
                 break;
         }
         $this->data[$field] = $value;
     }
     if ($request['stages']) {
         $this->_initStagesFromRequest($request['stages'], $files['stages'], $request['action'] == 'create' ? 0 : ($request['action'] == 'edit' ? 1 : 2));
         $this->getUserReqvs();
         if ($this->user_reqvs['rez_type'] == sbr::RT_UABYKZ) {
             $cost = 0;
             foreach ($this->stages as $s) {
                 $cost += $s->cost;
             }
             $cost_rur = $cost * $this->cost2rur();
             if ($cost_rur > $this->maxNorezCost()) {
                 $this->error['cost_sys_err_tbl'] = 'Превышена максимальная сумма сделки — ' . sbr::MAX_COST_USD . ' USD (или ' . sbr_meta::view_cost($this->maxNoRezCost(), exrates::BANK) . ')';
             }
         }
     }
     return !$this->error;
//.........这里部分代码省略.........
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:101,代码来源:sbr_emp.php


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