bebeboutik/modules/privatesales/cron_position.php

19 lines
482 B
PHP
Raw Normal View History

<?php
if(isset($_SERVER['REMOTE_ADDR'])) exit;
$_SERVER['SERVER_PORT'] = 80;
$_SERVER['HTTP_HOST'] = 'www.bebeboutik.com';
include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/Sale.php');
$nb_sales = Db::getInstance()->getValue('
SELECT COUNT(p.`id_sale`)
FROM `ps_privatesale` p
WHERE CAST(p.`date_start` AS DATE) = CAST(NOW() AS DATE)
AND `date_end` > NOW()
');
if($nb_sales>0) {
Sale::sortActiveSaleAfterAdd($nb_sales);
}