本文整理汇总了PHP中freelancer::Update方法的典型用法代码示例。如果您正苦于以下问题:PHP freelancer::Update方法的具体用法?PHP freelancer::Update怎么用?PHP freelancer::Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类freelancer
的用法示例。
在下文中一共展示了freelancer::Update方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: count
$count_add = count($_SESSION['w_select'][$_POST['w_move_prof_from']]);
if ($prof_id > 0 || $prof_id == professions::CLIENTS_PROF_ID || $prof_id == professions::BEST_PROF_ID && portfolio::CountAll($uid, $prof_id, true) + $count_add <= portfolio::MAX_BEST_WORKS) {
foreach ($_SESSION['w_select'][$_POST['w_move_prof_from']] as $wkey => $wvalue) {
$prj_id = (int) trim($wkey);
if ($prj_id) {
$error .= $portf->ChangeProjectProf($uid, $prof_id, $prj_id);
}
}
}
}
break;
case "diz_ch":
$stddiz = $_POST['stddiz'];
$frl = new freelancer();
$frl->design = isset($stddiz) ? 0 : 1;
$error .= $frl->Update($uid, $res);
break;
case "delete":
// удаление аккаунта
require_once ABS_PATH . "/classes/users.php";
require_once ABS_PATH . '/classes/admin_log.php';
$user_obj = new users();
$sUid = get_uid();
$user_obj->GetUserByUID($sUid);
$sObjName = $user_obj->uname . ' ' . $user_obj->usurname . '[' . $user_obj->login . ']';
$sObjLink = '/users/' . $user_obj->login;
$sReason = "Аккаунт удален самостоятельно";
if ($user_obj->setUserBan(get_uid(), 0, $sReason, 4, '', 1, true)) {
// если удалось заблокировать аккаунт
// пишем лог
admin_log::addLog(admin_log::OBJ_CODE_USER, admin_log::ACT_ID_DEL_ACC, $sUid, $sUid, $sObjName, $sObjLink, 1, '', null, $sReason);
示例3: transferUserInformation
/**
* Обновляем данные пользователя введенные в шаге портфолио
*
* @param array $data Данные пользователя
*/
public function transferUserInformation($data)
{
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/freelancer.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/professions.php";
$frl = new freelancer();
if ($data['resume'] > 0) {
$dir = "users/" . substr($this->user->login, 0, 2) . "/" . $this->user->login . "/resume/";
$table = 'file';
$files = array(array('id' => $data['resume']));
$resume = $this->transferFiles($files, $table, $dir);
}
$frl->exp = $data['exp'];
$frl->cost_hour = $data['cost_hour'];
$frl->cost_month = $data['cost_month'];
$frl->cost_type_hour = $data['cost_type_hour'];
$frl->cost_type_month = $data['cost_type_month'];
$frl->spec_text = $data['info'];
$frl->in_office = $data['in_office'];
$frl->spec = $data['spec'];
$frl->spec_orig = $data['spec_orig'];
$frl->resume_file = $resume[0]['fname'];
$error_db = $frl->Update(wizard::getUserIDReg(), $res);
$prof = new professions();
if ($data['spec_orig'] > 0) {
$error_db = $prof->UpdatePortfChoise(wizard::getUserIDReg(), array($data['spec_orig']));
}
// Если нет ошибок очищаем таблицу
if ($error_db) {
$this->log->writeln("Error transfer data user content - user (" . wizard::getUserIDReg() . "|" . $this->getWizardUserID() . ") - Error: {$error_db}");
} else {
$this->_db->query("DELETE FROM wizard_fields WHERE id = ? AND wiz_uid = ?", $field['id'], $this->getWizardUserID());
}
return $error_db;
}
示例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;
}
示例5: 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);
}
}
示例6: setcookie
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;
case 'new_tu':
示例7: removeSubscFilter
/**
* Удаляет категорию из подписки на проекты
*
* @param int $category_id
* @param int $subcategory_id
* @return \xajaxResponse
*/
function removeSubscFilter($category_id, $subcategory_id)
{
session_start();
$objResponse = new xajaxResponse();
if (!($uid = get_uid(false))) {
return $objResponse;
}
$user = new freelancer();
$user->GetUserByUID($uid);
$regex = '/:?c' . $category_id . ($subcategory_id > 0 ? 's' . $subcategory_id : '') . '/';
$user->mailer_str = preg_replace($regex, '', $user->mailer_str);
$res = array();
$user->Update($uid, $res);
return $objResponse;
}