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


PHP professions::setLastModifiedSpec方法代码示例

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


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

示例1: actionSaveInfoMobile

 /**
  * Заполнение обязательных полей после регистрации через API мобильного приложения.
  * 
  * @param  array $aParams массив входящих данных
  * @return bool true - успех, false - провал
  */
 public function actionSaveInfoMobile($aParams = array())
 {
     $this->setFieldInfo('uname', __paramValue('string', iconv('utf-8', 'cp1251', $aParams['first_name'])));
     $this->setFieldInfo('usurname', __paramValue('string', iconv('utf-8', 'cp1251', $aParams['last_name'])));
     $this->setFieldInfo('birthday', __paramValue('string', $aParams['birthday']));
     $this->setFieldInfo('country', __paramValue('int', $aParams['country_id']));
     $this->setFieldInfo('city', __paramValue('int', $aParams['city_id']));
     $this->setFieldInfo('info_for_reg', array('birthday' => 0, 'sex' => 0, 'country' => 0, 'city' => 0));
     $gender = __paramValue('int', $aParams['gender']);
     $this->setFieldInfo('sex', $gender == 1 ? 't' : ($gender == 2 ? 'f' : NULL));
     $this->checkedFields();
     if (date('Y-m-d', strtotime($aParams['birthday'])) != $aParams['birthday']) {
         $this->error['birthday'] = 'Укажите некорректную дату дня рождения';
         $this->errno['birthday'] = 2;
     }
     if (empty($this->error)) {
         if (!is_emp()) {
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/freelancer.php';
             $user = new freelancer();
         } else {
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/employer.php';
             $user = new employer();
         }
         $user->info_for_reg = serialize($this->info_for_reg);
         $user->uname = $this->uname;
         $user->usurname = $this->usurname;
         $user->sex = $this->sex;
         $user->birthday = $this->birthday;
         $user->country = $this->country;
         $user->city = $this->city;
         if (!is_emp()) {
             $spec = intvalPgSql($aParams['prof_id']);
             if ($spec) {
                 require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
                 $or_spec = professions::GetProfessionOrigin($spec);
                 $spec_mod = professions::getLastModifiedSpec($_SESSION['uid']);
                 if (!is_pro() && $spec_mod['days'] > 0) {
                     $this->error['spec'] = 'Не прошло 30 дней с момента последней смены специализации';
                     $this->errno['spec'] = 2;
                 } else {
                     $user->spec = $spec;
                     $user->spec_orig = $or_spec;
                     professions::setLastModifiedSpec($_SESSION['uid'], $spec);
                 }
             } else {
                 $this->error['spec'] = 'Не указан параметр ID профессии';
                 $this->errno['spec'] = 1;
             }
         }
         if (empty($this->error)) {
             if ($sError = $user->Update($_SESSION['uid'], $res)) {
                 $this->error['save'] = $sError;
             } else {
                 if (!is_emp()) {
                     $_SESSION['specs'] = $user->GetAllSpecs($_SESSION['uid']);
                 }
             }
         }
         if (empty($this->error['save'])) {
             $_SESSION['check_user_access'] = true;
         }
     }
     return empty($this->error);
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:70,代码来源:registration.php

示例2: professions

     require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
     $obj_prof = new professions();
     $error_prof .= $obj_prof->UpdateProfDesc($uid, $_POST['prof_id'], str_replace(" ", "", $_POST['prof_cost_from']), str_replace(" ", "", $_POST['prof_cost_to']), str_replace(" ", "", $_POST['prof_cost_hour']), str_replace(" ", "", $_POST['prof_cost_1000']), $_POST['prof_cost_type'], $_POST['prof_cost_type_hour'], $_POST['prof_time_type'], $_POST['prof_time_from'], $_POST['prof_time_to'], $_POST['prof_text'], $errorProfText);
     if (!$error_prof) {
         $info_prof = "Изменения внесены";
     }
     $saved_prof_id = intval($_POST['prof_id']);
     break;
 case "spec_change":
     $spec = trim($_POST['spec']);
     require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
     $or_spec = professions::GetProfessionOrigin($spec);
     $frl = new freelancer();
     $frl->spec = $spec;
     $frl->spec_orig = $or_spec;
     professions::setLastModifiedSpec($uid, $spec);
     $error .= $frl->Update($uid, $res);
     $_SESSION['specs'] = $frl->GetAllSpecs($uid);
     break;
 case "save_spec_add":
     require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
     if (professions::UpdateProfsAddSpec($uid, __paramInit('int', NULL, 'oldprof_id'), __paramInit('int', NULL, 'prof_id'), __paramInit('int', NULL, 'paid_id'))) {
         $_SESSION['specs'] = freelancer::GetAllSpecs($uid);
         header("Location: /users/{$login}/setup/specaddsetup/");
         exit;
     }
     break;
 case "portf_choise":
     unset($_SESSION['text_spec']);
     $params = $_POST['prof'];
     if (is_array($params)) {
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:index.php

示例3: addProfToUserIfNeed

 /**
  * Если у пользователя нет указанной специализации, то добавить ее
  * Предпочтительно в качестве основной
  * 
  * @param type $user_id ИД польователя
  * @param type $prof_id ИД специализации
  */
 private function addProfToUserIfNeed($user_id, $prof_id)
 {
     $add_key = self::needAddProf($user_id, $prof_id);
     if ($add_key == 1) {
         //Добавляем доп.специализацию
         professions::UpdateProfsAddSpec($user_id, 0, $prof_id, 0);
     } elseif ($add_key == 2) {
         //Устанавливаем основную специализацию
         $frl = new freelancer();
         $frl->spec = $prof_id;
         $frl->spec_orig = $prof_id;
         professions::setLastModifiedSpec($user_id, $prof_id);
         $frl->Update($user_id, $res);
     }
 }
开发者ID:amage,项目名称:fl-ru-damp,代码行数:22,代码来源:firstpage.php

示例4: create

 /**
  * Создает запись в таблице
  * @return type
  */
 public function create()
 {
     if ($this->bind_data['is_spec']) {
         $add_prof = $this->needAddProf($this->bind_data['user_id'], $this->bind_data['prof_id']);
         if ($add_prof == 1) {
             //Добавляем доп.специализацию
             professions::UpdateProfsAddSpec($this->bind_data['user_id'], 0, $this->bind_data['prof_id'], 0);
         } elseif ($add_prof == 2) {
             //Устанавливаем основную специализацию
             $frl = new freelancer();
             $frl->spec = $this->bind_data['prof_id'];
             $frl->spec_orig = $this->bind_data['prof_id'];
             professions::setLastModifiedSpec($this->bind_data['user_id'], $this->bind_data['prof_id']);
             $frl->Update($this->bind_data['user_id'], $res);
         }
     }
     $ok = $this->db->insert($this->TABLE, $this->bind_data);
     if ($ok) {
         freelancer::clearCacheFromProfIdNow($this->bind_data['prof_id'], $this->bind_data['is_spec']);
         return true;
     }
     return false;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:27,代码来源:freelancer_binds.php

示例5: __paramInit

$profession_id = __paramInit('int', null, 'profession', null);
if ($profession_id !== null) {
    $redirect_to = '/projects/';
    if ($profession_id > 0) {
        require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects_filter.php';
        //Создаем фильтр для проектов
        $f_category[1][$profession_id] = 1;
        $prj_filter = new projects_filters();
        $prj_filter->Save($uid, '', '', 2, true, $f_category, '', '', '', false, $rerror, $error, 0, 0, false, false, false, false, false, false, false, false, 4, false, false);
        setcookie('new_pf0', 1, time() + 60 * 60 * 24 * 30, '/');
        //Сохраняем как основную специализацию
        $or_spec = professions::GetProfessionOrigin($profession_id);
        $frl = new freelancer();
        $frl->spec = $profession_id;
        $frl->spec_orig = $or_spec;
        professions::setLastModifiedSpec($uid, $profession_id);
        $frl->Update($uid, $error);
        $_SESSION['specs'] = $frl->GetAllSpecs($uid);
    }
    //Если есть редирект то он приоритетней
    if ($_SESSION['ref_uri']) {
        $redirect_to = urldecode($_SESSION['ref_uri']);
    }
    $_user_action = isset($_REQUEST['user_action']) && $_REQUEST['user_action'] ? substr(htmlspecialchars($_REQUEST['user_action']), 0, 25) : '';
    $_user_action = trim($_user_action);
    switch ($_user_action) {
        case 'tu':
            if (isset($_SESSION['tu_ref_uri'])) {
                $redirect_to = HTTP_PFX . $_SERVER['HTTP_HOST'] . urldecode($_SESSION['tu_ref_uri']);
            }
            break;
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:profession.php


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