162 lines
5.9 KiB
PHP
162 lines
5.9 KiB
PHP
<?php
|
|
require_once('php/inc_start_time.php');
|
|
require_once('php/inc_fonctions.php');
|
|
require_once('php/inc_fx_promoteur.php');
|
|
|
|
global $objDatabase;
|
|
|
|
if (!empty($_GET['lang']))
|
|
$strLangue = $_GET['lang'];
|
|
else
|
|
$strLangue = 'fr';
|
|
|
|
// récupérer le code et les infos de l'événement
|
|
if (!empty($_GET['code'])) {
|
|
$code = $_GET['code'];
|
|
} else {
|
|
$code = 'bib_assignment';
|
|
}
|
|
|
|
$strLienFr = "/" . $code . "/fr";
|
|
$strLienEn = "/" . $code . "/en";
|
|
|
|
if (isset($_POST['promoteur_eve_id'])) {
|
|
$_SESSION['promoteur_eve_id'] = $_POST['promoteur_eve_id'];
|
|
} else {
|
|
if (isset($_SESSION['promoteur_eve_id'])) {
|
|
$_POST['promoteur_eve_id'] = $_SESSION['promoteur_eve_id'];
|
|
}
|
|
}
|
|
|
|
// preparer variables
|
|
if (isset($_POST['chk_bib_and_team']))
|
|
$intMode = 1;
|
|
else
|
|
$intMode = 0;
|
|
|
|
if (isset($_POST['epr_id'])) {
|
|
$intEprId = $_POST['epr_id'];
|
|
$_SESSION['epr_id_bib'] = $_POST['epr_id'];
|
|
} else {
|
|
if (isset($_GET['epr_id'])) {
|
|
$intEprId = $_GET['epr_id'];
|
|
$_SESSION['epr_id_bib'] = $_GET['epr_id'];
|
|
} else {
|
|
if(isset($_SESSION['epr_id_bib'])) {
|
|
$intEprId = $_SESSION['epr_id_bib'];
|
|
$_POST['epr_id'] = $_SESSION['epr_id_bib'];
|
|
} else
|
|
$intEprId = 0;
|
|
}
|
|
}
|
|
|
|
$sqlEpreuves = "SELECT * FROM inscriptions_epreuves WHERE epr_id = " . intval($intEprId);
|
|
$tabEpreuves = $objDatabase->fxGetRow($sqlEpreuves);
|
|
|
|
|
|
if($_POST['promoteur_eve_id']=='') { $_POST['promoteur_eve_id']=$tabEpreuves['eve_id'] ; }
|
|
$intEveIdbase= $_POST['promoteur_eve_id'];
|
|
if (isset($_POST['row_action_' . $intEprId]) && $_POST['row_action_' . $intEprId] != '') {
|
|
$strAction = $_POST['row_action_' . $intEprId];
|
|
$intEveId = $_POST['promoteur_eve_id'];
|
|
|
|
if (isset($_POST['num_bib_range_start_'. $intEprId])) {
|
|
if (empty($_POST['num_bib_range_start_'. $intEprId]))
|
|
$intStart = 1;
|
|
else
|
|
$intStart = $_POST['num_bib_range_start_' . $intEprId];
|
|
} else
|
|
$intStart = 0;
|
|
|
|
if (isset($_POST['num_bib_range_finish_dispo_' . $intEprId])) {
|
|
if (empty($_POST['num_bib_range_finish_dispo_' . $intEprId]))
|
|
$intFinish_dispo = 999999;
|
|
else
|
|
$intFinish_dispo = $_POST['num_bib_range_finish_dispo_' . $intEprId];
|
|
} else
|
|
$intFinish_dispo = 99999;
|
|
|
|
|
|
if (isset($_POST['sel_assignment_type_'. $intEprId]))
|
|
$intAssignmentType = $_POST['sel_assignment_type_'. $intEprId];
|
|
else {
|
|
if (isset($_GET['type']))
|
|
$intAssignmentType = $_GET['type'];
|
|
else
|
|
$intAssignmentType = 2; // defaut = assignation par nom de famille
|
|
}
|
|
|
|
switch($intAssignmentType) {
|
|
case 1:
|
|
$strOrderBy = " ORDER BY TRIM(p.par_prenom)";
|
|
break;
|
|
case 3:
|
|
$strOrderBy = " ORDER BY p.par_maj";
|
|
break;
|
|
case 4:
|
|
$strOrderBy = " ORDER BY p.par_naissance DESC";
|
|
break;
|
|
case 2:
|
|
default:
|
|
$strOrderBy = " ORDER BY TRIM(p.par_nom), TRIM(p.par_prenom)";
|
|
break;
|
|
}
|
|
|
|
$sqlEpreuvesCommandees = "select * from resultats_epreuves_commandees c, resultats_participants p where c.epr_id = " . intval($tabEpreuves['epr_id']) . " and c.pec_actif = 1 and c.pec_id_original = p.pec_id GROUP BY pec_id_original" . $strOrderBy;
|
|
$tabEpreuvesCommandees = $objDatabase->fxGetResults($sqlEpreuvesCommandees);
|
|
|
|
fxSetBibNumbers($tabEpreuvesCommandees, $tabEpreuves['epr_id'], $intStart, 0, $intAssignmentType, $tabEpreuves['epr_equipe'], $tabEpreuves['epr_equipe'], $intMode, $intFinish_dispo);
|
|
|
|
$sqlEpreuve = "SELECT * FROM inscriptions_epreuves WHERE epr_id = " . intval($tabEpreuves['epr_id']);
|
|
$tabEpreuve = $objDatabase->fxGetRow($sqlEpreuve);
|
|
|
|
?>
|
|
<a class="btn btn-primary rounded-pill" href="<?php echo $vDomaine .'/'. $strPage . "/inc_tableau_dossards?promoteur_eve_id=" . urlencode(base64_encode($intEveIdbase)); ?>">
|
|
<i class="fa fa-chevron-left mr-2" aria-hidden="true"></i>
|
|
<?php afficheTexte('dossard_back'); ?>
|
|
</a><br>
|
|
<?php
|
|
fxShowBibNumbersTable($tabEpreuve, $strLangue, $tabEpreuve['eve_id']);
|
|
?>
|
|
<a class="btn btn-primary rounded-pill" href="<?php echo $vDomaine .'/'. $strPage . "/inc_tableau_dossards?promoteur_eve_id=" . urlencode(base64_encode($intEveIdbase)); ?>">
|
|
<i class="fa fa-chevron-left mr-2" aria-hidden="true"></i>
|
|
<?php afficheTexte('dossard_back'); ?>
|
|
</a><br>
|
|
<?php
|
|
|
|
} else {
|
|
$sqlEveId = "SELECT eve_id FROM inscriptions_epreuves WHERE epr_id = " . intval($intEprId);
|
|
$intEveId = $objDatabase->fxGetVar($sqlEveId);
|
|
|
|
if (isset($_GET['a'])) {
|
|
$strAction = $_GET['a'];
|
|
?>
|
|
<a class="btn btn-primary rounded-pill" href="<?php echo $vDomaine .'/'. $strPage . "/inc_tableau_dossards?promoteur_eve_id=" . urlencode(base64_encode($intEveIdbase)); ?>">
|
|
<i class="fa fa-chevron-left mr-2" aria-hidden="true"></i>
|
|
<?php afficheTexte('dossard_back'); ?>
|
|
</a><br>
|
|
<?php
|
|
if ($_GET['a'] == 'view')
|
|
fxShowBibNumbersTable($tabEpreuves, $strLangue, $intEveId);
|
|
if ($_GET['a'] == 'reset')
|
|
fxSetBibNumbers($tabEpreuves, $tabEpreuves['epr_id'], 0, 0, 2, $tabEpreuves['epr_equipe'], 'reset', $intMode);
|
|
if ($_GET['a'] == 'show_bib_dupes') {
|
|
fxShowDupes($intEveId);
|
|
?>
|
|
<a class="btn btn-primary rounded-pill" href="<?php echo $vDomaine .'/'. $strPage . "/inc_tableau_dossards?promoteur_eve_id=" . urlencode(base64_encode($intEveIdbase)); ?>">
|
|
<i class="fa fa-chevron-left mr-2" aria-hidden="true"></i>
|
|
<?php afficheTexte('dossard_back'); ?>
|
|
</a><br>
|
|
<?php
|
|
|
|
}
|
|
|
|
} else {
|
|
$strAction = 'defaut';
|
|
$sqlEpreuve = "SELECT * FROM inscriptions_epreuves WHERE epr_id = " . intval($tabEpreuves['epr_id']);
|
|
$tabEpreuve = $objDatabase->fxGetRow($sqlEpreuve);
|
|
|
|
fxShowBibNumbersTable($tabEpreuve, $strLangue, $intEveId);
|
|
}
|
|
}
|