Compare commits
112 Commits
master
...
fada0b7595
| Author | SHA1 | Date | |
|---|---|---|---|
| fada0b7595 | |||
| c534a7f846 | |||
| 5a3ce23a4b | |||
| 2ee8ee21d2 | |||
| 162052a2d1 | |||
| dabb797060 | |||
| 54d5363f09 | |||
| 85e030b93a | |||
| 1af97e7bb6 | |||
| 49d8bd23f4 | |||
| 2f699ed10d | |||
| a30f887489 | |||
| bdf5df0923 | |||
| 79bea0f9c7 | |||
| 088cfefee2 | |||
| 1baefb5f9c | |||
| 504f245eb5 | |||
| 088fd91617 | |||
| 238c09357e | |||
| c2b5b68568 | |||
| 789ce4947d | |||
| ef8304c617 | |||
| 3ed9f8e1fc | |||
| d9775ab315 | |||
| 8717130865 | |||
| 044aca6026 | |||
| 97e554fc20 | |||
| b5ca510f1f | |||
| 4d7ebeba85 | |||
| 382b83e690 | |||
| d016eacb57 | |||
| 8001389e39 | |||
| 0a944bd549 | |||
| 804a8bba18 | |||
| f6398c5035 | |||
| 025e145f6f | |||
| d006d75e53 | |||
| f83bc634a3 | |||
| b6f0b85140 | |||
| 517ff7dff6 | |||
| 9690f1884c | |||
| 35b5a2a605 | |||
| 27e1ce326c | |||
| ed1b5b5bd2 | |||
| f97ee2485a | |||
| 8cfd6f2e35 | |||
| 4cdd814945 | |||
| dab41e4857 | |||
| a762f5e599 | |||
| 9d0e14b74b | |||
| bd0da2651b | |||
| 889ceddf79 | |||
| bba116e7b6 | |||
| 525ddba26f | |||
| 5d35f38985 | |||
| b4864a2278 | |||
| a0d879502a | |||
| b2ed26a0aa | |||
| 7a1685e7fa | |||
| f7b1a18365 | |||
| 181b3f7d1c | |||
| 13d6f0752a | |||
| 98109fa0ab | |||
| 0293ce9099 | |||
| 36dc2f6ab0 | |||
| 2efb46fc59 | |||
| ac21e4aa81 | |||
| 509619520d | |||
| de7e5ebe7f | |||
| 891fed7c66 | |||
| f7f38fa752 | |||
| 7b87f18d1a | |||
| 4bd33db912 | |||
| 41ecfd0756 | |||
| afc71f0d58 | |||
| a5d85d28fb | |||
| f55852a14f | |||
| 3eff5b3c3f | |||
| 5c35dd3c1b | |||
| 1f5cbcc8ba | |||
| 175d7e11db | |||
| 95204ed0f5 | |||
| bb62c4c8b6 | |||
| 30bdcd1423 | |||
| 734f9a899d | |||
| 688f864c95 | |||
| 57ffc59524 | |||
| 714b0e11ed | |||
| b3ebb337c4 | |||
| cc897bcaaa | |||
| 722488006d | |||
| 182083b6ce | |||
| 0dae4463ca | |||
| 0cf57c81fd | |||
| 95e4e7bb1a | |||
| b9f1b7d550 | |||
| 3b5a82b01c | |||
| 623895be87 | |||
| 911fbc788c | |||
| 62a6f4b7f6 | |||
| 6d5dc43a5a | |||
| 93e198372d | |||
| 4d5836b0ad | |||
| fb2525dfa4 | |||
| db13175202 | |||
| 1d850d035b | |||
| 96f78ebcb0 | |||
| 5957c72884 | |||
| 16cda56e02 | |||
| 5fa2bc3db5 | |||
| f90347c5ba | |||
| 9b36733035 |
45
.gitignore
vendored
45
.gitignore
vendored
@ -51,22 +51,31 @@ Thumbs.db
|
||||
/data/
|
||||
/pdf/dons/
|
||||
/images/evenements/
|
||||
v3_ci4/writable/
|
||||
/v3_ci4/writable/
|
||||
*.log
|
||||
error_log
|
||||
webhooks/paypaldevclient/paypal_incoming.json
|
||||
webhooks/paypaldevtest/paypal_incoming.json
|
||||
preprod/dons
|
||||
preprod/images/evenements
|
||||
preprod/pdf/dons/
|
||||
preprod/pdf/questions/
|
||||
preprod/images/backgrounds/
|
||||
preprod/pdf/cartes/
|
||||
preprod/pdf/template_carte/
|
||||
preprod/pdf/template_dons/
|
||||
upload/
|
||||
test/
|
||||
tpp/
|
||||
qr/
|
||||
bp/
|
||||
fnq/
|
||||
/error_log
|
||||
/webhooks/paypaldevclient/paypal_incoming.json
|
||||
/webhooks/paypaldevtest/paypal_incoming.json
|
||||
/preprod/dons
|
||||
/preprod/images/evenements
|
||||
/preprod/pdf/dons/
|
||||
/preprod/pdf/questions/
|
||||
/preprod/images/backgrounds/
|
||||
/preprod/pdf/cartes/
|
||||
/preprod/pdf/template_carte/
|
||||
/preprod/pdf/template_dons/
|
||||
/upload/
|
||||
/test/
|
||||
/tpp/
|
||||
/qr/
|
||||
/bp/
|
||||
/fnq/
|
||||
/images/backgrounds/
|
||||
/pdf/questions/
|
||||
/preprod/images/backgrounds/
|
||||
/preprod/images/evenements/
|
||||
/v3_ci4/writable/debugbar/
|
||||
/webhooks/paypaldevclient/
|
||||
/webhooks/paypaldevtest/
|
||||
webhooks/paypal/
|
||||
paypal_advanced/error_log
|
||||
25
.vscode/settings.json
vendored
Normal file
25
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"sqltools.connections": [
|
||||
{
|
||||
"mysqlOptions": {
|
||||
"authProtocol": "default",
|
||||
"enableSsl": "Disabled"
|
||||
},
|
||||
"ssh": "Enabled",
|
||||
"previewLimit": 50,
|
||||
"server": "localhost",
|
||||
"port": 3306,
|
||||
"sshOptions": {
|
||||
"port": 7822,
|
||||
"host": "104.254.182.111",
|
||||
"username": "devinscription",
|
||||
"password": "M-G7+[NdA34H"
|
||||
},
|
||||
"driver": "MariaDB",
|
||||
"name": "astral(dev) ms1inscription",
|
||||
"username": "devinscription_bd",
|
||||
"password": "x$@_v0-l_I((",
|
||||
"database": "devinscription_preprod"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -394,7 +394,7 @@ if ($action == 'batch_go') {
|
||||
|
||||
$nextBib = fxGetNextAvailableBib($epr_id, $tabRanges);
|
||||
$simu = fxProcessBatchAssignments($epr_id, $participants, $tabRanges, 'simulation');
|
||||
$summary = fxBuildBatchSummaryFromRanges($tabRangesInfos, $participants);
|
||||
$summary = fxBuildBatchSummaryFromRanges($tabRangesInfos, $participants, $epr_id);
|
||||
|
||||
$info = "{$summary['nb_dispo']} disponibles / {$summary['nb_participants']} à assigner → manque {$summary['nb_manque']}";
|
||||
// =====================
|
||||
@ -451,7 +451,7 @@ if ($action == 'batch_apply') {
|
||||
return in_array((int)$r['epr_bib_id'], $ids);
|
||||
});
|
||||
|
||||
$summary = fxBuildBatchSummaryFromRanges($tabRangesInfos, $participants);
|
||||
$summary = fxBuildBatchSummaryFromRanges($tabRangesInfos, $participants, $epr_id);
|
||||
|
||||
$assigned = count($exec);
|
||||
$total = count($participants);
|
||||
@ -605,6 +605,45 @@ if ($action == 'save_team_mode') {
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
// MSIN-4379 — Étape 2
|
||||
// Endpoint AJAX : sauvegarde ou désactivation de la config auto (epr_bib_auto).
|
||||
// Paramètres : epr_id, active (0|1), ranges (JSON des epr_bib_id).
|
||||
// Prochain tour : étape 6–7 (assignation réelle à l'achat, sans passer par cet endpoint).
|
||||
if ($action == 'save_auto_config') {
|
||||
|
||||
$epr_id = intval($_POST['epr_id'] ?? 0);
|
||||
$active = intval($_POST['active'] ?? 1) === 1;
|
||||
$ranges = json_decode($_POST['ranges'] ?? '[]', true);
|
||||
|
||||
if ($epr_id <= 0) {
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => 'epr_id invalide'
|
||||
]);
|
||||
exit;
|
||||
}
|
||||
|
||||
$result = fxSaveBibAutoConfig($epr_id, is_array($ranges) ? $ranges : [], $active);
|
||||
|
||||
if (!$result['success']) {
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'message' => $result['message'] ?? 'Erreur'
|
||||
]);
|
||||
exit;
|
||||
}
|
||||
|
||||
$tabBibStats = fxInfosBibRange($epr_id);
|
||||
|
||||
echo json_encode([
|
||||
'success' => true,
|
||||
'auto_active' => !empty($result['auto_active']),
|
||||
'html' => renderBibRanges($tabBibStats, $epr_id, 'assign')
|
||||
]);
|
||||
exit;
|
||||
}
|
||||
|
||||
// =====================
|
||||
// ACTION INVALIDE
|
||||
// =====================
|
||||
|
||||
@ -713,8 +713,8 @@ require_once("inc_header.php");
|
||||
break;
|
||||
case 'compte_inc_tableau_dossards':
|
||||
$blnBoutonRetour = false;
|
||||
|
||||
include("inc_tableau_dossards.php");
|
||||
include("inc_tableau_dossards_v2.php");
|
||||
break;
|
||||
case 'compte_inc_tableau_epreuves':
|
||||
$blnBoutonRetour = false;
|
||||
|
||||
@ -1038,9 +1038,8 @@ ul.ms1-menu-compte li a:hover, ul.ms1-menu-compte li a:active {
|
||||
font-weight: 700;
|
||||
font-size: 15px;
|
||||
}
|
||||
.bib-view.team-mode .bib-view-header {
|
||||
grid-template-columns: 1.6fr 1fr 1fr 0.7fr;
|
||||
}
|
||||
|
||||
|
||||
.bib-view-header > div {
|
||||
padding: 14px 16px;
|
||||
}
|
||||
@ -1050,8 +1049,9 @@ ul.ms1-menu-compte li a:hover, ul.ms1-menu-compte li a:active {
|
||||
grid-template-columns: 1.6fr 1fr 0.7fr;
|
||||
border-top: 1px solid #e1e1e1;
|
||||
}
|
||||
.bib-view.team-mode .bib-view-row {
|
||||
grid-template-columns: 1.6fr 1fr 1fr 0.7fr;
|
||||
.bib-view.team-mode .bib-view-header,
|
||||
.bib-view.team-mode .bib-view-row{
|
||||
grid-template-columns: 1.5fr 1fr 0.7fr 1fr 0.8fr;
|
||||
}
|
||||
.bib-view-row:nth-of-type(odd) {
|
||||
background: #f3f3f3;
|
||||
@ -1101,6 +1101,30 @@ ul.ms1-menu-compte li a:hover, ul.ms1-menu-compte li a:active {
|
||||
display:none;
|
||||
}
|
||||
|
||||
/* MSIN-4379 — Étape 2 : styles du mode « auto » (masque batch, verrouille édition des plages).
|
||||
Prochain tour : étape 6–7 (logique PHP à l'achat, pas de CSS supplémentaire prévu). */
|
||||
.epr-row.auto-mode .btn-assign-batch,
|
||||
.epr-row.auto-mode .btn-reset,
|
||||
.epr-row.auto-mode .batch-config-container {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.epr-row.auto-mode .btn-auto {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.epr-row.auto-mode .btn-save-range,
|
||||
.epr-row.auto-mode .btn-delete-range,
|
||||
.epr-row.auto-mode .btn-add-range {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.epr-row.auto-mode .bib-start,
|
||||
.epr-row.auto-mode .bib-end {
|
||||
pointer-events: none;
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
.epr-row.batch-mode .btn-go-batch {
|
||||
display: none;
|
||||
}
|
||||
@ -1144,10 +1168,7 @@ ul.ms1-menu-compte li a:hover, ul.ms1-menu-compte li a:active {
|
||||
.bib-view-header > div{
|
||||
white-space:nowrap;
|
||||
}
|
||||
.bib-view.team-mode .bib-view-header,
|
||||
.bib-view.team-mode .bib-view-row{
|
||||
grid-template-columns: 1.5fr 1fr 1fr 0.8fr;
|
||||
}
|
||||
|
||||
.team-mode-title{
|
||||
font-size:11px;
|
||||
color:#666;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Date: 2020-05-26
|
||||
* Time: 16:51
|
||||
*/
|
||||
require_once("PHPColors/Color.php"); // inclure la class
|
||||
require_once(__DIR__ . '/../PHPColors/Color.php'); // inclure la class
|
||||
use Mexitek\PHPColors\Color; // utiliser le namepace de la class
|
||||
global $vDomaine, $vRepertoireFichiers;
|
||||
|
||||
|
||||
3
deploy_dev.php
Normal file
3
deploy_dev.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
echo shell_exec('/home/devinscription/deploy/deploy_dev.sh 2>&1');
|
||||
@ -113,9 +113,9 @@ if (isset($tabEvenement) && $tabEvenement['general']['eve_commanditaires'] == "1
|
||||
<div class="social">
|
||||
<a href="http://www.facebook.com/pages/Ms1timing/387594717971765" target="_blank"><i class="fa fa-facebook-square"></i></a>
|
||||
<a href="https://twitter.com/ms1timing" target="_blank"><i class="fa fa-twitter-square"></i></a>
|
||||
|
||||
<!--
|
||||
<a href="/index.php?cookies" ><img style="border: none;" width="30" src="<?php echo $vDomaine; ?>/images/cookie.png" alt="cookies" /></a>
|
||||
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -259,11 +259,11 @@ if (isset($tabEvenement) && $tabEvenement['general']['eve_commanditaires'] == "1
|
||||
|
||||
//MSIN-3860
|
||||
|
||||
if (!getCookie('cookiesAccepted') && !getCookie('cookiesRejected')) {
|
||||
// if (!getCookie('cookiesAccepted') && !getCookie('cookiesRejected')) {
|
||||
|
||||
|
||||
$('#cookieConsent').fadeIn();
|
||||
}
|
||||
// $('#cookieConsent').fadeIn();
|
||||
// }
|
||||
|
||||
// Handle the acceptance of cookies
|
||||
$('#acceptCookies').click(function() {
|
||||
|
||||
@ -1948,6 +1948,189 @@ if ($strLangue == 'fr') {
|
||||
|
||||
if (moduleBib) {
|
||||
|
||||
// ============================================================
|
||||
// MSIN-4379 — Étape 2 : assignation automatique (interface JS)
|
||||
// Prochain tour : étape 6 (fxAssignAutoBibForParticipant), étape 7 (fxMajCommande).
|
||||
// ============================================================
|
||||
|
||||
/** MSIN-4379 — Compte les séquences cochées et met à jour le texte d'aide. */
|
||||
function updateAutoSelectionInfo(row) {
|
||||
|
||||
if (!row) return;
|
||||
|
||||
let count = row.querySelectorAll('.batch-select-range:checked').length;
|
||||
let info = row.querySelector('.auto-info');
|
||||
|
||||
if (!info) return;
|
||||
|
||||
if (count === 0) {
|
||||
info.textContent = 'Sélectionnez au moins une séquence.';
|
||||
} else {
|
||||
info.textContent = count + ' séquence(s) sélectionnée(s).';
|
||||
}
|
||||
}
|
||||
|
||||
/** MSIN-4379 — Après sauvegarde : badge, libellé du bouton, bouton Désactiver. */
|
||||
function syncAutoUiState(row, isActive) {
|
||||
|
||||
if (!row) return;
|
||||
|
||||
let btnAuto = row.querySelector('.btn-auto');
|
||||
let badge = row.querySelector('.bib-auto-badge');
|
||||
let btnDesactiver = row.querySelector('.btn-desactiver-auto');
|
||||
|
||||
row.dataset.autoActive = isActive ? '1' : '0';
|
||||
|
||||
if (isActive) {
|
||||
row.classList.add('auto-enabled');
|
||||
} else {
|
||||
row.classList.remove('auto-enabled');
|
||||
}
|
||||
|
||||
if (btnAuto) {
|
||||
btnAuto.textContent = isActive ? 'Configurer automatique' : 'Activer automatique';
|
||||
btnAuto.classList.toggle('btn-success', isActive);
|
||||
btnAuto.classList.toggle('btn-secondary', !isActive);
|
||||
}
|
||||
|
||||
if (badge) {
|
||||
badge.style.display = isActive ? '' : 'none';
|
||||
}
|
||||
|
||||
if (btnDesactiver) {
|
||||
btnDesactiver.style.display = isActive ? '' : 'none';
|
||||
}
|
||||
}
|
||||
|
||||
/** MSIN-4379 — Quitte le mode édition auto sans sauver ; recharge les plages (mode assign). */
|
||||
function exitAutoMode(row) {
|
||||
|
||||
if (!row) return;
|
||||
|
||||
row.classList.remove('auto-mode');
|
||||
|
||||
let container = row.querySelector('.bib-container');
|
||||
if (container) {
|
||||
container.classList.remove('batch-mode');
|
||||
}
|
||||
|
||||
row.querySelectorAll('.bib-start, .bib-end').forEach(input => {
|
||||
input.removeAttribute('readonly');
|
||||
});
|
||||
|
||||
let autoConfig = row.querySelector('.auto-config-container');
|
||||
if (autoConfig) {
|
||||
autoConfig.style.display = 'none';
|
||||
}
|
||||
|
||||
let btnAuto = row.querySelector('.btn-auto');
|
||||
if (btnAuto) {
|
||||
btnAuto.style.display = '';
|
||||
}
|
||||
|
||||
let btnBatch = row.querySelector('.btn-assign-batch');
|
||||
if (btnBatch) {
|
||||
btnBatch.style.display = '';
|
||||
}
|
||||
|
||||
let btnReset = row.querySelector('.btn-reset');
|
||||
if (btnReset) {
|
||||
btnReset.style.display = '';
|
||||
}
|
||||
|
||||
fetch('/ajax_bib_range.php', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
body:
|
||||
'action=refresh_ranges'
|
||||
+ '&epr_id=' + encodeURIComponent(row.dataset.eprId)
|
||||
+ '&mode=assign'
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
|
||||
if (!data.success) return;
|
||||
|
||||
let bibContainer = row.querySelector('.epr-block:nth-child(2) .bib-container');
|
||||
if (bibContainer) {
|
||||
bibContainer.innerHTML = data.html;
|
||||
}
|
||||
|
||||
syncBibUiState(row);
|
||||
});
|
||||
}
|
||||
|
||||
/** MSIN-4379 — Ouvre le mode édition : checkboxes, bloc Accepter/Annuler, refresh mode=auto. */
|
||||
function enterAutoMode(row) {
|
||||
|
||||
if (!row) return;
|
||||
|
||||
if (row.classList.contains('batch-mode') || row.classList.contains('reset-mode')) {
|
||||
return;
|
||||
}
|
||||
|
||||
row.classList.add('auto-mode');
|
||||
|
||||
let container = row.querySelector('.bib-container');
|
||||
if (container) {
|
||||
container.classList.add('batch-mode');
|
||||
}
|
||||
|
||||
row.querySelectorAll('.bib-start, .bib-end').forEach(input => {
|
||||
input.setAttribute('readonly', true);
|
||||
});
|
||||
|
||||
let autoConfig = row.querySelector('.auto-config-container');
|
||||
if (autoConfig) {
|
||||
autoConfig.style.display = 'block';
|
||||
}
|
||||
|
||||
let btnAuto = row.querySelector('.btn-auto');
|
||||
if (btnAuto) {
|
||||
btnAuto.style.display = 'none';
|
||||
}
|
||||
|
||||
let btnBatch = row.querySelector('.btn-assign-batch');
|
||||
if (btnBatch) {
|
||||
btnBatch.style.display = 'none';
|
||||
}
|
||||
|
||||
let btnReset = row.querySelector('.btn-reset');
|
||||
if (btnReset) {
|
||||
btnReset.style.display = 'none';
|
||||
}
|
||||
|
||||
fetch('/ajax_bib_range.php', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
body:
|
||||
'action=refresh_ranges'
|
||||
+ '&epr_id=' + encodeURIComponent(row.dataset.eprId)
|
||||
+ '&mode=auto'
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
|
||||
if (!data.success) return;
|
||||
|
||||
let bibContainer = row.querySelector('.epr-block:nth-child(2) .bib-container');
|
||||
if (!bibContainer) return;
|
||||
|
||||
bibContainer.innerHTML = data.html;
|
||||
bibContainer.classList.add('batch-mode');
|
||||
|
||||
row.querySelectorAll('.bib-start, .bib-end').forEach(input => {
|
||||
input.setAttribute('readonly', true);
|
||||
});
|
||||
|
||||
updateAutoSelectionInfo(row);
|
||||
});
|
||||
}
|
||||
|
||||
function syncBibUiState(row) {
|
||||
|
||||
let avecEl = row.querySelector('.bib-avec');
|
||||
@ -2039,7 +2222,12 @@ if ($strLangue == 'fr') {
|
||||
if (totalEl) totalEl.textContent = data.info.total;
|
||||
if (avecEl) avecEl.textContent = data.info.avec_bib;
|
||||
syncBibUiState(row);
|
||||
let sansBib = parseInt(data.info.sans_bib || 0, 10);
|
||||
let sansBib = parseInt(
|
||||
(data.info.a_assigner !== undefined && data.info.a_assigner !== null)
|
||||
? data.info.a_assigner
|
||||
: (data.info.sans_bib || 0),
|
||||
10
|
||||
);
|
||||
if (isNaN(sansBib)) sansBib = 0;
|
||||
let isResetMode = row.dataset.mode === 'reset';
|
||||
let message = '';
|
||||
@ -2108,6 +2296,12 @@ if ($strLangue == 'fr') {
|
||||
let row = cb.closest('.epr-row');
|
||||
if (!row) return;
|
||||
|
||||
// MSIN-4379 — En mode auto, pas de logique batch (refresh_ranges / GO).
|
||||
if (row.classList.contains('auto-mode')) {
|
||||
updateAutoSelectionInfo(row);
|
||||
return;
|
||||
}
|
||||
|
||||
if (row.dataset.loading === '1') return;
|
||||
let existing = document.querySelector('.epr-row-view');
|
||||
if (existing) existing.remove();
|
||||
@ -2332,6 +2526,23 @@ if ($strLangue == 'fr') {
|
||||
|
||||
let container = btnView.closest('.epr-block');
|
||||
|
||||
// Vérifier si une vue est déjà ouverte
|
||||
let existing = document.querySelector('.epr-row-view');
|
||||
|
||||
// Toggle : si c'est le même œil qui a ouvert la vue, on la ferme et on s'arrête
|
||||
if (existing
|
||||
&& existing.dataset.eprId === epr_id
|
||||
&& existing.dataset.rangeId === range_id
|
||||
) {
|
||||
existing.remove();
|
||||
return;
|
||||
}
|
||||
|
||||
// Un autre œil a été cliqué : fermer la vue précédente avant d'ouvrir la nouvelle
|
||||
if (existing) {
|
||||
existing.remove();
|
||||
}
|
||||
|
||||
fetch('/ajax_bib_range.php', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@ -2360,14 +2571,17 @@ if ($strLangue == 'fr') {
|
||||
|
||||
let row = btnView.closest('.epr-row');
|
||||
|
||||
// 1. Supprimer toute vue existante
|
||||
let existing = document.querySelector('.epr-row-view');
|
||||
if (existing) {
|
||||
existing.remove();
|
||||
}
|
||||
|
||||
// 2. Injecter sous la bonne ligne
|
||||
// Injecter la nouvelle vue sous la ligne du bouton cliqué,
|
||||
// en mémorisant epr_id et range_id pour le toggle suivant
|
||||
row.insertAdjacentHTML('afterend', data.html);
|
||||
|
||||
// Stocker les identifiants sur la vue injectée pour pouvoir détecter
|
||||
// le 2e clic sur le même œil
|
||||
let newView = row.nextElementSibling;
|
||||
if (newView && newView.classList.contains('epr-row-view')) {
|
||||
newView.dataset.eprId = epr_id;
|
||||
newView.dataset.rangeId = range_id;
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
@ -2405,6 +2619,11 @@ if ($strLangue == 'fr') {
|
||||
let row = btnBatch.closest('.epr-row');
|
||||
if (!row) return;
|
||||
|
||||
// MSIN-4379 — Batch et auto sont mutuellement exclusifs.
|
||||
if (row.classList.contains('auto-mode')) {
|
||||
return;
|
||||
}
|
||||
|
||||
let container = row.querySelector('.bib-container');
|
||||
if (!container) return;
|
||||
|
||||
@ -2529,6 +2748,11 @@ if ($strLangue == 'fr') {
|
||||
let row = btnReset.closest('.epr-row');
|
||||
if (!row) return;
|
||||
|
||||
// MSIN-4379 — Reset et auto sont mutuellement exclusifs.
|
||||
if (row.classList.contains('auto-mode')) {
|
||||
return;
|
||||
}
|
||||
|
||||
let container = row.querySelector('.bib-container');
|
||||
if (!container) return;
|
||||
|
||||
@ -2830,6 +3054,125 @@ if ($strLangue == 'fr') {
|
||||
return;
|
||||
}
|
||||
|
||||
// =====================
|
||||
// MSIN-4379 — Étape 2 : AUTO DOSSARD (clics Accepter / Annuler / Désactiver / Activer)
|
||||
// Prochain tour : étape 6–7 (assignation PHP à l'inscription).
|
||||
// =====================
|
||||
let btnAccepterAuto = e.target.closest('.btn-accepter-auto');
|
||||
if (btnAccepterAuto) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
let row = btnAccepterAuto.closest('.epr-row');
|
||||
if (!row) return;
|
||||
|
||||
let selected = [];
|
||||
|
||||
row.querySelectorAll('.batch-select-range:checked').forEach(cb => {
|
||||
selected.push(cb.dataset.rangeId);
|
||||
});
|
||||
|
||||
if (selected.length === 0) {
|
||||
alert('Sélectionnez au moins une séquence');
|
||||
return;
|
||||
}
|
||||
|
||||
// MSIN-4379 — Persiste epr_bib_auto=1 sur les séquences choisies (save_auto_config).
|
||||
fetch('/ajax_bib_range.php', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
body:
|
||||
'action=save_auto_config'
|
||||
+ '&epr_id=' + encodeURIComponent(row.dataset.eprId)
|
||||
+ '&active=1'
|
||||
+ '&ranges=' + encodeURIComponent(JSON.stringify(selected))
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
|
||||
if (!data.success) {
|
||||
alert(data.message || 'Erreur');
|
||||
return;
|
||||
}
|
||||
|
||||
syncAutoUiState(row, true);
|
||||
exitAutoMode(row);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// MSIN-4379 — Annule l'édition sans appeler save_auto_config.
|
||||
let btnAnnulerAuto = e.target.closest('.btn-annuler-auto');
|
||||
if (btnAnnulerAuto) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
let row = btnAnnulerAuto.closest('.epr-row');
|
||||
if (!row) return;
|
||||
|
||||
exitAutoMode(row);
|
||||
return;
|
||||
}
|
||||
|
||||
// MSIN-4379 — Désactive l'auto en base (active=0, toutes les séquences à 0).
|
||||
let btnDesactiverAuto = e.target.closest('.btn-desactiver-auto');
|
||||
if (btnDesactiverAuto) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
let row = btnDesactiverAuto.closest('.epr-row');
|
||||
if (!row) return;
|
||||
|
||||
if (!confirm('Désactiver l\'assignation automatique pour cette épreuve ?')) {
|
||||
return;
|
||||
}
|
||||
|
||||
fetch('/ajax_bib_range.php', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
body:
|
||||
'action=save_auto_config'
|
||||
+ '&epr_id=' + encodeURIComponent(row.dataset.eprId)
|
||||
+ '&active=0'
|
||||
+ '&ranges=' + encodeURIComponent('[]')
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
|
||||
if (!data.success) {
|
||||
alert(data.message || 'Erreur');
|
||||
return;
|
||||
}
|
||||
|
||||
syncAutoUiState(row, false);
|
||||
exitAutoMode(row);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// MSIN-4379 — Entrée dans le mode configuration auto.
|
||||
let btnAuto = e.target.closest('.btn-auto');
|
||||
if (btnAuto) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
let row = btnAuto.closest('.epr-row');
|
||||
if (!row) return;
|
||||
|
||||
if (row.classList.contains('batch-mode') || row.classList.contains('reset-mode')) {
|
||||
return;
|
||||
}
|
||||
|
||||
enterAutoMode(row);
|
||||
return;
|
||||
}
|
||||
|
||||
// =====================
|
||||
// CREATE
|
||||
// =====================
|
||||
|
||||
@ -65,9 +65,14 @@ if ($intEveId != 0) {
|
||||
<a class="nav-list" href="<?php echo $vDomaine . "/" . $strCode; ?>bib_assignment?a=show_bib_dupes&promoteur_eve_id=<?php echo urlencode(base64_encode($intEveId)); ?>"> <i class="fa fa-clone" aria-hidden="true"></i> <?php echo afficheTexte('tableau_dossards_doublons', 0) ;?>
|
||||
</a>
|
||||
</li> </ul>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
if (isset($_SESSION['usa_id'])) {
|
||||
fxShowBibTool4($strBibCode, $intEveId, $strLangue);
|
||||
}
|
||||
fxShowBibTool3($strBibCode, $intEveId, $strLangue);
|
||||
|
||||
?>
|
||||
|
||||
<a class="btn btn-primary rounded-pill" id="link_back" href="<?php echo $vDomaine . $strPage . "/inc_tableau_promoteur?promoteur_eve_id=" . urlencode(base64_encode($intEveId)); ?>">
|
||||
|
||||
@ -1,86 +0,0 @@
|
||||
|
||||
<?php
|
||||
|
||||
// MSIN-3880 nouveau tableau
|
||||
include_once("php/inc_fx_modifierinscriptions.php");
|
||||
include_once("php/inc_fx_memberships.php");
|
||||
include_once("php/inc_fx_promoteur.php");
|
||||
require_once('superadm/php/inc_manager.php');
|
||||
|
||||
global $objDatabase, $vDomaine, $strLangue;
|
||||
$intEveId = 0;
|
||||
$blnDon = false;
|
||||
|
||||
if ($strLangue == 'fr') {
|
||||
$strPage = '/compte';
|
||||
} else {
|
||||
$strPage = '/account';
|
||||
}
|
||||
if($strLangue == 'fr')
|
||||
$strCode = 'compte/';
|
||||
else
|
||||
$strCode = 'account/';
|
||||
|
||||
$strBibCode = $strCode;
|
||||
|
||||
if (!empty($_GET['code'])) {
|
||||
$code = $_GET['code'];
|
||||
} else {
|
||||
$code = 'bib_assignment';
|
||||
}
|
||||
|
||||
if (isset($_GET['promoteur_eve_id'])) {
|
||||
$intEveId = base64_decode(urldecode($_GET['promoteur_eve_id']));
|
||||
$arrEvenement = fxGetEvenementsId($intEveId);
|
||||
//$tabEvenement['general'] = $arrEvenement;
|
||||
}
|
||||
?>
|
||||
<a class="btn btn-primary rounded-pill" id="link_back" href="<?php echo $vDomaine . $strPage . "/inc_tableau_promoteur?promoteur_eve_id=" . urlencode(base64_encode($intEveId)); ?>">
|
||||
<i class="fa fa-chevron-left mr-2" aria-hidden="true"></i>
|
||||
<?php afficheTexte('promoteur_back'); ?>
|
||||
</a>
|
||||
<br> <br>
|
||||
<?php
|
||||
// recalculer les catégorie
|
||||
if (isset($_REQUEST['resetcategorie'])) {
|
||||
fxregles_niveau_updateall($intEveId);
|
||||
}
|
||||
// Annuler/retablir une inscriptions dans le tableau du promoteur
|
||||
if (isset($_POST['btn_cancel_event_promo'])) {
|
||||
$int_pec_id = $_POST['pec_id_original'];
|
||||
$int_epr_id = $_POST['epr_id'];
|
||||
|
||||
$tabEpreuve = fxGetEpreuve($int_epr_id);
|
||||
fxAnnulerRetablirInscription($tabEpreuve, $int_pec_id);
|
||||
}
|
||||
|
||||
if ($intEveId != 0) {
|
||||
$arrEvenement = fxGetEvenementsId($intEveId);
|
||||
$tabRapports = fxGetMenussuperadm(0, 0, 1, $intEveId);
|
||||
|
||||
|
||||
//$tabEvenement['general'] = $arrEvenement;
|
||||
?> <ul class="nav flex-column ms1-menu-compte">
|
||||
<li class="nav-item">
|
||||
<a class="nav-list" href="<?php echo $vDomaine . "/" . $strCode; ?>bib_assignment?a=show_bib_dupes&promoteur_eve_id=<?php echo urlencode(base64_encode($intEveId)); ?>"> <i class="fa fa-clone" aria-hidden="true"></i> <?php echo afficheTexte('tableau_dossards_doublons', 0) ;?>
|
||||
</a>
|
||||
</li> </ul>
|
||||
V2
|
||||
<?php
|
||||
|
||||
|
||||
fxShowBibTool4($strBibCode, $intEveId, $strLangue);
|
||||
|
||||
?>
|
||||
|
||||
<a class="btn btn-primary rounded-pill" id="link_back" href="<?php echo $vDomaine . $strPage . "/inc_tableau_promoteur?promoteur_eve_id=" . urlencode(base64_encode($intEveId)); ?>">
|
||||
<i class="fa fa-chevron-left mr-2" aria-hidden="true"></i>
|
||||
<?php afficheTexte('promoteur_back'); ?>
|
||||
</a>
|
||||
<?php
|
||||
} else {
|
||||
if ($strLangue == 'fr')
|
||||
echo "Une erreur quelconque est survenue.";
|
||||
else
|
||||
echo "A generic error occurred.";
|
||||
}
|
||||
@ -2,7 +2,9 @@
|
||||
require_once('php/inc_start_time.php');
|
||||
require_once('php/inc_fonctions.php');
|
||||
require_once('php/inc_fx_messages.php');
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
global $vPage, $vDomaine;
|
||||
$strLangue = 'fr';
|
||||
$strCode = "accueil";
|
||||
|
||||
13
min/.htaccess
Normal file
13
min/.htaccess
Normal file
@ -0,0 +1,13 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine on
|
||||
|
||||
# You may need RewriteBase on some servers
|
||||
#RewriteBase /min
|
||||
|
||||
# rewrite URLs like "/min/f=..." to "/min/?f=..."
|
||||
RewriteRule ^([bfg]=.*) index.php?$1 [L,NE]
|
||||
</IfModule>
|
||||
<IfModule mod_env.c>
|
||||
# In case AddOutputFilterByType has been added
|
||||
SetEnv no-gzip
|
||||
</IfModule>
|
||||
682
ms1_kc_set.php
Normal file
682
ms1_kc_set.php
Normal file
@ -0,0 +1,682 @@
|
||||
<?php
|
||||
/**
|
||||
* Outil temporaire : modifier key_chain_http pour un pk_key_chain.
|
||||
* Accès 1 : /ms1_kc_set.php?k=<KEYCHAIN_HTTP_EDIT_SECRET>
|
||||
* Accès 2 : compte connecté dont com_id est dans KEYCHAIN_HTTP_EDIT_ALLOWED_COM_IDS
|
||||
*/
|
||||
$blnNoMaintenance = true;
|
||||
session_start();
|
||||
|
||||
require_once __DIR__ . '/php/inc_fonctions.php';
|
||||
|
||||
header('X-Robots-Tag: noindex, nofollow');
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
|
||||
global $objDatabase, $vDomaine;
|
||||
|
||||
function kc_set_allowed_com_ids()
|
||||
{
|
||||
if (!defined('KEYCHAIN_HTTP_EDIT_ALLOWED_COM_IDS') || KEYCHAIN_HTTP_EDIT_ALLOWED_COM_IDS === '') {
|
||||
return [];
|
||||
}
|
||||
$arr = array_map('intval', explode(',', KEYCHAIN_HTTP_EDIT_ALLOWED_COM_IDS));
|
||||
return array_values(array_filter($arr, function ($id) {
|
||||
return $id > 0;
|
||||
}));
|
||||
}
|
||||
|
||||
function kc_set_com_id_authorized()
|
||||
{
|
||||
if (!isset($_SESSION['com_id']) || (int) $_SESSION['com_id'] <= 0) {
|
||||
return false;
|
||||
}
|
||||
return in_array((int) $_SESSION['com_id'], kc_set_allowed_com_ids(), true);
|
||||
}
|
||||
|
||||
$strSecret = isset($_GET['k']) ? (string) $_GET['k'] : '';
|
||||
$blnAuthSecret = ($strSecret !== '' && hash_equals(KEYCHAIN_HTTP_EDIT_SECRET, $strSecret));
|
||||
if ($blnAuthSecret) {
|
||||
$_SESSION['kc_edit_auth_key'] = 1;
|
||||
}
|
||||
$blnAuthUser = kc_set_com_id_authorized();
|
||||
$blnAuth = $blnAuthSecret || $blnAuthUser || !empty($_SESSION['kc_edit_auth_key']);
|
||||
|
||||
if (!$blnAuth) {
|
||||
if (!isset($_SESSION['com_id']) && kc_set_allowed_com_ids() !== []) {
|
||||
$_SESSION['redirect_after_login'] = $_SERVER['REQUEST_URI'];
|
||||
header('Location: ' . $vDomaine . '/compte');
|
||||
exit;
|
||||
}
|
||||
http_response_code(403);
|
||||
echo '<!DOCTYPE html><html lang="fr"><head><meta charset="UTF-8"><title>Accès refusé</title></head><body>';
|
||||
echo '<p>Accès refusé.</p>';
|
||||
if (kc_set_allowed_com_ids() !== []) {
|
||||
echo '<p><a href="' . htmlspecialchars($vDomaine . '/compte', ENT_QUOTES, 'UTF-8') . '">Se connecter</a></p>';
|
||||
}
|
||||
echo '</body></html>';
|
||||
exit;
|
||||
}
|
||||
|
||||
if (empty($_SESSION['kc_edit_csrf'])) {
|
||||
$_SESSION['kc_edit_csrf'] = bin2hex(random_bytes(16));
|
||||
}
|
||||
$strCsrf = $_SESSION['kc_edit_csrf'];
|
||||
$strBasePath = $_SERVER['PHP_SELF'];
|
||||
|
||||
function kc_set_page_url(array $params = [])
|
||||
{
|
||||
global $strBasePath;
|
||||
$query = $params;
|
||||
if (!empty($_SESSION['kc_edit_auth_key']) && !isset($query['k'])) {
|
||||
$query = array_merge(['k' => KEYCHAIN_HTTP_EDIT_SECRET], $query);
|
||||
}
|
||||
$qs = http_build_query($query);
|
||||
return $strBasePath . ($qs !== '' ? '?' . $qs : '');
|
||||
}
|
||||
|
||||
$strPageUrl = kc_set_page_url();
|
||||
$strBaseUrlHtml = htmlspecialchars($strPageUrl, ENT_QUOTES, 'UTF-8');
|
||||
$blnCanShareLink = !empty($_SESSION['kc_edit_auth_key']);
|
||||
$strShareUrl = '';
|
||||
if ($blnCanShareLink) {
|
||||
$scheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
|
||||
$strShareUrl = $scheme . '://' . $_SERVER['HTTP_HOST'] . kc_set_page_url(['k' => KEYCHAIN_HTTP_EDIT_SECRET]);
|
||||
}
|
||||
|
||||
$strUserName = '';
|
||||
if ($blnAuthUser && !empty($_SESSION['com_prenom'])) {
|
||||
$strUserName = trim((string) $_SESSION['com_prenom']);
|
||||
} elseif ($blnAuthUser && !empty($_SESSION['com_info']['com_prenom'])) {
|
||||
$strUserName = trim((string) $_SESSION['com_info']['com_prenom']);
|
||||
}
|
||||
|
||||
$strMessage = '';
|
||||
$strMessageClass = '';
|
||||
$intPk = 0;
|
||||
$strCurrentHttp = '';
|
||||
$blnShowUrlForm = false;
|
||||
$strVehiculeSaisi = '';
|
||||
|
||||
if (!empty($_GET['ok'])) {
|
||||
$strMessage = 'Le lien de votre code QR a été enregistré. Vous pouvez modifier un autre véhicule ci-dessous.';
|
||||
$strMessageClass = 'ok';
|
||||
}
|
||||
|
||||
function kc_set_parse_vehicule_no($input)
|
||||
{
|
||||
$input = trim((string) $input);
|
||||
if ($input === '' || !ctype_digit($input)) {
|
||||
return 0;
|
||||
}
|
||||
$no = intval($input);
|
||||
if ($no <= 0) {
|
||||
return 0;
|
||||
}
|
||||
return $no + KEYCHAIN_HTTP_EDIT_SHIFT;
|
||||
}
|
||||
|
||||
function kc_set_validate_url($url)
|
||||
{
|
||||
$url = trim($url);
|
||||
if ($url === '') {
|
||||
return false;
|
||||
}
|
||||
if (!filter_var($url, FILTER_VALIDATE_URL)) {
|
||||
return false;
|
||||
}
|
||||
$parts = parse_url($url);
|
||||
if (empty($parts['scheme']) || !in_array(strtolower($parts['scheme']), ['http', 'https'], true)) {
|
||||
return false;
|
||||
}
|
||||
return $url;
|
||||
}
|
||||
|
||||
function kc_set_save_lien_for_pk($intPk, $strVehiculeSaisi, $strNewHttp)
|
||||
{
|
||||
global $objDatabase, $strMessage, $strMessageClass, $strCurrentHttp, $blnShowUrlForm;
|
||||
|
||||
if ($strVehiculeSaisi !== '' && kc_set_parse_vehicule_no($strVehiculeSaisi) !== $intPk) {
|
||||
$intPk = 0;
|
||||
}
|
||||
if ($intPk <= 0) {
|
||||
$strMessage = 'Veuillez recommencer avec votre numéro de véhicule.';
|
||||
$strMessageClass = 'err';
|
||||
return false;
|
||||
}
|
||||
$sqlCheck = 'SELECT pk_key_chain FROM key_chain WHERE pk_key_chain = ' . $intPk;
|
||||
if ($objDatabase->fxGetRow($sqlCheck) === null) {
|
||||
$strMessage = 'Code QR introuvable. Vérifiez votre numéro de véhicule.';
|
||||
$strMessageClass = 'err';
|
||||
return false;
|
||||
}
|
||||
$sqlUpdate = "UPDATE key_chain SET key_chain_http = '" . $objDatabase->fxEscape($strNewHttp) . "' WHERE pk_key_chain = " . $intPk;
|
||||
if ($objDatabase->fxQuery($sqlUpdate) === false) {
|
||||
$strMessage = 'Impossible d’enregistrer pour le moment. Réessayez plus tard.';
|
||||
$strMessageClass = 'err';
|
||||
$blnShowUrlForm = true;
|
||||
$strCurrentHttp = $strNewHttp;
|
||||
return false;
|
||||
}
|
||||
header('Location: ' . kc_set_page_url(['ok' => '1']));
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$strPostedCsrf = isset($_POST['csrf']) ? (string) $_POST['csrf'] : '';
|
||||
if (!hash_equals($strCsrf, $strPostedCsrf)) {
|
||||
$strMessage = 'Veuillez recharger la page et réessayer.';
|
||||
$strMessageClass = 'err';
|
||||
} else {
|
||||
$strAction = isset($_POST['action']) ? (string) $_POST['action'] : '';
|
||||
|
||||
if ($strAction === 'load') {
|
||||
$strVehiculeSaisi = isset($_POST['vehicule_no']) ? trim((string) $_POST['vehicule_no']) : '';
|
||||
$intPk = kc_set_parse_vehicule_no($strVehiculeSaisi);
|
||||
if ($intPk <= 0) {
|
||||
$strMessage = 'Veuillez entrer un numéro de véhicule valide.';
|
||||
$strMessageClass = 'err';
|
||||
} else {
|
||||
$sql = 'SELECT key_chain_http FROM key_chain WHERE pk_key_chain = ' . $intPk;
|
||||
$row = $objDatabase->fxGetRow($sql);
|
||||
if ($row === null || !isset($row['key_chain_http'])) {
|
||||
$strMessage = 'Aucun code QR trouvé pour ce numéro de véhicule.';
|
||||
$strMessageClass = 'err';
|
||||
} else {
|
||||
$strCurrentHttp = $row['key_chain_http'];
|
||||
$blnShowUrlForm = true;
|
||||
}
|
||||
}
|
||||
} elseif ($strAction === 'save') {
|
||||
$intPk = intval(isset($_POST['pk']) ? $_POST['pk'] : 0);
|
||||
$strVehiculeSaisi = isset($_POST['vehicule_no']) ? trim((string) $_POST['vehicule_no']) : '';
|
||||
$strLienPost = isset($_POST['lien_qr']) ? trim((string) $_POST['lien_qr']) : '';
|
||||
$strNewHttp = kc_set_validate_url($strLienPost);
|
||||
if ($strNewHttp === false) {
|
||||
$strMessage = 'Veuillez entrer une adresse Web valide (commençant par http:// ou https://).';
|
||||
$strMessageClass = 'err';
|
||||
$blnShowUrlForm = true;
|
||||
$strCurrentHttp = $strLienPost;
|
||||
} else {
|
||||
kc_set_save_lien_for_pk($intPk, $strVehiculeSaisi, $strNewHttp);
|
||||
}
|
||||
} elseif ($strAction === 'save_ms1') {
|
||||
$intPk = intval(isset($_POST['pk']) ? $_POST['pk'] : 0);
|
||||
$strVehiculeSaisi = isset($_POST['vehicule_no']) ? trim((string) $_POST['vehicule_no']) : '';
|
||||
kc_set_save_lien_for_pk($intPk, $strVehiculeSaisi, 'https://ms1.ca');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Code QR — lien de redirection</title>
|
||||
<style>
|
||||
:root {
|
||||
--ms1-orange: #ff8c00;
|
||||
--ms1-orange-dark: #e67a00;
|
||||
--ms1-ink: #1a1a2e;
|
||||
--ms1-card: #ffffff;
|
||||
--ms1-muted: #5c6370;
|
||||
--ms1-ok: #0d7a4a;
|
||||
--ms1-err: #b42318;
|
||||
--radius: 16px;
|
||||
--shadow: 0 12px 40px rgba(26, 26, 46, 0.12);
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
|
||||
color: var(--ms1-ink);
|
||||
background:
|
||||
radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 140, 0, 0.25), transparent),
|
||||
linear-gradient(160deg, #f8f4ef 0%, #eef2f7 45%, #e8edf5 100%);
|
||||
padding: 1.5rem 1rem 3rem;
|
||||
}
|
||||
|
||||
.page {
|
||||
max-width: 640px;
|
||||
margin: 0 auto;
|
||||
animation: fadeUp 0.5s ease-out;
|
||||
}
|
||||
|
||||
@keyframes fadeUp {
|
||||
from { opacity: 0; transform: translateY(12px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
.hero {
|
||||
text-align: center;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.qr-icon {
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
margin: 0 auto 0.75rem;
|
||||
background: var(--ms1-ink);
|
||||
border-radius: 12px;
|
||||
padding: 10px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 4px;
|
||||
box-shadow: 0 6px 20px rgba(26, 26, 46, 0.2);
|
||||
}
|
||||
|
||||
.qr-icon span {
|
||||
background: var(--ms1-orange);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.qr-icon span:nth-child(5) { background: #fff; }
|
||||
|
||||
h1 {
|
||||
margin: 0;
|
||||
font-size: 1.75rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.user-bar {
|
||||
margin-top: 0.5rem;
|
||||
color: var(--ms1-muted);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.intro {
|
||||
text-align: center;
|
||||
font-size: 1.08rem;
|
||||
line-height: 1.6;
|
||||
color: var(--ms1-muted);
|
||||
margin: 0 0 1.5rem;
|
||||
padding: 0 0.5rem;
|
||||
}
|
||||
|
||||
.steps {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.step {
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 700;
|
||||
font-size: 0.95rem;
|
||||
background: #dde3eb;
|
||||
color: var(--ms1-muted);
|
||||
transition: transform 0.2s, background 0.2s;
|
||||
}
|
||||
|
||||
.step.active {
|
||||
background: var(--ms1-orange);
|
||||
color: #fff;
|
||||
transform: scale(1.08);
|
||||
box-shadow: 0 4px 14px rgba(255, 140, 0, 0.45);
|
||||
}
|
||||
|
||||
.step.done {
|
||||
background: var(--ms1-ok);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.step-line {
|
||||
width: 2rem;
|
||||
height: 3px;
|
||||
align-self: center;
|
||||
background: #dde3eb;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--ms1-card);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: var(--shadow);
|
||||
padding: 1.75rem 1.5rem 1.5rem;
|
||||
border: 1px solid rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
.field-label {
|
||||
display: block;
|
||||
font-weight: 700;
|
||||
font-size: 1.05rem;
|
||||
margin-bottom: 0.6rem;
|
||||
color: var(--ms1-ink);
|
||||
}
|
||||
|
||||
.field-wrap {
|
||||
position: relative;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.input-vehicule {
|
||||
width: 100%;
|
||||
padding: 1rem 1.15rem;
|
||||
font-size: 1.75rem;
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
letter-spacing: 0.08em;
|
||||
border: 2px solid #e2e8f0;
|
||||
border-radius: 12px;
|
||||
transition: border-color 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.input-vehicule:focus {
|
||||
outline: none;
|
||||
border-color: var(--ms1-orange);
|
||||
box-shadow: 0 0 0 4px rgba(255, 140, 0, 0.2);
|
||||
}
|
||||
|
||||
.input-lien {
|
||||
width: 100%;
|
||||
padding: 1rem 1.15rem;
|
||||
font-size: 1.05rem;
|
||||
line-height: 1.45;
|
||||
border: 2px solid #e2e8f0;
|
||||
border-radius: 12px;
|
||||
transition: border-color 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.input-lien:focus {
|
||||
outline: none;
|
||||
border-color: var(--ms1-orange);
|
||||
box-shadow: 0 0 0 4px rgba(255, 140, 0, 0.2);
|
||||
}
|
||||
|
||||
.input-lien::placeholder {
|
||||
color: #9aa3af;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.75rem 1rem;
|
||||
margin-top: 1.25rem;
|
||||
}
|
||||
|
||||
.btn-enter {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.55rem;
|
||||
padding: 0.85rem 1.5rem;
|
||||
font-size: 1.05rem;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
background: linear-gradient(180deg, var(--ms1-orange) 0%, var(--ms1-orange-dark) 100%);
|
||||
border: none;
|
||||
border-radius: 999px;
|
||||
cursor: pointer;
|
||||
box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
|
||||
transition: transform 0.15s, box-shadow 0.15s;
|
||||
}
|
||||
|
||||
.btn-enter:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 10px 28px rgba(255, 140, 0, 0.5);
|
||||
}
|
||||
|
||||
.btn-enter:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.btn-ms1 {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 0.85rem 1.25rem;
|
||||
font-size: 1rem;
|
||||
font-weight: 700;
|
||||
color: var(--ms1-ink);
|
||||
background: #fff;
|
||||
border: 2px solid var(--ms1-ink);
|
||||
border-radius: 999px;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s, color 0.15s;
|
||||
}
|
||||
|
||||
.btn-ms1:hover {
|
||||
background: var(--ms1-ink);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.btn-enter:disabled {
|
||||
opacity: 0.85;
|
||||
cursor: wait;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.btn-enter .key-cap {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 2rem;
|
||||
height: 1.75rem;
|
||||
padding: 0 0.4rem;
|
||||
background: rgba(255, 255, 255, 0.25);
|
||||
border-radius: 6px;
|
||||
font-size: 0.9rem;
|
||||
border: 1px solid rgba(255, 255, 255, 0.35);
|
||||
}
|
||||
|
||||
.hint {
|
||||
color: var(--ms1-muted);
|
||||
font-size: 0.9rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.msg {
|
||||
margin: 0 0 1.25rem;
|
||||
padding: 1rem 1.15rem;
|
||||
border-radius: 12px;
|
||||
font-size: 1rem;
|
||||
font-weight: 500;
|
||||
animation: fadeUp 0.35s ease-out;
|
||||
}
|
||||
|
||||
.msg.ok {
|
||||
background: #e6f4ed;
|
||||
color: var(--ms1-ok);
|
||||
border: 1px solid #b8e6d0;
|
||||
}
|
||||
|
||||
.msg.err {
|
||||
background: #fdecea;
|
||||
color: var(--ms1-err);
|
||||
border: 1px solid #f5c4c0;
|
||||
}
|
||||
|
||||
.back {
|
||||
text-align: center;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.back a {
|
||||
color: var(--ms1-muted);
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: 8px;
|
||||
transition: color 0.2s, background 0.2s;
|
||||
}
|
||||
|
||||
.back a:hover {
|
||||
color: var(--ms1-orange-dark);
|
||||
background: rgba(255, 140, 0, 0.1);
|
||||
}
|
||||
|
||||
.share-box {
|
||||
background: #fff8ee;
|
||||
border: 1px dashed var(--ms1-orange);
|
||||
border-radius: 12px;
|
||||
padding: 1rem 1.15rem;
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.share-box strong {
|
||||
display: block;
|
||||
margin-bottom: 0.5rem;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.share-row {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.share-url {
|
||||
flex: 1 1 12rem;
|
||||
min-width: 0;
|
||||
padding: 0.55rem 0.65rem;
|
||||
font-size: 0.82rem;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.btn-copy {
|
||||
padding: 0.55rem 1rem;
|
||||
font-weight: 600;
|
||||
font-size: 0.9rem;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
background: var(--ms1-ink);
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn-copy:hover { background: #2d2d44; }
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.actions { flex-direction: column; align-items: stretch; }
|
||||
.btn-enter { justify-content: center; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="page">
|
||||
<header class="hero">
|
||||
<div class="qr-icon" aria-hidden="true">
|
||||
<span></span><span></span><span></span>
|
||||
<span></span><span></span><span></span>
|
||||
<span></span><span></span><span></span>
|
||||
</div>
|
||||
<h1>Code QR</h1>
|
||||
<?php if ($strUserName !== '') { ?>
|
||||
<p class="user-bar">Bonjour <?php echo htmlspecialchars($strUserName, ENT_QUOTES, 'UTF-8'); ?>.</p>
|
||||
<?php } ?>
|
||||
</header>
|
||||
|
||||
<p class="intro">Entrez votre numéro de véhicule. Vous pourrez ainsi changer le lien de votre code QR.</p>
|
||||
|
||||
<?php if ($blnCanShareLink && $strShareUrl !== '') { ?>
|
||||
<div class="share-box">
|
||||
<strong>Lien à envoyer aux autres</strong>
|
||||
<p class="hint" style="margin:0 0 0.65rem;">Chaque personne ouvre ce lien et entre <em>son</em> numéro de véhicule.</p>
|
||||
<div class="share-row">
|
||||
<input type="text" class="share-url" id="share_url" readonly value="<?php echo htmlspecialchars($strShareUrl, ENT_QUOTES, 'UTF-8'); ?>">
|
||||
<button type="button" class="btn-copy" id="btn_copy_link">Copier le lien</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="steps" aria-hidden="true">
|
||||
<span class="step <?php echo !$blnShowUrlForm ? 'active' : 'done'; ?>">1</span>
|
||||
<span class="step-line"></span>
|
||||
<span class="step <?php echo $blnShowUrlForm ? 'active' : ''; ?>">2</span>
|
||||
</div>
|
||||
|
||||
<?php if ($strMessage !== '') { ?>
|
||||
<div class="msg <?php echo htmlspecialchars($strMessageClass, ENT_QUOTES, 'UTF-8'); ?>" role="status"><?php
|
||||
echo htmlspecialchars($strMessage, ENT_QUOTES, 'UTF-8');
|
||||
?></div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="card">
|
||||
<?php if (!$blnShowUrlForm) { ?>
|
||||
<form method="post" action="<?php echo $strBaseUrlHtml; ?>" id="frm_load">
|
||||
<input type="hidden" name="csrf" value="<?php echo htmlspecialchars($strCsrf, ENT_QUOTES, 'UTF-8'); ?>">
|
||||
<input type="hidden" name="action" value="load">
|
||||
<label class="field-label" for="vehicule_no">Numéro de véhicule</label>
|
||||
<div class="field-wrap">
|
||||
<input type="text" inputmode="numeric" pattern="[0-9]+" class="input-vehicule" id="vehicule_no" name="vehicule_no" required autofocus placeholder="ex. 8" value="<?php echo htmlspecialchars($strVehiculeSaisi, ENT_QUOTES, 'UTF-8'); ?>">
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button type="submit" class="btn-enter">
|
||||
<span class="key-cap">↵</span>
|
||||
<span>Continuer</span>
|
||||
</button>
|
||||
<p class="hint">Remplissez le numéro, puis cliquez ou appuyez sur Entrée.</p>
|
||||
</div>
|
||||
</form>
|
||||
<?php } else { ?>
|
||||
<?php if ($strVehiculeSaisi !== '') { ?>
|
||||
<p class="hint" style="margin:0 0 1rem;">Véhicule <strong><?php echo htmlspecialchars($strVehiculeSaisi, ENT_QUOTES, 'UTF-8'); ?></strong></p>
|
||||
<?php } ?>
|
||||
<form method="post" action="<?php echo $strBaseUrlHtml; ?>" id="frm_save">
|
||||
<input type="hidden" name="csrf" value="<?php echo htmlspecialchars($strCsrf, ENT_QUOTES, 'UTF-8'); ?>">
|
||||
<input type="hidden" name="action" value="save">
|
||||
<input type="hidden" name="pk" value="<?php echo (int) $intPk; ?>">
|
||||
<input type="hidden" name="vehicule_no" value="<?php echo htmlspecialchars($strVehiculeSaisi, ENT_QUOTES, 'UTF-8'); ?>">
|
||||
<label class="field-label" for="lien_qr">Lien de votre code QR</label>
|
||||
<div class="field-wrap">
|
||||
<input type="url" class="input-lien" id="lien_qr" name="lien_qr" required autofocus placeholder="https://..." value="<?php echo htmlspecialchars($strCurrentHttp, ENT_QUOTES, 'UTF-8'); ?>">
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button type="submit" class="btn-enter">
|
||||
<span class="key-cap">↵</span>
|
||||
<span>Enregistrer</span>
|
||||
</button>
|
||||
<p class="hint">Ou enregistrer directement le lien par défaut :</p>
|
||||
</div>
|
||||
</form>
|
||||
<form method="post" action="<?php echo $strBaseUrlHtml; ?>" style="margin-top:0.75rem;">
|
||||
<input type="hidden" name="csrf" value="<?php echo htmlspecialchars($strCsrf, ENT_QUOTES, 'UTF-8'); ?>">
|
||||
<input type="hidden" name="action" value="save_ms1">
|
||||
<input type="hidden" name="pk" value="<?php echo (int) $intPk; ?>">
|
||||
<input type="hidden" name="vehicule_no" value="<?php echo htmlspecialchars($strVehiculeSaisi, ENT_QUOTES, 'UTF-8'); ?>">
|
||||
<button type="submit" class="btn-ms1">Mettre le lien vers ms1.ca</button>
|
||||
</form>
|
||||
<p class="hint" style="margin-top:0.75rem;">Sinon modifiez l’adresse ci-dessus et appuyez sur Entrée pour enregistrer.</p>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php if ($blnShowUrlForm) { ?>
|
||||
<p class="back"><a href="<?php echo $strBaseUrlHtml; ?>">← Autre numéro de véhicule</a></p>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php if ($blnCanShareLink && $strShareUrl !== '') { ?>
|
||||
<script>
|
||||
(function () {
|
||||
var btn = document.getElementById('btn_copy_link');
|
||||
var input = document.getElementById('share_url');
|
||||
if (!btn || !input) return;
|
||||
btn.addEventListener('click', function () {
|
||||
input.select();
|
||||
input.setSelectionRange(0, 99999);
|
||||
var ok = false;
|
||||
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||
navigator.clipboard.writeText(input.value).then(function () { ok = true; });
|
||||
}
|
||||
try { ok = document.execCommand('copy') || ok; } catch (e) {}
|
||||
btn.textContent = ok ? 'Copié !' : 'Sélectionné — Ctrl+C';
|
||||
setTimeout(function () { btn.textContent = 'Copier le lien'; }, 2000);
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<?php } ?>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,526 +0,0 @@
|
||||
<?php
|
||||
// mets les totaux dans un tableau (JSP)
|
||||
// param : id de l'vévénement, no panier, langue
|
||||
// créé : 2021-05-12
|
||||
function fxUpdateFinancesMembership($intEvenement) {
|
||||
global $objDatabase;
|
||||
$strOutput = '';
|
||||
|
||||
// SQL
|
||||
$sqlTypeEvenement = "
|
||||
SELECT
|
||||
te_id
|
||||
FROM
|
||||
inscriptions_evenements
|
||||
WHERE
|
||||
eve_id = " . intval($intEvenement) . "
|
||||
";
|
||||
$intTypeEvenement = $objDatabase->fxGetVar($sqlTypeEvenement);
|
||||
|
||||
if (intval($intTypeEvenement) != 0) {
|
||||
if (intval($intTypeEvenement) == 13) {
|
||||
$sqlAcheteurs = "
|
||||
SELECT
|
||||
a.*, " . intval($intEvenement) . " AS eve_id_membership
|
||||
FROM
|
||||
inscriptions_panier_acheteurs a
|
||||
WHERE
|
||||
a.sta_id = 3
|
||||
AND a.eve_id <> " . intval($intEvenement) . "
|
||||
AND a.no_panier IN(
|
||||
SELECT no_panier FROM inscriptions_panier_produits_new p WHERE p.eve_id = " . intval($intEvenement) . "
|
||||
UNION
|
||||
SELECT no_panier FROM inscriptions_panier_epreuves_commandees ec WHERE ec.eve_id = " . intval($intEvenement) . "
|
||||
)
|
||||
AND a.no_panier NOT IN(
|
||||
SELECT no_panier FROM rapport_finances_membership
|
||||
)
|
||||
";
|
||||
} else {
|
||||
$sqlAcheteurs = "
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
inscriptions_panier_acheteurs a
|
||||
JOIN inscriptions_evenements e ON e.eve_id = a.eve_id
|
||||
WHERE
|
||||
a.sta_id = 3
|
||||
AND a.eve_id = " . intval($intEvenement) . "
|
||||
AND a.no_panier IN(
|
||||
SELECT no_panier FROM inscriptions_panier_produits_new p WHERE p.eve_id = e.eve_id_membership
|
||||
UNION
|
||||
SELECT no_panier FROM inscriptions_panier_epreuves_commandees ec WHERE ec.eve_id = e.eve_id_membership
|
||||
)
|
||||
";
|
||||
}
|
||||
$tabAcheteurs = $objDatabase->fxGetResults($sqlAcheteurs);
|
||||
|
||||
if ($tabAcheteurs != null) {
|
||||
foreach ($tabAcheteurs as $acheteur) {
|
||||
//$strOutput .= '<h1>no_commande: ' . $acheteur['no_commande'] . '</h1>';
|
||||
$arrTotalsMembership = fxTotalPanierMembership($acheteur['eve_id'], $acheteur['eve_id_membership'], $acheteur['no_panier']);
|
||||
//$strOutput .= '<pre>' . print_r($arrTotals, true) . '</pre>';
|
||||
// insérer les totaux dans la table de jonction (NOTE: no_commande et no_panier onnt des INDEX UNIQUE donc, aucune chance de doublons)
|
||||
$sqlInsert = "INSERT INTO rapport_finances_membership SET no_commande = '" . $objDatabase->fxEscape($acheteur['no_commande']) . "', no_panier = '" . $objDatabase->fxEscape($acheteur['no_panier']) . "', eve_id = " . intval($acheteur['eve_id']) . ", eve_id_membership = " . intval($acheteur['eve_id_membership']) . ", ach_total = " . floatval($arrTotalsMembership['total']) . ", ach_taxe1 = " . floatval($arrTotalsMembership['taxes'][1]['montant']) . ", ach_taxe2 = " . floatval($arrTotalsMembership['taxes'][2]['montant']) . ", ach_taxe3 = " . floatval($arrTotalsMembership['taxes'][3]['montant']) . ", rabais_total = " . floatval($arrTotalsMembership['rabais_total']);
|
||||
$strOutput = $objDatabase->fxQuery($sqlInsert);
|
||||
// mettre à jour les totaux de la facture originale
|
||||
$arrTotalsOriginal = fxTotalPanier($acheteur['no_panier'], 'fr');
|
||||
$sqlUpdate = "UPDATE inscriptions_panier_acheteurs SET ach_total = " . floatval(floatval($arrTotalsOriginal['total']) - floatval($arrTotalsMembership['total'])) . ", ach_taxe1 = " . floatval(floatval($arrTotalsOriginal['taxes'][1]['montant']) - floatval($arrTotalsMembership['taxes'][1]['montant'])) . ", ach_taxe2 = " . floatval(floatval($arrTotalsOriginal['taxes'][2]['montant']) - floatval($arrTotalsMembership['taxes'][2]['montant'])) . ", ach_taxe3 = " . floatval(floatval($arrTotalsOriginal['taxes'][3]['montant']) - floatval($arrTotalsMembership['taxes'][3]['montant'])) . ", rabais_total = " . floatval(floatval($arrTotalsOriginal['rabais_total']) - floatval($arrTotalsMembership['rabais_total'])) . " WHERE no_panier = '" . $objDatabase->fxEscape($acheteur['no_panier']) . "'";
|
||||
//$strOutput .= $objDatabase->fxQuery($sqlUpdate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $strOutput;
|
||||
}
|
||||
function fxTotalPanierMembership($intEvenement, $intEvenementMembership, $strNoPanier) {
|
||||
global $objDatabase;
|
||||
$fltTotalTaxes = $fltTotalTaxesFrais = $fltMontantTaxable = $fltSousTotal = $fltSousTotal2 = $fltTotal = 0;
|
||||
|
||||
// info événements
|
||||
$sqlEvenements = "SELECT * FROM inscriptions_panier_evenements WHERE eve_id = " . intval($intEvenement);
|
||||
$tabEvenements = $objDatabase->fxGetRow($sqlEvenements);
|
||||
|
||||
// info épreuves
|
||||
$sqlEpreuves = "SELECT pec_id FROM inscriptions_panier_epreuves_commandees WHERE no_panier = '" . $objDatabase->fxEscape($strNoPanier) . "' AND eve_id = " . intval($intEvenementMembership) . " ORDER BY pec_id";
|
||||
$tabEpreuves = $objDatabase->fxGetResults($sqlEpreuves);
|
||||
|
||||
// Calculer le sous-total
|
||||
$sqlTotal = "
|
||||
SELECT
|
||||
(SELECT SUM(pec_prix) FROM inscriptions_panier_epreuves_commandees WHERE no_panier = '" . $objDatabase->fxEscape($strNoPanier) . "' AND eve_id = " . intval($intEvenementMembership) . ") AS prix_epreuves,
|
||||
(SELECT SUM(e.rab_montant) FROM inscriptions_panier_epreuves_commandees e, inscriptions_panier_rabais r WHERE r.pra_id = e.pra_id AND r.pra_depot = 0 AND e.no_panier = '" . $objDatabase->fxEscape($strNoPanier) . "' AND eve_id = " . intval($intEvenementMembership) . ") AS rabais_epreuves,
|
||||
(SELECT SUM(c.pec_prix - c.rab_montant) FROM inscriptions_panier_epreuves_commandees c, inscriptions_panier_epreuves e WHERE c.epr_id = e.epr_id AND e.epr_taxes_incluses = 0 AND c.no_panier = '" . $objDatabase->fxEscape($strNoPanier) . "' AND eve_id = " . intval($intEvenementMembership) . ") AS prix_epreuves_taxable,
|
||||
(SELECT SUM(pro_prix) FROM inscriptions_panier_produits_new WHERE no_panier = '" . $objDatabase->fxEscape($strNoPanier) . "' AND eve_id = " . intval($intEvenementMembership) . ") AS prix_produits,
|
||||
(SELECT SUM(p.rab_montant) FROM inscriptions_panier_produits_new p, inscriptions_panier_rabais r WHERE r.pra_id = p.pra_id AND r.pra_depot = 0 AND p.no_panier = '" . $objDatabase->fxEscape($strNoPanier) . "' AND eve_id = " . intval($intEvenementMembership) . ") AS rabais_produits,
|
||||
(SELECT SUM(pro_prix - rab_montant) FROM inscriptions_panier_produits_new WHERE pro_taxable = 1 AND no_panier = '" . $objDatabase->fxEscape($strNoPanier) . "' AND eve_id = " . intval($intEvenementMembership) . ") AS prix_produits_taxable,
|
||||
(SELECT SUM(r.rab_montant) FROM inscriptions_panier_rabais r, inscriptions_panier_rabais_acheteurs a WHERE r.pra_id = a.pra_id AND r.pra_depot = 0 AND a.no_panier = '" . $objDatabase->fxEscape($strNoPanier) . "' AND r.rab_pourcent = 0 AND r.rab_epreuves = '' AND r.rab_produits = '') AS rabais_panier_montant,
|
||||
(SELECT SUM(r.rab_pourcent) FROM inscriptions_panier_rabais r, inscriptions_panier_rabais_acheteurs a WHERE r.pra_id = a.pra_id AND r.pra_depot = 0 AND a.no_panier = '" . $objDatabase->fxEscape($strNoPanier) . "' AND r.rab_montant = 0 AND r.rab_epreuves = '' AND r.rab_produits = '') AS rabais_panier_pourcent
|
||||
FROM DUAL
|
||||
";
|
||||
$tabTotal = $objDatabase->fxGetRow($sqlTotal);
|
||||
|
||||
$fltRegistrationTotal = $tabTotal['prix_epreuves'] + $tabTotal['prix_produits'];
|
||||
|
||||
// calculer les rabais
|
||||
$fltRabaisMontant = $tabTotal['rabais_panier_montant'] + $tabTotal['rabais_epreuves'] + $tabTotal['rabais_produits'];
|
||||
$intRabaisPourcent = $tabTotal['rabais_panier_pourcent'];
|
||||
|
||||
if ($intRabaisPourcent > 100)
|
||||
$intRabaisPourcent = 100;
|
||||
|
||||
// calculer le rabais %
|
||||
$fltRabaisPourcent = ($fltRegistrationTotal - $fltRabaisMontant) * ($intRabaisPourcent / 100);
|
||||
|
||||
// calculer le total après rabais pourcent
|
||||
$fltRabaisTotal = $fltRabaisMontant + $fltRabaisPourcent;
|
||||
$fltRegistrationTotal -= ($fltRabaisTotal);
|
||||
|
||||
if ($fltRegistrationTotal < 0)
|
||||
$fltRegistrationTotal = 0;
|
||||
|
||||
$fltMontantTaxable = ($tabTotal['prix_epreuves_taxable'] + $tabTotal['prix_produits_taxable']) - ($fltRabaisPourcent + $tabTotal['rabais_panier_montant']);
|
||||
|
||||
if ($fltMontantTaxable < 0)
|
||||
$fltMontantTaxable = 0;
|
||||
|
||||
// calculer le sous total (registration + option)
|
||||
$fltSousTotal = $fltRegistrationTotal;
|
||||
|
||||
// calculer les taxes
|
||||
$tabTaxes[1] = $tabTaxes[2] = $tabTaxes[3] = array('label_fr' => '', 'label_en' => '', 'montant' => 0, 'taux' => 0, 'numero' => '');
|
||||
|
||||
// récupérer les infos des taxes
|
||||
if ($tabEvenements['tt_id'] > 1) {
|
||||
$sqlTaux = "SELECT t.tau_nom_fr, t.tau_nom_en, t.tau_taux, t.tau_numero_client, t.tau_numero_ms1 FROM inscriptions_taux t, inscriptions_taux_types_taux ttt WHERE t.tau_id = ttt.tau_id AND ttt.tt_id = " . intval($tabEvenements['tt_id']) . " ORDER BY ttt.ttt_tri";
|
||||
$tabTaux = $objDatabase->fxGetResults($sqlTaux);
|
||||
|
||||
if ($tabTaux != null) {
|
||||
for ($intCtr = 1; $intCtr <= count($tabTaux); $intCtr++) {
|
||||
$fltMontantTaxes = round($fltMontantTaxable * ($tabTaux[$intCtr]['tau_taux'] / 100), 2);
|
||||
$tabTaxes[$intCtr] = array('label_fr' => $tabTaux[$intCtr]['tau_nom_fr'] . ' (' . $tabTaux[$intCtr]['tau_taux'] . '%)', 'label_en' => $tabTaux[$intCtr]['tau_nom_en'] . ' (' . $tabTaux[$intCtr]['tau_taux'] . '%)', 'montant' => $fltMontantTaxes, 'taux' => $tabTaux[$intCtr]['tau_taux'], 'numero' => $tabTaux[$intCtr]['tau_numero_client']);
|
||||
$fltTotalTaxes += $fltMontantTaxes;
|
||||
}
|
||||
} else {
|
||||
fxcreer_log("Il y a eu une erreur lors de la récupération des taxes:\n" . $sqlTaux);
|
||||
}
|
||||
}
|
||||
// calculer le total après taxes
|
||||
$fltSousTotal2 = $fltSousTotal + $fltTotalTaxes;
|
||||
// calculer le total avec frais d'administration
|
||||
$fltTotal = $fltSousTotal2;
|
||||
|
||||
// affiche le sous-total, les taxes, rabais et le total complet
|
||||
$tabRetour['taxes'] = $tabTaxes;
|
||||
$tabRetour['total_taxes'] = $fltTotalTaxes;
|
||||
$tabRetour['total'] = abs($fltTotal);
|
||||
$tabRetour['stotal'] = $fltSousTotal;
|
||||
$tabRetour['stotal2'] = $fltSousTotal2;
|
||||
$tabRetour['rabais_total'] = $fltRabaisTotal;
|
||||
|
||||
if ($tabEpreuves != null)
|
||||
$tabRetour['pec_id'] = implode(',', array_map(function($tab) { return $tab['pec_id']; }, $tabEpreuves));
|
||||
else
|
||||
$tabRetour['pec_id'] = 0;
|
||||
|
||||
$tabRetour['eve_id'] = $tabEvenements['eve_id'];
|
||||
$tabRetour['eve_id_membership'] = $intEvenementMembership;
|
||||
|
||||
return $tabRetour;
|
||||
}
|
||||
function fxGetTermes($intEvenement, $strNoPanier, $blnMembership, $strLangue) {
|
||||
$strSuffixe = $strTermesText = $strTermesHTML = $strTermesModal = '';
|
||||
$arrRetour = $arrTermesModalButtons = $arr_epreuves_id = array();
|
||||
|
||||
// faire un tableau avec tout les epr_id (sl)
|
||||
$epreuves = fxListPanier($strNoPanier);
|
||||
|
||||
foreach ($epreuves[3] as $key => $value) {
|
||||
$arr_epreuves_id[$key]= $value['epr_id'] ;
|
||||
}
|
||||
|
||||
$tabEvenement = fxGetEvenements(fxGetEvenementsUrl($intEvenement), $strLangue);
|
||||
|
||||
if ($blnMembership) {
|
||||
$strSuffixe = '_mem';
|
||||
$tabEvenement = fxGetEvenements(fxGetEvenementsUrl($tabEvenement['general']['eve_id_membership']), $strLangue);
|
||||
}
|
||||
|
||||
if ($tabEvenement['general']['eve_waiver_' . $strLangue] != '') {
|
||||
$strTermesText .= '<p><strong>' . afficheTexte('terme_waiver', 0, 1, 1) . ' :</strong></p>';
|
||||
$strTermesText .= $tabEvenement['general']['eve_waiver_' . $strLangue] . '<br>';
|
||||
$strTermesHTML = '
|
||||
<div class="card-text">
|
||||
' . afficheTexte('terme_jaccepte', 0, 1, 1) . '
|
||||
<strong><a href="#div_waiver' . $strSuffixe . '" id="link_waiver' . $strSuffixe . '" data-toggle="modal">' . afficheTexte('terme_waiver', 0, 1, 1) .'</a>.</strong>
|
||||
<div class="form-check d-inline-block ml-2">
|
||||
<input class="form-check-input position-static chk_termes" type="checkbox" id="chk_waiver' . $strSuffixe . '" name="chk_waiver' . $strSuffixe . '" value="1" aria-label="..." readonly>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
$strTermesModal .= '
|
||||
<div class="modal fade" id="div_waiver' . $strSuffixe . '" data-backdrop="static" data-keyboard="false" tabindex="-1" aria-labelledby="div_waiver_label' . $strSuffixe . '" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="div_waiver_label' . $strSuffixe . '">' . afficheTexte('terme_waiver_titre', 0, 1, 1) . '</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="' . afficheTexte('btn_terme_close', 0, 1, 1) . '">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
' . $tabEvenement['general']['eve_waiver_' . $strLangue] . '
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary rounded-0" data-dismiss="modal">' . afficheTexte('btn_terme_close', 0, 1, 1) . '</button>
|
||||
<button id="btn_accept_waiver' . $strSuffixe . '" type="button" class="btn btn-primary rounded-0">' . afficheTexte('btn_terme_jaccepte', 0, 1, 1) . '</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
$arrTermesModalButtons[] = 'btn_accept_waiver' . $strSuffixe;
|
||||
}
|
||||
|
||||
if ($tabEvenement['general']['eve_policy_' . $strLangue] != '') {
|
||||
$strTermesText .= '<p><strong>' . afficheTexte('terme_politique_achat', 0, 1, 1) . ' :</strong></p>';
|
||||
$strTermesText .= $tabEvenement['general']['eve_policy_' . $strLangue] . '<br>';
|
||||
$strTermesHTML .= '
|
||||
<div class="card-text">
|
||||
' . afficheTexte('terme_jaccepte', 0, 1, 1) . '
|
||||
<strong><a href="#div_policy' . $strSuffixe . '" id="link_policy' . $strSuffixe . '" data-toggle="modal">' . afficheTexte('terme_politique_achat', 0, 1, 1) . '</a>.</strong>
|
||||
<div class="form-check d-inline-block ml-2">
|
||||
<input class="form-check-input position-static chk_termes" type="checkbox" id="chk_policy' . $strSuffixe . '" name="chk_policy' . $strSuffixe . '" value="1" aria-label="..." readonly>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
$strTermesModal .= '
|
||||
<div class="modal fade" id="div_policy' . $strSuffixe . '" data-backdrop="static" data-keyboard="false" tabindex="-1" aria-labelledby="div_policy_label' . $strSuffixe . '" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="div_policy_label' . $strSuffixe . '">' . afficheTexte('terme_policy_titre', 0, 1, 1) . '</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="' . afficheTexte('btn_terme_close', 0, 1, 1) . '">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
' . $tabEvenement['general']['eve_policy_' . $strLangue] . '
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary rounded-0" data-dismiss="modal">' . afficheTexte('btn_terme_close', 0, 1, 1) . '</button>
|
||||
<button id="btn_accept_policy' . $strSuffixe . '" type="button" class="btn btn-primary rounded-0">' . afficheTexte('btn_terme_jaccepte', 0, 1, 1) . '</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
$arrTermesModalButtons[] = 'btn_accept_policy' . $strSuffixe;
|
||||
}
|
||||
|
||||
if ($tabEvenement['general']['eve_policy2_' . $strLangue] != '') {
|
||||
$strTermesText .= '<p><strong>' . afficheTexte('terme_location_politique_achat', 0, 1, 1) . ' :</strong></p>';
|
||||
$strTermesText .= $tabEvenement['general']['eve_policy2_' . $strLangue] . '<br>';
|
||||
$strTermesHTML .= '
|
||||
<div class="card-text">
|
||||
' . afficheTexte('terme_jaccepte', 0, 1, 1) . '
|
||||
<strong><a href="#div_location_policy' . $strSuffixe . '" id="link_location_policy' . $strSuffixe . '" data-toggle="modal">' . afficheTexte('terme_location_politique_achat', 0, 1, 1) . '</a>.</strong>
|
||||
<div class="form-check d-inline-block ml-2">
|
||||
<input class="form-check-input position-static chk_termes" type="checkbox" id="chk_location_policy' . $strSuffixe . '" name="chk_location_policy' . $strSuffixe . '" value="1" aria-label="..." readonly>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
$strTermesModal .= '
|
||||
<div class="modal fade" id="div_location_policy' . $strSuffixe . '" data-backdrop="static" data-keyboard="false" tabindex="-1" aria-labelledby="div_location_policy_label' . $strSuffixe . '" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="div_location_policy_label' . $strSuffixe . '">' . afficheTexte('terme_location_policy_titre', 0, 1, 1) . '</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="' . afficheTexte('btn_terme_close', 0, 1, 1) . '">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
' . $tabEvenement['general']['eve_policy2_' . $strLangue] . '
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary rounded-0" data-dismiss="modal">' . afficheTexte('btn_terme_close', 0, 1, 1) . '</button>
|
||||
<button id="btn_accept_location_policy' . $strSuffixe . '" type="button" class="btn btn-primary rounded-0">' . afficheTexte('btn_terme_jaccepte', 0, 1, 1) . '</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
$arrTermesModalButtons[] = 'btn_accept_location_policy' . $strSuffixe;
|
||||
}
|
||||
|
||||
// valide les waiver de 0 a 6 (sl)
|
||||
for ($x = 0; $x <= 6; $x++) {
|
||||
$mem_waive="eve_waiver".$x;
|
||||
$array_list = explode(',',$tabEvenement['general'][$mem_waive.'_list_epreuves' ]);
|
||||
|
||||
$result = array_intersect($array_list, $arr_epreuves_id);
|
||||
|
||||
if (count($result) > 0) {
|
||||
$strTermesText .= '<p><strong>' . $tabEvenement['general'][$mem_waive.'_titre_' . $strLangue] . ' :</strong></p>';
|
||||
$strTermesText .= $tabEvenement['general'][$mem_waive . '_' . $strLangue] . '<br>';
|
||||
$strTermesHTML .= '
|
||||
<div class="card-text">
|
||||
' . afficheTexte('terme_jaccepte', 0, 1, 1) . '
|
||||
<strong><a href="#div_' . $mem_waive . $strSuffixe . '" id="link_' . $mem_waive . $strSuffixe . '" data-toggle="modal">' . $tabEvenement['general'][$mem_waive.'_titre_' . $strLangue] . '</a>.</strong>
|
||||
<div class="form-check d-inline-block ml-2">
|
||||
<input class="form-check-input position-static chk_termes" type="checkbox" id="chk_' . $mem_waive . $strSuffixe . '" name="chk_' . $mem_waive . $strSuffixe . '" value="1" aria-label="..." readonly>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
$strTermesModal .= '
|
||||
<div class="modal fade" id="div_'.$mem_waive.'' . $strSuffixe . '" data-backdrop="static" data-keyboard="false" tabindex="-1" aria-labelledby="div_' . $mem_waive . '_label' . $strSuffixe . '" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="div_'.$mem_waive.'_label' . $strSuffixe . '">' .$tabEvenement['general'][$mem_waive.'_titre_' . $strLangue]. '</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="' . afficheTexte('btn_terme_close', 0, 1, 1) . '">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
' . $tabEvenement['general'][$mem_waive.'_' . $strLangue] . '
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary rounded-0" data-dismiss="modal">' . afficheTexte('btn_terme_close', 0, 1, 1) . '</button>
|
||||
<button id="btn_accept_' . $mem_waive . $strSuffixe . '" type="button" class="btn btn-primary rounded-0">' . afficheTexte('btn_terme_jaccepte', 0, 1, 1) . '</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
$arrTermesModalButtons[] = 'btn_accept_' . $mem_waive . $strSuffixe;
|
||||
}
|
||||
}
|
||||
|
||||
$arrRetour['html'] = $strTermesHTML;
|
||||
$arrRetour['modal'] = $strTermesModal;
|
||||
$arrRetour['text'] = $strTermesText;
|
||||
$arrRetour['buttons'] = $arrTermesModalButtons;
|
||||
|
||||
return $arrRetour;
|
||||
}
|
||||
function fxShowBlocPaiement($tabEvenement, $fltMontant, $strLangue) {
|
||||
global $vDomaine, $vblnEnvironementDev;
|
||||
$strCCNumber = ($vblnEnvironementDev) ? ' value="4528038032834793"' : '';
|
||||
$strCVV = ($vblnEnvironementDev) ? ' value="123"' : '';
|
||||
$blnIsPromoteur = $blnAdmin = false;
|
||||
$strOutput = '';
|
||||
|
||||
if (isset($tabEvenement) && intval($tabEvenement['general']['eve_gratuit']) != 1) { // si l'événement n'est pas gratuite, afficher le bloc de paiement
|
||||
$strOutput .= '
|
||||
<div id="paiement" class="card box_participant mb-3">
|
||||
<div class="card-header">
|
||||
<h2 class="box_paiement">' . afficheTexte('mode_paiement', 0) . '</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-2 col-lg-3">
|
||||
|
||||
</div>
|
||||
<div class="col-12 col-md-8 col-lg-6">
|
||||
<div class="form-group text-center">
|
||||
';
|
||||
|
||||
if (floatval($fltMontant) > 0) {
|
||||
if (isset($_SESSION['com_info']) && $_SESSION['com_info'] != '') {
|
||||
$blnIsPromoteur = fxIsPromoteur($_SESSION['com_info']['com_id'], $tabEvenement['general']['eve_id']);
|
||||
}
|
||||
|
||||
// si en mode admin, récupérer les mode de paiement réservés aux admin
|
||||
if (isset($_SESSION['usa_id'])) {
|
||||
$blnAdmin = true;
|
||||
}
|
||||
|
||||
$tabPaiements = fxGetPaiements($blnAdmin, $blnIsPromoteur, $strLangue);
|
||||
|
||||
if ($tabPaiements != false) { // afficher le formulaire de la carte de crédit
|
||||
for ($intCtr = 1; $intCtr <= count($tabPaiements); $intCtr++) {
|
||||
if ($tabPaiements[$intCtr]['pai_id'] == 2 || $tabPaiements[$intCtr]['pai_id'] == 6) {
|
||||
$strDetailsPaiement = $strChecked = '';
|
||||
|
||||
if ($tabPaiements[$intCtr]['pai_id'] == 2) {
|
||||
$strChecked = ' checked';
|
||||
}
|
||||
|
||||
if ($tabPaiements[$intCtr]['pai_id'] == 6) {
|
||||
//$strDetailsPaiement = ' <em>' . afficheTexte('paiement_cheque', 0) . '</em>';
|
||||
}
|
||||
|
||||
$strOutput .= '
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" id="chk_pai_' . $tabPaiements[$intCtr]['pai_id'] . '" name="chk_paiement" value="' . $tabPaiements[$intCtr]['pai_id'] . '"' . $strChecked . '>
|
||||
<label class="form-check-label" for="chk_pai_' . $tabPaiements[$intCtr]['pai_id'] . '">
|
||||
' . $tabPaiements[$intCtr]['pai_nom_' . $strLangue] . '
|
||||
</label>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$strOutput .= '
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" id="chk_pai_1" name="chk_paiement" value="1" checked>
|
||||
<label class="form-check-label" for="chk_pai_1">
|
||||
' . afficheTexte('paypal', 0) . '
|
||||
</label>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
} else {
|
||||
$strOutput .= '
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" id="chk_pai_1" name="chk_paiement" value="1" checked>
|
||||
<label class="form-check-label" for="chk_pai_1">
|
||||
' . afficheTexte('gratuit', 0) . '
|
||||
</label>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
if (floatval($fltMontant) > 0) {
|
||||
$strMonth = ($strLangue == 'fr') ? '-- Mois --' : '-- Month --';
|
||||
$strYear = ($strLangue == 'fr') ? '-- Année --' :'-- Year --';
|
||||
|
||||
$strOutput .= '
|
||||
</div>
|
||||
<div id="creditcard">
|
||||
<div class="form-message"></div>
|
||||
<div class="img_cartes text-center">
|
||||
<img id="card_mc" src="' . $vDomaine . '/images/mastercard.gif" width="55" height="34" alt="MasterCard">
|
||||
<img id="card_visa" src="' . $vDomaine . '/images/visa.gif" width="59" height="34" alt="Visa">
|
||||
</div>
|
||||
<br>
|
||||
<input type="hidden" id="card_type" name="card_type" value="">
|
||||
<div class="form-group row justify-content-center">
|
||||
<label for="ccnumber" class="control-label col-12">' . afficheTexte('checkout_ccnumber', 0) . ':</label>
|
||||
<div class="col-11">
|
||||
<input class="form-control" type="text" id="ccnumber" name="ccnumber" size="20" maxlength="16" autocomplete="off" placeholder="1234567890123456"' . $strCCNumber . '>
|
||||
</div>
|
||||
<small class="col text-muted">*</small>
|
||||
</div>
|
||||
<div class="form-group row justify-content-center">
|
||||
<label class="control-label col-12">' . afficheTexte('checkout_ccexp', 0) . ':</label>
|
||||
<div class="col-5">
|
||||
<select class="form-control" id="ccmonth" name="ccmonth">
|
||||
<label class="sr-only" for="ccmonth">' . afficheTexte('month', 0, 1, 1) . '</label>
|
||||
<option value="" selected="selected">' . $strMonth . '</option>
|
||||
';
|
||||
|
||||
for ($intCtr = 1; $intCtr <= 12; $intCtr++) {
|
||||
$strSelected = ($vblnEnvironementDev && $intCtr == 3) ? ' selected' : '';
|
||||
$strOutput .= '<option value="' . fxAddLeadingZero($intCtr) . '"' . $strSelected . '>' . fxMois('2013-' . $intCtr . '-01', $strLangue) . ' (' . $intCtr . ')' . '</option>';
|
||||
}
|
||||
|
||||
$strOutput .= '
|
||||
</select>
|
||||
</div>
|
||||
<small class="col text-muted">*</small>
|
||||
<div class="col-5">
|
||||
<label class="sr-only" for="ccyear">' . afficheTexte('year', 0, 1, 1) . '</label>
|
||||
<select class="form-control" id="ccyear" name="ccyear">
|
||||
<option value="" selected="selected">' . $strYear . '</option>
|
||||
';
|
||||
|
||||
for ($intCtr = date('Y', strtotime(fxGetDate())); $intCtr <= date('Y', strtotime(fxGetDate()))+ 10; $intCtr++) {
|
||||
$strSelected = ($vblnEnvironementDev && $intCtr == 2025) ? ' selected' : '';
|
||||
$strOutput .= '<option value="' . $intCtr . '"' . $strSelected . '>' . $intCtr . '</option>';
|
||||
}
|
||||
|
||||
$strOutput .= '
|
||||
</select>
|
||||
</div>
|
||||
<small class="col text-muted">*</small>
|
||||
</div>
|
||||
<div class="form-group row justify-content-center">
|
||||
<label class="control-label col-12" for="cvv">' . afficheTexte('checkout_cvv', 0) . ':</label>
|
||||
<div class="col-11">
|
||||
<input class="form-control" type="text" id="cvv" name="cvv" size="3" maxlength="3" autocomplete="off" placeholder="123"' . $strCVV . '>
|
||||
</div>
|
||||
<small class="col text-muted">*</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 col-lg-3">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
} else {
|
||||
$strOutput .= '
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
} else { // si événement gratuit
|
||||
$strOutput .= '
|
||||
<input type="hidden" name="chk_paiement" value="1">
|
||||
';
|
||||
}
|
||||
|
||||
return $strOutput;
|
||||
}
|
||||
function fxShowTermesAcceptes($strNoPanier, $strLangue) {
|
||||
$strRetour = '';
|
||||
$tabPanier = fxListPanier($strNoPanier);
|
||||
$tabAcheteur = $tabPanier[0];
|
||||
|
||||
$strRetour .= '
|
||||
<div style="padding: 10px;">
|
||||
<div style="color: #666666; font-size: 0.75rem;">
|
||||
' . ($tabAcheteur['ach_termes_' . $strLangue]) . '
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
return $strRetour;}
|
||||
@ -2178,10 +2178,14 @@ function fxShowCommandes($arrEpreuvesCommandees, $arrCompteClient, $tep_id, $str
|
||||
<td colspan="7">
|
||||
<div class="h5">
|
||||
<?php
|
||||
$arrCapitaine = fxGetCapitaine($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['pec_id'], $arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['epr_id']);
|
||||
|
||||
$arrCapitaine = fxGetCapitaine($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['pec_id'], $arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['epr_id']);
|
||||
//MSIN-4375
|
||||
|
||||
|
||||
echo $arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['par_prenom'] . ' ' . $arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['par_nom'];
|
||||
if ($arrCapitaine != false) {
|
||||
echo $arrCapitaine['par_nom'] . ', ' . $arrCapitaine['par_prenom'];
|
||||
echo 'Capitaine:'.$arrCapitaine['par_nom'] . ', ' . $arrCapitaine['par_prenom'];
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@ -2196,6 +2200,10 @@ function fxShowCommandes($arrEpreuvesCommandees, $arrCompteClient, $tep_id, $str
|
||||
<?php echo fxGetTabInscription('epr_type_' . $strLangue, $arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['epr_id'], 'epreuves', 'epr'); ?>
|
||||
<br>
|
||||
<?php
|
||||
//MSIN-4376
|
||||
//print_rsl($arrEpreuvesCommandees);
|
||||
if($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['eve_code_qr']!=1 ){
|
||||
|
||||
//MSIN-4323
|
||||
//if($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]['eve_code_qr']==1 ){
|
||||
// print_rsl($arrEpreuvesCommandees[$intCtrEpreuvesCommandees]);
|
||||
@ -2216,7 +2224,7 @@ function fxShowCommandes($arrEpreuvesCommandees, $arrCompteClient, $tep_id, $str
|
||||
?> <img src="<?php echo $vDomaine.'/php/qr_img.php?t='.urlencode($result['qr_public_id']); ?> " width="100" /> <?php
|
||||
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ require_once('inc_fx_options.php'); // inclure les fonctions des options
|
||||
require_once('inc_fx_participants.php'); // inclure les fonctions des participants
|
||||
require_once('inc_fx_code_qr.php');
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/inc_fx_panier_js.php';
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/inc_fx_promoteur.php';
|
||||
|
||||
// Retourner le numéro du panier ou en générer un (JSP)
|
||||
// param : langue
|
||||
@ -1436,6 +1437,10 @@ function fxListPanier($strNoPanier)
|
||||
// sortir la couleur de l'événement
|
||||
$sqlColor = "SELECT eve_couleur FROM inscriptions_evenements WHERE eve_id = " . intval($intEvenement);
|
||||
$strColor = $objDatabase->fxGetVar($sqlColor);
|
||||
//MSIN-4376
|
||||
// sortir la switch qrcode
|
||||
$sqlqrcode = "SELECT eve_code_qr FROM inscriptions_evenements WHERE eve_id = " . intval($intEvenement);
|
||||
$strqrcode = $objDatabase->fxGetVar($sqlqrcode);
|
||||
|
||||
// si vide, couleur par défaut
|
||||
if (empty($strColor)) {
|
||||
@ -1459,7 +1464,7 @@ function fxListPanier($strNoPanier)
|
||||
$tabRetour[12] = $tabDons;
|
||||
$tabRetour[13] = $tabDonsAuto;
|
||||
$tabRetour[14] = $strColor;
|
||||
|
||||
$tabRetour[15] = $strqrcode;
|
||||
return $tabRetour;
|
||||
}
|
||||
|
||||
@ -1493,6 +1498,7 @@ function fxShowPanier($strNoPanier, $cart, $output, $resume, $strLangue)
|
||||
$tabQuestionsEpreuve = $tabPanier[11];
|
||||
$tabDons = $tabPanier[12];
|
||||
$strColor = $tabPanier[14];
|
||||
$strcodeqr = $tabPanier[15];
|
||||
|
||||
$tabTotal = fxTotalPanier($strNoPanier, $strLangue);
|
||||
|
||||
@ -1895,7 +1901,12 @@ function fxShowPanier($strNoPanier, $cart, $output, $resume, $strLangue)
|
||||
|
||||
|
||||
//MSIN-4323 $tabEvenements['eve_code_qr']==1 &&
|
||||
if( $resume==1){
|
||||
//MSIN-4376
|
||||
|
||||
|
||||
if($strcodeqr!=1 ){
|
||||
|
||||
if( $resume==1){
|
||||
|
||||
|
||||
$result = fxcreer_qr_token([
|
||||
@ -1916,7 +1927,7 @@ function fxShowPanier($strNoPanier, $cart, $output, $resume, $strLangue)
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$strRetour .= '</tr>';
|
||||
}
|
||||
@ -3031,6 +3042,16 @@ function fxMajCommande($strNoPanier, $strLangue = 'fr', $blnResend = false)
|
||||
$sqlInsert = "INSERT INTO resultats_participants(eve_id, epr_id, par_prenom, par_nom, par_naissance, par_age, par_sexe, par_adresse, par_adresse2, par_ville, pro_id, par_codepostal, pay_id, par_telephone1, par_telephone1_ext, par_telephone2, par_courriel, par_capitaine, com_id, par_nom_equipe, no_panier, par_note, par_maj, no_commande, par_id_original, par_no_equipe, par_equipe, pec_id, rol_id, no_invitation, epr_objectif_dons, epr_objectif_dons_original, par_categorie_1_long_fr, par_categorie_1_long_en,par_categorie_1_court_fr, par_categorie_1_court_en, par_categorie_2_long_fr, par_categorie_2_long_en, par_categorie_2_court_fr, par_categorie_2_court_en, par_categorie_3_long_fr, par_categorie_3_long_en, par_categorie_3_court_fr, par_categorie_3_court_en, epr_objectif_distance, epr_objectif_distance_original, epr_objectif_temps, epr_objectif_temps_original, par_contact_urgence_nom, par_contact_urgence_telephone) SELECT eve_id, epr_id, par_prenom, par_nom, par_naissance, par_age, par_sexe, par_adresse, par_adresse2, par_ville, pro_id, par_codepostal, pay_id, par_telephone1, par_telephone1_ext, par_telephone2, par_courriel, par_capitaine, com_id, par_nom_equipe, no_panier, par_note, '" . fxGetDateTime() . "', '" . $no_commande . "', par_id, par_no_equipe, par_equipe, pec_id, rol_id, no_invitation, epr_objectif_dons, epr_objectif_dons, par_categorie_1_long_fr, par_categorie_1_long_en,par_categorie_1_court_fr, par_categorie_1_court_en, par_categorie_2_long_fr, par_categorie_2_long_en, par_categorie_2_court_fr, par_categorie_2_court_en, par_categorie_3_long_fr, par_categorie_3_long_en, par_categorie_3_court_fr, par_categorie_3_court_en, epr_objectif_distance, epr_objectif_distance, epr_objectif_temps, epr_objectif_temps, par_contact_urgence_nom, par_contact_urgence_telephone FROM inscriptions_panier_participants WHERE par_id = " . intval($tabParticipants[$tabEpreuves[$intCtr]['pec_id']][$intCtr2]['par_id']);
|
||||
$qryInsert = $objDatabase->fxQuery($sqlInsert);
|
||||
|
||||
// MSIN-4379 — Étape 7 : assignation auto du dossard après création du participant (achat).
|
||||
if ($qryInsert !== false) {
|
||||
$intNewParId = (int)$objDatabase->fxGetLastId();
|
||||
$intEprIdAutoBib = (int)$tabParticipants[$tabEpreuves[$intCtr]['pec_id']][$intCtr2]['epr_id'];
|
||||
|
||||
if ($intNewParId > 0 && $intEprIdAutoBib > 0) {
|
||||
fxAssignAutoBibForParticipant($intEprIdAutoBib, $intNewParId);
|
||||
}
|
||||
}
|
||||
|
||||
// insérer les questions
|
||||
if (isset($tabQuestions[$tabParticipants[$tabEpreuves[$intCtr]['pec_id']][$intCtr2]['par_id']])) {
|
||||
$list_file = [];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -7,10 +7,17 @@
|
||||
* Constantes *
|
||||
*
|
||||
**************/
|
||||
define('_VERSION_CODE', '4.72.39');
|
||||
define('_DATE_CODE', '2026-03-09');
|
||||
define('_VERSION_CODE', '4.72.61');
|
||||
define('_DATE_CODE', '2026-06-02');
|
||||
//MSIN-4290
|
||||
define('QR_SECRET_KEY', 'ms1_qr_2026_cle_secrete_longue_et_fixe');
|
||||
// Outil temporaire ms1_kc_set.php — modifier key_chain_http (lien /kc/{pk}/)
|
||||
// KEYCHAIN_HTTP_EDIT_SECRET : paramètre ?k= dans l’URL (mot de passe d’accès à la page)
|
||||
// KEYCHAIN_HTTP_EDIT_SHIFT : ajouté au numéro saisi (ex. 8 → pk 108 en base)
|
||||
// KEYCHAIN_HTTP_EDIT_ALLOWED_COM_IDS : com_id autorisés (virgules) pour /ms1_kc_set.php sans ?k=
|
||||
define('KEYCHAIN_HTTP_EDIT_SECRET', 'ms1_kc_http_edit_2026_c7e4a91f3b2d8e0f6a5c4b3d2e1f0a9');
|
||||
define('KEYCHAIN_HTTP_EDIT_SHIFT', 100);
|
||||
define('KEYCHAIN_HTTP_EDIT_ALLOWED_COM_IDS', '');
|
||||
|
||||
/**********************
|
||||
*
|
||||
|
||||
@ -4,7 +4,9 @@
|
||||
|
||||
// IMPORTANT : aucun espace avant <?php
|
||||
// Aucun echo avant les headers
|
||||
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('display_startup_errors', 0);
|
||||
error_reporting(E_ALL);
|
||||
require_once __DIR__ . '/../libs/phpqrcode-master/qrlib.php';
|
||||
|
||||
// Vérification du token
|
||||
|
||||
20
qr_test.php
20
qr_test.php
@ -175,7 +175,27 @@ function fxShowQrParticipantDebug($strToken, $strLangue = 'fr')
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
============================================
|
||||
DEBUG PARTICIPANT
|
||||
============================================
|
||||
*/
|
||||
|
||||
$strRetour .= '
|
||||
<pre style="
|
||||
background:#111;
|
||||
color:#0f0;
|
||||
padding:15px;
|
||||
font-size:12px;
|
||||
overflow:auto;
|
||||
margin-top:15px;
|
||||
">';
|
||||
|
||||
$strRetour .= htmlspecialchars(
|
||||
print_r($tabParticipantTrouve, true)
|
||||
);
|
||||
|
||||
$strRetour .= '</pre>';
|
||||
return $strRetour;
|
||||
}
|
||||
/*
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
<?php
|
||||
global $db, $objDatabase, $vblnEnvironementDev, $vDomaine, $objDatabasePreProd, $objDatabaseProd;
|
||||
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('display_startup_errors', 0);
|
||||
error_reporting(E_ALL);
|
||||
// vérifier les paramètres
|
||||
if (!empty($_GET['t']))
|
||||
$intMenu = $_GET['t'];
|
||||
|
||||
@ -7,7 +7,7 @@ require_once('inc_dates.php');
|
||||
require_once('inc_files.php');
|
||||
require_once('inc_manager.php');
|
||||
error_reporting(E_ALL);
|
||||
//ini_set("display_errors", 0);
|
||||
ini_set("display_errors", 0);
|
||||
global $arrConDatabasePreProd,$arrConDatabasecrm;
|
||||
$db = $objDatabase = new clsMysql($GLOBALS['arrConDatabaseMain']);
|
||||
$db_prod = $objDatabaseProd = new clsMysql($GLOBALS['arrConDatabaseProd']);
|
||||
|
||||
@ -600,6 +600,9 @@ function fxrapportexcell_array($headers,$data,$memexcfichier,$memexctitre) {
|
||||
}
|
||||
function fxupload_excel_fnq($mem_fichier) {
|
||||
/** Include PHPExcel */
|
||||
//ini_set('display_errors', 1);
|
||||
//ini_set('display_startup_errors', 1);
|
||||
// error_reporting(E_ALL);
|
||||
require_once dirname(__FILE__) . '/Classes/PHPExcel.php';
|
||||
$objReader = new PHPExcel_Reader_Excel2007();
|
||||
$objReader->setReadDataOnly(false);
|
||||
@ -621,13 +624,14 @@ function fxupload_excel_fnq($mem_fichier) {
|
||||
$counter = 0;
|
||||
//echo('test');
|
||||
foreach ($mem_rows as $r) {
|
||||
|
||||
//echosl($counter);
|
||||
if ($counter != 0) {
|
||||
// $sqlInsert = "INSERT INTO inscriptions_tq set tq_nom='" . $GLOBALS['db']->fxEscape(htmlentities(trim( trim($r[0])), ENT_QUOTES, 'UTF-8')) . "',tq_prenom='" . $GLOBALS['db']->fxEscape(htmlentities(trim($r[1]), ENT_QUOTES, 'UTF-8')) . "',tq_no='" . $r[2] . "',tq_adhesion='" . $r[3] . "',tq_naissance='" . $r[4] . "',tq_echeance='" . $r[5] . "',tq_sexe='" . $r[6] . "',tq_timeupdate=now()";
|
||||
//print_r($r);
|
||||
$newDate = date("Y-m-d", strtotime($r[7]));
|
||||
//print_rsl($r);
|
||||
|
||||
$newDate = date("Y-m-d", strtotime($r[3]));
|
||||
//echo("<br>");
|
||||
$sqlInsert = "INSERT INTO inscriptions_fnq set tq_no='" . $r[3] . "',tq_naissance='" . $newDate . "',tq_timeupdate=now()";
|
||||
$sqlInsert = "INSERT INTO inscriptions_fnq set tq_nom='" . $GLOBALS['db']->fxEscape($r[0]) . "',tq_prenom='" . $GLOBALS['db']->fxEscape($r[1] ). "',tq_sexe='" . $r[2] . "', tq_no='" . $r[4] . "',tq_naissance='" . $newDate . "',tq_timeupdate=now()";
|
||||
$qryInsert = $GLOBALS['db']->fxQuery($sqlInsert);
|
||||
|
||||
}
|
||||
@ -635,7 +639,7 @@ function fxupload_excel_fnq($mem_fichier) {
|
||||
}
|
||||
|
||||
//echo($counter);
|
||||
return $counter;
|
||||
return $counter-1;
|
||||
}
|
||||
|
||||
function fxupload_excel_triathlonv2($mem_fichier) {
|
||||
|
||||
Reference in New Issue
Block a user