This commit introduces a new UI structure for the superadmin interface by implementing the fxSuperadmV2Panel functions, which improve the organization and presentation of event access and ChronoTrack API sections. The changes include the addition of collapsible panels for better user interaction and visual clarity. Additionally, the versioning in the settings file is updated to reflect the latest changes. These enhancements aim to streamline the user experience and improve the overall functionality of the superadmin interface.
1191 lines
65 KiB
PHP
1191 lines
65 KiB
PHP
|
|
|
|
<?php
|
|
global $strhomeclientannuler, $inteprId, $vSuperadm, $vtexte_page, $vblnEnvironementPreProd, $vDomaine, $objDatabase, $objDatabaseProd, $objDatabasePreProd, $strhomeclient, $vblnEnvironementDev;
|
|
//error_reporting(E_ALL);
|
|
//ini_set("display_errors", 1);
|
|
|
|
$vtexte_page = obtenirTextepage('form.php', $strLangue, 2);
|
|
|
|
$finlink = '&a=list';
|
|
|
|
if (isset($eve_id)) {
|
|
$finlink = '&promoteur_eve_id=' . urlencode(base64_encode($eve_id));
|
|
$_GET['eve_id'] = $eve_id;
|
|
if (isset($inteprId)) {
|
|
$finlink = $finlink . "&epr_id=" . urlencode(base64_encode($inteprId));
|
|
}
|
|
|
|
}
|
|
|
|
|
|
if (!isset($strhomeclient)) {
|
|
$strhomeclient = 'index.php';
|
|
}
|
|
if (!isset($strhomeclientannuler)) {
|
|
$strhomeclientannuler = 'index.php';
|
|
}
|
|
|
|
$intMenuActuel = intval($tabResults['menu']['men_id']);
|
|
$strMenuTableActuel = isset($tabResults['menu']['men_table']) ? (string)$tabResults['menu']['men_table'] : '';
|
|
$intEveIdForm = ($strAction === 'mod' && !empty($_GET['id'])) ? intval($_GET['id']) : 0;
|
|
$blnIsEventModForm = ($intEveIdForm > 0 && ($intMenuActuel === 4 || $strMenuTableActuel === 'inscriptions_evenements'));
|
|
$blnCompteShowAccesSections = false;
|
|
|
|
if ($strAction == 'mod' && $tabResults['data'] == null) {
|
|
|
|
?>
|
|
<script type="text/javascript">
|
|
window.location = "index.php?t=<?php echo urlencode(base64_encode(fxUnescape($tabResults['menu']['men_id']))); ?>&a=list";
|
|
</script>
|
|
<?php
|
|
|
|
}
|
|
|
|
if ($tabResults['menu']['sous_men_id'] != 0) {
|
|
if ($strAction == 'add' || $strAction == 'add_batch') {
|
|
$strLinkRetour = $strhomeclient . '?t=' . urlencode(base64_encode(fxUnescape($tabResults['menu']['sous_men_id']))) . '&a=mod&id=' . $_GET['id'];
|
|
$strLinkRetourannuler = $strhomeclientannuler . '?t=' . urlencode(base64_encode(fxUnescape($tabResults['menu']['sous_men_id']))) . '&a=mod&id=' . $_GET['id'];
|
|
|
|
} else {
|
|
$strLinkRetour = $strhomeclient . '?t=' . urlencode(base64_encode(fxUnescape($tabResults['menu']['sous_men_id']))) . '&a=mod&id=' . intval($tabResults['data'][fxGetPK($tabResults['menu']['sous_men_id'])]);
|
|
$strLinkRetourannuler = $strhomeclientannuler . '?t=' . urlencode(base64_encode(fxUnescape($tabResults['menu']['sous_men_id']))) . '&a=mod&id=' . intval($tabResults['data'][fxGetPK($tabResults['menu']['sous_men_id'])]);
|
|
|
|
}
|
|
} else {
|
|
$strLinkRetour = $strhomeclient . '?t=' . urlencode(base64_encode(fxUnescape($tabResults['menu']['men_id']))) . $finlink;
|
|
$strLinkRetourannuler = $strhomeclientannuler . '?t=' . urlencode(base64_encode(fxUnescape($tabResults['menu']['men_id']))) . $finlink;
|
|
|
|
}
|
|
|
|
// Initialiser les variables
|
|
$tabValidation = $tbRules = $tabMessages = $tabDates = $arrClocks = $tabAutocomplete = $tabConfirmation = array();
|
|
$intFile = 1;
|
|
|
|
?>
|
|
<h1><?php
|
|
|
|
|
|
|
|
if ($intMenuActuel != 250) {
|
|
if ($strAction == 'add' || $strAction == 'add_batch') { ?><?php afficheTexte('Ajouter'); ?><?php } else { ?><?php afficheTexte('Modifier'); ?><?php } ?>
|
|
|
|
|
|
<?php ;
|
|
|
|
|
|
if ($intMenuActuel == 246) {
|
|
afficheTexte(fxUnescape($tabResults['menu']['men_nom']));
|
|
} else {
|
|
echo(fxUnescape($tabResults['menu']['men_nom']));
|
|
}
|
|
}
|
|
if ($strAction == 'add_batch') { ?> batch<?php } ?></h1>
|
|
|
|
|
|
<?php
|
|
$mem_selectpicker=' selectpicker show-tick';
|
|
|
|
if ($intMenuActuel == 246) {
|
|
?><p> <?php afficheTexte('rabaishelp'); ?></p> <?php
|
|
|
|
$mem_selectpicker='';
|
|
|
|
}
|
|
|
|
if ($strAction == 'mod') {
|
|
|
|
$arrDataActuel = $tabResults['data'];
|
|
if ($intMenuActuel == 4 ) {
|
|
|
|
if ($vblnEnvironementDev == true) {
|
|
?>
|
|
<a href="index.php?t=<?php echo $_GET['t']; ?>&id=mod&eve_id=<?php echo $_GET['id'] ; ?>&action=doubler" class="btn btn-secondary">Double</a>
|
|
<?php
|
|
}
|
|
|
|
fxgetpromoteurs($_GET['id']);
|
|
|
|
require_once(dirname(__FILE__) . '/../../php/inc_fx_eve_acces.php');
|
|
fxEveAccesShowEventAccessPanel(intval($_GET['id']));
|
|
|
|
if ($blnIsEventModForm) {
|
|
require_once(dirname(__FILE__) . '/../../php/chronotrack_api/inc_bootstrap.php');
|
|
require_once(dirname(__FILE__) . '/../../php/inc_fx_superadm_v2_ui.php');
|
|
$arrCtConfig = fxChronotrackApiConfigGet($intEveIdForm);
|
|
$strCtHeaderExtra = '';
|
|
if ($arrCtConfig !== null) {
|
|
$strCtHeaderExtra = '<span class="superadm-v2-panel__header-extra ml-2">'
|
|
. '<span class="badge badge-light">'
|
|
. fxChronotrackApiAdminEsc(fxChronotrackApiConfigStatusLabel($arrCtConfig['sync_status'] ?? ''))
|
|
. '</span></span>';
|
|
}
|
|
fxSuperadmV2PanelOpen('MSIN API ChronoTrack', array(
|
|
'collapse_id' => 'chronotrackApiCollapse',
|
|
'zone_id' => 'chronotrack_api',
|
|
'zone_class' => 'superadm-content-v2-zone mt-3 mb-2',
|
|
'header_extra' => $strCtHeaderExtra,
|
|
));
|
|
fxChronotrackApiAdminRenderEventPage($intEveIdForm, $strLangue, true, true);
|
|
fxSuperadmV2PanelClose(array('collapse_id' => 'chronotrackApiCollapse'));
|
|
}
|
|
|
|
}
|
|
?>
|
|
<p> </p>
|
|
<div class="text-center">
|
|
<div class="btn-group" role="group" aria-label="Basic example">
|
|
<?php
|
|
$tabSubTables = fxGetMenussuperadm(0, $tabResults['menu']['men_id']);
|
|
|
|
for ($intCtr = 1; $intCtr <= fxcountpatch($tabSubTables); $intCtr++) {
|
|
$intMenu = urlencode(base64_encode(fxUnescape($tabSubTables[$intCtr]['men_id'])));
|
|
?>
|
|
<a class="btn btn-secondary" href="#list_<?php echo $tabSubTables[$intCtr]['men_id']; ?>">
|
|
<?php echo fxUnescape($tabSubTables[$intCtr]['men_nom']); ?>
|
|
</a>
|
|
<?php
|
|
}
|
|
|
|
if ($blnIsEventModForm) {
|
|
?>
|
|
<a class="btn btn-secondary" href="#chronotrack_api"
|
|
onclick="if (window.jQuery) { jQuery('#chronotrackApiCollapse').collapse('show'); }">
|
|
ChronoTrack
|
|
</a>
|
|
<a class="btn btn-secondary" href="#list_rapports">
|
|
Rapports
|
|
</a>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
<p> </p>
|
|
<?php
|
|
}
|
|
|
|
?>
|
|
<form action="<?php echo $strhomeclient; ?>?t=<?php echo urlencode(base64_encode(fxUnescape($tabResults['menu']['men_id']))) . $finlink; ?>"
|
|
class="form-horizontal" method="post" id="frm_form" name="frm_form" enctype="multipart/form-data">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h2 class="py-3"><?php afficheTexte('Détailsdelitem'); ?></h2>
|
|
</div>
|
|
<div class="card-body">
|
|
<?php
|
|
|
|
|
|
if ($intMenuActuel != 246) {
|
|
?>
|
|
<div class="form-group row">
|
|
<div class="col-sm-9 col-lg-7 offset-sm-3">
|
|
<?php
|
|
if ($strAction == 'mod') {
|
|
?>
|
|
<button type="submit" class="btn btn-success rounded-0" id="btn_save_top"
|
|
name="btn_save_top"><i class="fa fa-check" aria-hidden="true"></i> Enregistrer
|
|
</button>
|
|
<a class="btn btn-danger rounded-0" href="<?php echo $strLinkRetourannuler; ?>"><i
|
|
class="fa fa-times" aria-hidden="true"></i> Annuler</a>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<!-- Bouton Ajouter standard -->
|
|
<button type="submit" class="btn btn-success rounded-0" id="btn_add_top"
|
|
name="btn_add_top">
|
|
<i class="fa fa-check"
|
|
aria-hidden="true"></i> <?php afficheTexte('ajouter'); ?>
|
|
</button>
|
|
|
|
|
|
<!-- Bouton Annuler -->
|
|
<a class="btn btn-danger rounded-0 ms-3" href="?t=MjQ2&promoteur_eve_id=">
|
|
<i class="fa fa-times" aria-hidden="true"></i> Annuler
|
|
</a>
|
|
|
|
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
<?php
|
|
}
|
|
if ($strAction == 'mod') {
|
|
$mem_readonly_total = 0;
|
|
?>
|
|
<input type="hidden" name="<?php echo fxUnescape($tabResults['key']); ?>"
|
|
value="<?php echo $_GET['id']; ?>">
|
|
<?php
|
|
if ($intMenuActuel == 246) {
|
|
|
|
|
|
if ($vblnEnvironementDev == true) {
|
|
$arrProd = fxGetStatutProd($tabResults['menu']['men_table'], $tabResults['key'], $_GET['id']);
|
|
|
|
if($arrProd['statut']=='existant'){
|
|
afficheTexte('readonly_existe_en_prod');
|
|
$mem_readonly_total = 1;
|
|
}else{
|
|
$mem_readonly_total = 0;
|
|
}
|
|
|
|
|
|
} else {
|
|
afficheTexte('readonly_existe_en_prod');
|
|
$mem_readonly_total = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (isset($vSuperadm)) {
|
|
$mem_readonly_total = 0;
|
|
}
|
|
|
|
|
|
}
|
|
?>
|
|
<input type="hidden" name="form_action" value="<?php echo $strAction; ?>">
|
|
<input type="hidden" name="form_action_encode"
|
|
value="<?php echo urlencode(base64_encode($strAction)); ?>">
|
|
<div class="error"></div>
|
|
<?php
|
|
$arrInfluencesOn = array();
|
|
|
|
if ($strAction == 'add_batch') {
|
|
?>
|
|
<div class="form-group row">
|
|
<label for="txt_heure_debut" class="control-label col-sm-3">Heure de début :</label>
|
|
<div class="col-sm-9 col-lg-7">
|
|
<div class="input-group" id="clk-txt_heure_debut" data-target-input="nearest">
|
|
<input type="text" class="form-control rounded-0" id="txt_heure_debut"
|
|
name="txt_heure_debut" data-target="#clk-txt_heure_debut" value="10:00" autofocus
|
|
required>
|
|
<div class="input-group-append" data-target="#clk-txt_heure_debut"
|
|
data-toggle="datetimepicker">
|
|
<div class="input-group-text rounded-0"><i class="fa fa-clock-o"></i></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label for="txt_heure_fin" class="control-label col-sm-3">Heure de fin :</label>
|
|
<div class="col-sm-9 col-lg-7">
|
|
<div class="input-group" id="clk-txt_heure_fin" data-target-input="nearest">
|
|
<input type="text" class="form-control rounded-0" id="txt_heure_fin"
|
|
name="txt_heure_fin" data-target="#clk-txt_heure_fin" value="18:00" required>
|
|
<div class="input-group-append" data-target="#clk-txt_heure_fin"
|
|
data-toggle="datetimepicker">
|
|
<div class="input-group-text rounded-0"><i class="fa fa-clock-o"></i></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="form-group row">
|
|
<label for="txt_repetition" class="control-label col-sm-3">Durée (répéter toutes les...)
|
|
:</label>
|
|
<div class="col-sm-9 col-lg-7">
|
|
<select class="form-control rounded-0" id="txt_repetition" name="txt_repetition">
|
|
<option value="10" selected>10 minutes</option>
|
|
<option value="15">15 minutes</option>
|
|
<option value="30">30 minutes</option>
|
|
<option value="45">45 minutes</option>
|
|
<option value="60">60 minutes</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
$arrClocks[] = 'clk-txt_heure_debut';
|
|
$arrClocks[] = 'clk-txt_heure_fin';
|
|
};
|
|
$mem_block = "";
|
|
|
|
for ($intCtr = 1; $intCtr <= fxcountpatch($tabResults['fields']); $intCtr++) {
|
|
$blnInputGroup = false;
|
|
|
|
// block d'info
|
|
|
|
if ($tabResults['fields'][$intCtr]['for_block_' . $strLangue] != "") {
|
|
|
|
if ($mem_block != $tabResults['fields'][$intCtr]['for_block_' . $strLangue]) {
|
|
$mem_block = $tabResults['fields'][$intCtr]['for_block_' . $strLangue];
|
|
echo('<hr><h3>');
|
|
echo($tabResults['fields'][$intCtr]['for_block_' . $strLangue]);
|
|
echo('</h1></br>');
|
|
}
|
|
}
|
|
if (($tabResults['menu']['men_id'] == 12 || $tabResults['menu']['men_id'] == 246) && $tabResults['fields'][$intCtr]['for_tri'] == 140) {
|
|
?>
|
|
<h4>Rabais multi-épreuves</h4>
|
|
<?php
|
|
} elseif (($tabResults['menu']['men_id'] == 12 || $tabResults['menu']['men_id'] == 246) && $tabResults['fields'][$intCtr]['for_tri'] == 150) {
|
|
?>
|
|
<h4>Limiter à des ÉpreuvesRabais pour un nombre limite d'épreuves</h4>
|
|
<?php
|
|
}
|
|
// stocker les règles
|
|
$tabValidation[$tabResults['fields'][$intCtr]['for_field']]['rules'] = $tabValidation[$tabResults['fields'][$intCtr]['for_field']]['messages'] = array();
|
|
|
|
// REQUIRED
|
|
if ($tabResults['fields'][$intCtr]['for_required'] == 1) {
|
|
array_push($tabValidation[$tabResults['fields'][$intCtr]['for_field']]['rules'], "required: true");
|
|
array_push($tabValidation[$tabResults['fields'][$intCtr]['for_field']]['messages'], str_replace("%label%", $tabResults['fields'][$intCtr]['lab_texte_form'], $GLOBALS['tabValMessages']['required'][$strLangue]));
|
|
}
|
|
// VALIDATION
|
|
if ($tabResults['fields'][$intCtr]['for_validation'] != '') {
|
|
switch ($tabResults['fields'][$intCtr]['for_validation']) {
|
|
case 'image':
|
|
array_push($tabValidation[$tabResults['fields'][$intCtr]['for_field']]['rules'], 'extension: "jpg|png|gif"');
|
|
array_push($tabValidation[$tabResults['fields'][$intCtr]['for_field']]['messages'], str_replace("%label%", $tabResults['fields'][$intCtr]['lab_texte_form'], $GLOBALS['tabValMessages'][$tabResults['fields'][$intCtr]['for_validation']][$strLangue]));
|
|
break;
|
|
|
|
case 'document':
|
|
array_push($tabValidation[$tabResults['fields'][$intCtr]['for_field']]['rules'], 'extension: "doc|docx|pdf"');
|
|
array_push($tabValidation[$tabResults['fields'][$intCtr]['for_field']]['messages'], str_replace("%label%", $tabResults['fields'][$intCtr]['lab_texte_form'], $GLOBALS['tabValMessages'][$tabResults['fields'][$intCtr]['for_validation']][$strLangue]));
|
|
break;
|
|
|
|
case 'pdf':
|
|
array_push($tabValidation[$tabResults['fields'][$intCtr]['for_field']]['rules'], 'extension: "pdf"');
|
|
array_push($tabValidation[$tabResults['fields'][$intCtr]['for_field']]['messages'], str_replace("%label%", $tabResults['fields'][$intCtr]['lab_texte_form'], $GLOBALS['tabValMessages'][$tabResults['fields'][$intCtr]['for_validation']][$strLangue]));
|
|
break;
|
|
|
|
default:
|
|
array_push($tabValidation[$tabResults['fields'][$intCtr]['for_field']]['rules'], $tabResults['fields'][$intCtr]['for_validation'] . ": true");
|
|
array_push($tabValidation[$tabResults['fields'][$intCtr]['for_field']]['messages'], str_replace("%label%", $tabResults['fields'][$intCtr]['lab_texte_form'], $GLOBALS['tabValMessages'][$tabResults['fields'][$intCtr]['for_validation']][$strLangue]));
|
|
}
|
|
}
|
|
// DATE
|
|
if ($tabResults['fields'][$intCtr]['for_validation'] == 'dateCA') {
|
|
$blnInputGroup = true;
|
|
$strInputGroupIconAfter = '<i class="fa fa-calendar"></i>';
|
|
$tabParam['format'] = "'YYYY-MM-DD'";
|
|
|
|
$strInputGroupId = $tabDates[] = 'cal-' . $tabResults['fields'][$intCtr]['for_field'];
|
|
}
|
|
?>
|
|
<div class="form-group row">
|
|
<?php
|
|
if ($tabResults['fields'][$intCtr]['for_' . $strAction] == 1) {
|
|
|
|
// Afficher l'étiquette
|
|
if ($tabResults['fields'][$intCtr]['for_type'] != 'radio' && $tabResults['fields'][$intCtr]['for_type'] != 'hidden') {
|
|
?>
|
|
<label for="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
class="control-label col-sm-3"><?php echo fxUnescape($tabResults['fields'][$intCtr]['lab_texte_form']); ?>
|
|
:</label>
|
|
<?php
|
|
} elseif ($tabResults['fields'][$intCtr]['for_type'] != 'hidden') {
|
|
?>
|
|
<label class="control-label col-sm-3"><?php echo fxUnescape($tabResults['fields'][$intCtr]['lab_texte_form']); ?>
|
|
:</label>
|
|
<?php
|
|
}
|
|
?>
|
|
<div class="col-sm-9 col-lg-7">
|
|
<?php
|
|
// Afficher le input selon le type
|
|
switch ($tabResults['fields'][$intCtr]['for_type']) {
|
|
case 'text':
|
|
case 'readonly':
|
|
case 'autocomplete':
|
|
$mem_readonly = "";
|
|
if ($tabResults['fields'][$intCtr]['for_type'] == "readonly") {
|
|
$mem_readonly = "readonly";
|
|
}
|
|
if ($mem_readonly_total == 1) {
|
|
$mem_readonly = "readonly";
|
|
}
|
|
if ($strAction == 'mod') {
|
|
if ($tabResults['fields'][$intCtr]['for_type'] == 'autocomplete') {
|
|
$strValue = fxGetAutocompleteValue($tabResults['fields'][$intCtr]['lab_list'], $tabResults['fields'][$intCtr]['lab_autocomplete_where'], $tabResults['fields'][$intCtr]['lab_autocomplete_id'], $tabResults['data'][$tabResults['fields'][$intCtr]['for_result_field']]);
|
|
} else
|
|
$strValue = fxUnescape($tabResults['data'][$tabResults['fields'][$intCtr]['for_field']]);
|
|
} elseif ($strAction == 'add_batch') {
|
|
$strValue = fxUnescape($tabResults['fields'][$intCtr]['lab_default']);
|
|
if (isset($_SESSION['com_info'])) {
|
|
$strValue = str_replace('%user%', $_SESSION['com_info']['com_prenom'] . ' ' . $_SESSION['com_info']['com_nom'], $strValue);
|
|
|
|
} else {
|
|
$strValue = str_replace('%user%', $_SESSION['usa_info']['com_prenom'] . ' ' . $_SESSION['usa_info']['com_nom'], $strValue);
|
|
}
|
|
$strValue = str_replace('%ip%', $_SERVER['REMOTE_ADDR'], $strValue);
|
|
|
|
switch ($tabResults['fields'][$intCtr]['for_field']) {
|
|
case 'epr_nom_fr':
|
|
case 'epr_nom_en':
|
|
$strValue = '%heure%';
|
|
break;
|
|
}
|
|
} else {
|
|
$strValue = fxUnescape($tabResults['fields'][$intCtr]['lab_default']);
|
|
if (isset($_SESSION['com_info'])) {
|
|
$strValue = str_replace('%user%', $_SESSION['com_info']['com_prenom'] . ' ' . $_SESSION['com_info']['com_nom'], $strValue);
|
|
|
|
} else {
|
|
$strValue = str_replace('%user%', $_SESSION['usa_info']['com_prenom'] . ' ' . $_SESSION['usa_info']['com_nom'], $strValue);
|
|
|
|
}
|
|
|
|
$strValue = str_replace('%ip%', $_SERVER['REMOTE_ADDR'], $strValue);
|
|
|
|
}
|
|
|
|
if ($blnInputGroup) {
|
|
?>
|
|
<div class="input-group"<?php if ($strInputGroupId != '') {
|
|
echo ' id="' . $strInputGroupId . '"';
|
|
} ?> data-target-input="nearest">
|
|
<?php
|
|
}
|
|
?>
|
|
<input type="text" class="form-control rounded-0"
|
|
id="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
name="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
value="<?php echo $strValue; ?>"<?php if (trim($tabResults['fields'][$intCtr]['for_maxlength']) > 0) { ?>
|
|
maxlength="<?php echo $tabResults['fields'][$intCtr]['for_maxlength'];
|
|
} ?>"<?php if ($blnInputGroup && $strInputGroupId != '') {
|
|
echo ' data-target="#' . $strInputGroupId . '"';
|
|
};
|
|
echo $mem_readonly; ?>>
|
|
<?php
|
|
if ($blnInputGroup) {
|
|
if ($strInputGroupIconAfter != '') {
|
|
?>
|
|
<div class="input-group-append rounded-0"<?php if ($strInputGroupId != '') {
|
|
echo ' data-target="#' . $strInputGroupId . '" data-toggle="datetimepicker"';
|
|
} ?>>
|
|
<span class="input-group-text rounded-0">
|
|
<?php echo $strInputGroupIconAfter; ?>
|
|
</span>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<?php
|
|
}
|
|
|
|
if ($tabResults['fields'][$intCtr]['for_type'] == 'autocomplete')
|
|
$tabAutocomplete[] = array('field' => $tabResults['fields'][$intCtr]['for_field'], 'result' => $tabResults['fields'][$intCtr]['for_result_field']);
|
|
break;
|
|
case 'color':
|
|
if ($strAction == 'mod') {
|
|
$strValue = fxUnescape($tabResults['data'][$tabResults['fields'][$intCtr]['for_field']]);
|
|
} else {
|
|
$strValue = fxUnescape($tabResults['fields'][$intCtr]['lab_default']);
|
|
$strValue = str_replace('%user%', $_SESSION['usa_info']['com_prenom'] . ' ' . $_SESSION['usa_info']['com_nom'], $strValue);
|
|
$strValue = str_replace('%ip%', $_SERVER['REMOTE_ADDR'], $strValue);
|
|
}
|
|
?>
|
|
<input type="color" class="form-control rounded-0" data-allowEmpty="true"
|
|
id="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
name="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
value="<?php echo $strValue; ?>"<?php if (trim($tabResults['fields'][$intCtr]['for_maxlength']) > 0) { ?>
|
|
maxlength="<?php echo $tabResults['fields'][$intCtr]['for_maxlength'];
|
|
} ?>">
|
|
<?php
|
|
break;
|
|
case 'hidden':
|
|
if ($strAction == 'add' || $strAction == 'add_batch') {
|
|
|
|
$tabResults['data'][$tabResults['fields'][$intCtr]['for_field']] = $_GET['id'];
|
|
}
|
|
// HARDCODE eve_id pour épreuves_prix
|
|
if ($tabResults['menu']['men_id'] == 85 && $tabResults['fields'][$intCtr]['for_field'] == 'eve_id') {
|
|
//$tabResults['data'][$tabResults['fields'][$intCtr]['for_field']] = fxGetEvenement($_GET['id']);
|
|
?>
|
|
<input type="hidden"
|
|
id="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
name="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
value="<?php if ($strAction == 'mod') {
|
|
echo fxUnescape($tabResults['data'][$tabResults['fields'][$intCtr]['for_field']]);
|
|
} else {
|
|
echo fxGetEvenement($_GET['id']);
|
|
} ?>"/>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<input type="hidden"
|
|
id="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
name="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
value="<?php if ($strAction == 'mod') {
|
|
echo fxUnescape($tabResults['data'][$tabResults['fields'][$intCtr]['for_field']]);
|
|
} else {
|
|
echo $_GET['id'];
|
|
} ?>">
|
|
<?php
|
|
}
|
|
break;
|
|
case 'textarea':
|
|
?>
|
|
<textarea
|
|
class="form-control rounded-0<?php if ($tabResults['fields'][$intCtr]['for_tinymce'] == 1) { ?> tinymce<?php } ?>"
|
|
id="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
name="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
cols="<?php echo $tabResults['fields'][$intCtr]['for_minlength']; ?>"><?php if ($strAction == 'mod') {
|
|
echo fxUnescape($tabResults['data'][$tabResults['fields'][$intCtr]['for_field']]);
|
|
} ?></textarea>
|
|
<?php
|
|
break;
|
|
case 'file':
|
|
if ($strAction == 'mod') {
|
|
$tabPath = $GLOBALS[fxUnescape($tabResults['fields'][$intCtr]['for_file_path'])];
|
|
|
|
if ($tabResults['fields'][$intCtr]['for_image_thumb'] == 1 && $tabResults['data'][$tabResults['fields'][$intCtr]['for_field'] . '_big'] != '' && $tabResults['data'][$tabResults['fields'][$intCtr]['for_field'] . '_small'] != '') {
|
|
?>
|
|
<p>
|
|
<a href="<?php echo $tabPath['physical'] . fxUnescape($tabResults['data'][$tabResults['fields'][$intCtr]['for_field'] . '_big']); ?>"
|
|
target="_blank"><img
|
|
src="<?php echo $tabPath['physical'] . fxUnescape($tabResults['data'][$tabResults['fields'][$intCtr]['for_field'] . '_small']); ?>"
|
|
alt="" style="max-width: 800px;"/></a></p>
|
|
<br>
|
|
<label class="form"><span></span></label>
|
|
<p>
|
|
<button class="btn_delete_file btn btn-danger rounded-0"
|
|
type="button" id="btn_delete_file_<?php echo $intFile; ?>"
|
|
data-men_id="<?php echo urlencode(base64_encode($tabResults['menu']['men_id'])); ?>"
|
|
data-key="<?php echo $_GET['id']; ?>"
|
|
data-file="<?php echo $intFile; ?>"
|
|
data-title="<?php echo fxUnescape($tabResults['fields'][$intCtr]['lab_texte_form']); ?>">
|
|
Effacer <?php echo fxUnescape($tabResults['fields'][$intCtr]['lab_texte_form']); ?></button>
|
|
</p>
|
|
<?php
|
|
} elseif ($tabResults['fields'][$intCtr]['for_image_thumb'] == 0 && $tabResults['data'][$tabResults['fields'][$intCtr]['for_field']] != '') {
|
|
if ($tabResults['fields'][$intCtr]['for_validation'] == 'image') {
|
|
?>
|
|
<p>
|
|
<img src="<?php echo $tabPath['physical'] . fxUnescape($tabResults['data'][$tabResults['fields'][$intCtr]['for_field']]); ?>"
|
|
alt="" style="max-width: 800px;"/></p>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<p>
|
|
<a href="<?php echo $tabPath['physical'] . fxUnescape($tabResults['data'][$tabResults['fields'][$intCtr]['for_field']]); ?>"
|
|
target="_blank"><?php echo fxUnescape($tabResults['data'][$tabResults['fields'][$intCtr]['for_field']]); ?></a>
|
|
</p>
|
|
<?php
|
|
}
|
|
?>
|
|
<br>
|
|
<label class="form"><span></span></label>
|
|
<p>
|
|
<button class="btn_delete_file btn btn-danger rounded-0"
|
|
type="button" id="btn_delete_file_<?php echo $intFile; ?>"
|
|
data-men_id="<?php echo urlencode(base64_encode($tabResults['menu']['men_id'])); ?>"
|
|
data-key="<?php echo $_GET['id']; ?>"
|
|
data-file="<?php echo $intFile; ?>"
|
|
data-title="<?php echo fxUnescape($tabResults['fields'][$intCtr]['lab_texte_form']); ?>">
|
|
Effacer <?php echo fxUnescape($tabResults['fields'][$intCtr]['lab_texte_form']); ?></button>
|
|
</p>
|
|
<?php
|
|
} else {
|
|
?>
|
|
<input class="form-control rounded-0" type="file"
|
|
id="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
name="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
size="<?php echo $tabResults['fields'][$intCtr]['for_size']; ?>"
|
|
maxlength="<?php echo $tabResults['fields'][$intCtr]['for_maxlength']; ?>"/>
|
|
<?php
|
|
}
|
|
|
|
$intFile++;
|
|
} else {
|
|
?>
|
|
<input class="form-control rounded-0" type="file"
|
|
id="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
name="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
size="<?php echo $tabResults['fields'][$intCtr]['for_size']; ?>"
|
|
maxlength="<?php echo $tabResults['fields'][$intCtr]['for_maxlength']; ?>"/>
|
|
<?php
|
|
}
|
|
break;
|
|
case 'list':
|
|
case 'select':
|
|
// con-258
|
|
$tabListItems = (array)null;
|
|
|
|
if (trim($tabResults['fields'][$intCtr]['lab_data_type']) == 'json')
|
|
$tabListItems = json_decode($tabResults['fields'][$intCtr]['lab_list'], true);
|
|
else {
|
|
if (trim($tabResults['fields'][$intCtr]['for_influenced_by']) != '') {
|
|
$strInfluencedBy = $tabResults['fields'][$intCtr]['for_influenced_by'];
|
|
$strReplaceValue = $tabResults['data'][$strInfluencedBy];
|
|
$tabResults['fields'][$intCtr]['lab_list'] = str_replace('%' . trim($strInfluencedBy) . '%', intval($strReplaceValue), $tabResults['fields'][$intCtr]['lab_list']);
|
|
}
|
|
|
|
if (strstr($tabResults['fields'][$intCtr]['lab_list'], '%eve_id%') && !empty($_GET['eve_id'])) {
|
|
$tabResults['fields'][$intCtr]['lab_list'] = str_replace('%eve_id%', intval($_GET['eve_id']), $tabResults['fields'][$intCtr]['lab_list']);
|
|
|
|
}
|
|
|
|
if (trim($tabResults['fields'][$intCtr]['for_influences_on']) != '') {
|
|
$arrInfluencesOn[] = array(
|
|
'key' => trim($tabResults['fields'][$intCtr]['for_field']),
|
|
'men_id' => intval($tabResults['menu']['men_id']),
|
|
'influences_on' => trim($tabResults['fields'][$intCtr]['for_influences_on'])
|
|
);
|
|
|
|
if ($strAction == 'add' || $strAction == 'add_batch') {
|
|
$tabResults['data'][$tabResults['fields'][$intCtr]['for_field']] = trim($tabResults['fields'][$intCtr]['lab_default']);
|
|
}
|
|
}
|
|
|
|
if (strstr($tabResults['fields'][$intCtr]['lab_list'], '%id%') && !empty($_GET['id'])) {
|
|
$tabResults['fields'][$intCtr]['lab_list'] = str_replace('%id%', intval($_GET['id']), $tabResults['fields'][$intCtr]['lab_list']);
|
|
}
|
|
|
|
$recListItems = $objDatabase->fxGetResults($tabResults['fields'][$intCtr]['lab_list']);
|
|
|
|
if ($recListItems != null) {
|
|
foreach ($recListItems as $tabResultat) {
|
|
$tabKeys = array_keys($tabResultat);
|
|
$tabListItems[$tabResultat[$tabKeys[1]]] = fxUnescape($tabResultat[$tabKeys[0]]);
|
|
}
|
|
} else {
|
|
$recListItems = array();
|
|
}
|
|
}
|
|
if ($mem_readonly_total == 1) {
|
|
$mem_readonly = " disabled ";
|
|
} else {
|
|
$mem_readonly = "";
|
|
}
|
|
?>
|
|
<select <?php echo($mem_readonly); ?> class="form-control rounded-0 selectpicker show-tick "
|
|
id="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
name="<?php echo $tabResults['fields'][$intCtr]['for_field'];
|
|
if (intval($tabResults['fields'][$intCtr]['for_multiple']) == 1) { ?>[]<?php } ?>"
|
|
data-live-search="true"<?php if (intval($tabResults['fields'][$intCtr]['for_multiple']) == 1) { ?> multiple data-selected-text-format="count" data-actions-box="true"<?php } ?>>
|
|
<?php
|
|
$arrValues = explode(',', $tabResults['data'][$tabResults['fields'][$intCtr]['for_field']]);
|
|
foreach ($tabListItems as $strLabel => $strValue) {
|
|
?>
|
|
<option value="<?php echo fxUnescape($strValue); ?>"<?php if ((($strAction == 'add' || $strAction == 'add_batch') && $tabResults['fields'][$intCtr]['lab_default'] == $strValue) || ($strAction == 'mod' && in_array($strValue, $arrValues))) { ?> selected="selected"<?php } ?>><?php echo fxUnescape($strLabel); ?></option>
|
|
<?php
|
|
}
|
|
?>
|
|
</select>
|
|
<?php
|
|
break;
|
|
case 'radio':
|
|
if ($mem_readonly_total == 1) {
|
|
$mem_readonly = " disabled ";
|
|
} else {
|
|
$mem_readonly = "";
|
|
}
|
|
if ($tabResults['fields'][$intCtr]['for_yesno'] == 1) {
|
|
?>
|
|
<div>
|
|
<label class="radio-inline">
|
|
<input type="radio"
|
|
name="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
value="1"
|
|
|
|
<?php
|
|
echo($mem_readonly);
|
|
if (($strAction == 'mod' && $tabResults['data'][$tabResults['fields'][$intCtr]['for_field']] == 1) || (($strAction == 'add' || $strAction == 'add_batch') && intval($tabResults['fields'][$intCtr]['lab_default']) === 1)) { ?>checked<?php } ?>>
|
|
Oui
|
|
</label>
|
|
<label class="radio-inline">
|
|
<input type="radio"
|
|
name="<?php echo $tabResults['fields'][$intCtr]['for_field']; ?>"
|
|
value="0"
|
|
<?php
|
|
echo($mem_readonly);
|
|
if ($strAction == 'mod' && $tabResults['data'][$tabResults['fields'][$intCtr]['for_field']] == 0 || (($strAction == 'add' || $strAction == 'add_batch') && intval($tabResults['fields'][$intCtr]['lab_default']) === 0)) { ?>checked<?php } ?>>
|
|
Non
|
|
</label>
|
|
</div>
|
|
<?php
|
|
}
|
|
break;
|
|
case 'static':
|
|
?>
|
|
<p class="form-control-static">
|
|
<?php
|
|
if ($tabResults['fields'][$intCtr]['for_datetime'] == 1) {
|
|
if ($tabResults['data'][$tabResults['fields'][$intCtr]['for_field']] == '' || $tabResults['data'][$tabResults['fields'][$intCtr]['for_field']] == '0000-00-00 00:00:00')
|
|
echo 'Jamais';
|
|
else
|
|
echo fxShowDate($tabResults['data'][$tabResults['fields'][$intCtr]['for_field']], $strLangue) . ' @ ' . fxShowTime($tabResults['data'][$tabResults['fields'][$intCtr]['for_field']]);
|
|
} elseif ($tabResults['fields'][$intCtr]['for_date'] == 1)
|
|
echo fxShowDate($tabResults['data'][$tabResults['fields'][$intCtr]['for_field']], $strLangue);
|
|
else
|
|
echo fxUnescape($tabResults['data'][$tabResults['fields'][$intCtr]['for_field']]);
|
|
?>
|
|
</p>
|
|
<?php
|
|
break;
|
|
|
|
default:
|
|
}
|
|
?>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<?php
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
</div>
|
|
<?php
|
|
// ajout de la section sycro de compte entre prod et preprod
|
|
|
|
if ($strAction == 'mod') {
|
|
if ($intMenuActuel == 2 ) {
|
|
$blnCompteShowAccesSections = true;
|
|
}
|
|
if ($intMenuActuel == 2 && $vblnEnvironementDev == false) {
|
|
?>
|
|
<h1 id="list_compte">Syncro des compte</h1>
|
|
<input type="hidden" name="avant_com_preprod"
|
|
value="<?php echo($arrDataActuel['com_preprod']); ?>">
|
|
|
|
<?php
|
|
$sqlCourriel = "SELECT * FROM inscriptions_comptes WHERE com_login = '" . $arrDataActuel['com_courriel'] . "'";
|
|
$infoCompte = $objDatabasePreProd->fxGetRow($sqlCourriel);
|
|
$_post['avant_com_preprod'] = $arrDataActuel['com_preprod'];
|
|
|
|
|
|
if ($infoCompte !== null) {
|
|
|
|
?>
|
|
|
|
|
|
<div class="form-group row">
|
|
<label class="control-label col-sm-3">bouton changement test à prod :</label>
|
|
<div class="col-sm-9 col-lg-7">
|
|
<div>
|
|
<label class="radio-inline">
|
|
<input type="radio"
|
|
name="com_preprod"
|
|
value="1"
|
|
<?php if ($arrDataActuel['com_preprod'] == 1) { ?>checked<?php } ?>>
|
|
Oui
|
|
</label>
|
|
<label class="radio-inline">
|
|
<input type="radio"
|
|
name="com_preprod"
|
|
value="0"
|
|
<?php if ($arrDataActuel['com_preprod'] == 0) { ?>checked<?php } ?>>
|
|
Non
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
echo('effacer le compte en test (preprod)');
|
|
?>
|
|
<button type="submit" class="btn btn-success rounded-0" id="btn_copie_compte"
|
|
name="btn_copie_compte"><i
|
|
class="fa fa-check" aria-hidden="true"></i> Copier le compte de prod a test
|
|
</button>
|
|
|
|
<?php
|
|
} else {
|
|
echo('pas de compte en preprod');
|
|
?>
|
|
<button type="submit" class="btn btn-success rounded-0" id="btn_copie_compte"
|
|
name="btn_copie_compte"><i
|
|
class="fa fa-check" aria-hidden="true"></i> Copier le compte de prod a test
|
|
</button>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
$sqlCourriel = "SELECT * FROM inscriptions_comptes WHERE com_login = '" . $arrDataActuel['com_courriel'] . "'";
|
|
$infoCompteprod = $objDatabaseProd->fxGetRow($sqlCourriel);
|
|
// echo('Prod');
|
|
// print_rsl($infoCompte);
|
|
|
|
$sqlCourriel = "SELECT * FROM inscriptions_comptes WHERE com_login = '" . $arrDataActuel['com_courriel'] . "'";
|
|
$infoCompte = $objDatabasePreProd->fxGetRow($sqlCourriel);
|
|
if ($infoCompte === null) {
|
|
}
|
|
|
|
// echo('PreProd');
|
|
// print_rsl($infoCompte);
|
|
|
|
// print_rsl($arrDataActuel);
|
|
}
|
|
}
|
|
?>
|
|
<br><hr><br>
|
|
<div class="form-group row">
|
|
<div class="col-sm-9 col-lg-7 offset-sm-3">
|
|
<?php
|
|
if ($strAction == 'mod') {
|
|
if ($intMenuActuel == 246 && $vblnEnvironementDev == false) {
|
|
?>
|
|
|
|
|
|
<!-- Bouton Annuler -->
|
|
<a class="btn btn-success rounded-0" href="?t=MjQ2&promoteur_eve_id">
|
|
<i class="fa fa-times" aria-hidden="true"></i> Retour
|
|
</a>
|
|
<?php
|
|
|
|
}else {
|
|
?>
|
|
<button type="submit" class="btn btn-success rounded-0" id="btn_save_bot"
|
|
name="btn_save_bot"><i class="fa fa-check" aria-hidden="true"></i> Enregistrer
|
|
</button>
|
|
<a class="btn btn-danger rounded-0" href="<?php echo $strLinkRetourannuler; ?>"><i
|
|
class="fa fa-times"
|
|
aria-hidden="true"></i> Annuler</a>
|
|
|
|
<?php
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
?>
|
|
<!-- Bouton Ajouter standard -->
|
|
<button type="submit" class="btn btn-success rounded-0" id="btn_add_bot" name="btn_add_bot">
|
|
<i class="fa fa-check" aria-hidden="true"></i> <?php afficheTexte('ajouter'); ?>
|
|
</button>
|
|
<?php
|
|
if ($intMenuActuel == 246){ ?>
|
|
<!-- Champ pour la quantité -->
|
|
<input type="number"
|
|
class="form-control rounded-0 ms-3 d-inline-block"
|
|
id="multiple"
|
|
name="multiple"
|
|
value="1"
|
|
min="1"
|
|
style="width: 80px;"
|
|
aria-invalid="false"
|
|
autocomplete="off"
|
|
title="Quantité"
|
|
>
|
|
|
|
<!-- Bouton Ajouter plusieurs avec un attribut pour inclure la quantité -->
|
|
<button
|
|
type="submit"
|
|
class="btn btn-success rounded-0 ms-2 d-inline-block"
|
|
id="btn_add_multiple"
|
|
name="btn_add_multiple"
|
|
data-quantity="1"
|
|
>
|
|
<i class="fa fa-check" aria-hidden="true"></i> <?php afficheTexte('ajouter'); ?>
|
|
<span id="quantity_display">1</span> <?php afficheTexte('aléatoire'); ?>
|
|
</button>
|
|
<?php }
|
|
?>
|
|
<!-- Bouton Annuler -->
|
|
<a class="btn btn-danger rounded-0 ms-3" href="?t=MjQ2&promoteur_eve_id=">
|
|
<i class="fa fa-times" aria-hidden="true"></i> Annuler
|
|
</a>
|
|
|
|
|
|
<script>
|
|
// Mettre à jour la quantité dans le bouton en temps réel
|
|
const quantityInput = document.getElementById('multiple');
|
|
const addMultipleButton = document.getElementById('btn_add_multiple');
|
|
const quantityDisplay = document.getElementById('quantity_display');
|
|
|
|
quantityInput.addEventListener('input', function () {
|
|
const quantity = quantityInput.value || 1; // Définit 1 par défaut si l'entrée est vide
|
|
addMultipleButton.setAttribute('data-quantity', quantity);
|
|
quantityDisplay.textContent = quantity;
|
|
});
|
|
</script>
|
|
<?php
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<?php
|
|
|
|
if (!empty($blnCompteShowAccesSections)) {
|
|
?>
|
|
<hr class="my-4">
|
|
<h2 id="promoteur-legacy" class="h4">Promoteur classique (ancien système)</h2>
|
|
<p class="text-muted small mb-2">
|
|
Pages promoteur desktop legacy — sera retiré après migration vers les kits.
|
|
</p>
|
|
<?php
|
|
$strLegacyPromoteur = trim((string)($arrDataActuel['com_eve_promoteur'] ?? ''));
|
|
if ($strLegacyPromoteur !== '') {
|
|
fxgetevenementpromoteurs($strLegacyPromoteur, $arrDataActuel['com_id']);
|
|
} else {
|
|
?>
|
|
<p class="text-muted small mb-1">Aucun événement.</p>
|
|
<div id="pick-evenement">
|
|
<input id="pp-evenement" type="text" class="form-control form-control-sm" placeholder="Ajouter un événement (promoteur classique)…">
|
|
<div id="pp-results-eve" class="list-group d-none"></div>
|
|
</div>
|
|
<?php
|
|
}
|
|
|
|
require_once(dirname(__FILE__) . '/../../php/inc_fx_eve_acces.php');
|
|
fxEveAccesShowCompteForm($arrDataActuel['com_id']);
|
|
}
|
|
?>
|
|
|
|
</form>
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(function () {
|
|
validator = $("#frm_form").validate({
|
|
<?php
|
|
|
|
foreach ($tabValidation as $field => $items) {
|
|
if (fxcountpatch($items['rules']) > 0) {
|
|
$tabRules[] = $field . ": {" . implode(',', $items['rules']) . "}";
|
|
$tabMessages[] = $field . ": {" . implode(',', $items['messages']) . "}";
|
|
}
|
|
}
|
|
?>
|
|
rules: {
|
|
<?php echo implode(',', $tabRules); ?>
|
|
},
|
|
messages: {
|
|
<?php echo implode(',', $tabMessages); ?>
|
|
}
|
|
});
|
|
<?php
|
|
if (fxcountpatch($tabDates) > 0) {
|
|
foreach ($tabDates as $calendrier) {
|
|
$strField = str_replace('cal-', '', $calendrier);
|
|
?>
|
|
$('#<?php echo $calendrier; ?>').datetimepicker({
|
|
format: 'YYYY-MM-DD',
|
|
locale: '<?php echo $strLangue; ?>-ca'
|
|
});
|
|
<?php
|
|
}
|
|
}
|
|
if (fxcountpatch($arrClocks) > 0) {
|
|
foreach ($arrClocks as $clock) {
|
|
$strField = str_replace('clk-', '', $clock);
|
|
?>
|
|
$('#<?php echo $clock; ?>').datetimepicker({
|
|
format: 'HH:mm',
|
|
locale: '<?php echo $strLangue; ?>-ca'
|
|
});
|
|
<?php
|
|
}
|
|
}
|
|
|
|
if (fxcountpatch($tabAutocomplete) > 0) {
|
|
foreach ($tabAutocomplete as $tabItem) {
|
|
?>
|
|
$("#<?php echo $tabItem['field']; ?>").autocomplete({
|
|
source: "ajax_autocomplete.php?t=<?php echo fxUnescape($tabResults['menu']['men_id']); ?>&f=<?php echo $tabItem['field']; ?>",
|
|
delay: 500,
|
|
minLength: 3,
|
|
select: function (event, ui) {
|
|
$("#<?php echo $tabItem['result']; ?>").val(ui.item.id);
|
|
}
|
|
});
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
$('.btn_delete_file').click(function () {
|
|
var $file = $(this).data('file');
|
|
var $title = $(this).data('title');
|
|
var $men_id = $(this).data('men_id');
|
|
var $key = $(this).data('key');
|
|
var $preloader = $('#preloader');
|
|
|
|
bootbox.confirm({
|
|
title: "EFFACER",
|
|
message: "Êtes-vous certain de vouloir supprimer " + $title + " ?",
|
|
buttons: {
|
|
confirm: {
|
|
label: 'Oui',
|
|
className: 'btn btn-success rounded-0'
|
|
},
|
|
cancel: {
|
|
label: 'Non',
|
|
className: 'btn btn-danger rounded-0'
|
|
}
|
|
},
|
|
callback: function (result) {
|
|
if (result === true) {
|
|
$preloader.show();
|
|
$.post('<?php echo $vDomaine; ?>/superadm/enregistrer.php', 'action=delete_file&file=' + $file + '&men_id=' + $men_id + '&key=' + $key, function ($resultajax) {
|
|
$preloader.fadeOut();
|
|
if ($resultajax.state == 'success') {
|
|
bootbox.alert({
|
|
title: "Résultat",
|
|
message: $resultajax.message,
|
|
onHidden: function () {
|
|
window.location.reload();
|
|
},
|
|
callback: function () { /* your callback code */
|
|
}
|
|
});
|
|
} else {
|
|
bootbox.alert({
|
|
title: "Résultat",
|
|
message: $resultajax.message,
|
|
callback: function () { /* your callback code */
|
|
}
|
|
});
|
|
}
|
|
}, 'json');
|
|
}
|
|
}
|
|
});
|
|
});
|
|
<?php
|
|
if (!empty($arrInfluencesOn)) {
|
|
foreach ($arrInfluencesOn as $arrInput) {
|
|
?>
|
|
$("#<?php echo $arrInput['key']; ?>").change(function () {
|
|
var $preloader = $('#preloader');
|
|
$preloader.show();
|
|
|
|
var $intValue = $(this).val();
|
|
var $intMenu = '<?php echo intval($arrInput['men_id']); ?>';
|
|
var $strInfluenced = '<?php echo urldecode(fxUnescape($arrInput['influences_on'])); ?>';
|
|
|
|
$.post('<?php echo $vDomaine; ?>/superadm/enregistrer.php', 'action=influences_on&key=' + '<?php echo $arrInput['key']; ?>' + '&value=' + $intValue + '&men_id=' + $intMenu + '&influenced=' + $strInfluenced, function ($arrResult) {
|
|
if ($arrResult.state == 'success') {
|
|
var $data = $arrResult.data;
|
|
var $intLength = $data.length;
|
|
|
|
for (var $intCtr = 0; $intCtr < $intLength; $intCtr++) {
|
|
var $strIndex = $item[$intCtr][0];
|
|
var $objItem = $item[$intCtr][1];
|
|
|
|
alert($strIndex + ' ' + $objItem);
|
|
fxFillSelect($objItem, $strIndex);
|
|
}
|
|
} else {
|
|
alert($arrResult.state);
|
|
}
|
|
|
|
$preloader.fadeOut();
|
|
}, 'json');
|
|
});
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
});
|
|
|
|
function fxFillSelect($objItem, $strIndex) {
|
|
var $select = $("#" + $strIndex);
|
|
$select.empty();
|
|
var $intLength = $objItem.length;
|
|
|
|
for (var $intCtr = 0; $intCtr < $intLength; $intCtr++) {
|
|
var $intValue = $objItem[$intCtr]['epr_id'];
|
|
var $strLabel = $objItem[$intCtr]['epreuve'];
|
|
|
|
alert($intValue + '-' + $strLabel);
|
|
$select.append("<option value='" + $intValue + "'>" + $strLabel + "</option>");
|
|
}
|
|
}
|
|
</script>
|
|
<?php
|
|
|
|
if ($strAction == 'mod') {
|
|
|
|
?>
|
|
<p> </p>
|
|
<?php
|
|
|
|
for ($intCtr = 1; $intCtr <= fxcountpatch($tabSubTables); $intCtr++) {
|
|
|
|
$intMenu = urlencode(base64_encode(fxUnescape($tabSubTables[$intCtr]['men_id'])));
|
|
$tabResults = fxGetListData($intMenu, '', '', '', 1, $strLangue, $_GET['id']);
|
|
|
|
//MSIN-3872
|
|
//affiche le id de la section
|
|
//echo($tabSubTables[$intCtr]['men_id']);
|
|
fxShowList($tabResults, $intMenu, '', '', '', 1, $strLangue);
|
|
|
|
}
|
|
|
|
if ($blnIsEventModForm) {
|
|
?>
|
|
<h1 id="list_rapports">Rapport de l'événement</h1>
|
|
<ul class="nav nav-pills flex-column">
|
|
<?php
|
|
if ($arrDataActuel['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($_GET['id'])); ?>&lng=fr"
|
|
target="_blank"><i class="fa fa-clock-o" aria-hidden="true"></i> chrono + questions</a>
|
|
</li>
|
|
<?php
|
|
}
|
|
if ($arrDataActuel['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($_GET['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($_GET['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 ($arrDataActuel['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($_GET['id'])); ?>&lng=fr"
|
|
target="_blank"><i class="fa fa-money" aria-hidden="true"></i> Transactions-Finances
|
|
(capitaines seulement)</a>
|
|
</li>
|
|
<?php
|
|
}
|
|
?>
|
|
<li class="nav-item" role="presentation">
|
|
<a class="nav-link"
|
|
href="rapport_new.php?r=finances<?php if ($arrDataActuel['te_id'] == 13) { ?>-membership<?php } ?>&e=<?php echo urlencode(base64_encode($_GET['id'])); ?>&lng=fr"
|
|
target="_blank"><i class="fa fa-money" aria-hidden="true"></i> Transactions-Finances</a>
|
|
</li>
|
|
<li class="nav-item" role="presentation">
|
|
<a class="nav-link"
|
|
href="rapport_new.php?r=remboursements&e=<?php echo urlencode(base64_encode($_GET['id'])); ?>&lng=fr"
|
|
target="_blank"><i class="fa fa-money" aria-hidden="true"></i> Paiements</a>
|
|
</li>
|
|
<?php
|
|
$tabRapports = fxGetMenussuperadm(0, 0, 1, $_GET['id']);
|
|
for ($intCtr = 1; $intCtr <= fxcountpatch($tabRapports); $intCtr++) {
|
|
?>
|
|
<li class="nav-item" role="presentation">
|
|
<a class="nav-link"
|
|
href="<?php echo $vDomaine; ?>/superadm/index.php?t=<?php echo urlencode(base64_encode(fxUnescape($tabRapports[$intCtr]['men_id']))); ?>&a=report"
|
|
data-toto="<?php echo $intCtr; ?>" target="_blank">
|
|
<i class="fa fa-bar-chart mr-2"
|
|
aria-hidden="true"></i><?php echo fxUnescape($tabRapports[$intCtr]['men_nom']); ?>
|
|
</a>
|
|
</li>
|
|
<?php
|
|
}
|
|
?>
|
|
</ul>
|
|
<?php
|
|
}
|
|
|
|
}
|