-
Notifications
You must be signed in to change notification settings - Fork 3
/
allpacklist.php
759 lines (333 loc) · 16.2 KB
/
allpacklist.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
<?php
@session_start();
$user = $_SESSION['user'];
include "include/dbconnect.php";
date_default_timezone_set ("Asia/Chongqing");
$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'] = '津巴布韦';
$dbcon = new DBClass();
require_once 'Classes/PHPExcel.php';
$objPHPExcel = new PHPExcel();
$objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
->setLastModifiedBy("Maarten Balliauw")
->setTitle("Office 2007 XLSX Test Document")
->setSubject("Office 2007 XLSX Test Document")
->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
->setKeywords("office 2007 openxml php")
->setCategory("Test result file");
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', 'Record No');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('B1', 'tracking number');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('C1', 'carrier');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('D1', 'seller id');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('E1', 'Item Number');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('F1', 'paypal Time');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('G1', 'Email');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('H1', 'Buyer ID');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('I1', 'Item Name');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('J1', 'Label');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('K1', 'Address');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('L1', 'Quantity');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('M1', 'Price');
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('N1', 'Paypal Notes');
$ertj = "";
$orders = explode(",",$_REQUEST['ordersn']);
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 * from ebay_order as a where ($ertj) and ebay_user='$user' and a.ebay_combine!='1' ";
$sql = $dbcon->execute($sql);
$sql = $dbcon->getResultArray($sql);
$a = 2;
for($i=0;$i<count($sql);$i++){
$ordersn = $sql[$i]['ebay_ordersn'];
@$paidtime = date('Y-m-d',$sql[$i]['ebay_paidtime']);
$ebay_usermail = $sql[$i]['ebay_usermail'];
$ebay_userid = $sql[$i]['ebay_userid'];
$name = $sql[$i]['ebay_username'];
$street1 = @$sql[$i]['ebay_street'];
$street2 = @$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'];
$ebay_shipfee = $sql[$i]['ebay_shipfee'];
$ebay_note = $sql[$i]['ebay_note'];
$ebay_total = @$sql[$i]['ebay_total'];
$ebay_tracknumber = @$sql[$i]['ebay_tracknumber'];
$ebay_account = @$sql[$i]['ebay_account'];
$addressline = "TO".chr(10).$name.chr(10).$street1." ".$street2.chr(10).$city.", ".$state.chr(10).$zip.chr(10).$countryname."(".$country[$countryname].")".chr(10).$tel;
$sl = "select * from ebay_orderdetail where ebay_ordersn='$ordersn'";
$sl = $dbcon->execute($sl);
$sl = $dbcon->getResultArray($sl);
for($o=0;$o<count($sl);$o++){
$recordnumber = $sl[$o]['recordnumber'];
$sku1 = $sl[$o]['sku'];
$sku = $sl[$o]['ebay_itemtitle'];
$amount = $sl[$o]['ebay_amount'];
$ebay_itemprice = $sl[$o]['ebay_itemprice'];
$ebay_itemid = $sl[$o]['ebay_itemid'];
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('A'.$a, "".$recordnumber);
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('B'.$a, "".$ebay_tracknumber);
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('C'.$a, "");
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('D'.$a, "".$ebay_account);
//$objPHPExcel->setActiveSheetIndex(0)->setCellValue('D'.$a, "".$ebay_itemid);
$objPHPExcel->setActiveSheetIndex(0)->getCell('E'.$a)->setValueExplicit($ebay_itemid, PHPExcel_Cell_DataType::TYPE_STRING);
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('F'.$a, "".$paidtime);
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('G'.$a, "".$ebay_usermail);
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('H'.$a, "".$ebay_userid);
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('I'.$a, "".$sku);
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('J'.$a, "".$sku1);
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('K'.$a, "".$addressline);
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('L'.$a, "".$amount);
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('M'.$a, "".$ebay_total);
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('N'.$a, "".$ebay_note);
$a++;
}
}
$objPHPExcel->getActiveSheet(0)->getStyle('A1:N500')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('A')->setWidth(10);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('B')->setWidth(25);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('C')->setWidth(15);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('C')->setWidth(15);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('D')->setWidth(15);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('E')->setWidth(30);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('F')->setWidth(15);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('E')->setWidth(25);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('G')->setWidth(60);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('H')->setWidth(25);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('I')->setWidth(45);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('J')->setWidth(15);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('M')->setWidth(15);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('N')->setWidth(30);
$objPHPExcel->setActiveSheetIndex(0)->getColumnDimension('K')->setWidth(45);
$objPHPExcel->getActiveSheet(0)->getStyle('A1:M500')->getAlignment()->setWrapText(true);
$title = "Shippinglist".date('Y-m-d');
$titlename = "Shippinglist".date('Y-m-d').".xls";
$objPHPExcel->getActiveSheet()->setTitle($title);
$objPHPExcel->setActiveSheetIndex(0);
// Redirect output to a client’s web browser (Excel5)
header('Content-Type: application/vnd.ms-excel');
header("Content-Disposition: attachment;filename={$titlename}");
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');
exit;
?>