ticket-12948-PrivatesaleNewsletter
This commit is contained in:
parent
434816c22c
commit
2641936fae
@ -179,6 +179,13 @@ class AdminPrivateSalesNewsletter extends AdminTab {
|
|||||||
global $cookie, $currentIndex;
|
global $cookie, $currentIndex;
|
||||||
|
|
||||||
if(Tools::isSubmit('submitNewsletterAdd')) {
|
if(Tools::isSubmit('submitNewsletterAdd')) {
|
||||||
|
$date = Tools::getValue('date_pub');
|
||||||
|
$now = date('Y-m-d');
|
||||||
|
$now_seven_more = date('Y-m-d',strtotime($now.' + 7 days'));
|
||||||
|
|
||||||
|
if($date<$now || $date>$now_seven_more) {
|
||||||
|
$this->_errors[] = Tools::displayError('Vous ne pouvez pas créer une newsletter dans le passé ou dans plus de 7 jours');
|
||||||
|
} else {
|
||||||
Db::getInstance()->Execute('
|
Db::getInstance()->Execute('
|
||||||
INSERT INTO `'._DB_PREFIX_.'privatesale_newsletter` VALUES (
|
INSERT INTO `'._DB_PREFIX_.'privatesale_newsletter` VALUES (
|
||||||
DEFAULT,
|
DEFAULT,
|
||||||
@ -190,6 +197,7 @@ class AdminPrivateSalesNewsletter extends AdminTab {
|
|||||||
)
|
)
|
||||||
');
|
');
|
||||||
$id_newsletter = Db::getInstance()->Insert_ID();
|
$id_newsletter = Db::getInstance()->Insert_ID();
|
||||||
|
}
|
||||||
|
|
||||||
// if(isset($_FILES['image']) && $_FILES['image']['name'] != '') {
|
// if(isset($_FILES['image']) && $_FILES['image']['name'] != '') {
|
||||||
// if(!copy($_FILES['image']['tmp_name'], _PS_ROOT_DIR_.'/modules/privatesales/img/newsletter/'.$id_newsletter.'.jpg')) {
|
// if(!copy($_FILES['image']['tmp_name'], _PS_ROOT_DIR_.'/modules/privatesales/img/newsletter/'.$id_newsletter.'.jpg')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user