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


PHP Messages::getbyServiceId方法代码示例

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


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

示例1: editAction

 /**
  * editAction
  * Get a record and populate the application form 
  * @return unknown_type
  */
 public function editAction()
 {
     $form = $this->getForm('/admin/services/process');
     $service_domains = new OrdersItemsDomains();
     $id = $this->getRequest()->getParam('id');
     // Create the buttons in the edit form
     $this->view->buttons = array(array("url" => "#", "label" => $this->translator->translate('Save'), "params" => array('css' => null, 'id' => 'submit')), array("url" => "/admin/services/list", "label" => $this->translator->translate('List'), "params" => array('css' => null, 'id' => 'submit')), array("url" => "/admin/services/new/", "label" => $this->translator->translate('New'), "params" => array('css' => null)));
     try {
         if (!empty($id) && is_numeric($id)) {
             $form->getElement('domains')->setMultiOptions(Domains::getFreeOrderDomainsList($id));
             $rs = $this->services->getAllInfo($id, null, true);
             if (!empty($rs)) {
                 $form->getElement('domains_selected')->setMultiOptions($service_domains->getList($id));
                 $rs['date_start'] = Shineisp_Commons_Utilities::formatDateOut($rs['date_start']);
                 $rs['date_end'] = Shineisp_Commons_Utilities::formatDateOut($rs['date_end']);
                 $rs['customer_id'] = $rs['Orders']['customer_id'];
                 $form->populate($rs);
                 $this->view->buttons[] = array("url" => "/admin/services/confirm/id/{$id}", "label" => $this->translator->translate('Delete'), "params" => array('css' => null));
                 $this->view->buttons[] = array("url" => "/admin/orders/edit/id/" . $rs['Orders']['order_id'], "label" => $this->translator->translate('Order'), "params" => array('css' => null));
             }
             // Get all the messages attached to the ordersitems
             $this->view->messages = Messages::getbyServiceId($id);
             $this->view->owner_datagrid = $this->ownerGrid($rs['Orders']['customer_id']);
         }
     } catch (Exception $e) {
         echo $e->getMessage();
     }
     $this->view->title = $this->translator->translate("Service Details");
     $this->view->description = $this->translator->translate("Here you can see the details of the service subscribed by the customer.");
     $this->view->mex = $this->getRequest()->getParam('mex');
     $this->view->mexstatus = $this->getRequest()->getParam('status');
     $this->view->form = $form;
     $this->render('applicantform');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:39,代码来源:ServicesController.php

示例2: editAction

 /**
  * editAction
  * Get a record and populate the application form 
  * @return unknown_type
  */
 public function editAction()
 {
     $currency = Shineisp_Registry::getInstance()->Zend_Currency;
     $id = $this->getRequest()->getParam('id');
     if (!empty($id) && is_numeric($id)) {
         $NS = new Zend_Session_Namespace('Default');
         $NS->productid = $id;
         $form = $this->getForm('/services/process');
         //Add upgrade service if exists
         $fields = "o.order_id as order, pd.name as product, CONCAT(d.domain, '.', ws.tld) as domain, oi.status_id, oi.detail_id, DATE_FORMAT(o.order_date, '%d/%m/%Y') as order_date, DATE_FORMAT(oi.date_end, '%d/%m/%Y') as next_deadline, (DATEDIFF(oi.date_end, CURRENT_DATE)) as daysleft, b.name, oi.price as price, t.name as tax, t.percentage as vat, s.status as status, bc.name as billing_cycle, oi.autorenew as autorenew, oi.note as note";
         $rs = $this->services->getAllInfo($id, $fields, 'c.customer_id = ' . $NS->customer['customer_id'] . ' OR c.parent_id = ' . $NS->customer['customer_id']);
         if (empty($rs)) {
             $this->_helper->redirector('list', 'services', 'default', array('mex' => 'The service selected has been not found.', 'status' => 'danger'));
         }
         if (!empty($rs['vat']) && $rs['price'] > 0) {
             $rs['total_with_tax'] = $currency->toCurrency($rs['price'] * (100 + $rs['vat']) / 100, array('currency' => Settings::findbyParam('currency')));
             $rs['tax'] = $rs['vat'] . "% " . $this->translator->translate($rs['tax']);
         }
         $form->populate($rs);
         // Hide these fields and values inside the vertical grid object
         unset($rs['autorenew']);
         unset($rs['vat']);
         unset($rs['note']);
         if ($rs['status_id'] == Statuses::id("complete", "orders")) {
             $this->view->expired = true;
         } else {
             $this->view->expired = false;
         }
         $this->view->datagrid = array('records' => array($rs));
         $this->view->id = $id;
         $this->view->setup = OrdersItems::getSetupConfig($id);
         // Get all the messages attached to the ordersitems
         $this->view->messages = Messages::getbyServiceId($id);
         $this->view->title = $rs['product'];
     } else {
         $this->view->title = $this->translator->translate("Detail of the service");
     }
     $this->view->description = $this->translator->translate("Here you can see the detail of the service.");
     $this->view->dnsdatagrid = $this->dnsGrid();
     $this->view->form = $form;
     $this->_helper->viewRenderer('customform');
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:47,代码来源:ServicesController.php


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