| Current Path : /home/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/happyrenas/myreco.online/administration/panel/email_queue.php |
<?
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 = "email_queue";
$page = "email_queue";
$ariane1 = "File d'attente";
$ariane2 = "File d'attente";
$titre = "File d'attente";
$datatable_nom = "File d'attente";
///////////////////////
//RECUPERATION ET TRAITEMENT
///////////////////////
?>
<!DOCTYPE html>
<html lang="fr">
<?include("includes/head.php");?>
<style>
/* Réduire la hauteur des lignes de la table */
table.dataTable tbody tr {
height: 20px!important; /* Ajustez en fonction de vos besoins */
}
/* Réduire les marges internes des cellules */
table.dataTable td, table.dataTable th {
padding: 0.5rem!important; /* Réduire le padding */
/*white-space: nowrap; /* Empêche le texte de s'étendre sur plusieurs lignes */*/
}
table.dataTable td, table.dataTable th {
font-size: 0.9rem !important; /* Ajustez en fonction de vos besoins */
}
.badge-queued{background:#e9f2ff;color:#0b5ed7;}
.badge-sending{background:#fff3cd;color:#856404;}
.badge-sent{background:#d4edda;color:#155724;}
.badge-failed{background:#f8d7da;color:#721c24;}
.td-mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;}
</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"><?echo $country_code_selected;?></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 $postal_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="card card-custom gutter-b" style="border: 1px solid <?echo $couleur_bordure;?>;">
<div class="card-header">
<h3 class="card-title">File d'attente Emails</h3>
</div>
<div class="card-body">
<table id="queueTable" class="table table-striped table-bordered table-hover" style="width:100%">
<thead>
<tr>
<th>ID</th>
<th>Créé</th>
<th>UID</th>
<th>Token</th>
<th>Destinataire</th>
<th>Objet</th>
<th>Statut</th>
<th>Essais</th>
<th>Dernière tentative</th>
<th>Prochaine</th>
<th>Action</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="queueDetailModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Détail email <span class="text-muted" id="qd_id"></span></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Fermer">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<div class="mb-2"><b>Statut:</b> <span id="qd_status"></span></div>
<div class="mb-2"><b>Créé:</b> <span id="qd_created"></span></div>
<div class="mb-2"><b>UID:</b> <span class="td-mono" id="qd_request"></span></div>
<div class="mb-2"><b>Token:</b> <span class="td-mono" id="qd_token"></span></div>
</div>
<div class="col-md-6">
<div class="mb-2"><b>Expéditeur:</b> <span id="qd_from"></span></div>
<div class="mb-2"><b>Destinataire:</b> <span id="qd_to"></span></div>
<div class="mb-2"><b>CC:</b> <span id="qd_cc"></span></div>
<div class="mb-2"><b>Essais:</b> <span id="qd_retries"></span></div>
<div class="mb-2"><b>Dernière tentative:</b> <span id="qd_last"></span></div>
<div class="mb-2"><b>Prochaine tentative:</b> <span id="qd_next"></span></div>
</div>
</div>
<hr>
<div class="mb-2"><b>Objet :</b></div>
<div class="p-2 bg-light rounded" id="qd_subject"></div>
<hr>
<div class="mb-2"><b>Message:</b></div>
<iframe id="qd_iframe" style="width:100%;height:420px;border:1px solid rgba(0,0,0,.12);border-radius:8px;background:#fff;"></iframe>
<hr>
<div class="mb-2"><b>Contexte :</b></div>
<pre class="p-2 bg-light rounded" style="white-space:pre-wrap" id="qd_context"></pre>
<hr>
<div class="mb-2"><b>Erreur :</b></div>
<pre class="p-2 bg-light rounded" style="white-space:pre-wrap" id="qd_error"></pre>
</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>
(function(){
const table = $('#queueTable').DataTable({
processing: true,
serverSide: true,
pageLength: 25,
order: [[0,'desc']],
ajax: {
url: 'ajax/email_queue_list.php',
type: 'GET',
dataType: 'json'
},
columns: [
{ data: 'id', className:'td-mono' },
{ data: 'created_at' },
{ data: 'request_uid', className:'td-mono' },
{ data: 'token', className:'td-mono' },
{ data: 'to' },
{ data: 'subject' },
{ data: 'status_html', orderable: true, searchable: false },
{ data: 'retries', className:'td-mono' },
{ data: 'last_attempt' },
{ data: 'next_attempt' },
{ data: 'actions_html', orderable:false, searchable:false }
],
language: {
zeroRecords: "Aucun résultat",
sLengthMenu: "Afficher _MENU_ lignes",
info: "_TOTAL_ enregistrement(s) ",
infoEmpty: "Aucun enregistrement",
infoFiltered: "(Sur _MAX_ résultats)",
sSearch: "Rechercher : ",
}
});
// Ouvrir détail
$('#queueTable').on('click', '.btnQueueView', async function(){
const id = $(this).data('id');
if (!id) return;
try{
const res = await fetch('ajax/email_queue_get.php?id=' + encodeURIComponent(id), {
headers: {'Accept':'application/json'}
});
const data = await res.json();
if (!data.ok){
alert(data.error || 'Erreur');
return;
}
const r = data.row;
$('#qd_id').text('#' + r.id);
$('#qd_status').html(r.status_html);
$('#qd_created').text(r.created_at || '');
$('#qd_request').text(r.request_uid || '');
$('#qd_token').text(r.token || '');
$('#qd_from').text(r.expediteur || '');
$('#qd_to').text(r.destinataire_principal || '');
$('#qd_cc').text(r.destinataire_copie || '');
$('#qd_subject').text(r.objet || '');
$('#qd_retries').text(r.retries || 0);
$('#qd_last').text(r.last_attempt || '');
$('#qd_next').text(r.next_attempt || '');
$('#qd_error').text(r.error_message || '');
$('#qd_context').text(r.context_json_pretty || '');
// inject HTML dans iframe
const iframe = document.getElementById('qd_iframe');
const doc = iframe.contentDocument || iframe.contentWindow.document;
doc.open();
doc.write(r.message || '');
doc.close();
$('#queueDetailModal').modal('show');
}catch(err){
alert('Erreur réseau');
}
});
})();
</script>
<?include("includes/end.php");?>
</body>
<!--end::Body-->
</html>