-
Notifications
You must be signed in to change notification settings - Fork 3
/
a4print01.php
1327 lines (1021 loc) · 45.7 KB
/
a4print01.php
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
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?
//header("Content-type:application/vnd.ms-doc;");
//header("Content-Disposition:filename=test.doc");
?>
<?php
include "include/config.php";
$country['Russian Federation'] = '俄罗斯联邦';
$country['Afghanistan'] = '阿富汗';
$country['Albania'] = '阿尔巴尼亚';
$country['Algeria'] = '阿尔及利亚';
$country['American Samoa'] = '美属萨摩亚';
$country['Andorra'] = '安道尔共和国';
$country['Angola'] = '安哥拉';
$country['Anguilla'] = '安圭拉';
$country['Antigua and Barbuda'] = '安提瓜和巴布达';
$country['Argentina'] = '阿根廷';
$country['Armenia'] = '亚美尼亚';
$country['Aruba'] = '阿鲁巴岛';
$country['Australia'] = '澳大利亚';
$country['Austria'] = '奥地利';
$country['Azerbaijan Republic'] = '阿塞拜疆共和国';
$country['Bahamas'] = '巴哈马';
$country['Bahrain'] = '巴林';
$country['Bangladesh'] = '孟加拉';
$country['Barbados'] = '巴巴多斯';
$country['Belarus'] = '白俄罗斯';
$country['Belgium'] = '比利时';
$country['Belize'] = '伯利兹';
$country['Benin'] = '贝宁';
$country['Bermuda'] = '百慕大群岛';
$country['Bhutan'] = '不丹';
$country['Bolivia'] = '玻利维亚';
$country['Botsnia and Herzegovina'] = '波斯尼亚和黑塞哥维那';
$country['Botswana'] = '博茨瓦纳';
$country['Brazil'] = '巴西';
$country['British Virgin Islands'] = '英属维京群岛';
$country['Bruneui Darussalam'] = '文莱达鲁萨兰';
$country['Bulgaria'] = '保加利亚';
$country['Burkina Faso'] = '布基纳法索';
$country['Burma'] = '缅甸';
$country['Burundi'] = '布隆迪';
$country['Cambodia'] = '柬埔寨';
$country['Cameroon'] = '喀麦隆';
$country['Canada'] = '加拿大';
$country['Cape Verde Islands'] = '佛得角群岛';
$country['Cayman Islands'] = '开曼群岛';
$country['Central African Republic'] = '中非共和国';
$country['Chad'] = '乍得';
$country['Chile'] = '智利';
$country['China'] = '中国';
$country['Colombia'] = '哥伦比亚';
$country['Comoros'] = '科摩罗';
$country['Congo, Democratic Republic of the'] = '刚果民主共和国';
$country['Congo, Republic of the'] = '刚果共和国';
$country['Cook Islands'] = '库克群岛';
$country['Costa Rica'] = '哥斯达黎加';
$country['Cote d Ivoire(Ivory Coast)'] = '象牙海岸共和国';
$country['Croatia, Republic of'] = '克罗地亚';
$country['Cyprus'] = '塞浦路斯';
$country['Czech Republic'] = '捷克共和国';
$country['Denmark'] = '丹麦';
$country['Djibouti'] = '吉布提';
$country['Dominica'] = '多米尼加';
$country['Dominican Republic'] = '多米尼加共和国';
$country['Ecuador'] = '厄瓜多尔';
$country['Egypt'] = '埃及';
$country['El Salvador'] = '萨尔瓦多';
$country['Equatorial Guinea '] = '赤道几内亚';
$country['Eritrea'] = '厄立特里亚';
$country['Ethiopia'] = '埃塞俄比亚';
$country['Falkland Islands(Islas Malvinas)'] = '福克兰群岛(马尔维纳斯群岛)';
$country['Fiji'] = '斐济';
$country['Finland'] = '芬兰';
$country['France'] = '法国';
$country['French Guiana '] = '法属圭亚那';
$country['Gambia'] = '冈比亚';
$country['Georgia'] = '格鲁吉亚';
$country['Germany'] = '德国';
$country['Ghana'] = '加纳';
$country['Gibraltar'] = '直布罗陀';
$country['Greece'] = '希腊';
$country['Greenland'] = '格陵兰';
$country['Grenada'] = '格林纳达';
$country['Guadeloupe'] = '瓜德罗普';
$country['Guam'] = '关岛';
$country['Guatemala'] = '危地马拉';
$country['Guernsey'] = '根西岛';
$country['Guinea'] = '几内亚';
$country['Guinea-Bissau'] = '几内亚比绍共和国';
$country['Guyana'] = '圭亚那';
$country['Haiti'] = '海地';
$country['Honduras'] = '洪都拉斯';
$country['Hong Kong '] = '中国香港';
$country['Hungary'] = '匈牙利';
$country['Iceland'] = '冰岛';
$country['India'] = '印度';
$country['Indonesia '] = '印度尼西亚';
$country['Ireland'] = '爱尔兰';
$country['Israel'] = '以色列';
$country['Italy'] = '意大利';
$country['Jamaica'] = '牙买加';
$country['Jan Mayen'] = '扬马延岛';
$country['Japan'] = '日本';
$country['Jersey'] = '泽西岛';
$country['Jordan'] = '约旦';
$country['Kazakhstan'] = '哈萨克斯坦';
$country['Kenya'] = '肯尼亚';
$country['Kiribati'] = '基里巴斯';
$country['Korea, South'] = '韩国';
$country['Kuwait'] = '科威特';
$country['Kyrgyzstan'] = '吉尔吉斯斯坦';
$country['Laos'] = '老挝';
$country['Latvia'] = '拉脱维亚';
$country['Lebanon'] = '黎巴嫩';
$country['Liechtenstein'] = '列支敦士登';
$country['Lithuania'] = '立陶宛';
$country['Luxembourg'] = '卢森堡';
$country['Macau'] = '中国澳门';
$country['Macedonia'] = '马其顿';
$country['Madagascar'] = '马达加斯加';
$country['Malawi'] = '马拉维';
$country['Malaysia'] = '马来西亚';
$country['Maldives'] = '马尔代夫';
$country['Mali'] = '马里';
$country['Malta'] = '马耳他';
$country['Marshall Islands'] = '马绍尔群岛';
$country['Martinique'] = '马提尼克';
$country['Mauritania'] = '毛利塔尼亚';
$country['Mauritius'] = '毛里求斯';
$country['Mayotte'] = '马约特';
$country['Mexico'] = '墨西哥';
$country['Micronesia'] = '密克罗尼西亚';
$country['Moldova'] = '摩尔多瓦';
$country['Monaco'] = '摩纳哥';
$country['Mongolia'] = '蒙古';
$country['Montenegro'] = '门的内哥罗';
$country['Montserrat'] = '蒙特塞拉特';
$country['Morocco'] = '摩洛哥';
$country['Mozambique'] = '莫桑比克';
$country['Namibia'] = '纳米比亚';
$country['Nauru'] = '瑙鲁';
$country['Nepal'] = '尼泊尔';
$country['Netherlands'] = '荷兰';
$country['Netherlands Antilles'] = '荷属安的列斯群岛';
$country['New Caledonia'] = '新喀里多尼亚';
$country['New Zealand'] = '新西兰';
$country['Nicaragua'] = '尼加拉瓜';
$country['Niger'] = '尼日尔';
$country['Nigeria'] = '尼日利亚';
$country['Niue'] = '纽埃';
$country['Norway'] = '挪威';
$country['Oman'] = '阿曼';
$country['Pakistan'] = '巴基斯坦';
$country['Palau'] = '帕劳';
$country['Panama'] = '巴拿马';
$country['Papua New Guinea'] = '巴布亚新几内亚';
$country['Paraguay'] = '巴拉圭';
$country['Peru'] = '秘鲁';
$country['Philippines'] = '菲律宾共和国';
$country['Poland'] = '波兰';
$country['Portugal'] = '葡萄牙';
$country['Puerto Rico'] = '波多黎各';
$country['Qatar'] = '卡塔尔';
$country['Romania'] = '罗马尼亚';
$country['Rwanda'] = '卢旺达';
$country['Saint Helena'] = '圣赫勒拿';
$country['Saint Kitts-Nevis'] = '圣克里斯多福尼维斯';
$country['Saint Lucia'] = '圣卢西亚';
$country['Saint Pierre and Miquelon'] = '圣皮埃尔和密克隆';
$country['Saint Vincent and the Grenadines'] = '圣文森特和格林纳丁斯';
$country['San Marino'] = '圣马力诺';
$country['Saudi Arabia'] = '沙特阿拉伯';
$country['Senegal'] = '塞内加尔';
$country['Serbia'] = '塞尔维亚';
$country['Seychelles'] = '塞舌尔';
$country['Sierra Leone'] = '塞拉利昂';
$country['Singapore'] = '新加坡';
$country['Slovakia'] = '斯洛伐克';
$country['Slovenia'] = '斯洛文尼亚';
$country['Solomon Islands'] = '所罗门岛';
$country['Somalia'] = '索马里';
$country['South Africa'] = '南非';
$country['Spain'] = '西班牙';
$country['Sri Lanka'] = '斯里兰卡';
$country['Suriname'] = '苏里南';
$country['Svalbard'] = '斯瓦尔巴';
$country['Swaziland '] = '斯威士兰';
$country['Sweden'] = '瑞典';
$country['Switzerland'] = '瑞士';
$country['Syria'] = '叙利亚共和国';
$country['Tahiti'] = '塔希提岛';
$country['Taiwan'] = '中国台湾';
$country['Tajikistan'] = '塔吉克斯坦';
$country['Tanzania'] = '坦桑尼亚';
$country['Thailand'] = '泰国';
$country['Togo'] = '多哥';
$country['Trinidad and Tobago'] = '特立尼达和多巴哥';
$country['Tunisia'] = '突尼斯';
$country['Turkey'] = '土耳其';
$country['Turkmenistan'] = '土库曼斯坦';
$country['Turks and Caicos Islands']= '特克斯和凯科斯群岛';
$country['Tuvalu'] = '图瓦卢';
$country['Uganda'] = '乌干达';
$country['Ukraine'] = '乌克兰';
$country['United Arab Emirates'] = '阿拉伯联合酋长国';
$country['United Kingdom'] = '英国';
$country['United States'] = '美国';
$country['US'] = '美国';
$country['Uruguay'] = '乌拉圭';
$country['Uzbekistan'] = '乌兹别克斯坦';
$country['Vanuatu'] = '瓦努阿图';
$country['Vatican City State'] = '梵蒂冈';
$country['Venezuela'] = '委内瑞拉';
$country['Vietnam'] = '越南';
$country['Virgin Islands(U.S.)'] = '美属维尔京群岛';
$country['Wallis and Futuna'] = '瓦利斯和富图纳';
$country['Western Sahara'] = '西撒哈拉';
$country['Western Samoa'] = '西萨摩亚';
$country['Yemen'] = '也门';
$country['Zambia'] = '赞比亚';
$country['Zimbabwe'] = '津巴布韦';
function getpostcode($ordersn){
global $dbcon;
$sql = "select * from ebay_order where ebay_id ='$ordersn' ";
$sql = $dbcon->execute($sql);
$sql = $dbcon->getResultArray($sql);
$ebay_couny = $sql[0]['ebay_couny'];
$ebay_city = $sql[0]['ebay_city'];
$ebay_postcode = substr($sql[0]['ebay_postcode'],0,1);
$ebay_countryname = $sql[0]['ebay_countryname'];
$returnstr = '';
if($ebay_couny =='US' ){
if($ebay_postcode == '0' || $ebay_postcode == '1' || $ebay_postcode == '2' || $ebay_postcode == '3'){
$returnstr = '1';
}
}
if($ebay_couny =='US'){
if($ebay_postcode == '4' || $ebay_postcode == '5' || $ebay_postcode == '6' || $ebay_postcode == '7'){
$returnstr = '2';
}
}
if($ebay_couny =='US'){
if($ebay_postcode == '8' || $ebay_postcode == '9'){
$returnstr = '3';
}
}
if($ebay_couny =='AU'){
if($ebay_postcode == '0' || $ebay_postcode == '1' || $ebay_postcode == '2'){
$returnstr = '1';
}
}
if($ebay_couny =='AU'){
if($ebay_postcode == '3' || $ebay_postcode == '5' || $ebay_postcode == '7' || $ebay_postcode == '8'){
$returnstr = '2';
}
}
if($ebay_couny =='AU'){
if($ebay_postcode == '4' || $ebay_postcode == '9' ){
$returnstr = '3';
}
}
if($ebay_couny =='AU'){
if($ebay_postcode == '6' ){
$returnstr = '4';
}
}
if($ebay_couny =='CA'){
$str = 'abcdefghijklmnopABCDEFGHIJKLMNOP';
if(strstr($str,$ebay_postcode)){
$returnstr = '1';
}
}
if($ebay_couny =='CA' || $ebay_countryname == 'Canada'){
$str = 'RSTUVWXYrstuvwxy';
if(strstr($str,$ebay_postcode)){
$returnstr = '2';
}
}
return $returnstr;
}
$ertj = "";
$orders = explode(",",$_REQUEST['bill']);
for($g=0;$g<count($orders);$g++){
$sn = $orders[$g];
if($sn != ""){
$ertj .= " a.ebay_id ='$sn' or";
}
}
$ertj = substr($ertj,0,strlen($ertj)-3);
$sql = "select a.*,count(b.ebay_id) as cc from ebay_order as a join ebay_orderdetail as b on a.ebay_ordersn = b.ebay_ordersn where ($ertj) and a.ebay_user='$user' group by a.ebay_id order by cc asc ";
$sql = "select a.*,count(b.ebay_id) as cc from ebay_order as a join ebay_orderdetail as b on a.ebay_ordersn = b.ebay_ordersn where ($ertj) and a.ebay_user='$user' group by a.ebay_id order by cc asc ,sku asc ";
$sql = $dbcon->execute($sql);
$sql = $dbcon->getResultArray($sql);
$totalcounts = count($sql);
?>
<style type="text/css">
<!--
.table {border: 0px dotted #CCCCCC; }
-->
</style>
<style media="print">
.noprint { display: none }
</style>
<script >
self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);
self.focus();
function doPrintSetup(){
//打印设置
WB.ExecWB(8,1)
}
function doPrintPreview(){
//打印预览
WB.ExecWB(7,1)
}
function doprint(){
//直接打印
WB.ExecWB(6,6)
}
function window.onload() {
//idPrint1.disabled = false;
//idPrint3.disabled = false;
}
</script>
<style type="text/css">
<!--
.STYLE3 {font-size: 12px}
.STYLE1 { font-size: 14px;
font-weight: bold;
}
.STYLE2 { font-size: 12px;
font-weight: bold;
}
.STYLE5 {font-size: 10px}
.STYLE6 {font-size: 10px; font-weight: bold; }
.STYLE9 {font-size: 9px}
-->
</style>
<?php
for($i=0;$i<count($sql);$i++){
$headerstr2 = '';
/* first*/
$ebayaccount = $sql[$i]['ebay_account'];
$recordnumber = $sql[$i]['recordnumber'];
$ebay_id = $sql[$i]['ebay_id'];
$userid = $sql[$i]['ebay_userid'];
$cname = $sql[$i]['ebay_username'];
$street1 = @$sql[$i]['ebay_street'];
$street2 = @$sql[$i]['ebay_street1']?@$sql[$i]['ebay_street1']:"";
$city = $sql[$i]['ebay_city'];
$state = $sql[$i]['ebay_state'];
$countryname = $sql[$i]['ebay_countryname'];
$zip = $sql[$i]['ebay_postcode'];
$tel = $sql[$i]['ebay_phone']?$sql[$i]['ebay_phone']:"";
$recordnumber = $sql[$i]['recordnumber'];
$is_reg = $sql[$i]['is_reg'];
$ordersn = $sql[$i]['ebay_ordersn'];
$ebay_noteb = $sql[$i]['ebay_noteb']?$sql[$i]['ebay_noteb']:" ";
$addressline = $cname."<br>".$street1."<br>".$street2."<br>".$city.", ".$state."<br>".$zip;
$ebay_carrier = $sql[$i]['ebay_carrier'];
$ss = "select * from ebay_carrier where name ='$ebay_carrier'";
$ss = $dbcon->execute($ss);
$ss = $dbcon->getResultArray($ss);
$address = $ss[0]['address'];
$ss = "select * from ebay_orderdetail where ebay_ordersn = '$ordersn'";
$ss = $dbcon->execute($ss);
$ss = $dbcon->getResultArray($ss);
$headerstr = '';
for($g=0;$g<count($ss);$g++){
$sku = $ss[$g]['sku'];
$ebay_amount = $ss[$g]['ebay_amount'];
$ebay_itemtitle = $ss[$g]['ebay_itemtitle'];
$headerstr .= '<br><b> <font size=3px>'.$ebay_amount.' * '.$sku.'</font></b>('.$ebay_itemtitle.')';
}
$headerstr .= '<b>'.$ebay_noteb.'</b>';
$i++;
$ebayaccount = $sql[$i]['ebay_account'];
if($ebayaccount != ''){
$recordnumber = $sql[$i]['recordnumber'];
$ebay_id = $sql[$i]['ebay_id'];
$userid = $sql[$i]['ebay_userid'];
$cname = $sql[$i]['ebay_username'];
$street1 = @$sql[$i]['ebay_street'];
$street2 = @$sql[$i]['ebay_street1']?@$sql[$i]['ebay_street1']:"";
$city = $sql[$i]['ebay_city'];
$state = $sql[$i]['ebay_state'];
$countryname = $sql[$i]['ebay_countryname'];
$zip = $sql[$i]['ebay_postcode'];
$tel = $sql[$i]['ebay_phone']?$sql[$i]['ebay_phone']:"";
$recordnumber = $sql[$i]['recordnumber'];
$is_reg = $sql[$i]['is_reg'];
$ordersn = $sql[$i]['ebay_ordersn'];
$ebay_noteb = $sql[$i]['ebay_noteb']?$sql[$i]['ebay_noteb']:" ";
$addressline2 = $cname."<br>".$street1."<br>".$street2."<br>".$city.", ".$state."<br>".$zip;
$ebay_carrier = $sql[$i]['ebay_carrier'];
$ss = "select * from ebay_carrier where name ='$ebay_carrier'";
$ss = $dbcon->execute($ss);
$ss = $dbcon->getResultArray($ss);
$address2 = $ss[0]['address'];
$ss = "select * from ebay_orderdetail where ebay_ordersn = '$ordersn'";
$ss = $dbcon->execute($ss);
$ss = $dbcon->getResultArray($ss);
$headerstr2 = '';
for($g=0;$g<count($ss);$g++){
$sku = $ss[$g]['sku'];
$ebay_amount = $ss[$g]['ebay_amount'];
$ebay_itemtitle = $ss[$g]['ebay_itemtitle'];
$headerstr2 .= '<br><b><font size=3px>'.$ebay_amount.' * '.$sku.'</font></b>('.$ebay_itemtitle.')';
}
$headerstr2 .= '<b>'.$ebay_noteb.'</b>';
}
?>
<table width="700" height="166" border="0" cellpadding="0" cellspacing="0" style="border:1px dashed #000000" >
<tr>
<td width="50%" height="31" align="center" valign="middle" style="border-right:#000000 dashed 1px; border-bottom:#000000 dashed 1px">
<span class="STYLE9"><?php echo $headerstr;?></span></td>
<td width="505" align="center" valign="middle" style="border-right:#000000 dashed 1px; border-bottom:#000000 dashed 1px"> </td>
<td width="50%" align="center" valign="middle" style="border-bottom:#000000 dashed 1px" ><span class="STYLE9"><?php echo $headerstr2;?></span></td>
</tr>
<tr>
<td width="50%" align="center" valign="top" style="border-right:#000000 dashed 1px; ">
<?php
$i--;
$ebayaccount = $sql[$i]['ebay_account'];
$recordnumber = $sql[$i]['recordnumber'];
$ebay_id = $sql[$i]['ebay_id'];
$userid = $sql[$i]['ebay_userid'];
$cname = $sql[$i]['ebay_username'];
$street1 = @$sql[$i]['ebay_street'];
$street2 = @$sql[$i]['ebay_street1']?@$sql[$i]['ebay_street1']:"";
$city = $sql[$i]['ebay_city'];
$state = $sql[$i]['ebay_state'];
$countryname = $sql[$i]['ebay_countryname'];
$zip = $sql[$i]['ebay_postcode'];
$tel = $sql[$i]['ebay_phone']?$sql[$i]['ebay_phone']:"";
$recordnumber = $sql[$i]['recordnumber'];
$is_reg = $sql[$i]['is_reg'];
$ordersn = $sql[$i]['ebay_ordersn'];
$ebay_noteb = $sql[$i]['ebay_noteb']?$sql[$i]['ebay_noteb']:" ";
$addressline = $cname."<br>".$street1."<br>".$street2."<br>".$city.", ".$state."<br>".$zip;
$ebay_carrier = $sql[$i]['ebay_carrier'];
$ss = "select * from ebay_carrier where name ='$ebay_carrier'";
$ss = $dbcon->execute($ss);
$ss = $dbcon->getResultArray($ss);
$address = $ss[0]['address'];
?>
<?php if($ebay_carrier == '香港挂号'){ ?>
<table width="100%" cellpadding="5" cellspacing="0" bordercolor="#000000" style="border:1px dashed #000000">
<tr >
<td colspan="2" style=" border-bottom:1px dashed #000000"><div align="center" class="STYLE1 STYLE5">NO:<?php echo $ordersn; ?> <?php echo date('y').'-'.date('m').'-'.date('d');
echo ' '.($i+1).'/'.$totalcounts
?></div></td>
</tr>
<tr>
<td width="54%"><span class="STYLE5">From:<?php echo $ebayaccount;?><br/>
<?php echo nl2br($address);?></span></td>
<td width="46%"><table width="86%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" >
<tr>
<td><div align="center" class="STYLE3" >1</div></td>
<td ><div align="center" class="STYLE3">POSTAGE PAID HONG KONG</div></td>
<td ><div align="center" class="STYLE3">PERMIT NO. T0240</div></td>
</tr>
</table>
<table style="margin-top:3px" width="79%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" >
<tr>
<td><div align="center" class="STYLE2">BY AIR MAIL<br />
航PAR AVION空</div></td>
</tr>
</table></td>
</tr>
<tr>
<td style=" ">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="14%" align="left" valign="top"><strong>To:</strong></td>
<td width="86%"><div style=" font-weight:bold; font-size:13px">
<?php
echo $cname."</strong><br>";
echo $street1." ".$street2;
echo $city.", ".$state."<br>".$zip."<br>";
echo $countryname."</b>";
if($tel !="" && $tel !="Invalid Request") echo "<br><b>Tel: ".$tel.'</b><br>';
?>
</div></td>
</tr>
</table> </td>
<td align="center" ><div align="right"><?php echo $ebay_carrier;?> </div></td>
</tr>
<tr >
<td style=" border-bottom:1px dashed #000000"><div align="center"> </div></td>
<td align="right" style=" border-bottom:1px dashed #000000; margin-right:3px"><div align="right">
<?php echo $country[$countryname];
$ress = getpostcode($ebay_id);
if($ress != '') echo '/'.$ress;
?>
</div></td>
</tr>
<tr >
<td colspan="2" style=" border-bottom:1px dashed #000000"><div align="center"> <?php echo $ordersn; ?><br />
<img src="barcode128.class.php?data=<?php echo $ordersn;?>" width="143" height="38" /> </div>
<div align="right">NO:<?php echo $ordersn; ?> <?php echo ' '.($i+1).'/'.$totalcounts; ?></div></td>
</tr>
</table>
<?php } ?>
<?php if($ebay_carrier == '香港平邮'){ ?>
<table width="100%" cellpadding="5" cellspacing="0" bordercolor="#000000" style="border:1px dashed #000000">
<tr >
<td colspan="2" style=" border-bottom:1px dashed #000000"><div align="center" class="STYLE6">NO:<?php echo $ordersn; ?> <?php echo date('y').'-'.date('m').'-'.date('d');
echo ' '.($i+1).'/'.$totalcounts
?></div></td>
</tr>
<tr>
<td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><span class="STYLE5"><strong>From:<?php echo $ebayaccount;?></strong><br/>
<?php echo nl2br($address);?></span></td>
<td><table width="86%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" >
<tr>
<td><div align="center" class="STYLE3" >1</div></td>
<td ><div align="center" class="STYLE3">POSTAGE PAID HONG KONG</div></td>
<td ><div align="center" class="STYLE3">PERMIT NO. 5283</div></td>
</tr>
</table>
<table style="margin-top:3px" width="73%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" >
<tr>
<td><div align="center" class="STYLE2">BY AIR MAIL<br />
航PAR AVION空</div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td width="76%" style=" ">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="14%" align="left" valign="top"><strong>To:</strong></td>
<td width="86%"><div style=" font-weight:bold; font-size:13px">
<?php
echo $cname."</strong><br>";
echo $street1." ".$street2;
echo $city.", ".$state."<br>".$zip."<br>";
echo $countryname."</b>";
if($tel !="" && $tel !="Invalid Request") echo "<br><b>Tel: ".$tel.'</b><br>';
?>
</div></td>
</tr>
</table> </td>
<td width="24%" align="center" ><div align="right"><?php echo $ebay_carrier;?> <br />
<br />
<?php echo $country[$countryname];
$ress = getpostcode($ebay_id);
if($ress != '') echo '/'.$ress;
?>
</div></td>
</tr>
<tr >
<td colspan="2" style=" border-bottom:1px dashed #000000"><div align="right">NO:<?php echo $ordersn; ?> <?php echo ' '.($i+1).'/'.$totalcounts
?></div></td>
</tr>
</table>
<?php } ?>
<?php if($ebay_carrier == 'EMS' || $ebay_carrier == 'UPS' || $ebay_carrier == 'DHL' || $ebay_carrier == '中国挂号' || $ebay_carrier == '中国平邮'){ ?>
<table width="100%" cellpadding="5" cellspacing="0" bordercolor="#000000" style="border:1px dashed #000000">
<tr >
<td colspan="2" style=" border-bottom:1px dashed #000000"><div align="center" class="STYLE6">NO:<?php echo $ordersn; ?> <?php echo date('y').'-'.date('m').'-'.date('d');
echo ' '.($i+1).'/'.$totalcounts
?></div></td>
</tr>
<tr>
<td width="50%"><span class="STYLE5"><strong>From:<?php echo $ebayaccount;?><br/>
<?php echo nl2br($address);?></strong></span></td>
<td width="50%"> </td>
</tr>
<tr>
<td style=" ">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="14%" align="left" valign="top"><strong>To:</strong></td>
<td width="86%"><div style=" font-weight:bold; font-size:13px">
<?php
echo $cname."</strong><br>";
echo $street1." ".$street2;
echo $city.", ".$state."<br>".$zip."<br>";
echo $countryname."</b>";
if($tel !="" && $tel !="Invalid Request") echo "<br><b>Tel: ".$tel.'</b><br>';
?>
</div></td>
</tr>
</table></td>
<td align="center" ><div align="right"><?php echo $ebay_carrier;?> </div></td>
</tr>
<tr >
<td style=" border-bottom:1px dashed #000000"><div align="center"> </div></td>
<td align="right" style=" border-bottom:1px dashed #000000; margin-right:3px"><div align="right">
<?php echo $country[$countryname];
$ress = getpostcode($ebay_id);
if($ress != '') echo '/'.$ress;
?>
</div></td>
</tr>
<tr >
<td colspan="2" style=" border-bottom:1px dashed #000000"><div align="center"> <?php echo $ordersn; ?><br />
<img src="barcode128.class.php?data=<?php echo $ordersn;?>" width="143" height="38" /> </div>
<div align="right">NO:<?php echo $ordersn; ?>
<?php
echo ' '.($i+1).'/'.$totalcounts
?>
</div></td>
</tr>
</table>
<?php } ?>
<?php if($ebay_carrier == '瑞士小包' || $ebay_carrier == '瑞士挂号' ){ ?>
<table width="100%" cellpadding="5" cellspacing="0" bordercolor="#000000" style="border:1px dashed #000000">
<tr >
<td colspan="2" style=" border-bottom:1px dashed #000000"><div align="center" class="STYLE6">NO:<?php echo $ordersn; ?> <?php echo date('y').'-'.date('m').'-'.date('d');
echo ' '.($i+1).'/'.$totalcounts
?></div></td>
</tr>
<tr>
<td colspan="2"><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td colspan="2"><div align="center" class="STYLE3">
<p>PRIORITY</p>
</div></td>
</tr>
<tr>
<td valign="top"><p class="STYLE3">If undeliverable,please return to:<br />
<strong><span style="font-size:10px"><?php echo nl2br($address);?></span></strong></p></td>
<td><p class="STYLE3">P.P.<br />
Swiss Post<br />
CH-8010 Zurich<br />
Mulligen</p></td>
</tr>
</table></td>
</tr>
<tr>
<td width="81%"><span class="STYLE5"><strong>From:<?php echo $ebayaccount;?></strong></span></td>
<td width="19%"> </td>
</tr>
<tr>
<td style=" ">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="14%" align="left" valign="top"><strong>To:</strong></td>
<td width="86%"><div style=" font-weight:bold; font-size:13px">
<?php
echo $cname."</strong><br>";
echo $street1." ".$street2;
echo $city.", ".$state."<br>".$zip."<br>";
echo $countryname."</b>";
if($tel !="" && $tel !="Invalid Request") echo "<br><b>Tel: ".$tel.'</b><br>';
?>
</div></td>
</tr>
</table> </td>
<td align="center" ><div align="right"><?php echo $ebay_carrier;?> </div></td>
</tr>
<tr >
<td colspan="2" style=" border-bottom:1px dashed #000000"><div align="center"> <?php echo $ordersn; ?><br />
<img src="barcode128.class.php?data=<?php echo $ordersn;?>" width="143" height="38" /> </div>
<div align="right">NO:<?php echo $ordersn; ?>
<?php
echo ' '.($i+1).'/'.$totalcounts;
?>
</div></td>
</tr>
</table>
<?php } ?>
<?php if($ebay_carrier == '新加坡小包' || $ebay_carrier == '新加坡挂号' ){ ?>
<table width="100%" cellpadding="5" cellspacing="0" bordercolor="#000000" style="border:1px dashed #000000">
<tr >
<td colspan="2" style=" border-bottom:1px dashed #000000"><div align="center" class="STYLE6">NO:<?php echo $ordersn; ?> <?php echo date('y').'-'.date('m').'-'.date('d');
echo ' '.($i+1).'/'.$totalcounts
?></div></td>
</tr>
<tr>
<td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td valign="top"><p class="STYLE3">If undeliverable,please return to:<br />
<strong><span style="font-size:10px"><?php echo nl2br($address);?></span></strong></p></td>
<td><p class="STYLE3"><img src="sg_rg.gif" width="193" height="79" /><br />
</p></td>
</tr>
</table></td>
</tr>
<tr>
<td width="78%"><span class="STYLE5"><strong>From:<?php echo $ebayaccount;?></strong></span></td>
<td width="22%"> </td>
</tr>
<tr>
<td style=" ">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="14%" align="left" valign="top"><strong>To:</strong></td>
<td width="86%"><div style=" font-weight:bold; font-size:13px">
<?php
echo $cname."</strong><br>";
echo $street1." ".$street2;
echo $city.", ".$state."<br>".$zip."<br>";
echo $countryname."</b>";
if($tel !="" && $tel !="Invalid Request") echo "<br><b>Tel: ".$tel.'</b><br>';
?>
</div></td>
</tr>
</table> </td>
<td align="center" ><div align="right"><?php echo $ebay_carrier;?> </div></td>
</tr>
<tr >
<td colspan="2" style=" border-bottom:1px dashed #000000"><div align="center"> <?php echo $ordersn; ?><br />
<img src="barcode128.class.php?data=<?php echo $ordersn;?>" width="143" height="38" /> </div>
<div align="right">NO:<?php echo $ordersn; ?> <?php echo ' '.($i+1).'/'.$totalcounts; ?></div></td>
</tr>
</table>
<?php } ?></td>
<td width="505" align="center" valign="top" style="border-right:#000000 dashed 1px; "> </td>
<td width="50%" align="center" valign="top">
<span class="STYLE5">
<?php
$i++;
$ebayaccount = $sql[$i]['ebay_account'];
$recordnumber = $sql[$i]['recordnumber'];
$ebay_id = $sql[$i]['ebay_id'];
$userid = $sql[$i]['ebay_userid'];
$cname = $sql[$i]['ebay_username'];
$street1 = @$sql[$i]['ebay_street'];
$street2 = @$sql[$i]['ebay_street1']?@$sql[$i]['ebay_street1']:"";
$city = $sql[$i]['ebay_city'];
$state = $sql[$i]['ebay_state'];
$countryname = $sql[$i]['ebay_countryname'];
$zip = $sql[$i]['ebay_postcode'];
$tel = $sql[$i]['ebay_phone']?$sql[$i]['ebay_phone']:"";
$recordnumber = $sql[$i]['recordnumber'];
$is_reg = $sql[$i]['is_reg'];
$ordersn = $sql[$i]['ebay_ordersn'];
$ebay_noteb = $sql[$i]['ebay_noteb']?$sql[$i]['ebay_noteb']:" ";
$addressline = $cname."<br>".$street1."<br>".$street2."<br>".$city.", ".$state."<br>".$zip;
$ebay_carrier = $sql[$i]['ebay_carrier'];
$ss = "select * from ebay_carrier where name ='$ebay_carrier'";
$ss = $dbcon->execute($ss);
$ss = $dbcon->getResultArray($ss);
$address = $ss[0]['address'];
?>
<?php if($ebay_carrier == '香港挂号'){ ?>
</span>
<table width="100%" cellpadding="5" cellspacing="0" bordercolor="#000000" style="border:1px dashed #000000">
<tr >
<td colspan="2" style=" border-bottom:1px dashed #000000"><div align="center" class="STYLE6">NO:<?php echo $ordersn; ?> <?php echo date('y').'-'.date('m').'-'.date('d');
echo ' '.($i+1).'/'.$totalcounts
?></div></td>
</tr>
<tr>
<td width="54%"><span class="STYLE5">From:<?php echo $ebayaccount;?><br/>
<?php echo nl2br($address);?></span></td>
<td width="46%"><table width="86%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" >
<tr>
<td><div align="center" class="STYLE3" >1</div></td>
<td ><div align="center" class="STYLE3">POSTAGE PAID HONG KONG</div></td>
<td ><div align="center" class="STYLE3">PERMIT NO. T0240</div></td>
</tr>
</table>
<table style="margin-top:3px" width="63%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" >
<tr>
<td><div align="center" class="STYLE2">BY AIR MAIL<br />
航PAR AVION空</div></td>
</tr>
</table></td>
</tr>
<tr>
<td style=" ">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="14%" align="left" valign="top"><strong>To:</strong></td>
<td width="86%"><div style=" font-weight:bold; font-size:13px">
<?php
echo $cname."</strong><br>";
echo $street1." ".$street2;
echo $city.", ".$state."<br>".$zip."<br>";
echo $countryname."</b>";