|
4 | 4 | require '../includes/application_top_export.php';
|
5 | 5 | require '../inc/xtc_not_null.inc.php';
|
6 | 6 | require '../inc/xtc_get_country_name.inc.php';
|
| 7 | +require '../inc/xtc_href_link.inc.php'; |
| 8 | +session_start(); |
| 9 | + |
| 10 | +if (!isset($_SESSION['cleacerreach_interface_counter'])) { |
| 11 | + $_SESSION['cleacerreach_interface_counter'] = 1; |
| 12 | +} |
7 | 13 |
|
8 | 14 | if(!defined('MODULE_FS_CLEVERREACH_INTERFACE_STATUS') || MODULE_FS_CLEVERREACH_INTERFACE_STATUS != 'true')
|
9 | 15 | {
|
|
43 | 49 |
|
44 | 50 | $receivers = array();
|
45 | 51 |
|
| 52 | +$where_limit = ''; |
| 53 | +$where_offset = ''; |
| 54 | +if (isset($_SESSION['cleacerreach_interface_counter'])) { |
| 55 | + $where_limit .= ' LIMIT 100 '; |
| 56 | + if ($_SESSION['cleacerreach_interface_counter'] > 1) { |
| 57 | + $where_offset .= ' OFFSET ' . ($_SESSION['cleacerreach_interface_counter'] - 1) * 100 . ' '; |
| 58 | + } |
| 59 | +} |
| 60 | + |
46 | 61 | if (MODULE_FS_CLEVERREACH_INTERFACE_IMPORT_SUBSCRIBERS == 'true') {
|
47 | 62 |
|
48 | 63 |
|
|
52 | 67 | date_added as registered,
|
53 | 68 | customers_firstname as firstname,
|
54 | 69 | customers_lastname as lastname
|
55 |
| - FROM " . TABLE_NEWSLETTER_RECIPIENTS . " WHERE mail_status = '1' "); |
| 70 | + FROM " . TABLE_NEWSLETTER_RECIPIENTS . " WHERE mail_status = '1' " . $where_limit . $where_offset); |
56 | 71 |
|
57 | 72 | while ($customer = xtc_db_fetch_array($manual_registered_customers)) {
|
58 | 73 | $orders = array();
|
|
99 | 114 | if (isset($_GET['export_filter_amazon']) && $_GET['export_filter_amazon'] == 1) {
|
100 | 115 | $where_clause .= " AND customers_email_address NOT LIKE '%@marketplace.amazon.de%'";
|
101 | 116 | }
|
102 |
| - $order_rows = xtc_db_query("SELECT DISTINCT o.orders_id, o.customers_id, o.customers_email_address as email, o.customers_firstname as firstname, o.customers_lastname as lastname, o.customers_gender as gender, o.customers_street_address as street, o.customers_city as city, o.customers_postcode as zip, o.customers_country as country, o.date_purchased, op.products_id, op.products_name, op.products_price, op.products_quantity from " . TABLE_ORDERS . " o JOIN " . TABLE_ORDERS_PRODUCTS . " op ON o.orders_id = op.orders_id GROUP BY o.customers_id ORDER BY o.date_purchased "); |
| 117 | + $order_rows = xtc_db_query("SELECT DISTINCT o.orders_id, o.customers_id, o.customers_email_address as email, o.customers_firstname as firstname, o.customers_lastname as lastname, o.customers_gender as gender, o.customers_street_address as street, o.customers_city as city, o.customers_postcode as zip, o.customers_country as country, o.date_purchased, op.products_id, op.products_name, op.products_price, op.products_quantity from " . TABLE_ORDERS . " o JOIN " . TABLE_ORDERS_PRODUCTS . " op ON o.orders_id = op.orders_id GROUP BY o.customers_id ORDER BY o.date_purchased " . $where_limit . $where_offset); |
103 | 118 | while ($order_row = xtc_db_fetch_array($order_rows)) {
|
104 | 119 |
|
105 | 120 | $orders = array();
|
|
153 | 168 | } else {
|
154 | 169 | die('Keine neuen Daten gefunden');
|
155 | 170 | }
|
| 171 | + |
| 172 | +if (count($receivers) == 100) { |
| 173 | + $_SESSION['cleacerreach_interface_counter'] = $_SESSION['cleacerreach_interface_counter'] + 1; |
| 174 | + header("Refresh:1;"); |
| 175 | + exit; |
| 176 | +} |
| 177 | + |
156 | 178 | $receivers = array();
|
157 | 179 |
|
158 |
| -header('Location: ' . preg_replace("/[\r\n]+(.*)$/i", "", html_entity_decode($_SERVER['HTTP_REFERER']))); |
| 180 | +unset($_SESSION['cleacerreach_interface_counter']); |
| 181 | +header('Location: ' . xtc_href_link_admin((defined('DIR_ADMIN') ? DIR_ADMIN : 'admin/').'module_export.php', 'set=system&module=fs_cleverreach_interface&action=edit', 'NONSSL')); |
159 | 182 | exit();
|
0 commit comments