當前位置: 首頁>>代碼示例>>PHP>>正文


PHP projects::getProjectByOfferId方法代碼示例

本文整理匯總了PHP中projects::getProjectByOfferId方法的典型用法代碼示例。如果您正苦於以下問題:PHP projects::getProjectByOfferId方法的具體用法?PHP projects::getProjectByOfferId怎麽用?PHP projects::getProjectByOfferId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在projects的用法示例。


在下文中一共展示了projects::getProjectByOfferId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: actionNewProjectOrder

 /**
  * Cоздание заказа на базе проекта.
  */
 public function actionNewProjectOrder()
 {
     //@todo: на период разработки резерва заказов
     if (!tservices_helper::isAllowOrderReserve()) {
         $this->missingAction(null);
     }
     $offer_id = __paramInit('int', 'offer_id', 'offer_id', null);
     $projects = new projects();
     $projectData = $projects->getProjectByOfferId($offer_id, $this->uid);
     if (!$projectData) {
         $this->missingAction(null);
     }
     $freelancer = new freelancer();
     $freelancer->GetUserByUID($projectData['frl_id']);
     if ($freelancer->uid <= 0) {
         $this->missingAction(null);
     }
     $form = new NewOrderForm();
     $form->setDefaults(array('title' => addslashes(htmlspecialchars_decode($projectData['name'], ENT_QUOTES)), 'description' => addslashes(htmlspecialchars_decode($projectData['descr'], ENT_QUOTES)), 'order_price' => $projectData['currency'] == 2 ? $projectData['cost'] : ''));
     if (isset($_POST) && sizeof($_POST) > 0 && $form->isValid($_POST)) {
         $data = $form->getValues();
         $data['frl_id'] = $freelancer->uid;
         $data['emp_id'] = $this->uid;
         $data['tu_id'] = $projectData['id'];
         if ($order = $this->order_model->createFromProject($data)) {
             $projects->SetExecutor($projectData['id'], $projectData['frl_id'], $projectData['user_id']);
             $tservices_smail = new tservices_smail();
             $tservices_smail->newOrder($order);
             $this->redirect(sprintf(tservices_helper::url('order_card_url'), $order['id']));
         }
     }
     //Выводим в сайдбар виджет индикатор статуса заказа
     $this->getClips()->add('sidebar', $this->widget('OrderStatusIndicator', array(), true));
     $this->render('new-order-form', array('title' => 'Новый заказ по проекту', 'submit_title' => 'Выбрать исполнителем и предложить заказ', 'cansel_url' => getFriendlyURL('project', $projectData), 'form' => $form, 'freelancer' => $freelancer));
 }
開發者ID:kapai69,項目名稱:fl-ru-damp,代碼行數:38,代碼來源:TServiceOrderController.php


注:本文中的projects::getProjectByOfferId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。