Files
ms1inscription-v5/superadm/rapport_new.php
stephan c7482016ce Implement superadmin login redirection and session handling improvements
This commit introduces a new function, `fxSuperadmRedirectToLoginIfNeeded`, to streamline the login redirection process for superadmin users. It enhances session management by checking for user authentication and allowing legacy account access under specific conditions. Additionally, the login flow is updated to ensure users are redirected appropriately after login, improving the overall security and user experience in the superadmin interface. These changes aim to enhance maintainability and clarity in session handling across various superadmin pages.
2026-07-07 14:15:48 -04:00

116 lines
4.5 KiB
PHP

<?php
ini_set("memory_limit","1000M");
$page = $strPage = 'rapport.php';
$strLangue = 'fr';
$intEvenement = 432;
$intPage = 1;
$strReport = $strWhere = $strOrder = '';
if (!empty($_GET['e']))
$intEvenement = base64_decode(urldecode($_GET['e']));
//if (!empty($_GET['e']))
// $intEvenement = $_GET['e'];
if (!empty($_GET['r']))
$strReport = $_GET['r'];
if (!empty($_GET['lng']))
$strLangue = $_GET['lng'];
require_once('php/inc_start_time.php');
require_once('php/inc_fx_messages.php');
require_once('../php/inc_fx_memberships.php');
global $db, $objDatabasePreProd,$objDatabasecrm,$objDatabaseProd ;
fxSuperadmRedirectToLoginIfNeeded(true);
$blnLogged = fxSuperadmReportsAllowed(intval($intEvenement));
$strWhere = fxSetWhere($strReport, $_GET);
if (isset($_POST['btn_paiement'])) {
// print_rsl($_POST);
foreach ($_POST['eve_id'] as $val) {
// Séparer les deux valeurs
list($evenement_id, $montant) = explode(';', $val);
// echo "Événement : $evenement_id, Montant : $montant<br>";
$sqlInsert = "INSERT INTO remboursements SET tr_id = 1, mr_id=1,eve_id = " . $evenement_id . ", rem_montant = '" . $montant . "',rem_date='" . $_POST['info_paiement']['date_payele'] . "',rem_date_pour='" . $_POST['info_paiement']['date_pour'] . "',rem_details='" . $_POST['info_paiement']['details'] . "',rem_ajoute_par='" . $_POST['info_paiement']['ajouter_par'] . "'";
//avant MSIN-4206
// $qryInsert = $objDatabasePreProd->fxQuery($sqlInsert);
$qryInsert =$objDatabaseProd->fxQuery($sqlInsert);
}
}
// si on clique excel
if (isset($_POST['btn_excel_top']) || isset($_POST['btn_excel_bot'])) {
fxShowReport($intEvenement, $strReport, $strWhere, $strOrder, $strLangue, true,false,false,false,$_POST,'excel');
}
if (isset($_POST['btn_excel_na_top']) || isset($_POST['btn_excel_na_bot'])) {
fxShowReport($intEvenement, $strReport, $strWhere, $strOrder, $strLangue, true, true,false,false,$_POST,'excel');
}
if (isset($_POST['btn_excel_mc_top']) || isset($_POST['btn_excel_mc_bot'])) {
fxShowReport($intEvenement, $strReport, $strWhere, $strOrder, $strLangue, true, false, true, 'mailchimp','false','excel');
}
if (isset($_POST['btn_excel_animateur_top']) || isset($_POST['btn_excel_animateur_bot'])) {
fxShowReport($intEvenement, $strReport, $strWhere, $strOrder, $strLangue, true, false, true, 'animateur','false','excel');
}
if (isset($_POST['btn_pdf_top']) || isset($_POST['btn_pdf_bot'])) {
fxShowReport($intEvenement, $strReport, $strWhere, $strOrder, $strLangue, false, false, false, 'pdf',$_POST,'pdf');
}
if (isset($_POST['btn_pdf_pay_top']) || isset($_POST['btn_pdf_pay_bot'])) {
fxShowReport($intEvenement, $strReport, $strWhere, $strOrder, $strLangue, false, false, false, 'pdf',$_POST,'pdf_pay');
}
if (isset($_POST['btn_pdf_leg_top']) || isset($_POST['btn_pdf_leg_bot'])) {
fxShowReport($intEvenement, $strReport, $strWhere, $strOrder, $strLangue, false, false, false, 'pdf',$_POST,'pdf_leg');
}
if (isset($_POST['btn_pdf_pay_leg_top']) || isset($_POST['btn_pdf_pay_leg_bot'])) {
fxShowReport($intEvenement, $strReport, $strWhere, $strOrder, $strLangue, false, false, false, 'pdf',$_POST,'pdf_pay_leg');
}
require_once('inc_header.php');
?>
<div class="container-fluid">
<div class="col-sm-12">
<?php
if ($blnLogged) {
fxShowFormSearch($intEvenement, $strReport, $_GET, $strLangue);
fxShowReport($intEvenement, $strReport, $strWhere, $strOrder, $strLangue);
} else {
if ($strLangue == 'fr') {
?>
<h1>Accès refusé!</h1>
<?php
} else {
?>
<h1>Access denied!</h1>
<?php
}
}
?>
<p>&nbsp;</p>
</div>
</div>
<script type="text/javascript">
$(function() {
$('#btn_excel_top, #btn_excel_bot, #btn_excel_na_top, #btn_excel_na_bot, #btn_excel_animateur_top, #btn_excel_animateur_bot').click(function(){
return confirm("<?php if ($strLangue == 'fr') { ?>Voulez-vous télécharger la version excel ?<?php } else { ?>Do you want to download the excel version?<?php } ?>");
});
});
</script>
<script>
function toggleAllCheckboxes(master) {
var checkboxes = document.querySelectorAll('.eve_id_checkbox');
for (var i = 0; i < checkboxes.length; i++) {
checkboxes[i].checked = master.checked;
}
}
</script>
<?php require_once('inc_footer.php'); ?>