|
@@ -1,438 +1,233 @@
|
|
|
-<?php
|
|
|
-
|
|
|
-namespace Mshop\Lib;
|
|
|
-
|
|
|
-use Dever;
|
|
|
-
|
|
|
-class Feieyun
|
|
|
-{
|
|
|
- private $config = array
|
|
|
- (
|
|
|
-
|
|
|
- 'user' => '',
|
|
|
-
|
|
|
- 'ukey' => '',
|
|
|
-
|
|
|
- 'sn' => '',
|
|
|
-
|
|
|
- 'host' => 'http://api.feieyun.cn:80/Api/Open/',
|
|
|
- );
|
|
|
-
|
|
|
- public function param($param)
|
|
|
- {
|
|
|
- $time = time();
|
|
|
- $param['user'] = this->config['user'];
|
|
|
- $param[''] = sha1($this->config['user'] . $this->config['ukey'] . $time);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public function send_api()
|
|
|
- {
|
|
|
- return Dever::load('mshop/lib/buy.send_commit');
|
|
|
- }
|
|
|
-
|
|
|
- <?php
|
|
|
- header("Content-type: text/html; charset=utf-8");
|
|
|
- include 'HttpClient.class.php';
|
|
|
-
|
|
|
- define('USER', 'xxxxxxxxxxxxxxxxx');
|
|
|
- define('UKEY', 'xxxxxxxxxxxxxxxxx');
|
|
|
- define('SN', 'xxxxxxxxxxxxxxxxx');
|
|
|
-
|
|
|
-
|
|
|
- define('IP','api.feieyun.cn');
|
|
|
- define('PORT',80);
|
|
|
- define('PATH','/Api/Open/');
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $content = '<CB>测试打印</CB><BR>';
|
|
|
- $content .= '名称 单价 数量 金额<BR>';
|
|
|
- $content .= '--------------------------------<BR>';
|
|
|
- $content .= '饭 10.0 10 100.0<BR>';
|
|
|
- $content .= '炒饭 10.0 10 100.0<BR>';
|
|
|
- $content .= '蛋炒饭 10.0 10 100.0<BR>';
|
|
|
- $content .= '鸡蛋炒饭 10.0 10 100.0<BR>';
|
|
|
- $content .= '西红柿炒饭 10.0 10 100.0<BR>';
|
|
|
- $content .= '西红柿蛋炒饭 10.0 10 100.0<BR>';
|
|
|
- $content .= '西红柿鸡蛋炒饭 10.0 10 100.0<BR>';
|
|
|
- $content .= '--------------------------------<BR>';
|
|
|
- $content .= '备注:加辣<BR>';
|
|
|
- $content .= '合计:xx.0元<BR>';
|
|
|
- $content .= '送货地点:广州市南沙区xx路xx号<BR>';
|
|
|
- $content .= '联系电话:13888888888888<BR>';
|
|
|
- $content .= '订餐时间:2014-08-08 08:08:08<BR>';
|
|
|
- $content .= '<QR>http://www.feieyun.com</QR>';
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $content = "<DIRECTION>1</DIRECTION>";
|
|
|
- $content .= "<TEXT x='9' y='10' font='12' w='1' h='2' r='0'>#001 五号桌 1/3</TEXT><TEXT x='80' y='80' font='12' w='2' h='2' r='0'>可乐鸡翅</TEXT><TEXT x='9' y='180' font='12' w='1' h='1' r='0'>张三先生 13800138000</TEXT>";
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- * [批量添加打印机接口 Open_printerAddlist]
|
|
|
- * @param [string] $printerContent [打印机的sn
|
|
|
- * @return [string] [接口返回值]
|
|
|
- */
|
|
|
- function printerAddlist($printerContent){
|
|
|
- $time = time();
|
|
|
- $msgInfo = array(
|
|
|
- 'user'=>USER,
|
|
|
- 'stime'=>$time,
|
|
|
- 'sig'=>signature($time),
|
|
|
- 'apiname'=>'Open_printerAddlist',
|
|
|
- 'printerContent'=>$printerContent
|
|
|
- );
|
|
|
- $client = new HttpClient(IP,PORT);
|
|
|
- if(!$client->post(PATH,$msgInfo)){
|
|
|
- echo 'error';
|
|
|
- }else{
|
|
|
- $result = $client->getContent();
|
|
|
- echo $result;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- * [打印订单接口 Open_printMsg]
|
|
|
- * @param [string] $sn [打印机编号sn]
|
|
|
- * @param [string] $content [打印内容]
|
|
|
- * @param [string] $times [打印联数]
|
|
|
- * @return [string] [接口返回值]
|
|
|
- */
|
|
|
- function printMsg($sn,$content,$times){
|
|
|
- $time = time();
|
|
|
- $msgInfo = array(
|
|
|
- 'user'=>USER,
|
|
|
- 'stime'=>$time,
|
|
|
- 'sig'=>signature($time),
|
|
|
- 'apiname'=>'Open_printMsg',
|
|
|
- 'sn'=>$sn,
|
|
|
- 'content'=>$content,
|
|
|
- 'times'=>$times
|
|
|
- );
|
|
|
- $client = new HttpClient(IP,PORT);
|
|
|
- if(!$client->post(PATH,$msgInfo)){
|
|
|
- echo 'error';
|
|
|
- }else{
|
|
|
-
|
|
|
- $result = $client->getContent();
|
|
|
- echo $result;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * [标签机打印订单接口 Open_printLabelMsg]
|
|
|
- * @param [string] $sn [打印机编号sn]
|
|
|
- * @param [string] $content [打印内容]
|
|
|
- * @param [string] $times [打印联数]
|
|
|
- * @return [string] [接口返回值]
|
|
|
- */
|
|
|
- function printLabelMsg($sn,$content,$times){
|
|
|
- $time = time();
|
|
|
- $msgInfo = array(
|
|
|
- 'user'=>USER,
|
|
|
- 'stime'=>$time,
|
|
|
- 'sig'=>signature($time),
|
|
|
- 'apiname'=>'Open_printLabelMsg',
|
|
|
- 'sn'=>$sn,
|
|
|
- 'content'=>$content,
|
|
|
- 'times'=>$times
|
|
|
- );
|
|
|
- $client = new HttpClient(IP,PORT);
|
|
|
- if(!$client->post(PATH,$msgInfo)){
|
|
|
- echo 'error';
|
|
|
- }else{
|
|
|
-
|
|
|
- $result = $client->getContent();
|
|
|
- echo $result;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * [批量删除打印机 Open_printerDelList]
|
|
|
- * @param [string] $snlist [打印机编号,多台打印机请用减号“-”连接起来]
|
|
|
- * @return [string] [接口返回值]
|
|
|
- */
|
|
|
- function printerDelList($snlist){
|
|
|
- $time = time();
|
|
|
- $msgInfo = array(
|
|
|
- 'user'=>USER,
|
|
|
- 'stime'=>$time,
|
|
|
- 'sig'=>signature($time),
|
|
|
- 'apiname'=>'Open_printerDelList',
|
|
|
- 'snlist'=>$snlist
|
|
|
- );
|
|
|
- $client = new HttpClient(IP,PORT);
|
|
|
- if(!$client->post(PATH,$msgInfo)){
|
|
|
- echo 'error';
|
|
|
- }else{
|
|
|
- $result = $client->getContent();
|
|
|
- echo $result;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * [修改打印机信息接口 Open_printerEdit]
|
|
|
- * @param [string] $sn [打印机编号]
|
|
|
- * @param [string] $name [打印机备注名称]
|
|
|
- * @param [string] $phonenum [打印机流量卡号码,可以不传参,但是不能为空字符串]
|
|
|
- * @return [string] [接口返回值]
|
|
|
- */
|
|
|
- function printerEdit($sn,$name,$phonenum){
|
|
|
- $time = time();
|
|
|
- $msgInfo = array(
|
|
|
- 'user'=>USER,
|
|
|
- 'stime'=>$time,
|
|
|
- 'sig'=>signature($time),
|
|
|
- 'apiname'=>'Open_printerEdit',
|
|
|
- 'sn'=>$sn,
|
|
|
- 'name'=>$name,
|
|
|
- 'phonenum'=>$phonenum
|
|
|
- );
|
|
|
- $client = new HttpClient(IP,PORT);
|
|
|
- if(!$client->post(PATH,$msgInfo)){
|
|
|
- echo 'error';
|
|
|
- }else{
|
|
|
- $result = $client->getContent();
|
|
|
- echo $result;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- * [清空待打印订单接口 Open_delPrinterSqs]
|
|
|
- * @param [string] $sn [打印机编号]
|
|
|
- * @return [string] [接口返回值]
|
|
|
- */
|
|
|
- function delPrinterSqs($sn){
|
|
|
- $time = time();
|
|
|
- $msgInfo = array(
|
|
|
- 'user'=>USER,
|
|
|
- 'stime'=>$time,
|
|
|
- 'sig'=>signature($time),
|
|
|
- 'apiname'=>'Open_delPrinterSqs',
|
|
|
- 'sn'=>$sn
|
|
|
- );
|
|
|
- $client = new HttpClient(IP,PORT);
|
|
|
- if(!$client->post(PATH,$msgInfo)){
|
|
|
- echo 'error';
|
|
|
- }else{
|
|
|
- $result = $client->getContent();
|
|
|
- echo $result;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * [查询订单是否打印成功接口 Open_queryOrderState]
|
|
|
- * @param [string] $orderid [调用打印机接口成功后,服务器返回的JSON中的编号 例如:123456789_20190919163739_95385649]
|
|
|
- * @return [string] [接口返回值]
|
|
|
- */
|
|
|
- function queryOrderState($orderid){
|
|
|
- $time = time();
|
|
|
- $msgInfo = array(
|
|
|
- 'user'=>USER,
|
|
|
- 'stime'=>$time,
|
|
|
- 'sig'=>signature($time),
|
|
|
- 'apiname'=>'Open_queryOrderState',
|
|
|
- 'orderid'=>$orderid
|
|
|
- );
|
|
|
- $client = new HttpClient(IP,PORT);
|
|
|
- if(!$client->post(PATH,$msgInfo)){
|
|
|
- echo 'error';
|
|
|
- }else{
|
|
|
- $result = $client->getContent();
|
|
|
- echo $result;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * [查询指定打印机某天的订单统计数接口 Open_queryOrderInfoByDate]
|
|
|
- * @param [string] $sn [打印机的编号]
|
|
|
- * @param [string] $date [查询日期,格式YY-MM-DD,如:2019-09-20]
|
|
|
- * @return [string] [接口返回值]
|
|
|
- */
|
|
|
- function queryOrderInfoByDate($sn,$date){
|
|
|
- $time = time();
|
|
|
- $msgInfo = array(
|
|
|
- 'user'=>USER,
|
|
|
- 'stime'=>$time,
|
|
|
- 'sig'=>signature($time),
|
|
|
- 'apiname'=>'Open_queryOrderInfoByDate',
|
|
|
- 'sn'=>$sn,
|
|
|
- 'date'=>$date
|
|
|
- );
|
|
|
- $client = new HttpClient(IP,PORT);
|
|
|
- if(!$client->post(PATH,$msgInfo)){
|
|
|
- echo 'error';
|
|
|
- }else{
|
|
|
- $result = $client->getContent();
|
|
|
- echo $result;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * [获取某台打印机状态接口 Open_queryPrinterStatus]
|
|
|
- * @param [string] $sn [打印机编号]
|
|
|
- * @return [string] [接口返回值]
|
|
|
- */
|
|
|
- function queryPrinterStatus($sn){
|
|
|
- $time = time();
|
|
|
- $msgInfo = array(
|
|
|
- 'user'=>USER,
|
|
|
- 'stime'=>$time,
|
|
|
- 'sig'=>signature($time),
|
|
|
- 'apiname'=>'Open_queryPrinterStatus',
|
|
|
- 'sn'=>$sn
|
|
|
- );
|
|
|
- $client = new HttpClient(IP,PORT);
|
|
|
- if(!$client->post(PATH,$msgInfo)){
|
|
|
- echo 'error';
|
|
|
- }else{
|
|
|
- $result = $client->getContent();
|
|
|
- echo $result;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * [signature 生成签名]
|
|
|
- * @param [string] $time [当前UNIX时间戳,10位,精确到秒]
|
|
|
- * @return [string] [接口返回值]
|
|
|
- */
|
|
|
- function signature($time){
|
|
|
- return sha1(USER.UKEY.$time);
|
|
|
- }
|
|
|
-
|
|
|
-?>
|
|
|
-
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace Mshop\Lib;
|
|
|
+
|
|
|
+use Dever;
|
|
|
+
|
|
|
+class Feieyun
|
|
|
+{
|
|
|
+ private $config = array
|
|
|
+ (
|
|
|
+
|
|
|
+ 'user' => 'liuxuemei@zsma.com.cn',
|
|
|
+
|
|
|
+ 'ukey' => 'pMsXhZWu5F65MYyV',
|
|
|
+
|
|
|
+ 'host' => 'http://api.feieyun.cn:80/Api/Open/',
|
|
|
+ );
|
|
|
+
|
|
|
+ public function param($api, $send = array())
|
|
|
+ {
|
|
|
+ $time = time();
|
|
|
+ $param['user'] = $this->config['user'];
|
|
|
+ $param['stime'] = $time;
|
|
|
+ $param['sig'] = sha1($this->config['user'] . $this->config['ukey'] . $time);
|
|
|
+ $param['apiname'] = $api;
|
|
|
+ $param = array_merge($param, $send);
|
|
|
+ return $param;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function send($api, $send)
|
|
|
+ {
|
|
|
+ $url = $this->config['host'];
|
|
|
+ $param = $this->param($api, $send);
|
|
|
+ $result = Dever::curl($url, $param, 'post');
|
|
|
+ $result = Dever::json_decode($result);
|
|
|
+ if (isset($result['data']) && $result['data'] && isset($result['data'])) {
|
|
|
+ return $result['data'];
|
|
|
+ }
|
|
|
+ if (isset($result['msg'])) {
|
|
|
+ return $result['msg'];
|
|
|
+ }
|
|
|
+ return 'error';
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function add($data)
|
|
|
+ {
|
|
|
+ $content = array();
|
|
|
+ foreach ($data as $k => $v) {
|
|
|
+ $content[] = $v['number'] . '#' . $v['key'] . '#' . $v['name'] . '#' . $v['phonenum'];
|
|
|
+ }
|
|
|
+ $content = implode('\n', $content);
|
|
|
+ $send['printerContent'] = $content;
|
|
|
+ $result = $this->send('Open_printerAddlist', $send);
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function edit($sn, $name, $phonenum)
|
|
|
+ {
|
|
|
+ $send['sn'] = $sn;
|
|
|
+ $send['name'] = $name;
|
|
|
+ if ($phonenum && $phonenum != 'null') {
|
|
|
+ $send['phonenum'] = $phonenum;
|
|
|
+ }
|
|
|
+
|
|
|
+ $result = $this->send('Open_printerEdit', $send);
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function del($data)
|
|
|
+ {
|
|
|
+ $content = array();
|
|
|
+ foreach ($data as $k => $v) {
|
|
|
+ $content[] = $v['number'];
|
|
|
+ }
|
|
|
+ $content = implode('-', $content);
|
|
|
+ $send['snlist'] = $content;
|
|
|
+ $result = $this->send('Open_printerDelList', $send);
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function printOrder($sn, $content, $times)
|
|
|
+ {
|
|
|
+ $send['sn'] = $sn;
|
|
|
+ $send['content'] = $content;
|
|
|
+ $send['times'] = $times;
|
|
|
+ $result = $this->send('Open_printMsg', $send);
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function printLabelOrder($sn, $content, $times)
|
|
|
+ {
|
|
|
+ $send['sn'] = $sn;
|
|
|
+ $send['content'] = $content;
|
|
|
+ $send['times'] = $times;
|
|
|
+ $result = $this->send('Open_printLabelMsg', $send);
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function delOrder($sn)
|
|
|
+ {
|
|
|
+ $send['sn'] = $sn;
|
|
|
+ $result = $this->send('Open_delPrinterSqs', $send);
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function order($id)
|
|
|
+ {
|
|
|
+ $send['orderid'] = $id;
|
|
|
+ $result = $this->send('Open_queryOrderState', $send);
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function stat($sn, $date)
|
|
|
+ {
|
|
|
+ $send['sn'] = $sn;
|
|
|
+ $send['date'] = $date;
|
|
|
+ $result = $this->send('Open_queryOrderInfoByDate', $send);
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function status($sn)
|
|
|
+ {
|
|
|
+ $send['sn'] = $sn;
|
|
|
+ $result = $this->send('Open_queryPrinterStatus', $send);
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function goods($name, $goods, $A = 14, $B = 6, $C = 3, $D = 6)
|
|
|
+ {
|
|
|
+ $orderInfo = '';
|
|
|
+ $orderInfo .= '--------------------------------<BR>';
|
|
|
+ if ($name) {
|
|
|
+ $orderInfo .= '<C>'.$name.'</C><BR>';
|
|
|
+ }
|
|
|
+ $orderInfo .= '名称 单价 数量 金额<BR>';
|
|
|
+
|
|
|
+ foreach ($goods as $k5 => $v5) {
|
|
|
+ $name = $v5['title'];
|
|
|
+ $price = '¥' . $v5['price'];
|
|
|
+ $num = $v5['num'];
|
|
|
+ $prices = $v5['price']*$v5['num'];
|
|
|
+ $kw3 = '';
|
|
|
+ $kw1 = '';
|
|
|
+ $kw2 = '';
|
|
|
+ $kw4 = '';
|
|
|
+ $str = $name;
|
|
|
+ $blankNum = $A;
|
|
|
+ $lan = mb_strlen($str,'utf-8');
|
|
|
+ $m = 0;
|
|
|
+ $j=1;
|
|
|
+ $blankNum++;
|
|
|
+ $result = array();
|
|
|
+ if (strlen($price) < $B) {
|
|
|
+ $k1 = $B - strlen($price);
|
|
|
+ for ($q=0; $q<$k1; $q++) {
|
|
|
+ $kw1 .= ' ';
|
|
|
+ }
|
|
|
+ $price = $price.$kw1;
|
|
|
+ }
|
|
|
+ if (strlen($num) < $C) {
|
|
|
+ $k2 = $C - strlen($num);
|
|
|
+ for ($q=0; $q<$k2; $q++) {
|
|
|
+ $kw2 .= ' ';
|
|
|
+ }
|
|
|
+ $num = $num.$kw2;
|
|
|
+ }
|
|
|
+ if (strlen($prices) < $D) {
|
|
|
+ $k3 = $D - strlen($prices);
|
|
|
+ for ($q=0;$q<$k3;$q++) {
|
|
|
+ $kw4 .= ' ';
|
|
|
+ }
|
|
|
+ $prices = $prices.$kw4;
|
|
|
+ }
|
|
|
+ for ($i=0;$i<$lan;$i++) {
|
|
|
+ $new = mb_substr($str,$m,$j,'utf-8');
|
|
|
+ $j++;
|
|
|
+ if (mb_strwidth($new,'utf-8')<$blankNum) {
|
|
|
+ if ($m+$j>$lan) {
|
|
|
+ $m = $m+$j;
|
|
|
+ $tail = $new;
|
|
|
+ $lenght = Dever::convert($new);
|
|
|
+ $k = $A - strlen($lenght);
|
|
|
+ for ($q=0;$q<$k;$q++) {
|
|
|
+ $kw3 .= ' ';
|
|
|
+ }
|
|
|
+ if ($m==$j) {
|
|
|
+ $tail .= $kw3.' '.$price.' '.$num.' '.$prices;
|
|
|
+ } else {
|
|
|
+ $tail .= $kw3.'<BR>';
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ $next_new = mb_substr($str,$m,$j,'utf-8');
|
|
|
+ if (mb_strwidth($next_new,'utf-8')<$blankNum) {
|
|
|
+ continue;
|
|
|
+ } else{
|
|
|
+ $m = $i+1;
|
|
|
+ $result[] = $new;
|
|
|
+ $j=1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $head = '';
|
|
|
+ foreach ($result as $key=>$value) {
|
|
|
+ if ($key < 1) {
|
|
|
+ $v_lenght = Dever::convert($value);
|
|
|
+ $v_lenght = strlen($v_lenght);
|
|
|
+ if($v_lenght == 13) $value = $value." ";
|
|
|
+ $head .= $value.' '.$price.' '.$num.' '.$prices;
|
|
|
+ } else {
|
|
|
+ $head .= $value.'<BR>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $orderInfo .= $head.$tail.'<BR>';
|
|
|
+ }
|
|
|
+
|
|
|
+ $orderInfo .= '--------------------------------<BR>';
|
|
|
+
|
|
|
+ return $orderInfo;
|
|
|
+ }
|
|
|
}
|