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


PHP Generic::selectStringTypeOrder方法代码示例

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


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

示例1: emailExcelReportDayByDayOrder

 public function emailExcelReportDayByDayOrder()
 {
     if (Efiwebsetting::getData('checkOAuth') == 'yes') {
         IMBAuth::checkOAuth();
     }
     $idResto = $this->mustCheck($_GET['id_restaurant'], "NO ID Restaurant");
     $range = $_GET['range'] == null || $_GET['range'] == "" ? 30 : $_GET['range'];
     $extraQ = $this->selectTypeOrder($_GET['type_order']);
     $idServer = $_GET['id_user'];
     $extraQ .= $idServer == null || $idServer == "" || $idServer == "0" ? "" : "AND id_server='{$idServer}'";
     $extraQ .= $_GET['voided'] == null || $_GET['voided'] == "" || $_GET['voided'] == "0" ? " AND status_progress='4' " : "AND status_progress='9' AND voided='1'";
     $extraQ .= $_GET['status_payment'] == null || $_GET['status_payment'] == "" || $_GET['status_payment'] == "999" ? "" : "AND status_payment='" . $_GET['status_payment'] . "'";
     ///EXCEL
     $ex = array();
     $resto = new MasterRestaurantModel();
     $resto->getByID($idResto);
     $text = "Report\t" . $resto->name . "\t" . date('Y-m-d H:i:s') . "\n";
     $text .= "Interval\t{$range} day(s)\n";
     $text .= "Server\t";
     if ($idServer == null || $idServer == "" || $idServer == "0") {
         $text .= "All Server\n";
     } else {
         $sr = new RestaurantUserModel();
         $sr->getByID($idServer);
         $text .= $sr->name . "\n";
     }
     $text .= "Type Order\t" . Generic::selectStringTypeOrder($_GET['type_order']) . "\n";
     $text .= "Order Status\t";
     $text .= $_GET['voided'] == null || $_GET['voided'] == "" || $_GET['voided'] == "0" ? "Finished Order\n" : "Voided Order\n";
     $text .= "Payment Method\t" . $this->selectTypePayment($_GET['status_payment']) . "\n\n";
     for ($i = 0; $i <= $range; $i++) {
         $date = date('Y-m-d', strtotime("-{$i} days"));
         $o = new MasterOrderModel();
         if ($range == 999) {
             $arrO = $o->getWhere("id_restaurant='{$idResto}' {$extraQ}");
         } else {
             $arrO = $o->getWhere("id_restaurant='{$idResto}' AND DATE(datetime_order)='{$date}' {$extraQ}");
         }
         if (count($arrO) == 0) {
             continue;
         }
         $text .= "Order ID " . $arrO[0]->id_order . "\n";
         if ($arrO[0]->id_server != null || $arrO[0]->id_server != "" || $arrO[0]->id_server != "0") {
             unset($sr);
             $sr = new RestaurantUserModel();
             $sr->getByID($idServer);
             $text .= "Server\t" . $sr->name . "\n";
         }
         $text .= "Time Order\t" . leap_mysqldate_isi($arrO[0]->id_server) . "\n";
         $text .= "Total\t" . $arrO[0]->total_cost . "\n";
         $text .= $arrO[0]->disc_mr == 0 ? "" : "Disc MR\t" . $arrO[0]->disc_mr . "\n";
         $text .= $arrO[0]->disc_resto == 0 ? "" : "Disc Resto\t" . $arrO[0]->disc_resto . "\n";
         $text .= $arrO[0]->disc_bank == 0 ? "" : "Disc Bank\t" . $arrO[0]->disc_bank . "\n";
         $text .= $arrO[0]->disc_other == 0 ? "" : "Disc Other\t" . $arrO[0]->disc_other . "\n";
         $text .= $arrO[0]->tax_pb1 == 0 ? "" : "Tax PB 1\t" . $arrO[0]->tax_pb1 . "\n";
         $text .= $arrO[0]->service_charge == 0 ? "" : "Service Charge\t" . $arrO[0]->service_charge . "\n";
         $text .= $arrO[0]->other_charge == 0 ? "" : "Other Charge\t" . $arrO[0]->other_charge . "\n";
         $text .= "Grand Total\t" . $arrO[0]->grand_total . "\n";
         $text .= "ID Details\tDish Name\tQuantity\tPrice\tVoided\tNote\n";
         foreach ($arrO as $or) {
             $ex[] = $or;
             $detailsOrder = OrderDetail::getOrderDetailsByIDOrder($or->id_order);
             foreach ($detailsOrder as $dor) {
                 $text .= $dor['id_order_detail'] . "\t";
                 $text .= $dor['name'] . "\t";
                 $text .= $dor['quantity'] . "\t";
                 $text .= $dor['price'] . "\t";
                 $text .= $dor['voided'] == "1" ? "YES\t" : "NO\t";
                 $text .= $dor['note'] . "\t";
                 $text .= "\n";
             }
         }
         $text .= "\n\n";
     }
     if (count($ex) <= 0) {
         //            Generic::errorMsg("Empty Record");
         $text .= "EMPTY RECORD\n\n";
     }
     $title = "Report_" . $resto->name . "_" . 1000 * strtotime(date('Y-m-d H:i:s'));
     header("Content-Disposition: attachment; filename=\"{$title}\".xls");
     header("Content-Type: application/vnd.ms-excel");
     $file = fopen($title, "w+");
     fwrite($file, $text);
     fclose($file);
     die;
 }
开发者ID:CapsuleCorpIndonesia,项目名称:martabak_revolution,代码行数:86,代码来源:GENI.php


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