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


PHP Shineisp_Commons_Utilities::array2table方法代碼示例

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


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

示例1: remindersEmail

 /**
  * reminderAction
  * This action send to every customers an email
  * reminder about their expiring services and domains
  */
 public static function remindersEmail()
 {
     $i = 0;
     $customers = array();
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     /* We have to start to get all the domains that them expiring date is today
     		 then we have to create a custom array sorted by customerID in order to
     		group services and domains of a particular customer.
     		*/
     // Get all the active domains that expire in 1 day
     $domains = Domains::getExpiringDomainsByRange(0, 30, Statuses::id('active', 'domains'));
     if ($domains) {
         // Create the customer group list for the email summary
         foreach ($domains as $domain) {
             if ($domain['reseller']) {
                 $invoice_dest = Customers::getAllInfo($domain['reseller']);
                 $customers[$domain['customer_id']]['id'] = $invoice_dest['customer_id'];
                 $customers[$domain['customer_id']]['fullname'] = $invoice_dest['firstname'] . " " . $invoice_dest['lastname'] . " " . $invoice_dest['company'];
                 $customers[$domain['customer_id']]['email'] = $invoice_dest['email'];
                 $customers[$domain['customer_id']]['language_id'] = $invoice_dest['language_id'];
             } else {
                 $customers[$domain['customer_id']]['id'] = $domain['customer_id'];
                 $customers[$domain['customer_id']]['fullname'] = $domain['fullname'];
                 $customers[$domain['customer_id']]['email'] = $domain['email'];
                 $customers[$domain['customer_id']]['language_id'] = $domain['language_id'];
             }
             $customers[$domain['customer_id']]['products'][$i]['name'] = $domain['domain'];
             $customers[$domain['customer_id']]['products'][$i]['type'] = "domain";
             $customers[$domain['customer_id']]['products'][$i]['renew'] = $domain['renew'];
             $customers[$domain['customer_id']]['products'][$i]['expiring_date'] = $domain['expiringdate'];
             $customers[$domain['customer_id']]['products'][$i]['days'] = $domain['days'];
             $customers[$domain['customer_id']]['products'][$i]['oldorderitemid'] = $domain['detail_id'];
             $i++;
         }
     }
     /*
      * Now we have to get the services expired and we have to sum the previous $customers array with these
      * new information.
      */
     // Get all the services active that expire the day after
     $services = OrdersItems::getExpiringServicesByRange(0, 30, Statuses::id("complete", "orders"));
     if ($services) {
         // Create the customer group list for the email summary
         foreach ($services as $service) {
             if ($service['reseller']) {
                 $invoice_dest = Customers::getAllInfo($service['reseller']);
                 $customers[$service['customer_id']]['id'] = $invoice_dest['customer_id'];
                 $customers[$service['customer_id']]['fullname'] = $invoice_dest['firstname'] . " " . $invoice_dest['lastname'] . " " . $invoice_dest['company'];
                 $customers[$service['customer_id']]['email'] = $customer_email = Contacts::getEmails($invoice_dest['customer_id']);
                 $customers[$service['customer_id']]['password'] = $invoice_dest['password'];
                 $customers[$service['customer_id']]['language_id'] = $invoice_dest['language_id'];
             } else {
                 $customers[$service['customer_id']]['id'] = $service['id'];
                 $customers[$service['customer_id']]['fullname'] = $service['fullname'];
                 $customers[$service['customer_id']]['email'] = $customer_email = Contacts::getEmails($service['id']);
                 $customers[$service['customer_id']]['password'] = $service['password'];
                 $customers[$service['customer_id']]['language_id'] = $service['language_id'];
             }
             $customers[$service['customer_id']]['products'][$i]['name'] = $service['product'];
             $customers[$service['customer_id']]['products'][$i]['type'] = "service";
             $customers[$service['customer_id']]['products'][$i]['renew'] = $service['renew'];
             $customers[$service['customer_id']]['products'][$i]['expiring_date'] = $service['expiringdate'];
             $customers[$service['customer_id']]['products'][$i]['days'] = $service['days'];
             $customers[$service['customer_id']]['products'][$i]['oldorderitemid'] = $service['detail_id'];
             $i++;
         }
     }
     // EMAIL SUMMARY FOR ALL THE EXPIRED AND NOT AUTORENEWABLE DOMAINS/SERVICES
     // =========================================================================
     // Create the emailS for the customers
     if (count($customers) > 0) {
         // For each client do ...
         foreach ($customers as $customer) {
             $items = array();
             $translator->setLocale(Languages::get_locale($customer['language_id']));
             // Check if there are some product to be expired
             if (count($customer['products']) > 0) {
                 $i = 0;
                 // For each product do ...
                 foreach ($customer['products'] as $product) {
                     $items[$i][$translator->translate("Expiry Date")] = $product['expiring_date'];
                     $items[$i][$translator->translate("Days")] = $product['days'];
                     $items[$i][$translator->translate("Description")] = $product['name'];
                     if ($product['renew']) {
                         $items[$i][$translator->translate("Auto Renewal")] = $translator->translate("Active");
                     } else {
                         $items[$i][$translator->translate("Auto Renewal")] = $translator->translate("Not Active");
                     }
                     $i++;
                 }
             }
             $items = Shineisp_Commons_Utilities::array2table($items);
             if (!empty($items)) {
                 Shineisp_Commons_Utilities::sendEmailTemplate($customer['email'], 'reminder', array('items' => $items, 'fullname' => $customer['fullname']), null, null, null, null, $customer['language_id'], Settings::findbyParam('cron_notify'));
             }
//.........這裏部分代碼省略.........
開發者ID:moay,項目名稱:shineisp,代碼行數:101,代碼來源:Cronjobs.php


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