| Current Path : /home/h/a/p/happyrenas/myreco.online/administration/panel/ |
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/administration/panel/toto.php |
<?
set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . '/../');
include("configuration.php");
include("includes/fonctions.php");
include("auth.php");
setlocale(LC_TIME, 'fr_FR.UTF-8');
// Récupérer tous les enregistrements vis_proprio où langue est vide ou spécifique
$proprios = $db->get_results("SELECT id, langue, hebergement_id FROM vis_proprio");
foreach ($proprios as $p) {
$langue = trim(strtolower($p->langue));
$table_source = '';
if ($langue == '') {
$table_source = 'hebergement';
} elseif ($langue == 'espagne') {
$table_source = 'hebergement_espagne';
} elseif ($langue == 'italie') {
$table_source = 'hebergement_italie';
} else {
continue; // Ignorer les autres langues inconnues
}
// Récupérer le token correspondant
$token = $db->get_var("SELECT token FROM `$table_source` WHERE id = '{$p->hebergement_id}'");
if ($token) {
// Chercher l’ID dans la table heb avec ce token
$heb_id = $db->get_var("SELECT id FROM heb WHERE token = '$token'");
if ($heb_id) {
// Mettre à jour vis_proprio avec le bon hebergement_id
$db->query("UPDATE vis_proprio SET hebergement_id = '$heb_id' WHERE id = '{$p->id}'");
$cpt++;
//echo $heb_id."<br>";
}
}
}
echo $cpt."OK";
?>