| Current Path : /home/h/a/p/happyrenas/myreco.online/ |
Linux webd005.cluster105.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 |
| Current File : /home/h/a/p/happyrenas/myreco.online/activation_lite.php |
<?
include("configuration.php");
include("includes/fonctions.php");
$auth = $db->escape($_REQUEST['auth']);
$refo = $db->escape($_REQUEST['refo']);
$idsu = $db->escape($_REQUEST['idsu']);
$idc = $db->escape($_REQUEST['idc']);
$activation = $db->escape($_REQUEST['activation']);
if ($auth!=$auth_activation_lite) {exit;}
$postal_code = $db->escape($_REQUEST['postal_code']);
$token = $db->escape($_REQUEST['token']);
$country_code = $db->escape($_REQUEST['country_code']);
if (!$country_code) {$country_code="FR";}
$trad = chargerTraductions($country_code);
?>
<!DOCTYPE html>
<html class="no-js" lang="fr">
<head>
<?include("includes/google_head.php");?>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<title>MyReco.Online</title>
<meta name="description" content="" />
<meta name="robots" content="noindex, nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="shortcut icon" href="img/icone.png" />
<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
<link rel="stylesheet" href="assets/css/LineIcons.2.0.css" />
<link rel="stylesheet" href="assets/css/animate.css" />
<link rel="stylesheet" href="assets/css/tiny-slider.css" />
<link rel="stylesheet" href="assets/css/glightbox.min.css" />
<link rel="stylesheet" href="assets/css/main.css" />
<script src="https://maps.googleapis.com/maps/api/js?key=<?echo $GOOGLE_FRONT_KEY;?>&libraries=places"></script>
</head>
<body>
<?include("includes/google_body.php");?>
<!--[if lte IE 9]>
<p class="browserupgrade">
You are using an <strong>outdated</strong> browser. Please
<a href="https://browsehappy.com/">upgrade your browser</a> to improve
your experience and security.
</p>
<![endif]-->
<div class="preloader">
<div class="preloader-inner">
<div class="preloader-icon">
<span></span>
<span></span>
</div>
</div>
</div>
<header class="header navbar-area">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-12">
<div class="nav-inner">
<!-- Start Navbar -->
<nav class="navbar navbar-expand-lg">
<a class="navbar-brand" href="index.php">
<img src="img/logo.png" alt="Logo">
</a>
<button class="navbar-toggler mobile-menu-btn" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="toggler-icon"></span>
<span class="toggler-icon"></span>
<span class="toggler-icon"></span>
</button>
</nav>
</div>
</div>
</div>
</div>
</header>
<section class="section call-action">
<div class="container">
<div class="row">
</div>
</div>
</section>
<?
//VILLE
if (!$postal_code)
{
?>
<form action="activation_lite.php" method="post">
<input type="hidden" name="country_code" value="<?echo $country_code;?>">
<input type="hidden" name="auth" value="<?echo $auth;?>">
<input type="hidden" name="refo" value="<?echo $refo;?>">
<input type="hidden" name="idsu" value="<?echo $idsu;?>">
<input type="hidden" name="idc" value="<?echo $idc;?>">
<section class="section call-action" style="height:900px">
<div class="container">
<div class="row">
<div class="col-12">
<div class="title">
<h3 class="text-white"><?echo $trad['Etape 1 : Saisissez votre ville'] ?? '⚠️';?></h3>
</div>
</div>
</div>
<div class="row mt-20">
<div class="input-group input-group-lg mb-3">
<input type="text" class="form-control" id="cityInput" name="cityInput" placeholder="Entrez une ville">
<input type="hidden" id="postal_code" name="postal_code"> <!-- Champ caché pour le code postal -->
<div id="postalCodeAlert" class="alert alert-danger mt-2 d-none"></div>
<div class="">
<button type="submit" class="btn btn-lg btn-secondary"><?echo $trad['Valider'] ?? '⚠️';?><span class="dir-part"></span></button>
</div>
</div>
</div>
</div>
</section>
</form>
<?
}
else {
$myquery = "SELECT id,name,token,city from heb where 1 AND name='lite' AND postal_code='".$postal_code."' limit 1 ";
$fiche = $db->get_row($myquery);
$token_activation = $fiche->token;
if ($token_activation) {
$result = genererQRCodeHabilleSansEcraser($token_activation, $country_code);
$requete="UPDATE heb set compteur_telechargement = compteur_telechargement+1 where token ='".$token_activation."'";
$db->query($requete);
?>
<section class="app-info section">
<div class="container">
<div class="row">
<div class="col-12">
</div>
</div>
<div class="row">
<div class="col-lg-8 offset-lg-2 col-md-12 col-12">
<div class="row">
<div class="col-12">
<div class="offset-lg-3 button mb-5">
<a href="telecharger_qrcode.php?token=<?echo $token_activation;?>" class="btn btn-block"><?echo $trad['Téléchargement'] ?? '⚠️';?></a>
</div>
</div>
<div class="col-12">
<div class="single-achievement wow fadeInUp" data-wow-delay=".2s">
<?if ($result['statut'] === 'ok') {?>
<a target="_blank" href="<?echo $result['qrcode_habille'];?>"><img width=600 src="<?echo $result['qrcode_habille'];?>"></a>
<?}?>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<?
$date_activation = date("Y-m-d");
$requete_update="UPDATE heb set refo='".$refo."', idsu='".$idsu."', idc='".$idc."', date_activation='".$date_activation."' where token ='".$token_activation."'";
$db->query($requete_update);
ob_start();
var_dump($_REQUEST);
$var_dump_output = ob_get_clean();
$filename = 'logs/activation_lite.txt';
$file_handle = fopen($filename, 'a');
if ($file_handle === false) {
die("Impossible d'ouvrir le fichier pour l'écriture.");
}
fwrite($file_handle, $var_dump_output);
fclose($file_handle);
}
}
?>
<!-- ========================= scroll-top ========================= -->
<a href="#" class="scroll-top">
<i class="lni lni-chevron-up"></i>
</a>
<!-- ========================= JS here ========================= -->
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/wow.min.js"></script>
<script src="assets/js/tiny-slider.js"></script>
<script src="assets/js/glightbox.min.js"></script>
<script src="assets/js/count-up.min.js"></script>
<script src="assets/js/main.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$(document).ready(function() {
// Fonction pour récupérer les villes et les codes postaux
function fetchCities(query, callback) {
$.ajax({
url: 'https://geo.api.gouv.fr/communes',
data: {
nom: query,
fields: 'nom,codesPostaux',
format: 'json',
limit: 20
},
success: function(data) {
callback(data);
},
error: function() {
callback([]);
}
});
}
// Initialisation de l'autocomplétion
$("#cityInput").autocomplete({
source: function(request, response) {
fetchCities(request.term, function(data) {
// Transformer les données pour inclure chaque ville avec chaque code postal séparément
var transformedData = [];
data.forEach(function(item) {
item.codesPostaux.forEach(function(postal_code) {
transformedData.push({
label: item.nom + " (" + postal_code + ")",
value: item.nom + " (" + postal_code + ")",
city: item.nom,
postal_code: postal_code
});
});
});
response(transformedData);
});
},
minLength: 2,
select: function(event, ui) {
$('#postal_code').val(ui.item.postal_code);
$('#postalCodeAlert').text('Code postal: ' + ui.item.postal_code).removeClass('d-none');
}
});
});
</script>
</body>
</html>