本文整理汇总了PHP中projects::SwitchStatusPrj方法的典型用法代码示例。如果您正苦于以下问题:PHP projects::SwitchStatusPrj方法的具体用法?PHP projects::SwitchStatusPrj怎么用?PHP projects::SwitchStatusPrj使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类projects
的用法示例。
在下文中一共展示了projects::SwitchStatusPrj方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: trim
}
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/payed.php";
$is_pro = payed::CheckPro($user->login);
$no_banner = !!$is_pro;
$action = trim(__paramInit('string', 'action', 'action'));
switch ($action) {
case 'activated':
$alert_message = "Аккаунт активирован";
break;
case "prj_close":
$kind = __paramInit('int', null, 'kind', 0);
$prj_id = __paramInit('int', null, 'project_id');
$do_close = __paramInit('bool', null, 'do_close');
$projects = new projects();
if ($prj_id) {
$error .= $projects->SwitchStatusPrj(get_uid(), $prj_id);
}
$location = "/users/{$name}/projects/?kind={$kind}" . ($do_close ? '&closed=1' : '');
header("Location: {$location}");
//перекидываем на текущую страницу, чтобы нельзя было повторить POST по F5
exit;
break;
case "prj_delete":
if (hasPermissions('projects') && $_SESSION["rand"] == $_POST["u_token_key"]) {
$prj_id = (int) trim(__paramInit('int', 'prjid', 'prjid'));
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/projects.php";
$prj = new projects();
$prj->DeletePublicProject($prj_id, get_uid(), 1);
}
break;
case "change_bn":
示例2: exit
}
break;
case "switch_error":
$response['success'] = true;
exit(json_encode($response));
break;
case "postproject":
include "user/employer/setup/newproj.php";
break;
case "prj_close":
if ($_GET["prid"]) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/projects.php";
$portf = new projects();
if (intval($_GET["prid"])) {
if (!$portf->CheckBlocked(intval($_GET['prid'])) || hasPermissions('projects')) {
$error .= $portf->SwitchStatusPrj(get_uid(), intval($_GET["prid"]));
header("Location: /");
exit;
}
}
}
break;
case "warn":
if (hasPermissions('projects')) {
require_once ABS_PATH . "/classes/messages.php";
require_once ABS_PATH . "/classes/users.php";
require_once ABS_PATH . "/classes/projects.php";
$usr = new users();
$usr->Warn($_GET["ulogin"]);
$threadid = intval(trim($_GET['threadid']));
$uid = get_uid();
示例3: trim
} else $error = "Поле заполнено некорректно";
} else $error = "Поле заполнено некорректно";
break;*/
case "prj_change":
include "newproj.php";
break;
case "prj_delete":
$prj_id = (int) trim($_POST['prjid']);
$prj = new projects();
$prj->DeletePublicProject($prj_id, get_uid());
break;
case "prj_close":
$prj_id = (int) trim($_POST['prjid']);
$portf = new projects();
if ($prj_id) {
$error .= $portf->SwitchStatusPrj(get_uid(), $prj_id);
}
$location = "/users/{$_SESSION['login']}/setup/projects/?p=list&fld={$_POST['fld']}&open={$_POST['open']}";
// $location .= ($_POST['openclose']==1) ? '?open=1' : ( ($_POST['openclose']==2) ? '?closed=1' : '' ) ;
header("Location: {$location}");
//перекидываем на текущую страницу, чтобы нельзя было повторить POST по F5
exit;
break;
case "prj_up":
$prj_id = __paramInit('int', 'prjid', 'prjid');
$tr_id = __paramInit('int', 'tid', 'transaction_id');
$rand = __paramInit('string', 'r', 'r');
if ($rand != $_SESSION['rand']) {
header('Location: /404.php');
exit;
}
示例4: cancel
/**
* Заказчик отменяет сделку.
*
* @param int $sbr_id ид. сделки.
*
* @return bool успешно?
*/
public function cancel($sbr_id)
{
$this->initFromId($sbr_id, false, false);
$project_null = '';
if ($this->data['project_id'] > 0) {
//Чистим проект
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
projects::SetExecutor($this->data['project_id'], null, $this->uid);
projects::SwitchStatusPrj($this->uid, $this->data['project_id'], false);
// Всегда открываем
$project_null = ', project_id = NULL';
}
$sql = 'UPDATE sbr SET status = ' . self::STATUS_CANCELED . " {$project_null} WHERE id = {$sbr_id} AND emp_id = {$this->uid} AND reserved_id IS NULL";
return $this->_eventQuery($sql);
}
示例5: switch
}
} else {
if ($action == 'blockuser' || $action == 'change-dates') {
$errmsg = 'У вас нет прав для выполнения данной операции';
}
}
if (is_emp()) {
switch ($action) {
case 'prj_close':
if ($prj_id) {
if (projects::isProjectOfficePostedAfterNewSBR($project) && $project['closed'] == 't') {
header('Location: /404.php');
exit;
} else {
if (!$obj_project->CheckBlocked($prj_id) || hasPermissions('projects')) {
$error .= $obj_project->SwitchStatusPrj($uid, $prj_id);
header('Location: ' . getFriendlyURL('project', $project['id']));
exit;
}
}
}
break;
}
//Персональный проект
//показываем одно единственное предложение
if ($project['kind'] == 9) {
$offers = $obj_offer->GetPrjOffers($num_offers, $prj_id, MAX_OFFERS_AT_PAGE, MAX_OFFERS_AT_PAGE * ($item_page - 1), $uid, TRUE, 'date', 'a');
$real_offers_count = current($obj_offer->CountPrjOffers($prj_id, 'all'));
} else {
switch ($_GET['sort']) {
default: