This commit enhances the static database synchronization feature by refining the `fxSuperadmStaticSyncAllowed` function to improve access control. The UI is updated to conditionally display synchronization options in both the header and sidebar, ensuring that only authorized users can access these tools. This change streamlines the user experience while maintaining security in the admin interface.
170 lines
9.3 KiB
PHP
170 lines
9.3 KiB
PHP
<?php
|
|
global $db, $objDatabase, $vblnEnvironementDev, $vDomaine, $vblnEnvironementPreProd;
|
|
?>
|
|
<div class="col-md-3 col-lg-2 order-last order-md-first bg-light border-right py-3">
|
|
<h4>Confirmation commande</h4>
|
|
<div class="p-3">
|
|
<?php
|
|
$intSendMail = fxGetVariable('confirm_mail');
|
|
|
|
if (intval($intSendMail) == 1) {
|
|
$intValeur = 0;
|
|
$strClass = 'btn-success';
|
|
$strImage = '<i class="fa fa-envelope mr-2" aria-hidden="true"></i>Envoyer courriel';
|
|
} else {
|
|
$intValeur = 1;
|
|
$strClass = 'btn-danger';
|
|
$strImage = '
|
|
<span class="fa-stack fa-lg">
|
|
<i class="fa fa-envelope-o fa-stack-1x"></i>
|
|
<i class="fa fa-ban fa-stack-2x"></i>
|
|
</span>
|
|
Aucun envoi courriel
|
|
';
|
|
}
|
|
?>
|
|
<a class="btn btn-sm rounded-0 <?php echo $strClass; ?>" id="btn_confirm_mail" href="#" data-action="change-var" data-key="confirm_mail" data-valeur="<?php echo $intValeur; ?>">
|
|
<?php echo $strImage; ?>
|
|
</a>
|
|
</div>
|
|
<h4>État du site</h4>
|
|
<div class="p-3">
|
|
<?php
|
|
$sqlMaintenance = "SELECT mai_actif FROM maintenance WHERE mai_id = 1";
|
|
$intMaintenance = $objDatabase->fxGetVar($sqlMaintenance);
|
|
|
|
if (intval($intMaintenance) == 1) {
|
|
$intValeur = 0;
|
|
$strClass = 'btn-danger';
|
|
$strImage = '<i class="fa fa-times mr-2" aria-hidden="true"></i>En maintenance';
|
|
} else {
|
|
$intValeur = 1;
|
|
$strClass = 'btn-success';
|
|
$strImage = '<i class="fa fa-check mr-2" aria-hidden="true"></i>En ligne';
|
|
}
|
|
?>
|
|
<a class="btn btn-sm rounded-0 <?php echo $strClass; ?>" id="btn_maintenance" href="#" data-action="actif2" data-table="<?php echo urlencode(base64_encode('maintenance')); ?>" data-field="mai_actif" data-key="mai_id" data-valeur="<?php echo $intValeur; ?>" data-id="1">
|
|
<?php echo $strImage; ?>
|
|
</a>
|
|
</div>
|
|
<h4><span>Gestion</span> des infos du site web</h4>
|
|
<?php
|
|
$tabMenus = fxGetMenussuperadm(0, 0, 0, 0, 0, 1);
|
|
|
|
?>
|
|
<ul class="nav nav-pills flex-column">
|
|
<?php
|
|
for ($intCtr = 1; $intCtr <= count($tabMenus); $intCtr++) {
|
|
if($tabMenus[$intCtr]['men_id']<>246){
|
|
?>
|
|
<li class="nav-item" role="presentation">
|
|
<a class="nav-link<?php if (isset($_GET['t']) && base64_decode(urldecode($_GET['t'])) == $tabMenus[$intCtr]['men_id']) { ?> active<?php } ?>" href="index.php?t=<?php echo urlencode(base64_encode(fxUnescape($tabMenus[$intCtr]['men_id']))); ?>&a=list"><img src="images_blue/<?php echo fxUnescape($tabMenus[$intCtr]['men_icone']); ?>" alt="" /> <?php echo fxUnescape($tabMenus[$intCtr]['men_nom']); ?></a>
|
|
</li>
|
|
<?php
|
|
if ($tabMenus[$intCtr]['men_nom'] == 'Rabais' && $vblnEnvironementDev) {
|
|
?>
|
|
<li class="nav-item" role="presentation">
|
|
<a class="nav-link" href="<?php echo $vDomaine; ?>/maj_rabais.php?p=<?php echo fxUnescape($_SESSION['usa_info']['com_login']); ?>" target="_blank"><img src="images_blue/ico_promotions.png" alt="" /> Créer des rabais</a>
|
|
</li>
|
|
<?php
|
|
if (fxSuperadmStaticSyncAllowed()) {
|
|
?>
|
|
<li class="nav-item" role="presentation">
|
|
<a class="nav-link" href="<?php echo $vDomaine; ?>/php/sync_static_db.php" target="_blank"><i class="fa fa-database" aria-hidden="true"></i> Sync tables statiques</a>
|
|
</li>
|
|
<?php
|
|
}
|
|
}
|
|
}}
|
|
?>
|
|
</ul>
|
|
|
|
<h4><span>Rapports</span> particuliers</h4>
|
|
<?php
|
|
$tabMenus = fxGetMenussuperadm(0, 0, 1);
|
|
?>
|
|
<ul class="nav nav-pills flex-column">
|
|
<li class="nav-item" role="presentation">
|
|
<a class="nav-link"
|
|
href="rapport_new.php?r=remboursements-bilan&lng=fr&a-ach_maj_from=2000-01-01&a-ach_maj_to=<?php echo date('Y-m-d') ?>&btn_search="
|
|
target="_blank"><i class="fa fa-money" aria-hidden="true"></i> Remboursements bilan</a>
|
|
</li>
|
|
|
|
<?php
|
|
for ($intCtr = 1; $intCtr <= count($tabMenus); $intCtr++) {
|
|
?>
|
|
<li class="nav-item" role="presentation">
|
|
<a class="nav-link" href="index.php?t=<?php echo urlencode(base64_encode(fxUnescape($tabMenus[$intCtr]['men_id']))); ?>&a=report" target="_blank"><i class="fa fa-bar-chart" aria-hidden="true"></i> <?php echo fxUnescape($tabMenus[$intCtr]['men_nom']); ?></a>
|
|
</li>
|
|
<?php
|
|
}
|
|
?>
|
|
</ul>
|
|
<h4><span>Rapports</span> événements</h4>
|
|
<?php
|
|
$sqlEvenements = "SELECT eve_id, eve_nom_fr, eve_rapport_finances_capitaines, te_id FROM inscriptions_evenements WHERE DATE_SUB(CURDATE(),INTERVAL 6 MONTH) <= eve_date_fin ORDER BY eve_date_debut DESC";
|
|
$arrEvenements = $objDatabase->fxGetResults($sqlEvenements);
|
|
|
|
if ($arrEvenements != null) {
|
|
for ($intCtr = 1; $intCtr <= count($arrEvenements); $intCtr++) {
|
|
?>
|
|
<h5><?php echo $arrEvenements[$intCtr]['eve_nom_fr']; ?></h5>
|
|
<ul class="nav nav-pills flex-column">
|
|
<?php
|
|
if ($arrEvenements[$intCtr]['te_id'] != 9) {
|
|
?>
|
|
<li class="nav-item" role="presentation">
|
|
<a class="nav-link" href="rapport_new.php?r=chrono&e=<?php echo urlencode(base64_encode($arrEvenements[$intCtr]['eve_id'])); ?>&lng=fr" target="_blank"><i class="fa fa-clock-o" aria-hidden="true"></i> chrono + questions</a>
|
|
</li>
|
|
<?php
|
|
}
|
|
if ($arrEvenements[$intCtr]['te_id'] == 13) {
|
|
?>
|
|
<li class="nav-item" role="presentation">
|
|
<a class="nav-link" href="rapport_new.php?r=adhesions&e=<?php echo urlencode(base64_encode($arrEvenements[$intCtr]['eve_id'])); ?>&lng=fr" target="_blank"><i class="fa fa-bar-chart mr-2" aria-hidden="true"></i>adhésions actives</a>
|
|
</li>
|
|
<li class="nav-item" role="presentation">
|
|
<a class="nav-link" href="rapport_new.php?r=adhesions-ventes&e=<?php echo urlencode(base64_encode($arrEvenements[$intCtr]['eve_id'])); ?>&lng=fr" target="_blank"><i class="fa fa-bar-chart mr-2" aria-hidden="true"></i>liste d'adhésions annuelles</a>
|
|
</li>
|
|
<?php
|
|
}
|
|
if ($arrEvenements[$intCtr]['eve_rapport_finances_capitaines'] == 1) {
|
|
?>
|
|
<li class="nav-item" role="presentation">
|
|
<a class="nav-link" href="rapport_new.php?r=finances-pnq&e=<?php echo urlencode(base64_encode($arrEvenements[$intCtr]['eve_id'])); ?>&lng=fr" target="_blank"><i class="fa fa-money" aria-hidden="true"></i> Transactions-Finances (capitaines seulement)</a>
|
|
</li>
|
|
<?php
|
|
}
|
|
$year = date('Y'); // Année courante
|
|
$datetq = $year . '-04-01 00:00:00';
|
|
if ($arrEvenements[$intCtr]['te_id'] == 13) {
|
|
?>
|
|
<li class="nav-item" role="presentation">
|
|
<a class="nav-link" href="rapport_new.php?r=finances-membership&e=<?php echo urlencode(base64_encode($arrEvenements[$intCtr]['eve_id'])); ?>&lng=fr&a-ach_maj_from=<?php echo $datetq; ?> &btn_search=" target="_blank"><i class="fa fa-money" aria-hidden="true"></i> Transactions-Finances - Tout</a>
|
|
</li>
|
|
<li class="nav-item" role="presentation">
|
|
<a class="nav-link" href="rapport_new.php?r=finances-membership-tq&e=<?php echo urlencode(base64_encode($arrEvenements[$intCtr]['eve_id'])); ?>&lng=fr&a-ach_maj_from=<?php echo $datetq; ?> &btn_search=" target="_blank"><i class="fa fa-money" aria-hidden="true"></i> Transactions-Finances - Adhésions Seul</a>
|
|
</li>
|
|
<li class="nav-item" role="presentation">
|
|
<a class="nav-link" href="rapport_new.php?r=finances-membership-autre&e=<?php echo urlencode(base64_encode($arrEvenements[$intCtr]['eve_id'])); ?>&lng=fr&a-ach_maj_from=<?php echo $datetq; ?> &btn_search=" target="_blank"><i class="fa fa-money" aria-hidden="true"></i> Transactions-Finances - Événements Seul</a>
|
|
</li>
|
|
<?php
|
|
}else{
|
|
?>
|
|
<li class="nav-item" role="presentation">
|
|
<a class="nav-link" href="rapport_new.php?r=finances&e=<?php echo urlencode(base64_encode($arrEvenements[$intCtr]['eve_id'])); ?>&lng=fr" target="_blank"><i class="fa fa-money" aria-hidden="true"></i> Transactions-Finances</a>
|
|
</li>
|
|
<?php
|
|
|
|
}
|
|
?>
|
|
|
|
<li class="nav-item" role="presentation">
|
|
<a class="nav-link" href="rapport_new.php?r=remboursements&e=<?php echo urlencode(base64_encode($arrEvenements[$intCtr]['eve_id'])); ?>&lng=fr" target="_blank"><i class="fa fa-money" aria-hidden="true"></i> Paiements</a>
|
|
</li>
|
|
</ul>
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
</div>
|