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


PHP Orders::getAllInfo方法代码示例

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


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

示例1: __construct

 /**
  * __construct
  * @param integer $orderid
  * @return array
  */
 public function __construct($orderid)
 {
     $order = Orders::getAllInfo($orderid, 'o.*, oi.*, c.*', true);
     $this->orderid = $orderid;
     if (!empty($order[0])) {
         $this->order = $order[0];
     }
     $this->translator = Shineisp_Registry::getInstance()->Zend_Translate;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:14,代码来源:Abstract.php

示例2: qrcodeAction

 /**
  * QrCode Invoice Order Management
  */
 public function qrcodeAction()
 {
     $qrcode = $this->getRequest()->getParam('q');
     if (!empty($qrcode)) {
         $decoded = base64_decode($qrcode);
         if (!empty($decoded)) {
             $data = json_decode($decoded, true);
             if (is_array($data)) {
                 if (!empty($data['customer'])) {
                     $this->view->customer = Customers::find($data['customer']);
                     $this->view->order = Orders::getAllInfo($data['order'], null, true);
                 }
             }
         }
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:19,代码来源:IndexController.php

示例3: CreateDomainsbyOrderID

 public static function CreateDomainsbyOrderID($orderid)
 {
     $domains = array();
     if (is_numeric($orderid)) {
         // Get the order information
         $order = Orders::getAllInfo($orderid, "o.*, oi.*", true);
         // Get the order items
         if (!empty($order[0]['OrdersItems'])) {
             // Get all the order products
             $products = $order[0]['OrdersItems'];
             if (is_array($products) && count($products) > 0) {
                 // For each product in order
                 foreach ($products as $product) {
                     // If it is a domain product
                     if (is_numeric($product['tld_id'])) {
                         // Get the additional parameters in the order item record
                         $parameters = !empty($product['parameters']) ? json_decode($product['parameters'], true) : array();
                         // If the parameters are present go on...
                         if (count($parameters) > 0) {
                             // Get the Authcode for the domains that need the transfer action
                             $authcode = !empty($parameters['authcode']) ? $parameters['authcode'] : "";
                             // Create the domain found in the order
                             $domainID = self::Create($parameters['domain'], $product['tld_id'], $order[0]['customer_id'], $product['detail_id'], 6, $authcode);
                             // Attach the domain to the order
                             OrdersItemsDomains::addDomain($orderid, $domainID);
                             // Prepare the result domain ids list
                             $domains[] = $domainID;
                         }
                     }
                 }
             }
         }
     }
     return $domains;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:35,代码来源:Domains.php

示例4: renewdomains

 /**
  * renewdomainAction
  * Renew a group of domains selected
  * @param $items
  * @return void
  */
 private function renewdomains($items)
 {
     $mex = "";
     if (is_array($items)) {
         try {
             $Orderid = Orders::createOrderWithMultiProducts($items, $this->customer['customer_id']);
             $isp = Shineisp_Registry::get('ISP');
             $order = Orders::getAllInfo($Orderid, null, true);
             $link = Fastlinks::findlinks($Orderid, $this->customer['customer_id'], 'orders');
             $retval = Shineisp_Commons_Utilities::getEmailTemplate('new_order');
             if ($retval) {
                 $subject = $retval['subject'];
                 $subject = str_replace("[orderid]", sprintf("%03s", $Orderid) . " - " . Shineisp_Commons_Utilities::formatDateOut($order[0]['order_date']), $subject);
                 $orderbody = $retval['template'];
                 $orderbody = str_replace("[fullname]", $order[0]['Customers']['firstname'] . " " . $order[0]['Customers']['lastname'], $orderbody);
                 $orderbody = str_replace("[bank]", $isp->bankname . "\nc/c:" . $isp->bankaccount . "\nIBAN: " . $isp->iban . "\nBIC: " . $isp->bic, $orderbody);
                 $orderbody = str_replace("[orderid]", $Orderid . "/" . date('Y'), $orderbody);
                 $orderbody = str_replace("[email]", $isp->email, $orderbody);
                 $orderbody = str_replace("[signature]", $isp->company . "\n" . $isp->email, $orderbody);
                 if (!empty($link[0])) {
                     $orderbody = str_replace("[url]", "http://" . $_SERVER['HTTP_HOST'] . "/index/link/id/" . $link[0]['code'], $orderbody);
                 } else {
                     $orderbody = str_replace("[url]", "http://" . $_SERVER['HTTP_HOST'], $orderbody);
                 }
                 if (!empty($order[0]['Customers']['email'])) {
                     Shineisp_Commons_Utilities::SendEmail($isp->email, $order[0]['Customers']['email'], $isp->email, $subject, $orderbody);
                 }
             }
             die(json_encode(array('reload' => '/orders/edit/id/' . $Orderid)));
         } catch (Exception $e) {
             die(json_encode(array('mex' => $e->getMessage())));
         }
     }
     return false;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:41,代码来源:DomainsController.php

示例5: responseAction

 /**
  * Process the response of the banks gateways
  * 
  * @return void
  */
 public function responseAction()
 {
     $request = $this->getRequest();
     $response = $request->getParams();
     if (!empty($response['custom']) && is_numeric(trim($response['custom']))) {
         $isp = Shineisp_Registry::get('ISP');
         // Orderid back from the bank
         $order_id = trim($response['custom']);
         // Getting the md5 value in order to match with the class name.
         $classrequest = $request->gateway;
         // Get the bank selected using the MD5 code
         $bank = Banks::findbyMD5($classrequest);
         if (!empty($bank[0]['classname'])) {
             if (!empty($bank[0]['classname']) && class_exists($bank[0]['classname'])) {
                 $class = $bank[0]['classname'];
                 $payment = new $class($order_id);
                 // Check if the method "Response" exists in the Payment class and send all the bank information to the payment module
                 if (method_exists($class, "Response")) {
                     $OrderID = $payment->Response($response);
                 } else {
                     $OrderID = false;
                 }
             }
         }
         // Check if the OrderID is a number because it
         // means that the order has been executed correctly
         if (is_numeric($OrderID)) {
             // Sending an email to the customer and the administrator with the order details.
             $order = Orders::getAllInfo($OrderID, null, true);
             Shineisp_Commons_Utilities::sendEmailTemplate($order[0]['Customers']['email'], 'order_confirm', array('fullname' => $order[0]['Customers']['fullname'], 'orderid' => $OrderID, 'order' => $order), null, null, null, null, $order[0]['Customers']['language_id']);
             // Redirect the user in the The task requested has been executed successfully. page
             $this->_helper->redirector('list', 'orders', 'default', array('mex' => 'The task requested has been executed successfully.', 'status' => 'success'));
         }
     }
     $this->_helper->redirector('list', 'orders', 'default', array('mex' => 'There was a problem during the payment process.', 'status' => 'danger'));
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:41,代码来源:OrdersController.php

示例6: PrintPDF

 /**
  * print the invoice
  * @param unknown_type $invoiceid
  */
 public static function PrintPDF($invoice_id, $show = true, $force = false, $path = "/documents/invoices/")
 {
     $currency = Shineisp_Registry::getInstance()->Zend_Currency;
     $pdf = new Shineisp_Commons_PdfOrder();
     if (!is_numeric($invoice_id)) {
         return false;
     }
     $invoice = Invoices::find($invoice_id);
     if (!$invoice) {
         return false;
     }
     $invoice = $invoice->toArray();
     // Set the basepath for the file
     $Order = Doctrine::getTable('Orders')->findOneBy('order_id', $invoice['order_id']);
     $invoicePath = $path . $Order->isp_id . '/' . str_replace('-', '/', $invoice['invoice_id']);
     // Set the name of the file
     $filename = $invoicePath . '/' . $invoice['invoice_id'] . ".pdf";
     $filenameOld = $path . $invoice['invoice_date'] . " - " . $invoice['number'] . ".pdf";
     // 			Invoice already exists, we return it
     if ((file_exists(PUBLIC_PATH . $filename) || file_exists(PUBLIC_PATH . $filenameOld)) && $show && !$force) {
         $outputFilename = !empty($invoice['formatted_number']) ? $invoice['formatted_number'] . ".pdf" : $invoice['invoice_date'] . "_" . $invoice['number'] . ".pdf";
         header('Content-type: application/pdf');
         header('Content-Disposition: attachment; filename="' . $outputFilename . '"');
         $invoice = file_exists(PUBLIC_PATH . $filename) ? file_get_contents(PUBLIC_PATH . $filename) : file_get_contents(PUBLIC_PATH . $filenameOld);
         die($invoice);
     }
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     $payments = Payments::findbyorderid($invoice['order_id'], null, true);
     $order = Orders::getAllInfo($invoice['order_id'], null, true);
     $database['header']['label'] = $translator->translate('Invoice No.') . " " . (!empty($invoice['formatted_number']) ? $invoice['formatted_number'] : $database['records']['invoice_number']) . " - " . Shineisp_Commons_Utilities::formatDateOut($invoice['invoice_date']);
     $database['columns'][] = array("value" => $translator->translate("SKU"), "size" => 20, "align" => "left", "key" => "sku");
     $database['columns'][] = array("value" => $translator->translate("Description"), "size" => 65, "align" => "left", "key" => "description");
     $database['columns'][] = array("value" => $translator->translate("Qty"), "size" => 2, "align" => "right", "key" => "qty");
     $database['columns'][] = array("value" => $translator->translate("Unit"), "size" => 12, "align" => "left", "key" => "unit");
     $database['columns'][] = array("value" => $translator->translate("Tax Free Price"), "size" => 9, "align" => "right", "key" => "taxfreeprice");
     $database['columns'][] = array("value" => $translator->translate("Discount"), "size" => 10, "align" => "right", "key" => "discount");
     $database['columns'][] = array("value" => $translator->translate("Setup fee"), "size" => 15, "align" => "right", "key" => "setup");
     $database['columns'][] = array("value" => $translator->translate("Total"), "size" => 18, "align" => "right", "key" => "total");
     if (isset($order[0])) {
         $orderinfo['order_number'] = !empty($order[0]['order_number']) ? $order[0]['order_number'] : Orders::formatOrderId($order[0]['order_id']);
         $orderinfo['invoice_id'] = $invoice['number'];
         $orderinfo['date'] = Shineisp_Commons_Utilities::formatDateOut($invoice['invoice_date']);
         //if customer comes from reseller
         if ($order[0]['Customers']['parent_id']) {
             $invoice_dest = Customers::getAllInfo($order[0]['Customers']['parent_id'], 'c.*, a.*');
             $orderinfo['customer']['customer_id'] = $invoice_dest['customer_id'];
             $orderinfo['customer']['company'] = $invoice_dest['company'];
             $orderinfo['customer']['firstname'] = $invoice_dest['firstname'];
             $orderinfo['customer']['lastname'] = $invoice_dest['lastname'];
             $orderinfo['customer']['vat'] = $invoice_dest['vat'];
             $orderinfo['customer']['taxpayernumber'] = $invoice_dest['taxpayernumber'];
             $orderinfo['customer']['email'] = $invoice_dest['email'];
             if (isset($invoice_dest['Addresses'][0])) {
                 $orderinfo['customer']['address'] = $invoice_dest['Addresses'][0]['address'];
                 $orderinfo['customer']['city'] = $invoice_dest['Addresses'][0]['city'];
                 $orderinfo['customer']['code'] = $invoice_dest['Addresses'][0]['code'];
                 $orderinfo['customer']['country'] = !empty($invoice_dest['Addresses'][0]['Countries']['name']) ? $invoice_dest['Addresses'][0]['Countries']['name'] : "";
             }
         } else {
             $orderinfo['customer']['customer_id'] = $order[0]['Customers']['customer_id'];
             $orderinfo['customer']['company'] = $order[0]['Customers']['company'];
             $orderinfo['customer']['firstname'] = $order[0]['Customers']['firstname'];
             $orderinfo['customer']['lastname'] = $order[0]['Customers']['lastname'];
             $orderinfo['customer']['vat'] = $order[0]['Customers']['vat'];
             $orderinfo['customer']['taxpayernumber'] = $order[0]['Customers']['taxpayernumber'];
             $orderinfo['customer']['email'] = $order[0]['Customers']['email'];
             if (isset($order[0]['Customers']['Addresses'][0])) {
                 $orderinfo['customer']['address'] = $order[0]['Customers']['Addresses'][0]['address'];
                 $orderinfo['customer']['city'] = $order[0]['Customers']['Addresses'][0]['city'];
                 $orderinfo['customer']['code'] = $order[0]['Customers']['Addresses'][0]['code'];
                 $orderinfo['customer']['country'] = $order[0]['Customers']['Addresses'][0]['Countries']['name'];
             }
         }
         $orderinfo['payments'] = array();
         if (count($payments) > 0) {
             if ($payments > 1) {
                 $numPayment = 1;
                 foreach ($payments as $payment) {
                     if ($numPayment++ > 10) {
                         break;
                     }
                     $payment['paymentdate'] = Shineisp_Commons_Utilities::formatDateOut($payment['paymentdate']);
                     $payment['income'] = $currency->toCurrency($payment['income'], array('currency' => Settings::findbyParam('currency')));
                     $orderinfo['payments'][] = $payment;
                 }
             }
             $orderinfo['payment_date'] = Shineisp_Commons_Utilities::formatDateOut($payments[0]['paymentdate']);
             $orderinfo['payment_mode'] = $payments[0]['Banks']['name'];
             $orderinfo['payment_description'] = $payments[0]['description'];
             $orderinfo['payment_transaction_id'] = $payments[0]['reference'];
         }
         $orderinfo['invoice_number'] = $invoice['number'];
         $orderinfo['company']['name'] = $order[0]['Isp']['company'];
         $orderinfo['company']['manager'] = $order[0]['Isp']['manager'];
         $orderinfo['company']['vat'] = $order[0]['Isp']['vatnumber'];
         $orderinfo['company']['bankname'] = $order[0]['Isp']['bankname'];
//.........这里部分代码省略.........
开发者ID:kokkez,项目名称:shineisp,代码行数:101,代码来源:Invoices.php

示例7: get

 public function get($uuid, $order_uuid = null, $service_uuid = null)
 {
     $this->authenticate();
     $customers = Customers::findWithUuid($uuid);
     if (empty($customers)) {
         throw new Shineisp_Api_Exceptions(400006, ":: 'uuid' not valid");
         exit;
     }
     $id = $customers['customer_id'];
     if ($order_uuid == null && $service_uuid == null) {
         throw new Shineisp_Api_Exceptions(400006, ":: 'order_uuid' not valid and 'service_uuid' not valid");
     }
     #TODO get order from $order_uuid
     if ($service_uuid != null) {
         $objService = OrdersItems::findByUUID($service_uuid);
         if ($objService == false) {
             return false;
         }
         $service = $objService->toArray();
         $orderid = $service['order_id'];
         $fields = "o.order_id, \n            \t\t   o.order_number,\n                        DATE_FORMAT(o.order_date, '%d/%m/%Y') as Starting, \n                        DATE_FORMAT(o.expiring_date, '%d/%m/%Y') as Valid_Up, \n                        in.invoice_id as invoice_id, \n                        in.number as Invoice, \n                        CONCAT(d.domain, '.', w.tld) as Domain, \n                        c.company as company, \n                        o.status_id, \n                        s.status as Status, \n                        o.vat as VAT, \n                        o.total as Total, \n                        o.grandtotal as Grandtotal\n                        so.code as servStatus";
         $rs = Orders::getAllInfo($orderid, "*", true, $id);
         if (empty($rs)) {
             throw new Shineisp_Api_Exceptions(404001, ":: Orders not found");
         }
         return $rs;
         $currency = Shineisp_Registry::getInstance()->Zend_Currency;
         $result = array();
         $order = array_shift($rs);
         // Check the status of the order.
         // If the order has to be paid we have update it to the last prices and taxes
         if ($order['status_id'] == Statuses::id('tobepaid', 'orders')) {
             // Update the total order
             Orders::updateTotalsOrder($orderid);
             // Reload the data
             $rs = Orders::getAllInfo($orderid, $fields, true, $id);
             $order = array_shift($rs);
             $order['Total'] = $currency->toCurrency($order['Total'], array('currency' => Settings::findbyParam('currency')));
             $order['VAT'] = $currency->toCurrency($order['VAT'], array('currency' => Settings::findbyParam('currency')));
             $order['Grandtotal'] = $currency->toCurrency($order['Grandtotal'], array('currency' => Settings::findbyParam('currency')));
             $order['price'] = $order['Grandtotal'];
             $result['tobepaid'] = true;
         }
         $result['order'] = $order;
         $records = OrdersItems::getAllDetails($orderid, "oi.detail_id, oi.description as description, DATE_FORMAT(oi.date_end, '%d/%m/%Y') as expiration_date, oi.quantity as quantity, oi.price as price, bc.name as billingcycle, oi.setupfee as setupfee,p.autosetup as autosetup, s.code as statuscode", true);
         $allactive = false;
         for ($i = 0; $i < count($records); $i++) {
             $records[$i]['itemactiveonorder'] = false;
             if ($records[$i]['autosetup'] == 1) {
                 $records[$i]['itemactiveonorder'] = true;
                 $allactive = true;
             } else {
                 $allactive = false;
             }
             $records[$i]['price'] = $currency->toCurrency($records[$i]['price'], array('currency' => Settings::findbyParam('currency')));
             $records[$i]['setupfee'] = $currency->toCurrency($records[$i]['setupfee'], array('currency' => Settings::findbyParam('currency')));
         }
         $result['activeonorder'] = $allactive;
         $result['orderitems'] = $records;
         $result['invoidid'] = $order['status_id'] == Statuses::id("complete", "orders") && $order['Invoice'] > 0 ? true : false;
         $result['invoidnumber'] = $order['Invoice'];
         $result['invoidid'] = $order['invoice_id'];
         $result['payments'] = "";
         if ($result['tobepaid'] == true) {
             $result['payments'] = array();
             $banks = Banks::findAllActive("classname", true);
             if (!empty($banks)) {
                 foreach ($banks as $bank) {
                     if (!empty($bank['classname']) && class_exists($bank['classname'])) {
                         if (class_exists($bank['classname'])) {
                             $class = $bank['classname'];
                             $payment = new $class($id);
                             $payment->setUrlOk($_SERVER['HTTP_HOST'] . "/orders/response/gateway/" . md5($bank['classname']));
                             $payment->setUrlKo($_SERVER['HTTP_HOST'] . "/orders/response/gateway/" . md5($bank['classname']));
                             $payment->setUrlCallback($_SERVER['HTTP_HOST'] . "/common/callback/gateway/" . md5($bank['classname']));
                             $result['payments'][] = $payment->CreateForm();
                         }
                     }
                 }
             }
         }
         return $result;
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:84,代码来源:Orders.php


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