本文整理汇总了PHP中tservices_helper::url方法的典型用法代码示例。如果您正苦于以下问题:PHP tservices_helper::url方法的具体用法?PHP tservices_helper::url怎么用?PHP tservices_helper::url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tservices_helper
的用法示例。
在下文中一共展示了tservices_helper::url方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionNewOrder
public function actionNewOrder()
{
$code = __paramInit('string', 'code', 'code', '');
$activation_data = $this->order_model->getOrderActivation($code);
if (!$activation_data) {
$this->missingAction(null);
}
$this->order_model->deleteOrderActivation($code);
$is_new = !($activation_data['user_id'] > 0);
$registration = new registration();
$user_data = $registration->autoRegistationAndLogin(array('uid' => $activation_data['user_id'], 'role' => 1, 'email' => $activation_data['email'], 'uname' => $activation_data['uname'], 'usurname' => $activation_data['usurname']));
//Если почему то не можем зарегать
//то редиректим на регистрацию
if (!$user_data || !$user_data['ret']) {
$this->redirect('/registration/');
}
$status = $user_data['ret'];
$user = $user_data['user'];
$this->uid = $user->uid;
$service_id = intval($activation_data['tu_id']);
$debt_info = $this->order_model->isDebt($this->uid);
//блокируем возможность заказать если у исполнителя долг
//и вышли все сроки погашения
if ($debt_info && $debt_info['is_blocked'] == 't') {
$this->missingAction(null);
}
$activation_data['options']['emp_id'] = $this->uid;
$this->order_model->attributes($activation_data['options']);
$order = $this->order_model->create($service_id);
//Не удалось создать заказ показываем 404
if (!$order) {
$this->missingAction(null);
}
//Уведомляем все стороны
$tservices_smail = new tservices_smail();
$tservices_smail->newOrder($order);
//Если юзер уже бывалый пользователь то редиректим на карточку заказа
$order_url = sprintf(tservices_helper::url('order_card_url'), $order['id']);
if (!$is_new) {
if ($status == users::AUTH_STATUS_2FA) {
$_SESSION['ref_uri'] = $order_url;
$order_url = '/auth/second/';
}
$this->redirect($order_url);
}
//Берем доп.инфу о фрилансере
$freelancer = new freelancer();
$freelancer->GetUserByUID($order['frl_id']);
//Если юзер новичек то показываем ему логин/пароль и статус заказа
$this->layout = '//layouts/content-full-width';
$this->render('new-order', array('order_url' => $order_url, 'login' => $user->login, 'passwd' => $user->passwd, 'freelancer' => (array) $freelancer));
}
示例2: sprintf
?>
<?php
if ($is_owner && @$_SESSION['tu_orders']) {
?>
<a href="<?php
echo tservices_helper::url('frl_orders');
?>
"
class="b-button b-button_flat b-button_flat_green b-button_margbot_30 b-button_margtop_30">
Перейти в заказы услуг
</a>
<?php
}
?>
<a href="<?php
echo sprintf(tservices_helper::url('new'), $user->login);
?>
"
class="b-button b-button_flat b-button_flat_green b-button_margbot_30 b-button_margtop_30"
onClick="yaCounter6051055.reachGoal('add_new_tu');">
Добавить услугу
</a>
<?php
}
?>
<div class="b-layout b-layout_padtop_20 b-layout__cf">
<?php
if (count($data)) {
?>
<?php
foreach ($data as $el) {
示例3: sprintf
<td class="b-layout__td b-layout__td_width_120 b-layout__td_valign_bot">
<button class="b-button b-button_flat b-button_flat_orange b-button_padlr_10 b-button_block" type="submit">Найти услугу</button>
</td>
<?php
if (!is_emp()) {
?>
<td class="b-layout__td b-layout__td_width_140 b-layout__td_padleft_10 b-layout__td_valign_bot b-layout__td_pad_null_ipad">
<?php
if (!get_uid(false)) {
?>
<a class="b-button b-button_flat b-button_flat_green b-button_padlr_10 b-button_nowrap b-button_block" href="/registration/?user_action=new_tu">Добавить услугу</a>
<?php
} else {
?>
<a href="<?php
echo sprintf(tservices_helper::url('new'), $_SESSION['login']);
?>
" class="b-button b-button_flat b-button_flat_green b-button_padlr_10 b-button_nowrap b-button_block" onClick="yaCounter6051055.reachGoal('add_new_tu');">Добавить услугу</a>
<?php
}
?>
</td>
<?php
}
?>
</tr>
</table>
</form>
</div>
<?php
/*
示例4: getPersonalOrderUrl
public static function getPersonalOrderUrl($login)
{
$url_key = get_uid(false) ? 'porder_url' : 'guest_porder_url';
return sprintf(tservices_helper::url($url_key), $login);
}
示例5: doActivation
public function doActivation($code)
{
$activation_data = $this->getActivation($code);
if (!$activation_data) {
return false;
}
$this->deleteActivation($code);
$current_uid = get_uid(false);
if ($current_uid) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/employer.php';
$user = new employer();
$user->GetUserByUID($current_uid);
$status = 1;
} else {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/registration.php';
$registration = new registration();
$user_data = $registration->autoRegistationAndLogin(array('uid' => $activation_data['user_id'], 'role' => 1, 'email' => $activation_data['email'], 'uname' => $activation_data['uname'], 'usurname' => $activation_data['usurname']));
if (!$user_data || !$user_data['ret']) {
return self::REDIRECT_AUTH_FAIL;
}
$status = $user_data['ret'];
$user = $user_data['user'];
}
$uid = $user->uid;
$redirect = false;
$data = $activation_data['data'];
switch ($activation_data['type']) {
case GuestConst::TYPE_PERSONAL_ORDER:
$data['emp_id'] = $uid;
require_once $_SERVER['DOCUMENT_ROOT'] . '/tu/models/TServiceOrderModel.php';
$orderModel = TServiceOrderModel::model();
if ($order = $orderModel->createPersonal($data)) {
$tservices_smail = new tservices_smail();
$tservices_smail->newOrder($order);
$redirect = sprintf(tservices_helper::url('order_card_url'), $order['id']);
}
break;
case GuestConst::TYPE_VACANCY:
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
$data['state'] = projects::STATE_MOVED_TO_VACANCY;
$date_public = null;
$redirect_layout = '/public/?step=1&kind=4&public=%s&popup=1';
case GuestConst::TYPE_PROJECT:
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
$key = md5(uniqid($uid));
$tmpPrj = new tmp_project($key);
$tmpPrj->initForUser($user);
if (isset($data['IDResource']) && !empty($data['IDResource'])) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/uploader/uploader.php';
$uploader = new uploader($data['IDResource']);
$attachedfiles_files = $uploader->getFiles();
$tmpPrj->clearAttaches();
$tmpPrj->addAttachedFiles($attachedfiles_files, false);
$uploader->clear();
}
if ($prj = $tmpPrj->addSimpleProject($data)) {
$_SESSION['new_public'] = 1;
$redirect = getFriendlyURL('project', $prj);
if (isset($redirect_layout)) {
$redirect = sprintf($redirect_layout, $prj['id']);
}
$src_id = $prj['id'];
//Если проект был создан при переходе с лендинга
//то привязываем его для статистики
if (isset($data['landingProjectId'])) {
require_once ABS_PATH . '/classes/LandingProjects.php';
LandingProjects::model()->linkWithProject($data['landingProjectId'], $src_id, !$activation_data['user_id']);
}
}
break;
}
//Обновляем приглашение
if (isset($activation_data['invite_id']) && $activation_data['invite_id'] > 0) {
$guestInviteModel = new GuestInviteModel();
$guestInviteModel->updateDateComeInvite($activation_data['invite_id'], array('src_id' => isset($src_id) ? $src_id : null, 'date_public' => isset($date_public) ? $date_public : null));
}
//Мессага с паролями для новеньких
if (!$activation_data['user_id'] && !$current_uid) {
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/Helpers/SubBarNotificationHelper.php';
SubBarNotificationHelper::getInstance()->setMessage($activation_data['type'], array('login' => $user->login, 'password' => $user->passwd), $user->uid);
} elseif ($status == users::AUTH_STATUS_2FA) {
$_SESSION['ref_uri'] = $redirect;
$redirect = '/auth/second/';
}
return $redirect;
}
示例6: testGetOrderUrl
public function testGetOrderUrl()
{
$url = isset($_SESSION) ? tservices_helper::url('order_url') : tservices_helper::url('sbr_url');
$this->assertEquals(tservices_helper::getOrderUrl(7777), sprintf($url, 7777));
}
示例7: sprintf
" onclick="yaCounter6051055.reachGoal('del_tu'); TServices.onServiceDeleteSubmit(this,<?php
echo $tuid;
?>
)" class="b-button b-button_flat b-button_flat_red b-button_margtop_15 b-page__iphone">
Удалить услугу
</a>
<?php
}
?>
</td>
<?php
if ($tuid > 0 && !$tservice->is_angry) {
?>
<td class="b-layout__td b-layout__td_right b-page__desktop b-page__ipad">
<a href="javascript:void(0)" data-url="<?php
echo sprintf(tservices_helper::url('delete'), $user_obj->login);
?>
" onclick="yaCounter6051055.reachGoal('del_tu'); TServices.onServiceDeleteSubmit(this,<?php
echo $tuid;
?>
)" class="b-button b-button_flat b-button_flat_red b-button_margtop_15">
Удалить услугу
</a>
</td>
<?php
}
?>
</tr>
</table>
</aside>