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


PHP tservices_helper::isOrderReserve方法代码示例

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


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

示例1: reformat

<?php

require_once $_SERVER['DOCUMENT_ROOT'] . "/xajax/tservices_orders.common.php";
$xajax->printJavascript('/xajax/');
/**
 * @var TServiceCatalogController $this
 * 
 * @var $order заказ на основе ТУ
 */
//Заголовок заказа
$title = reformat(htmlspecialchars($order['title']), 30, 0, 1);
$order_price = tservices_helper::cost_format($order['order_price'], true);
$order_days = tservices_helper::days_format($order['order_days']);
$is_reserve = tservices_helper::isOrderReserve($order['pay_type']);
$is_reserved = $is_reserve && $order['reserve']->isExistReserveData() && $order['reserve']->isStatusReserved();
$class_color = '000';
if ($is_reserve) {
    $class_color = 'ee1d16';
    if ($is_reserved) {
        $class_color = '6db335';
    }
}
?>
<script type="text/javascript">
    var _ORDERID = <?php 
echo $order['id'];
?>
;
</script>
<?php 
$this->renderClip('order-breadcrumbs');
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:index.php

示例2: acceptOrder

 public function acceptOrder()
 {
     $is_reserve = tservices_helper::isOrderReserve($this->order['pay_type']);
     //Отправляем фрилансеру
     //@todo: пока только при резерве суммы а при обычном заказе нечего не отправляем
     //@todo: доработать по аналогии с заказчиком ниже при использовании обеих форм!
     $ret_f = true;
     if ($is_reserve) {
         $this->recipient = $this->_formatFullname($this->order['freelancer'], true);
         $message = Template::render(TSERVICES_TPL_MAIL_PATH . 'accept_order_reserve_frl.tpl.php', array('smail' => &$this, 'order' => $this->order, 'params' => $this->_addUrlParams('f'), 'emp_fullname' => $this->_formatFullname($this->order['employer'])));
         $this->message = nl2br($message);
         $ret_f = $this->send('text/html');
     }
     /*  
     $this->recipient = $this->_formatFullname($this->order['freelancer'],true);
     $this->message = Template::render(
             TSERVICES_TPL_MAIL_PATH . 'accept_order_'.($this->debt_timestamp?'debt_':'').'frl.tpl.php', 
             array(
                 'smail' => &$this, 
                 'order' => $this->order,
                 'params' => $this->_addUrlParams('f'),
                 'emp_fullname' => $this->_formatFullname($this->order['employer']),
                 'debt_timestamp' => $this->debt_timestamp
             )
     );
     
     $ret_f = $this->send('text/html');
     */
     //Отправляем заказчику
     $this->recipient = $this->_formatFullname($this->order['employer'], true);
     $template = $is_reserve ? 'accept_order_reserve_emp.tpl.php' : 'accept_order_emp.tpl.php';
     $status = $is_reserve ? tservices_sms::STATUS_RESERVE_ACCEPT : NULL;
     $message = Template::render(TSERVICES_TPL_MAIL_PATH . $template, array('smail' => &$this, 'order' => $this->order, 'params' => $this->_addUrlParams('e'), 'frl_fullname' => $this->_formatFullname($this->order['freelancer'])));
     $this->message = nl2br($message);
     $ret_e = $this->send('text/html');
     //Доп.события
     $this->sendEvent($message, TRUE, $status);
     return $ret_f && $ret_e;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:39,代码来源:tservices_smail.php

示例3: reformat

<?php

/**
 *  Шаблок окошка подтверждения заказа для фрилансера
 *  учитывается вариант с резервированием средств.
 */
$title = reformat(htmlspecialchars($title), 30, 0, 1);
$price = tservices_helper::cost_format($price, true, false, false);
$days = $days . ' ' . ending($days, 'день', 'дня', 'дней');
$accept_url = tservices_helper::getOrderStatusUrl($idx, 'accept');
$is_reserve = tservices_helper::isOrderReserve($pay_type);
$tax = $tax * 100;
?>
<div id="tservices_orders_status_popup_<?php 
echo $idx;
?>
" class="b-shadow b-shadow_center b-shadow_width_580 b-shadow_hide b-shadow__quick __tservices_orders_status_popup_hide" style="display:block;">
    <div class="b-shadow__body b-shadow__body_pad_20">
        <h2 class="b-layout__title">
            Подтверждение заказа
        </h2>
        <div class="b-layout__txt b-layout__txt_padbot_10">
            <b><?php 
echo $title;
?>
</b>
            <br/><br/>
            Сумма заказа: <b><?php 
echo $price;
?>
</b><br/>
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:t-service-order-status-frl-popup.php

示例4: tservicesOrdersSetPrice

/**
 * Редактирование стоимости и сроков заказа ТУ
 * 
 * @param type $order_id
 * @param type $price
 * @param type $days
 * 
 * @return \xajaxResponse
 */
function tservicesOrdersSetPrice($order_id, $price, $days, $paytype)
{
    $objResponse =& new xajaxResponse();
    $uid = get_uid(false);
    $price = intval($price);
    $days = intval($days);
    $paytype = intval($paytype);
    //Валидация входных параметров
    $validator = new validation();
    $valid = $validator->is_natural_no_zero($price) && $validator->greater_than_equal_to($price, 300);
    $valid = $valid && $validator->is_natural_no_zero($days) && $validator->numeric_interval($days, 1, 730);
    $valid = $valid && in_array($valid, array(TServiceOrderModel::PAYTYPE_DEFAULT, TServiceOrderModel::PAYTYPE_RESERVE));
    if (!$valid) {
        return $objResponse;
    }
    //Получение заказа
    $orderModel = TServiceOrderModel::model();
    $order_id = intval($order_id);
    $old_order = $orderModel->getCard($order_id, $uid);
    if (!$old_order) {
        return $objResponse;
    }
    //Валидация возможности изменений
    $is_new_status = $old_order['status'] == TServiceOrderModel::STATUS_NEW;
    $is_owner = $old_order['emp_id'] == $uid;
    $is_reserve_accepted = isset($old_order['reserve_data']);
    if (!($is_new_status && $is_owner && !$is_reserve_accepted)) {
        return $objResponse;
    }
    //Проверка возможности смены типа оплаты
    $is_reserve = tservices_helper::isOrderReserve($paytype);
    if ($is_reserve && !tservices_helper::isAllowOrderReserve($old_order['category_id'])) {
        return $objResponse;
    }
    if (!$is_reserve) {
        $paytype = TServiceOrderModel::PAYTYPE_DEFAULT;
    }
    $data = array('order_price' => $price, 'order_days' => $days, 'pay_type' => $paytype);
    //Меняем
    if ($orderModel->edit($order_id, $data, $old_order['tax'])) {
        $order = $old_order;
        $order['order_price'] = $price;
        $order['order_days'] = $days;
        $order['pay_type'] = $paytype;
        //Сохранить действие в историю
        $history = new tservices_order_history($order_id);
        $history->save($order, $old_order);
        //Уведомление на почту
        $tservices_smail = new tservices_smail();
        $tservices_smail->changeOrder2($order, $old_order);
        //Обновляем интерфейс цен и сроков
        $objResponse->script("\$('tu-container-price').set('html', '" . tservices_helper::cost_format($price) . "');");
        $objResponse->script("\$('tu-container-days').set('html', '" . tservices_helper::days_format($days) . "');");
        $objResponse->script("\$('tu_edit_budjet_price').set('value', '" . $price . "');");
        $objResponse->script("\$('tu_edit_budjet_days').set('value', '" . $days . "');");
        //Обновляем сообщение статуса, т.к. вторая сторона тоже могла его изменить
        $tserviceOrderStatusWidget = new TServiceOrderStatus();
        $tserviceOrderStatusWidget->setIsEmp(true);
        $tserviceOrderStatusWidget->setOrder($order);
        $tserviceOrderStatusWidget->init();
        ob_start();
        $tserviceOrderStatusWidget->run();
        $statusHtml = ob_get_contents();
        ob_end_clean();
        $objResponse->assign('tservices_order_status_' . $order_id, 'innerHTML', $statusHtml);
        $objResponse->script("\n            \$('tu-container-price').getParent()\n            .removeClass('b-layout__link_bordbot_dot_" . ($is_reserve ? '000' : 'ee1d16') . "')\n            .addClass('b-layout__link_bordbot_dot_" . ($is_reserve ? 'ee1d16' : '000') . "');\n            \$('tu-container-price').getPrevious('span').set('html','" . ($is_reserve ? 'Бюджет:' : 'Стоимость:') . "');    \n        ");
    }
    return $objResponse;
}
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:78,代码来源:tservices_orders.server.php

示例5: save

 /**
  * Сохранить историю заказа
  * 
  * @param type $new_order
  * @param type $old_order
  */
 public function save($new_order, $old_order = null)
 {
     if (!$old_order) {
         $this->addEvent(sprintf(self::MES_CREATE, htmlspecialchars($new_order['title']), tservices_helper::days_format($new_order['order_days']), tservices_helper::cost_format($new_order['order_price'], true), tservices_helper::isOrderReserve($new_order['pay_type']) ? self::TEXT_RESERVE : self::TEXT_NORESERVE));
     } else {
         if ($old_order['order_price'] != $new_order['order_price']) {
             $this->addEvent(sprintf(self::MES_UPD_PRICE, tservices_helper::cost_format($old_order['order_price'], true), tservices_helper::cost_format($new_order['order_price'], true)));
         }
         if ($old_order['order_days'] != $new_order['order_days']) {
             $this->addEvent(sprintf(self::MES_UPD_DAYS, tservices_helper::days_format($old_order['order_days']), tservices_helper::days_format($new_order['order_days'])));
         }
         if ($old_order['pay_type'] != $new_order['pay_type']) {
             $is_reserve = tservices_helper::isOrderReserve($new_order['pay_type']);
             $str_from = $is_reserve ? self::TEXT_NORESERVE : self::TEXT_RESERVE;
             $str_to = !$is_reserve ? self::TEXT_NORESERVE : self::TEXT_RESERVE;
             $this->addEvent(sprintf(self::MES_UPD_RESERVE, $str_from, $str_to));
         }
     }
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:25,代码来源:tservices_order_history.php


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