| 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/exportation.php |
<?
ini_set('memory_limit', '512M'); // ou plus selon besoin
ini_set('max_execution_time', 300); // 5 minutes
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");
///////////////////////
//PARAMETRES DE LA PAGE
///////////////////////
$totem =$db->escape($_REQUEST['what']);
$what = $db->escape($_REQUEST['what']);
$page="exportation_".$what;
$ariane1 = "Exportation";
$ariane2 = "Exportation";
$titre = "Exportation";
$country_code_selected = $db->escape($_REQUEST['country_code_selected']);
?>
<!DOCTYPE html>
<html lang="fr">
<?include("includes/head.php");?>
<style>
</style>
<body id="kt_body" class="page-loading-enabled page-loading header-fixed header-mobile-fixed subheader-enabled subheader-fixed aside-enabled aside-fixed page-loading">
<div id="halt_loader_overlay"></div><div id="halt_loader" class=""><i class="fa fa-spinner fa-spin"></i> Chargement des informations, merci de patienter...</div>
<div class="d-flex flex-column flex-root">
<!--begin::Page-->
<div class="d-flex flex-row flex-column-fluid page">
<?include("includes/header_left.php");?>
<!--begin::Wrapper-->
<div class="d-flex flex-column flex-row-fluid wrapper" id="kt_wrapper">
<?include("includes/header_top.php");?>
<!--begin::Content-->
<div class="content d-flex flex-column flex-column-fluid" id="kt_content">
<!--begin::Subheader-->
<div class="subheader py-2 py-lg-4 subheader-solid" id="kt_subheader">
<div class="container-fluid d-flex align-items-center justify-content-between flex-wrap flex-sm-nowrap">
<div class="d-flex align-items-center flex-wrap mr-2">
<h5 class="text-dark font-weight-bold mt-2 mb-2 mr-5">Exportation</h5>
<div class="subheader-separator subheader-separator-ver mt-2 mb-2 mr-5 bg-gray-200"></div>
<h5 class="text-dark font-weight-bold mt-2 mb-2 mr-5"><?echo $country_code_selected;?></h5>
<div class="d-flex align-items-center" id="kt_subheader_search">
<span class="text-dark-50 font-weight-bold" id="kt_subheader_total"></span>
</div>
</div>
<div class="d-flex align-items-center">
<div class="btn-group ml-2">
</div>
</div>
</div>
</div>
<!--end::Subheader-->
<div class="d-flex flex-column-fluid">
<div class="container-fluid">
<div class="row">
<div class="col-xl-12" >
<div class="card card-custom" style="border: 1px solid <?echo $couleur_bordure;?>;">
<div class="card-header flex-wrap py-3">
<div class="card-title">
<h3 class="card-label">Exportation - <?echo $what;?>-<?echo $country_code_selected;?></h3>
</div>
<div class="card-toolbar" id="card-toolbar"></div>
</div>
<div class="card-body">
<!--begin::Tab Content-->
<div class="row">
<div class="col-12" >
<?
$csv_fields = array();
$file = "exportation/".$what."-".$country_code_selected.".csv";
if ($what=='vis') {
$myquery = "SELECT id,token,query,name,postal_code,categorie,city,email_1,email_2,email_3
from $what where 1 AND country_code = '".$country_code_selected."' order by id"; //AND liste_lieux_fait = 1
$myquery_calls = $db->get_results($myquery);
}
if ($what=='heb') {
$myquery = "SELECT id,token,name, compteur_affichage,
proche_json,median_json,lointain_json
from $what where 1 AND country_code = '".$country_code_selected."' AND compteur_affichage!=0 order by id"; //AND liste_lieux_fait = 1
$myquery_calls = $db->get_results($myquery);
}
if (!empty($myquery_calls))
{
foreach ( $myquery_calls as $liste )
{
$ligne = $ligne+1;
foreach ( $db->get_col_info("name") as $name )
{
$matrice[$ligne][$name] = utf8_decode($liste->{$name});
if ($ligne==1) {
$csv_fields[0][] = $name;
}
}
}
}
$fp = fopen($file, 'w');
foreach ($csv_fields as $fields) {
fputcsv($fp, $fields, ';');
}
if ($matrice) {
foreach ($matrice as $fields) {
fputcsv($fp, str_replace(";"," ",$fields), ';');
}
}
?>
<div id="kt_app_content" class="app-content flex-column-fluid">
<div id="kt_app_content_container" class="app-container container-fluid">
<form method="post" class="formulaire" id="formulaire" action="hebergement_optimisation.php">
<input type="hidden" name="action" value="1">
<input type="hidden" name="langue" value="<?echo $langue;?>">
<div class="card card-bordered mb-10" style=";">
<div class="card-body">
<div class="row">
<div class="example-preview">
<div id="texte1" class="alert alert-primary" role="alert">Analyse des données...</div>
<div id="texte2" class="alert alert-primary" role="alert">Compilation des données de la base...</div>
<a href="<?echo $file;?>"><div id="texte3" class="alert alert-danger" role="alert">Exportation CSV terminée... Télécharger</b></div></a>
</div>
</div>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--end::Content-->
</div>
<!--begin::Footer-->
<?include("includes/footer.php");?>
<!--end::Footer-->
</div>
<!--end::Wrapper-->
</div>
<!--end::Page-->
</div>
<!--end::Main-->
<?include("includes/extrav2.php");?>
<script type="text/javascript" class="init">
$(document).ready(function() {
$('#texte1').hide();
$('#texte2').hide();
$('#texte3').hide();
setTimeout(function() {$('#texte1').show();}, 0)
setTimeout(function() {$('#texte2').show();}, 2000)
setTimeout(function() {$('#texte3').show();}, 3000)
});
</script>
<?include("includes/end.php");?>
</body>
</html>