Files
ms1inscription-v5/panier.inc.php
2026-05-13 09:43:32 -04:00

112 lines
4.9 KiB
PHP

<?php
global $tabEvenement, $strLangue, $vDomaine, $objDatabase;
if (isset($_SESSION['no_panier'])) {
// lister les items du panier ici
$mem_panierinfo = fxNbItemsPanier($_SESSION['no_panier']);
} else
$mem_panierinfo = null;
if ($mem_panierinfo != null && $mem_panierinfo['nbitem'] > 0) {
// Valide les rabais auto
// fxSetRabaisauto('add', $_SESSION['no_panier'], $tabEvenement, $strLangue);
fxSetRabaisauto2('add', $_SESSION['no_panier'], $tabEvenement, $strLangue);
$mem_total = fxTotalPanier($_SESSION['no_panier'], $strLangue);
?>
<script type="text/javascript">
$(function() {
$('.btn_delete').click(function() {
return confirm("<?php if ($strLangue == 'fr') { ?>Êtes-vous certain de vouloir retirer le/les item(s) ?<?php } else { ?>Are you sure you want to remove the item(s) ?<?php } ?>");
});
$('#btn_participant').click(function(){
<?php
if ($_SESSION['last_race'] == 'bénévole') {
?>
document.location.href = '<?php echo $vDomaine; ?>/<?php echo $tabEvenement['general']['eve_label_url']; if ($strLangue == 'fr') { ?>/benevoles<?php } else { ?>/en/volunteers<?php } ?>';
<?php
} else {
?>
document.location.href = '<?php echo $vDomaine; ?>/<?php echo $tabEvenement['general']['eve_label_url']; if ($strLangue == 'en') { ?>/en<?php } ?>#reserver';
<?php
}
?>
});
$(".btn_modifinscriptions").click(function(){
code = $(this).data('code');
if('<?php echo $strLangue ?>' == 'fr')
strpath = '../../reserver/';
else
strpath = '../../book/';
document.location.href = strpath + code + '/' + $(this).data('epr_id') + '?action=mod&par_id_original=' + $(this).data('value');
});
});
</script>
<form action="<?php echo $vDomaine . '/'; if ($strLangue == 'fr') { ?>panier<?php } else { ?>cart<?php } ?>/somaire/<?php echo $tabEvenement['general']['eve_label_url']; ?>" id="frm_panier" name="frm_panier" method="post">
<fieldset>
<?php echo fxShowPanier($_SESSION['no_panier'], 1, 'web', 0, $strLangue); ?>
<p><?php echo $tabEvenement['general']['eve_msg_cart_'.$strLangue] ;?></p><br>
<?php
$tabParticipants = fxGetPanierParticipants($_SESSION['no_panier']);
// verrifi si on as déja une adresse de facturation
$sqlValide = "select com_prenom from inscriptions_panier_acheteurs WHERE no_panier = '" . $_SESSION['no_panier'] . "'";
$nbValide = $objDatabase->fxGetVar($sqlValide);
if ($nbValide == null && !isset($_SESSION['com_id'])) {
if (count($tabParticipants) > 1) {
?>
<div id="quitter_pas_login">
<div class="titre"><?php afficheTexte('panier_login_titre_address'); ?></div>
<p><?php afficheTexte('panier_login_fastcheckout_txte'); ?></p>
<br />
<?php
$x = 1;
foreach ($tabParticipants as $key => $value) {
if ($x==1)
$memcheck = ' checked="checked"';
else
$memcheck = "";
$x++;
echo '<input type="radio" name="acheteur" value="' . $value['par_id'] . '" ' . $memcheck . ' >' . $value['nom'] . '<br>';
}
?>
</div>
<?php
} else {
$mem_par_id=$tabParticipants[1]['par_id'];
?>
<input type="hidden" name="acheteur" value="<?php echo $mem_par_id; ?>">
<?php
}
}
?>
<br>
<br>
<div class="row text-center">
<div class="col-12 col-lg-4">
<button type="button" id="btn_empty" name="btn_empty" class="btn btn-secondary rounded-0 mb-2"><i class="fa fa-trash-o mr-2" aria-hidden="true"></i> <?php afficheTexte('panier_bouton_vider'); ?></button>
</div>
<div class="col-12 col-lg-4">
<button type="button" id="btn_participant" name="btn_participant" class="btn btn-primary rounded-0 mb-2"><i class="fa fa-cart-plus mr-2" aria-hidden="true"></i> <?php afficheTexte('panier_bouton_ajouter'); ?></button>
</div>
<div class="col-12 col-lg-4">
<button type="submit" id="btn_next" name="btn_next" class="btn btn-primary rounded-0 mb-2"><?php afficheTexte('panier_bouton_checkout'); ?> <i class="fa fa-chevron-circle-right ml-2" aria-hidden="true"></i></button>
</div>
</div>
<br>
</fieldset>
</form>
<?php
} else {
?>
<p><?php if ($strLangue == 'fr') { ?>Votre panier est vide pour le moment.<?php } else { ?>Your cart is currently empty.<?php } ?></p>
<?php
}