wlzboy
2025-07-09 ab0742bf945b5de8554761de6fa4ecda29f640e0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
<?php include "./inc/odbc.php"; ?>
<?php include "./inc/function.php"; ?>
<?php 
$ServiceOrdID=empty($_REQUEST['ServiceOrdID'])!=false ? "" : addslashes($_REQUEST['ServiceOrdID']);
$DispatchOrdID=empty($_REQUEST['DispatchOrdID'])!=false ? "0" : addslashes($_REQUEST['DispatchOrdID']);
$OrderType=empty($_REQUEST['OrderType'])!=false ? 1 : addslashes($_REQUEST['OrderType']);
$s=empty($_REQUEST['s'])!=false ? "" : $_REQUEST['s'];
 
//$ServiceOrdID=empty($_REQUEST['ServiceOrdID'])!=false ? "" : $_REQUEST['ServiceOrdID'];
//$DispatchOrdID=empty($_REQUEST['DispatchOrdID'])!=false ? "0" : $_REQUEST['DispatchOrdID'];
$sign=empty($_REQUEST['sign'])!=false ? "" : $_REQUEST['sign'];
if (($ServiceOrdID=="" and $DispatchOrdID=="0") or $sign==""){header("Location: /OrdEvaluateError.asp");exit;}
 
//验签
$signA="";
if ($ServiceOrdID!=""){$signA=$signA.$ServiceOrdID;}
if ($DispatchOrdID!="0"){$signA=$signA.$DispatchOrdID;}
if ($sign!=MD5($signA.$GPSKey) and $sign!="vicgame"){header("Location: /OrdEvaluateError.asp");exit;}
 
$openid=empty($_REQUEST['openid'])!=false ? "" : $_REQUEST['openid'];
if (isset($_COOKIE["openid"])){$openid=$_COOKIE["openid"];}
//include "./inc/OAuth2.php";
 
//微信JS
require_once "./inc/jssdk.php";
$jssdk = new JSSDK($APPID, $APPSECRET);
$signPackage = $jssdk->GetSignPackage();
$ShareURL="https://wx.966120.com.cn/MyOrder.php?ServiceOrdID=$ServiceOrdID&DispatchOrdID=$DispatchOrdID&s=1&sign=$sign";
?>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>民航医疗快线</title>
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/bootstrap-theme.min.css">
<script src="/js/jquery-1.10.2.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/app.js?v=1.8"></script>
<link rel="stylesheet" href="/css/app.css?v=1.9">
<link rel="stylesheet" href="/css/app_2.css?v=2.0">
</head>
<body class="ds_body da_body">
<div  style="text-align:center;margin-top:20px"><img src="img/top.png" width="90%" height="" border="0" alt=""></div>
<hr style="text-align:center;width:90%"></hr>
<style>
.da_body {
    min-width: 320px;
    margin: 0 auto;
    max-width: 640px;
}
header .headbrand {
    margin-top: -4px;
    position: absolute;
    right: 10px;
    top: 10px;
}
header {
    padding: 1em 5%;
    height: auto;
}
header .headico {
    margin-top: 0;
    display: inline-block;
    vertical-align: top;
}
.info{
    padding-left: 0px;padding-bottom: 5px;display: inline-block;vertical-align: top;width: 60%;
}
.rating-small .fa {
    color: #ffcc33;
}
.sign{
    color: #545454;clear: both;font-size: 14px;
}
#point_star span{
    background-image: url("/img/start2_09.png");
}
#point_star .empty {
    background-image: url("/img/start2_10.png");
}
.showlabel ul li img{
    width: 13px;
    height: 13px;
    margin-left: 3px;
}
.imgs{text-align: left;margin: 10px 0;}
.imgs img{width: 60px;height: 60px;margin: 5px;}
    @media screen and (max-width: 320px) {
        .info{width: 50%;}
    }
.label3 {
    color: #fff;
     background:transparent; 
    border: 1px solid #ffa732;
    cursor: pointer;
    color: #ffa732;
}
</style>
 
<?php 
$ServiceOrdState=0;
$DispatchOrdState=0;
$Guest_Point=0;
$ServiceOrdTraPrePayment=0;
$ServiceOrdTraPaidPrice=0;
$ServiceOrdTraTxnPrice=0;
 
//调度单数据
if ($DispatchOrdID!="0" or $ServiceOrdID!=""){
    $sql=empty($ServiceOrdID)!=false ? "" : " or ServiceOrdIDDt=".$ServiceOrdID;
    $sql="select *,DispatchOrdReturnDate=convert(char,DispatchOrdReturnDate,120) from DispatchOrd where DispatchOrdState>0 and DispatchOrdID=".$DispatchOrdID.$sql;
    //echo $sql;
    $data = sqlsrv_query($conn,$sql);
    if($data == true){
        if (sqlsrv_rows_affected($data)!=0) {
            while($rs = sqlsrv_fetch_array($data) ) {
                $DispatchOrdID            = $rs['DispatchOrdID'];            //调度单号
                $DispatchOrdClass        = $rs['DispatchOrdClass'];        //单据类型
                $ServiceOrdID            = $rs['ServiceOrdIDDt'];        //对应受理单号
                $DispatchOrdState        = $rs['DispatchOrdState'];        //调度单状态
                $DispatchOrd_AP_Check    = $rs['DispatchOrd_AP_Check'];    //是否审核(0否,1是)
                $DispatchOrd_AP_Reason    = $rs['DispatchOrd_AP_Reason'];    //审核原因
                $DispatchOrdCarID        = $rs['DispatchOrdCarID'];        //派遣车辆ID
                $DispatchOrdTraDistance    = $rs['DispatchOrdTraDistance'];    //实际距离
                $DispatchOrdTraStreet    = $rs['DispatchOrdTraStreet'];    //实际出发地
                $DispatchOrdTraEnd        = $rs['DispatchOrdTraEnd'];        //实际目的地
                $DispatchOrdTraVia        = $rs['DispatchOrdTraVia'];        //实际途经地
                $DispatchOrdCoName        = $rs['DispatchOrdCoName'];        //调度联系人
                $DispatchOrdCoPhone        = $rs['DispatchOrdCoPhone'];        //调度联系电话
                $DispatchOrdTraStreetMileage= $rs['DispatchOrdTraStreetMileage'];//开始里程数
                $DispatchOrdTraEndMileage= $rs['DispatchOrdTraEndMileage'];    //结束里程数
                $DispatchOrdMileage        = $rs['DispatchOrdMileage'];        //实际里程数
                $DispatchOrdReturnDate    = $rs['DispatchOrdReturnDate'];        //运转结束时间
                $DispatchOrdGasoline    = $rs['DispatchOrdGasoline'];        //油耗
                $DispatchOrdRemarks        = $rs['DispatchOrdRemarks'];        //行驶备注记录
                $EntourageName_aid1        = $rs['EntourageName_aid1'];        //外援人员1
                $EntourageName_aid2        = $rs['EntourageName_aid2'];        //外援人员2
                $DispatchOrdPerfomance    = $rs['DispatchOrdPerfomance'];
                $RecommendedCar            = $rs['RecommendedCar'];            //指定车型
                $CarStItm_OAId            = $rs['CarStItm_OAId'];            //物品清单检查人ID
                $StretcherMoney            = $rs['StretcherMoney'];            //担架费
            }
        }else{
            $DispatchOrdID        = "";
        }
    }
}
$DispatchOrdReturnDate=empty($DispatchOrdReturnDate)!=false ? date("y-m-d h:i:s") : $DispatchOrdReturnDate;
 
//服务单数据
if ($ServiceOrdID!=""){
    $sql="select *,OrdStartDate=convert(char,ServiceOrdStartDate,120),OrdApptDate=convert(char,ServiceOrdApptDate,120) from ServiceOrder where ServiceOrdID=".$ServiceOrdID;
    $data = sqlsrv_query($conn,$sql);
    if($data == true){
        if (sqlsrv_rows_affected($data)!=0) {
            while($rs = sqlsrv_fetch_array($data) ) {
                $ServiceOrdID            = $rs['ServiceOrdID'];            //服务单号
                $ServiceOrdClass        = $rs['ServiceOrdClass'];            //单据类型
                $ServiceOrdType        = $rs['ServiceOrdType'];            //服务单类型
                $ServiceOrdState        = $rs['ServiceOrdState'];            //服务单状态
                $ServiceOrdStartDate    = $rs['OrdStartDate'];        //开单日期
                $ServiceOrdApptDate    = $rs['OrdApptDate'];        //预约日期
                //If year(ServiceOrdApptDate)<2010 then ServiceOrdApptDate=""
                $ServiceOrdCoName        = $rs['ServiceOrdCoName'];        //联系人姓名
                $ServiceOrdCoPhone        = $rs['ServiceOrdCoPhone'];        //联系人电话
                $ServiceOrdCoTies        = $rs['ServiceOrdCoTies'];        //联系人与患者关系
                $ServiceOrdPtName        = $rs['ServiceOrdPtName'];        //患者姓名
                $ServiceOrdPtAge        = $rs['ServiceOrdPtAge'];            //患者年龄
                $ServiceOrdPtSex        = $rs['ServiceOrdPtSex'];            //患者性别
                $ServiceOrdPtNat        = $rs['ServiceOrdPtNat'];            //患者国籍
                $ServiceOrdPtOutHosp    = $rs['ServiceOrdPtOutHosp'];        //转出医院
                $ServiceOrdPtServicesID    = $rs['ServiceOrdPtServicesID'];        //科室ID
                $ServiceOrdPtServices    = $rs['ServiceOrdPtServices'];    //科室
                $ServiceOrdPtDiagnosis    = $rs['ServiceOrdPtDiagnosis'];    //诊断
                $ServiceOrdPtCondition    = $rs['ServiceOrdPtCondition'];    //备注
                $ServiceOrdPtDoctor    = $rs['ServiceOrdPtDoctor'];        //患者医生
                $ServiceOrdPtDoctorPhone=$rs['ServiceOrdPtDoctorPhone'];    //患者医生电话
                $ServiceOrdTraProvince    = $rs['ServiceOrdTraProvince'];    //出发地省份
                $ServiceOrdTraCity        = $rs['ServiceOrdTraCity'];        //出发地城市
                $ServiceOrdTraStreet    = $rs['ServiceOrdTraStreet'];        //出发地
                $ServiceOrdTraStreetCoo= $rs['ServiceOrdTraStreetCoo'];    //出发地坐标
                $ServiceOrdTraEnd        = $rs['ServiceOrdTraEnd'];        //目的地
                $ServiceOrdTraEndCoo    = $rs['ServiceOrdTraEndCoo'];        //目的地坐标
                $ServiceOrdTraDistance    = $rs['ServiceOrdTraDistance'];    //距离(公里)
                $ServiceOrdTraDuration    = $rs['ServiceOrdTraDuration'];    //预计行程时间
                $ServiceOrdTraUnitPrice= $rs['ServiceOrdTraUnitPrice'];    //单价/公里
                $ServiceOrdTraOfferPrice=$rs['ServiceOrdTraOfferPrice'];    //标准报价
                $ServiceOrdTraTxnPrice    = $rs['ServiceOrdTraTxnPrice'];    //成交价
                $ServiceOrdTraPrePayment= $rs['ServiceOrdTraPrePayment'];    //需预付款金额
                $ServiceOrdTraPaidPrice= $rs['ServiceOrdTraPaidPrice'];    //已支付金额
                $ServiceOrdTraPriceReason=$rs['ServiceOrdTraPriceReason'];//差价原因
                $Guest_Point            = $rs['Guest_Point'];            //评价情况
 
                $ServiceOrdTraVia    = $rs['ServiceOrdTraVia'];    //客人出发地
                $ServiceOrdTraEnd    = $rs['ServiceOrdTraEnd'];    //客人目的地
                $ServiceOrdPtOutHospID=$rs['ServiceOrdPtOutHospID'];//转出医院ID
                $ServiceOrdPtInHospID=$rs['ServiceOrdPtInHospID'];//转入医院ID
                if ($ServiceOrdPtOutHospID!='0' and $ServiceOrdPtOutHospID!='153') {
                    $sql="select HospName,HospLevel from HospData where HospID=".$ServiceOrdPtOutHospID;
                    $HospData = sqlsrv_query($conn,$sql);
                    if($HospData == true){
                        if (sqlsrv_rows_affected($HospData)!=0) {
                            while($rsHosp = sqlsrv_fetch_array($HospData) ) {
                                $ServiceOrdTraVia=$rsHosp['HospName'];
                            }
                        }
                    }
                }
                if ($ServiceOrdPtInHospID!='0' and $ServiceOrdPtInHospID!='153') {
                    $sql="select HospName,HospLevel from HospData where HospID=".$ServiceOrdPtInHospID;
                    $HospData = sqlsrv_query($conn,$sql);
                    if($HospData == true){
                        if (sqlsrv_rows_affected($HospData)!=0) {
                            while($rsHosp = sqlsrv_fetch_array($HospData) ) {
                                $ServiceOrdTraEnd=$rsHosp['HospName'];
                            }
                        }
                    }
                }
            }
        }else{
            $ServiceOrdID        = "";
        }
    }
}
 
//发票信息数据
if ($ServiceOrdID!=""){
    $sql="select *,ApplicationTime=convert(char,ApplicationTime,120),AuditTime=convert(char,AuditTime,120) from InvoiceData where AuditStatus<>4 and ServiceOrderIDPK=".$ServiceOrdID;
    $data = sqlsrv_query($conn,$sql);
    if($data == true){
        if (sqlsrv_rows_affected($data)!=0) {
            while($rs = sqlsrv_fetch_array($data) ) {
                $InvoiceID            = $rs['InvoiceID'];            //开票信息ID
                $InvoiceType        = $rs['InvoiceType'];        //开票类型
                $ApplicationTime    = $rs['ApplicationTime'];    //申请时间
                $AuditTime            = $rs['AuditTime'];            //处理时间
                $AuditStatus        = $rs['AuditStatus'];        //处理状态
                $AuditOAID            = $rs['AuditOAID'];            //处理人
                $AuditMakeout        = $rs['AuditMakeout'];        //处理备注
                $InvoiceMoney        = $rs['InvoiceMoney'];        //发票金额
                $InvoiceNo            = $rs['InvoiceNo'];            //发票编号
                $InvoiceURL            = $rs['InvoiceURL'];        //发票链接
            }
        }else{
            $InvoiceID=0;
            $InvoiceType        = 2;        //开票类型
            $ApplicationTime    = "";        //申请时间
            $AuditTime            = "";        //处理时间
            $AuditStatus        = 0;        //处理状态
            $AuditOAID            = "";        //处理人
            $AuditMakeout        = "";        //处理备注
            $InvoiceMoney        = "";        //发票金额
            $InvoiceNo            = "";        //发票编号
            $InvoiceURL            = "";        //发票链接
        }
    }
}
 
if(empty($ServiceOrdID)!=false and empty($DispatchOrdID)!=false){header("Location: /MyCenter.php");exit;}
?>
 
<header class="text-left dasang">
    <div class="info">
        <div class="waitername"  style="font-size: 16px;">任务状态:<?php echo OrdState_A($ServiceOrdState,$DispatchOrdState);?></div>     
    </div>
        <div class="sign"  style="font-size: 16px;">
        
        开单时间:<?php echo $ServiceOrdStartDate;?><br>
        <?php if ($ServiceOrdTraVia!=''){?>
         出发地:<?php echo $ServiceOrdTraVia;?><br><?php } ?>
         目的地:<?php echo $ServiceOrdTraEnd;?><br>
        <hr style="text-align:center;width:90%"></hr>
         联系人:<?php echo $ServiceOrdCoName;?><br>
         转运人:<?php echo $ServiceOrdPtName;?><br>
        科室床位:<?php echo PtServices_A($ServiceOrdPtServicesID);?>&nbsp;&nbsp;<?php echo $ServiceOrdPtServices;?><br>
        转运费用:<?php echo number_format($ServiceOrdTraTxnPrice,0);?><br>
        <hr style="text-align:center;width:90%"></hr>
        <?php if (empty($DispatchOrdID)==false and $DispatchOrdCarID!='0'){
            $CarLicense=CarDataA($DispatchOrdCarID);
            ?>
            执行车辆:<?php echo $CarLicense;?>
        <?php } ?>
    </div>
</header>
<?php
if ($ServiceOrdState!=4 and $OrderType==1) {
    if ($ServiceOrdTraPrePayment>0 And $ServiceOrdTraPaidPrice<$ServiceOrdTraPrePayment) {?>
        <div class="ds_form text-center">
            <div class="col-xs-12">
                <div class="anniu" onClick="javascript:location.href='/OrdPay.asp?ServiceOrdID=<?php echo $ServiceOrdID;?>&isPrePayment=1&sign=<?php echo MD5("/OrdPay.asp?ServiceOrdID".$ServiceOrdID."isPrePayment1".$APPkey);?>';">
                    <button type="button" id="btn_reg" class="" style=""><?php echo "支付定金 &nbsp;".number_format($ServiceOrdTraPrePayment,0)."元"?></button>
                </div>
            </div>
        </div>
    <?php }?>
    <?php if ($ServiceOrdTraPaidPrice<$ServiceOrdTraTxnPrice) {?>
        <div class="ds_form text-center">
            <div class="col-xs-12">
                <div class="anniu" onClick="javascript:location.href='/OrdPay.asp?ServiceOrdID=<?php echo $ServiceOrdID;?>&isPrePayment=0&sign=<?php echo MD5("/OrdPay.asp?ServiceOrdID".$ServiceOrdID."isPrePayment0".$APPkey);?>';">
                    <button type="button" id="btn_reg" class="" style="">
                    <?php
                    if ($ServiceOrdTraPrePayment>0 and $ServiceOrdTraPaidPrice<$ServiceOrdTraPrePayment) {
                        echo "全额支付 &nbsp;".number_format($ServiceOrdTraTxnPrice-$ServiceOrdTraPaidPrice,0)."元";
                    }elseif ($ServiceOrdTraPrePayment>0 and $ServiceOrdTraPaidPrice>=$ServiceOrdTraPrePayment) {
                        echo "支付尾款 &nbsp;".number_format($ServiceOrdTraTxnPrice-$ServiceOrdTraPaidPrice,0)."元";
                    }else{
                        echo "线上支付 &nbsp;".number_format($ServiceOrdTraTxnPrice-$ServiceOrdTraPaidPrice,0)."元";
                    }
                    ?>
                    </button>
                </div>
            </div>
        </div>
    <?php }
}?>
 
<?php if ($OrderType==1){?>
    <?php if (empty($DispatchOrdID)==false and empty($DispatchOrdCarID)==false and $DispatchOrdState>=6 and $DispatchOrdState<7){?>
    <div class="ds_form text-center">
        <div class="col-xs-12">
            <!--
            <div class="anniu" onClick="javascript:location.href='/CarGPS.php?OrdID=<?php echo $DispatchOrdID;?>&time=<?php echo time();?>&sign=<?php echo MD5($DispatchOrdID.time().$GPSKey);?>';">
                <button type="button" id="btn_reg" class="" style="">查看车辆实时位置</button>
            </div>
            -->
        </div>
    </div>
    <?php } ?>
<?php } ?>
 
<?php if ($OrderType==1 or $OrderType==3){?>
    <?php if (empty($ServiceOrdID)==false and empty($InvoiceID)!=false and $ServiceOrdTraPaidPrice>0 and (strtotime($DispatchOrdReturnDate)+86400*30)>=strtotime (date("y-m-d h:i:s")) and $DispatchOrdState>=7 and $DispatchOrdState!=10) {?>
    <div class="ds_form text-center">
        <div class="col-xs-12">
            转运结束后30天内,您可申请发票。电子发票通过手机短信形式发送。增值税普通发票通过邮寄发出,运费到付。
            <div class="anniu" onClick="javascript:location.href='/MyInvoice.php?ServiceOrdID=<?php echo $ServiceOrdID?>&sign=<?php echo MD5($ServiceOrdID.$GPSKey);?>';">
                <button type="button" id="btn_reg" class="" style="">申请发票</button>
            </div>
        </div>
    </div>
    <?php }elseif (empty($ServiceOrdID)==false and empty($InvoiceID)==false and $AuditStatus<3){?>
    <div class="ds_form text-center">
        <div class="col-xs-12">
            电子发票通过手机短信形式发送。增值税普通发票通过邮寄发出,运费到付。
            <div class="anniu" onClick="javascript:location.href='/MyInvoice.php?ServiceOrdID=<?php echo $ServiceOrdID?>&sign=<?php echo MD5($ServiceOrdID.$GPSKey);?>';">
                <button type="button" id="btn_reg" class="" style="">修改发票信息</button>
            </div>
        </div>
    </div>
    <?php }elseif (empty($ServiceOrdID)==false and empty($InvoiceID)==false and $AuditStatus==3){ 
        if ($InvoiceType=2){$InvoiceTypeTXT="短信";}
        else{$InvoiceTypeTXT="快递信息";}
    ?>
    <div class="ds_form text-center">
        <div class="col-xs-12">
            <div class="anniu">
                <button type="button" id="btn_reg" class="" style="">发票已开出,请留意<?php echo $InvoiceTypeTXT?>通知</button>
            </div>
        </div>
    </div>
    <?php }else{?>
    <div class="ds_form text-center">
        <div class="col-xs-12">
            转运结束后30天内,您可申请发票。电子发票通过手机短信形式发送。增值税普通发票通过邮寄发出,运费到付。
        </div>
    </div>
    <?php } ?>
<?php } ?>
 
<?php if (empty($DispatchOrdID)==false and empty($s) and $DispatchOrdState>=6 and $DispatchOrdState<=8 and $Guest_Point==0 and strtotime($ServiceOrdStartDate)+259200000>=strtotime(date("y-m-d h:i:s")) and ($OrderType==1 or $OrderType==2) ) {
//if (!empty($ServiceOrdID)) {header("Location: /index.html#/pages/order/detail/detail?ServiceOrdID=".$ServiceOrdID);exit;}
?>
    <!-- 打赏页 -->
    <div class="ds_form text-center">
        <form action='/OrdEvaluateSave.asp' method='post' name='order_form form-inline'>
            <input type='hidden' name="ServiceOrdID" value="<?php echo $ServiceOrdID;?>" />
            <input type='hidden' name="DispatchOrdID" value="<?php echo $DispatchOrdID;?>" />
            <input type='hidden' name="openid" value="<?php echo $openid;?>" />
            <input type='hidden' name="point" value="0" />
 
            <img src="/img/user_comment2_11.png" style="width: 100%;margin: 0px 0px 20px 0px;">
            <div class="ds_form text-center">
                <div class="col-xs-12" style="font-size: 16px;">请对我们本次服务作出评价</div>
            </div>
            <div id="cash_select" class="col-xs-12">
                    <ul>
                        <li style="width: 100px;height: 40px;line-height: 40px;"><input name="Guest_PointE" type="radio" value="1" ><span style="font-size: 18px;">满意</span></li>&nbsp;&nbsp;
                        <li style="width: 100px;height: 40px;line-height: 40px;"><input name="Guest_PointE" type="radio" value="2" ><span style="font-size: 18px;">不满意</span></li>
                    </ul>
            </div>
            <div style="display: none;" id="Guest_Point">
            <?php
            $i=0;
            $e=0;
            $DriverEId=0;
            $Guest_PointArray=[];
            $sql="select vID,vOrder2,DispatchOrd_Entourage.id,EntourageOAid,EntourageLead,OA_Name,OA_weixinAvatar,OA_Img,OA_Img_64,vtext from DispatchOrd_Entourage,OA_User,dictionary where vtitle='DispatchOrdEntourage' and  EntourageID=vID and OA_User_ID=EntourageOAid and EntourageState<>4 and DispatchOrdIDDt=".$DispatchOrdID." order by EntourageLead desc,vID desc";
            $data = sqlsrv_query($conn,$sql);
            if($data == true){
                if (sqlsrv_rows_affected($data)!=0) {
                    while($rs = sqlsrv_fetch_array($data) ) {
                        $OA_Name        = $rs['OA_Name'];
                        $OA_Img            = $rs['OA_Img'];
                        $OA_Img_64            = $rs['OA_Img_64'];
                        If (empty($OA_Img_64)) {
                            $OA_Img_64    = $rs['OA_weixinAvatar'];
                            If (empty($OA_Img_64)) {$OA_Img_64 = $OAImgURL."icon_avatar_default.png";}
                        }else{
                            $OA_Img_64 = $OAImgURL.$OA_Img_64;
                        }
                        if (empty($OA_Img)) {$OA_Img=$OA_Img_64;}else{$OA_Img = $OAImgURL.$OA_Img;}
                        $EntourageName    = $rs['vtext'];
                        $OA_Name=str_replace("(外援医生)","",$OA_Name);
                        $OA_Name=str_replace("(外援医生)","",$OA_Name);
                        $OA_Name=str_replace("司机001","",$OA_Name);
                        if (empty($DriverEId)){
                            $EntourageID    = $rs['vID'];
                                $OA_CompetencyID= $rs['vOrder2'];
                                $EId            = $rs['id'];
                                $EntourageOAid    = $rs['EntourageOAid'];
                                array_push($Guest_PointArray,"Guest_PointE_".$EId);
                                $i++;
                                    
            ?>
                <input type='hidden' name="EId" value="<?php echo $EId;?>" />
                <input type='hidden' name="EntourageName_<?php echo $EId;?>" value="<?php echo $EntourageName;?>" />
                <?php }?>
                        <?php if ($EntourageName!='司机') {
                            $e=$e+3;?>
                            <div style="text-align: left;font-size: 15px;color: #545454;margin-bottom: 26px;">
                                <div style="font-size: 24px;"><a href="<?php echo $OA_Img;?>"><img src="<?php echo $OA_Img_64;?>" style="max-width:64px;max-height:64px;"></a>&nbsp;<?php echo $OA_Name;?>&nbsp;<?php echo $EntourageName;?>
                                
                                </div>
                                <div id="cash_select" class="col-xs-12">
                                    <ul>
                                        <li style="width: 32%;height: 40px;line-height: 40px;"><input name="Guest_PointE_<?php echo $EId;?>" type="radio" value="1" ><span style="font-size: 14px;">满意<?php echo $EntourageName;?></span></li>
                                        <li style="width: 32%;height: 40px;line-height: 40px;"><input name="Guest_PointE_<?php echo $EId;?>" type="radio" value="2" ><span style="font-size: 14px;">不满意技能水平</span></li>
                                        <li style="width: 32%;height: 40px;line-height: 40px;"><input name="Guest_PointE_<?php echo $EId;?>" type="radio" value="3" ><span style="font-size: 14px;">不满意服务水平</span></li>
                                    </ul>
                            </div>
                            </div>
                        <?php }else{
                            if (empty($DriverEId)){
                                $e=$e+3;
                                $DriverData="<td><a href=\"".$OA_Img."\"><img src=\"".$OA_Img_64."\" style=\"max-width:64px;max-height:64px;\"></a></td>";
                                $DriverData.="</tr><tr>";
                                $DriverData.="<td>".$OA_Name." ".$EntourageName."</td>";
                                $DriverEId=$EId;
                            }else{
                                $DriverData=str_replace("</tr><tr>","<td><a href=\"".$OA_Img."\"><img src=\"".$OA_Img_64."\" style=\"max-width:64px;max-height:64px;\"></a></td></tr><tr>",$DriverData);
                                $DriverData.="<td>".$OA_Name." ".$EntourageName."</td>";
                            }
                            
                        }
                    }
                }
            }    
            ?>
            <?php if (!empty($DriverEId)){?>
                <div style="text-align: left;font-size: 15px;color: #545454;margin-bottom: 26px;">
                    <div style="font-size: 24px;">
                        <?php echo "<table style=\"width: 90%;\"><tr>".$DriverData."</tr></table>"?>
                    </div>
                    <div id="cash_select" class="col-xs-12">
                            <ul>
                                <li style="width: 32%;height: 40px;line-height: 40px;"><input name="Guest_PointE_<?php echo $EId;?>" type="radio" value="1" ><span style="font-size: 14px;">满意<?php echo $EntourageName;?></span></li>
                                <li style="width: 32%;height: 40px;line-height: 40px;"><input name="Guest_PointE_<?php echo $EId;?>" type="radio" value="2" ><span style="font-size: 14px;">不满意技能水平</span></li>
                                <li style="width: 32%;height: 40px;line-height: 40px;"><input name="Guest_PointE_<?php echo $EId;?>" type="radio" value="3" ><span style="font-size: 14px;">不满意服务水平</span></li>
                            </ul>
                    </div>
                </div>
            <?php }?>
                <div class="col-xs-12" style="border: 1px solid #dfdfdf;border-left:none;border-right:none; ">
                    <textarea name='contents' class="form-control" id="textarea" rows="4" placeholder="欢迎您提出宝贵的意见或建议!" style="border: none;resize: none;height: auto;"></textarea>
                </div>
                <div class="imgs" style="display: none;">
                    <img src="/img/camera.png" onclick="addPaperImg()" id="camera">
                </div>
            </div>
            <div id="amountDiv" style="display: none;">
                <img src="/img/user_comment2_12.png" style="width: 100%;padding: 0px 20px;margin-bottom: 10px">
                医疗护送工作不容易,可以答谢护送团队喔
                <div id="cash_select" class="col-xs-12">
            <!-- <img src="/hua_tian_zhu/288.png" style="width: 100px;"> -->
                        <ul>
                            <li><input name="amount" type="radio" value="5" ><span>5元</span></li>
                            <li><input name="amount" type="radio" value="10" ><span>10元</span></li>
                            <li><input name="amount" type="radio" value="-1"><span>自定义</span></li>
                        </ul>
                </div>
 
                <div class="form-group div_cash">
                    <label class="sr-only" for="exampleInputAmount">Amount (in dollars)</label>
                    <div class="input-group">
                      <div class="input-group-addon">答谢金额:</div>
                      <input type="text" name="other_amount" onkeyup="Num(this)" class="form-control" id="exampleInputAmount" placeholder="请输入金额">
                      <div class="input-group-addon">元</div>
                    </div>
                </div>
            </div>
 
            
            
            <input type="hidden" name="paperimg_id">
            <div class="col-xs-12">
                <div class="anniu" onclick="submitForm();">
                    <button type="button" id="btn_reg" class="" style="">提交评价</button>
                </div>
            </div>
        </form>
    </div>
    <div class="clear"></div>
    <div class="bottom_padding"></div>
    <div id="point_tip">
        <div>
            <button type="button" id="cancel_reg" class="btn btn-primary btn-block btn-lg" style="margin-right: 135px;background: #00cb6e;">我再想想</button>
            <button type="button" id="confirm_reg" class="btn btn-primary btn-block btn-lg" style="margin-right: 15px;background: #9f0c0c;">我确实不爽</button>
        </div>
    </div>
    <style>
        .complain_dialog{
            background: rgba(0, 0, 0, 0.51);
            position: fixed;
            top: 0;
            width: 100%;
            height: 100%;
            z-index: 999;
            color: #aaa;
            font-size: 14px;
            display: none;
        }
        #form{margin: 20px;}
        #result{display: none;margin: 30px;}
        .ts_success{
            width: 50%;
            max-width: 120px;
        }
        .complain_dialog .inner{
            background: #fff;border-radius: 10px;text-align: center;margin: 0 auto;padding:20px;position: relative;
        }
        .complain_dialog .cancel{
            position: absolute;right: 10px;top: 10px;width: 20px;
        }
        .complain_dialog input{margin: 20px 0 20px 10px;border:none;border-bottom: 1px solid #b5b5b5;width: 70%}
        .complain_dialog textarea{display: block;width: 100%;resize:none;height: 40%;border:1px solid #ccc;box-sizing: border-box;padding:10px 20px;}
        .error_tip{
            color: #ff0000;
            display: none;
        }
        .txt{
            color: #323232;
            font-size: 16px;
            margin: 10px 0 20px 0;
        }
        .complain_dialog h4{color: #323232;}
    </style>
    <!--投诉弹框-->
    <div class="complain_dialog">
        <div class="inner" id="form">
            <img src="/img/cha_ts.png" class="cancel">
            <h4>投诉建议</h4>
            <textarea placeholder="请留下投诉或建议(不超过200个字符)" rows="10" name="complain"></textarea>
            <div id="contents_error"  class="error_tip">手机号</div>
            <div style="width: 100%;">
                <span style="color: #686868;">手机</span>
                <input type="text" name="mobile" placeholder="留下手机号码,便于及时联系您" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
            </div>
            <div id="mobile_error" class="error_tip">手机号</div>
            <div class="anniu" onclick="submitComlain();">
                <button type="button"  style="width: 100%">提交</button>
            </div>
        </div>
        <div class="inner" id="result">
            <img src="/img/cha_ts.png" class="cancel">
            <img src="/img/ts_success.png" class="ts_success">
            <div class="txt"></div>
            <div class="anniu ">
                <button type="button"  style="width: 50%" class="complete">完成</button>
            </div>
        </div>
    </div>
    <script>
        $("#complain").click(function(){
            $('textarea[name="complain"]').val("");
            $('input[name="mobile"]').val("");
            $("#form").show();
            $("#result").hide();
            $(".complain_dialog").toggle();
        })
        $(".cancel,.complete").click(function(){
            $(".complain_dialog").toggle();
        })
        //提交投诉建议
        function submitComlain(){
            var isMobile = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1})|(   14[0-9]{1}))+\d{8})$/;
            var contents = $('textarea[name="complain"]').val();
            var mobile = $('input[name="mobile"]').val();
            var seller_id = "0";
            $("#contents_error").text('');
            $("#mobile_error").text('');
            var from="q";
            if(contents==""){
                $("#contents_error").text('请输入投诉建议内容').show();
            }else if(contents.length>200) {
                $("#contents_error").text('投诉建议内容不超过200个字符').show();
            }else if(mobile=="") {
                $("#mobile_error").text('请填写手机号码').show();
            } else if(!isMobile.exec(mobile) || mobile.length != 11) {
                $("#mobile_error").text('手机号码格式不正确').show();
            }else{
                $.post("/ucenter/submitComlain",{'contents':contents,'mobile':mobile,'seller_id':seller_id,'from':from},function(data){
                    if(data.result == 'success'){
                        $("#result .txt").text("您的意见已经提交,感谢您的支持!");
                    }else{
                        $("#result .txt").text(data.result);
                    }
                    $("#form").hide();
                    $("#result").show();
                },'json');
            }
        }
    </script><style>
        #empty button{
        width: auto;
        height: auto;
      }
      #empty{
        top: 50%;
        margin-top: -170px;
      }
    </style>
    <div class="modal fade bs-example-modal-sm" id="empty" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
      <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
        <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                <h4 class="modal-title">提示</h4>
              </div>
          <div class="modal-body text-center">
            <p><img src="/img/error.png" alt=""></p>
            <p>请给我们的医护人员都评个分吧。</p>
          </div>
        </div>
      </div>
    </div>
 
    <script>
      function showEmpty(){
        $('#empty').modal('show');
      }
    </script>
    <script>
        // 初步评价
        $('input[name=Guest_PointE]').bind('click',function(){
            if($(this).val()=="2"){
                $('#Guest_Point').show();
                $('#amountDiv').hide();
            }else{
                $('#Guest_Point').hide();
                $('#amountDiv').show();
                
            }
            <?php for($x=0;$x<count($Guest_PointArray);$x++) { echo "$('input:radio[name=".$Guest_PointArray[$x]."]').attr('checked',false);"; }?>
            $('input:radio[name=amount]').attr('checked',false);
            $('input[name=other_amount]').val('');
        });
        
    
        // 自定义打赏金额
        $('input[name=amount]').bind('click',function(){
            if($(this).val()=="-1"){
                $('.div_cash').show();
            }else{
                $('.div_cash').hide();
                $('input[name=other_amount]').val('');
            }
        });
        var localIds = new Array();
        var localIdIndex = 0;
        function addPaperImg(){
            wx.ready(function () {
                wx.chooseImage({
                    sizeType: [ 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
                    sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
                    success: function (res) {
                        //localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
                        var str='';
                        if(res.localIds){
                            $.each(res.localIds, function(i, item){
                                localIds[localIdIndex++] = item;
                                str+='<img class="pic" src="'+item+'" onclick="addPaperImg()">';
                            });
                        }
                        if(str){$(".imgs ").prepend(str);}
                        var num=0;
                        $.each($(".pic"), function(i, item){
                            num++;
                        });
                        if(num>8){
                            $("#camera").remove();
                        }else{
                            $("#camera").attr("src","/img/add_img.png");
                        }
                    }
                });
            });
        }
        //提交表单
        function submitForm(){
            $('input[name=point]').val('1');
            if($("input:radio[name='Guest_PointE']:checked").val()==undefined){
                $('input[name=point]').val('2');
            };
            if($("input:radio[name='Guest_PointE']:checked").val()=="2"){
                <?php for($x=0;$x<count($Guest_PointArray);$x++) { ?>
                if($("input:radio[name='<?php echo $Guest_PointArray[$x];?>']:checked").val()==undefined){
                    $('input[name=point]').val('2');
                };
                <?php }    ?>
            };
            if($("input[name='point']").val()!='1'){
                showEmpty();
                $('input[name=point]').val('1');
            }else{
                $("#btn_reg").css({ border: "none", background: "#ccc" }).text("提交中...").attr("disabled","disabled");
                //获取选择的标签列表
                var label_list="";
                $("#label ul li").each(function(idx,obj){
                    if($(this).attr("select")=="selected"){
                        label_list=label_list+$(this).attr("id")+"|";
                    }
                });
                $("input[name='label_list']").val(label_list);
                if(localIds && localIds.length > 0){
                    syncUpload(localIds);
                }else{
                    $("form").submit();
                }
            }
        }
        var serverId= new Array();
        function syncUpload(localIds){
            var localId = localIds.pop();
            wx.uploadImage({
                localId: localId,
                isShowProgressTips: 1,
                success: function (res) {
                    serverId.push(res.serverId); // 返回图片的服务器端ID
                    //其他对serverId做处理的代码
                    if(localIds.length > 0){
                        syncUpload(localIds);
                    }else{
                        $("input[name='paperimg_id']").val(serverId);
                        $("form").submit();
                    }
                },
                fail: function (res) {
    //                $("#textarea").attr("placeholder",JSON.stringify(res));
                }
            });
        }
        //输入校验
        function Num(obj){
            obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
            obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字而不是
            obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个. 清除多余的
            obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
            obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
        }
        $("#showmore").on("click",function(){
            $(this).hide();
            $(".labelmore").show();
        });
 
        $("#cancel_reg").click(function(){
            $("#point_tip").hide();
        });
        $("#confirm_reg").click(function(){
            $("#point_tip").hide();
            $("#btn_reg").css({ border: "none", background: "#ccc" }).text("提交中...").attr("disabled","disabled");
            //获取选择的标签列表
            var label_list="";
            $("#label ul li").each(function(idx,obj){
                if($(this).attr("select")=="selected"){
                    label_list=label_list+$(this).attr("id")+"|";
                }
            });
            $("input[name='label_list']").val(label_list);
            $('form').submit();
        });
 
        $(".label2").on("click",function(){
            var select=$(this).attr("select");
            $(".label2").css("background","#878787");
            $(".label2").attr("select","");
            if(select=="selected"){
                $(this).css("background","#878787");
                $(this).attr("select","");
            }else{
                $(this).css("background","#ffa732");
                $(this).attr("select","selected");
            }
        });
 
    </script>
    <!-- 服务员评价界面弹幕 小费、评价 -->
<?php }elseif ($Guest_Point>0){ 
//if (!empty($ServiceOrdID)) {header("Location: /index.html#/pages/order/detail/detail?ServiceOrdID=".$ServiceOrdID);exit;}?>
        <hr style="text-align:center;width:90%"></hr>
    <p class="text-center" style="color: #330000;font-size: 22px;">感谢您的评价</p>
    <p class="text-center" style="margin-top: 10px;"><img width="100%" src="/img/success2.png"/></p>
<?php } ?>
 
<script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
<script>
  wx.config({
    //debug: true,
    appId: '<?php echo $signPackage["appId"];?>',
    timestamp: <?php echo $signPackage["timestamp"];?>,
    nonceStr: '<?php echo $signPackage["nonceStr"];?>',
    signature: '<?php echo $signPackage["signature"];?>',
    jsApiList: [
      // 所有要调用的 API 都要加到这个列表中
        'checkJsApi',
        'updateAppMessageShareData',
        'updateTimelineShareData'
    ]
  });
  wx.ready(function () {
    // 在这里调用 API
    //自定义“分享给朋友”及“分享到QQ”按钮的分享内容(1.4.0)
    wx.updateAppMessageShareData({ 
        title: '966120医疗快线', // 分享标题
        desc: '966120医疗快线', // 分享描述
        link: '<?php echo $ShareURL?>', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
        imgUrl: 'https://wx.966120.com.cn/img/20181102151700.png', // 分享图标
        success: function () {
          // 设置成功
        }
    });
    //自定义“分享到朋友圈”及“分享到QQ空间”按钮的分享内容(1.4.0)
    wx.updateTimelineShareData({ 
        title: '966120医疗快线', // 分享标题
        link: '<?php echo $ShareURL?>', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
        imgUrl: 'https://wx.966120.com.cn/img/20181102151700.png', // 分享图标
        success: function () {
          // 设置成功
        }
    });
  });
 window.addEventListener('pageshow', function(e) {
    // 通过persisted属性判断是否存在 BF Cache
    if (e.persisted) {
        location.reload();
    }
});
</script>
 
</body>
</html>