Files
le-matelot/client/plugins/codepromo/admin/ajax/ajax.php
2020-01-27 08:56:08 +01:00

30 lines
627 B
PHP

<?php
//include_once(realpath(dirname(__FILE__)) . "/../../../../../fonctions/authplugins.php");
//autorisation("codepromo");
include_once(realpath(dirname(__FILE__)) . "/../../Codepromo.class.php");
if($id = lireParam('regle_id', 'int')){
$codepromo_codepromo_regle = new Codepromo_codepromo_regle();
$codepromo_codepromo_regle->id = $id;
$codepromo_codepromo_regle->delete();
}
else{
if(empty($_REQUEST['code']))
{
echo 0; exit;
}
$code = $_REQUEST['code'];
$codepromo_codepromo = new Codepromo_codepromo();
if($codepromo_codepromo->charger_statut($code, array(1, 2)))
echo 0;
else
echo 1;
}
exit;
?>