| Current Path : /home/happyrenas/myreco.online/administration/panel/api/ |
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/happyrenas/myreco.online/administration/panel/api/quick_search.php |
<?php
header('Access-Control-Allow-Origin: *');
set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . '/../');
include("../../../configuration.php");
include("../../../includes/fonctions.php");
setlocale(LC_TIME, 'fr_FR.UTF-8');
include("auth.php");
$keyword = trim($db->escape($_REQUEST['query']));
$resultat = "SELECT id,name,country_code,postal_code from heb where 1 AND (token = '".$keyword."' OR name like '%".$keyword."%') order by name LIMIT 50";
$boucle_heb = $db->get_results($resultat);
$nombre_heb = $db->num_rows;
$resultat = "SELECT id,name,country_code,postal_code from vis where 1 AND (token = '".$keyword."' OR name like '%".$keyword."%') order by name LIMIT 50";
$boucle_vis = $db->get_results($resultat);
$nombre_vis = $db->num_rows;
?>
<div class="quick-search-result">
<div class="row">
<div class="col-6">
<?if (!$nombre_heb)
{
?>
<div class="text-muted">Aucun résultat</div>
<?}?>
<?if ($nombre_heb){ ?>
<div class="font-size-sm text-info font-weight-bolder mb-2"><?echo $nombre_heb;?> Hébergement<?if ($nombre_heb>1) {echo "s";}?></div>
<div class="mb-10">
<?
if (!empty($boucle_heb))
{
foreach ( $boucle_heb as $liste )
{
$classe_texte = $pays[$liste->country_code]['classe_color'];
$departement = substr($liste->postal_code, 0, 2);
?>
<div class="d-flex align-items-center flex-grow-1 mb-2">
<div class="symbol symbol-30 bg-transparent flex-shrink-0">
</div>
<div class="d-flex flex-column ml-3 mt-2 mb-2">
<a href="hebergement_detail.php?hebergement_id=<?echo $liste->id;?>&country_code_selected=<?echo $liste->country_code;?>&postal_code_selected=<?echo $departement;?>" class="font-weight-bold text-dark text-hover-primary"><?if ($liste->statut==2) {echo "<s>";}?><?echo $liste->name;?><?if ($liste->statut==2) {echo "</s>";}?></a>
<span class="font-size-sm font-weight-bold <?echo $classe_texte;?>"><?echo $liste->country_code;?> (<?echo $liste->postal_code;?>) </span>
</div>
</div>
<?
}
}?>
</div>
<?
}
?>
</div>
<div class="col-6">
<?if (!$nombre_vis)
{
?>
<div class="text-muted">Aucun résultat</div>
<?}?>
<?if ($nombre_vis){ ?>
<div class="font-size-sm text-info font-weight-bolder mb-2"><?echo $nombre_vis;?> Lieux de visite<?if ($nombre_vis>1) {echo "s";}?></div>
<div class="mb-10">
<?
if (!empty($boucle_vis))
{
foreach ( $boucle_vis as $liste )
{
$departement = substr($liste->postal_code, 0, 2);
$classe_texte = $pays[$liste->country_code]['classe_color'];
?>
<div class="d-flex align-items-center flex-grow-1 mb-2">
<div class="symbol symbol-30 bg-transparent flex-shrink-0">
</div>
<div class="d-flex flex-column ml-3 mt-2 mb-2">
<a href="visite_detail.php?visite_id=<?echo $liste->id;?>&country_code_selected=<?echo $liste->country_code;?>&postal_code_selected=<?echo $departement;?>" class="font-weight-bold text-dark text-hover-primary"><?if ($liste->statut==2) {echo "<s>";}?><?echo $liste->name;?><?if ($liste->statut==2) {echo "</s>";}?></a>
<span class="font-size-sm font-weight-bold <?echo $classe_texte;?>"><?echo $liste->country_code;?> (<?echo $liste->postal_code;?>) </span>
</div>
</div>
<?
}
}?>
</div>
<?
}
?>
</div>
</div>
</div>