name)) exit; if (Tools::isSubmit('save_pudo_id')) { echo $module_instance->savePudoMapCode(); exit; } if (Tools::isSubmit('call_pudo_address')) { $pudo_code = Tools::getValue('pudo_code'); $pudoAddress = $module_instance->pudoService->getPudoAddress($pudo_code); if ($pudoAddress != null) echo $pudoAddress->address1 . ', ' . $pudoAddress->postcode . ' ' . $pudoAddress->city.', '.$pudo_code; else echo $pudo_code; exit; } if (Tools::isSubmit('call_has_pudo_cod')) { $pudo_code = Tools::getValue('pudo_code'); echo $module_instance->pudoService->hasCodService($pudo_code); exit; } if (Tools::isSubmit('getFormattedAddressHTML')) { $id_address = (int)Tools::getValue('id_address'); echo $module_instance->getFormattedAddressHTML($id_address); exit; } if (Tools::isSubmit('getFormattedSenderAddressHTML')) { $id_address = (int)Tools::getValue('id_address'); echo $module_instance->getFormattedSenderAddressHTML($id_address); exit; } if (Tools::isSubmit('getProducts')) { echo Tools::jsonEncode($module_instance->searchProducts(Tools::getValue('q'))); exit; } if (Tools::isSubmit('savePackagePrintLabels')) { if (!$id_package_ws = $module_instance->savePackageFromPost()) { die(Tools::jsonEncode(array( 'error' => reset(DpdPoland::$errors) ))); } $printout_format = Tools::getValue('dpdpoland_printout_format'); if ($printout_format != DpdPolandConfiguration::PRINTOUT_FORMAT_LABEL && $printout_format != DpdPolandConfiguration::PRINTOUT_FORMAT_A4) $printout_format = DpdPolandConfiguration::PRINTOUT_FORMAT_LABEL; die(Tools::jsonEncode(array( 'error' => false, 'id_package_ws' => (int)$id_package_ws, 'link_to_labels_pdf' => '?printLabels&id_package_ws=' . (int)$id_package_ws . '&printout_format=' . $printout_format . '&token=' . Tools::getValue('token') ))); } if (Tools::isSubmit('printLabels')) { $printout_format = Tools::getValue('dpdpoland_printout_format'); if ($printout_format != DpdPolandConfiguration::PRINTOUT_FORMAT_LABEL && $printout_format != DpdPolandConfiguration::PRINTOUT_FORMAT_A4) $printout_format = DpdPolandConfiguration::PRINTOUT_FORMAT_LABEL; die(Tools::jsonEncode(array( 'error' => false, 'link_to_labels_pdf' => '?printLabels&id_package_ws=' . (int)Tools::getValue('id_package_ws') . '&printout_format=' . $printout_format . '&token=' . Tools::getValue('token') ))); } if (Tools::getValue('addDPDClientNumber')) { $result = $module_instance->addDPDClientNumber(); die(Tools::jsonEncode($result)); } if (Tools::getValue('deleteDPDClientNumber')) { $result = $module_instance->deleteDPDClientNumber(); die(Tools::jsonEncode($result)); } if (Tools::getValue('getPayerNumbersTableHTML')) { $html = $module_instance->getPayerNumbersTableHTML(); die(Tools::jsonEncode($html)); } if (Tools::getValue('calculateTimeLeft')) { $time_left = $module_instance->calculateTimeLeft(); die(Tools::jsonEncode($time_left)); } if (Tools::getValue('getTimeFrames')) { $html = $module_instance->getTimeFrames(); die(Tools::jsonEncode($html)); }