File: /home/f/r/e/frenchy/refonte2023/wordpress/evenements/envoie_serveur.php
<?php
require_once("_mysql.php");
if (isset($_GET['code']))
{
$req = mysqli_query($link_bdd, "select * from bon_reductions where instr(libelle_evenements,CONCAT('*', '".$_GET['id']."','*')) <> 0 and upper(code_bon) = '".mysqli_real_escape_string($link_bdd, strtoupper($_GET['code']))."' and date_debut_bon <= '".date("Y-m-d")."' and date_fin_bon >= '".date("Y-m-d")."' and nb_utilisation <> 0");
if (mysqli_num_rows($req) != 0)
{
$line = mysqli_fetch_array($req);
echo "0|".$line['type_bon']."|".$line['montant_bon']."|".$line['libelle_bon'];
}
else
{
echo "-1|Aucun bon correspondant";
}
}
?>