bebeboutik/modules/soflexibilite/functions/checkPointSelectedOPC.php
Marion Muszynski ffbb3232b9 modif soflex
2016-05-09 17:43:57 +02:00

75 lines
2.2 KiB
PHP

<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to a commercial license from Common-Services Co., Ltd.
* Use, copy, modification or distribution of this source file without written
* license agreement from the SARL SMC is strictly forbidden.
* In order to obtain a license, please contact us: contact@common-services.com
* ...........................................................................
* INFORMATION SUR LA LICENCE D'UTILISATION
*
* L'utilisation de ce fichier source est soumise a une licence commerciale
* concedee par la societe Common-Services Co., Ltd.
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
* ...........................................................................
*
* @package So Colissimo Flexibilite
* @author Alexandre D.
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
* @license Commercial license
* Support by mail : support.soflexibilite@common-services.com
*/
require_once(dirname(__FILE__).'/../../../config/config.inc.php');
class SoFlexibiliteCheckPointSelectedOPC extends Module
{
public function save()
{
ob_start();
$retValue = 'NO';
if (Tools::getValue('check'))
{
$check = Tools::getValue('check');
if ($check === '0')
$this->context->cookie->soflexibilite_checkOPC = 42;
else if ($check === '1' && $this->context->cookie->soflexibilite_checkOPC === '42')
$retValue = 'OK';
else if ($check === '42')
$retValue = $this->context->cookie->soflexibilite_checkOPC;
else
$retValue = $this->context->cookie->soflexibilite_checkOPC = $check;
}
else
return (false);
$result = ob_get_clean();
if ($result)
$output = $result;
else
$output = null;
$json = array(
'output' => $output,
'status' => true,
'ret' => $retValue
);
die(Tools::jsonEncode($json));
}
}
$_soflexibilite_checkPointSelectedOPC = new SoFlexibiliteCheckPointSelectedOPC();
$_soflexibilite_checkPointSelectedOPC->save();