1 <?php namespace rpf\extension;
2
3 require_once __DIR__ . '/../../extensionModule.php';
4
5 class mailExport extends extensionModule {
6
7
8 9 10 11 12 13
14 public function getOrderList()
15 {
16
17 $this->system->orders->loadAll();
18 $this->system->emails->loadOrderMailCount();
19
20 $data = array_merge_recursive_distinct(
21 $this->system->order->loadAll()->getOrder(),
22 $this->system->email->loadOrderMailCount()->getOrder()
23 );
24
25 foreach ($data as $row)
26 {
27 if ($row['has_active_tariff'] == 1 && isset($row['mail_addresses']) && $row['mail_addresses'] > 0)
28 $return[$row['ordnr']] =
29 [
30 'oeid' => $row['oeid'],
31 'cus_company' => $row['cus_company'],
32 'cus_first_name' => $row['cus_first_name'],
33 'cus_last_name' => $row['cus_last_name'],
34 'mail_addresses' => $row['mail_addresses']
35 ];
36 }
37 return $return;
38 }
39
40 41 42 43 44 45
46 public function getEmails(array $orderIds)
47 {
48 if (!is_array($orderIds) || empty($orderIds))
49 {
50 throw new \Exception("Array of order-ids expected", 400);
51 }
52
53 $data = $this->system->emails->loadAll()->getByOeid();
54 foreach($orderIds as $orderId)
55 {
56 if (!isset($data[$orderId]))
57 {
58 throw new \Exception("Invalid orderId: $orderId");
59 }
60
61 print_r($row);
62
63
64 }
65 }
66
67 public function getEmailsConfigDesc(array $emails)
68 {
69 foreach ($emails as $row)
70 {
71
72
73 }
74 }
75
76
77
78
79 80 81 82 83 84
85 public function getConfigDesc($oeids)
86 {
87 $oeids = is_int($oeids) ? [$oeids] : $oeids;
88
89 print_r($this->system->email->load($oeids)->getData());
90 echo "jo";
91 return $this;
92 }
93
94 }