* @copyright 2007-2017 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ include(dirname(__FILE__).'/../../config/config.inc.php'); if (Tools::substr(Tools::encrypt('advansedcoupons'), 0, 10) != Tools::getValue('token') || !Module::isInstalled('advansedcoupons')) { die('Bad token'); } include_once(dirname(__FILE__).'/classes/WsCoupons.php'); if (Configuration::get('COUPON_BTHD_VOUCHER')) { if ((date('Ymd') > Configuration::get('COUPON_BTHD_BATCHLASTDATE'))) { Configuration::updateValue('COUPON_BTHD_BATCHLASTDATE', date('Ymd')); WsCoupons::registreBthDiscount(); if ((int)Configuration::get('COUPON_CRON_TYPE') == 1) { echo 'Birthday сoupons are sent'; } } else { WsCoupons::addLog('The date '.(int)date('Ymd').' is every worked'); if ((int)Configuration::get('COUPON_CRON_TYPE') == 1) { die('The date '.(int)date('Ymd').' is every worked'); } } } else { echo 'Error: Enable CRON in the module settings'; }