$is_approved = $order_data->APPROVED == 1; //Build data array $o = array(); $o['jng_sp_id'] = $jng_sp_id; $o['xml_file'] = basename($xml_filename); $o['xml_date'] = 'null'; $o['iln_jng'] = 'null'; $o['iln_sp'] = 'null'; $o['sp_jng_id'] = $order_data->CHANNEL_ID; $o['order_date'] = $order_date; $dateonly = date('Y-m-d', strtotime($o['order_date'])); if (!isset($daily_counter[$jng_sp_id][$dateonly])) { if (!isset($daily_counter[$jng_sp_id])) { $daily_counter[$jng_sp_id] = array(); } $daily_counter[$jng_sp_id][$dateonly] = $class_jo->nextDailyCounter($jng_sp_id, $dateonly); } else { $daily_counter[$jng_sp_id][$dateonly] += 1; } $o['daily_count'] = $daily_counter[$dateonly]; $o['import_date'] = $import_date; $o['shipment_id'] = $order_data->TB_ID . 'TB'; $order_id = $order_data->CHANNEL_NO; if ($jng_sp_id == '10') { //EB.DE SPECIAL RULE FOR ORDER_ID $oid_separator = '-'; $order_id_exp = explode($oid_separator, $order_id); //The ID is actually a combination of eBay Article Number //and eBay Order Number. We don't need the Article Number //since it's too long. //But sometime there is also an order with id like