bebeboutik/modules/__socolissimo/cron.php
Srv Bebeboutik 6c0978166c add modules
2016-01-04 12:49:26 +01:00

28 lines
750 B
PHP
Executable File

<?php
if(isset($_SERVER['REMOTE_ADDR'])) exit;
include(dirname(__FILE__).'/../../config/config.inc.php');
$context = stream_context_create(array(
'http' => array(
'timeout' => 5
)
));
$status = trim((string) file_get_contents('http://ws.colissimo.fr/supervision-pudo/supervision.jsp', 0, $context));
if(empty($status) || $status == '[KO]') {
Db::getInstance()->Execute('
UPDATE `'._DB_PREFIX_.'carrier`
SET `active` = 1
WHERE `name` = "'.pSQL(Configuration::get('SOCOLISSIMO_FALLBACK')).'"
AND `deleted` = 0
');
} else {
Db::getInstance()->Execute('
UPDATE `'._DB_PREFIX_.'carrier`
SET `active` = 0
WHERE `name` = "'.pSQL(Configuration::get('SOCOLISSIMO_FALLBACK')).'"
AND `deleted` = 0
');
}