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

22 lines
1006 B
PHP

<?php
include_once('php/inc_fonctions.php');
$int_pec_id = $_POST['pec_id_original'];
$int_epr_id = $_POST['epr_id'];
//echo "DEBUG<br />pec_id_original = $int_pec_id and epr_id = $int_epr_id";
//var_dump($_GET);
// check registration status
$query = "select is_cancelled from resultats_epreuves_commandees where pec_id_original = ". intval($int_pec_id) ." and epr_id = " . intval($int_epr_id);
$recStatus = mysqli_query($objDatabase->con, $query);
$resStatus = mysqli_fetch_row($recStatus);
if($resStatus[0] == '0' || $resStatus[0] == '')
$sql = "update resultats_epreuves_commandees set is_cancelled = 1 where pec_id_original = '" . intval($int_pec_id) . "' and epr_id =" . intval($int_epr_id);
else
$sql = "update resultats_epreuves_commandees set is_cancelled = 0 where pec_id_original = '" . intval($int_pec_id) . "' and epr_id =" . intval($int_epr_id);
if(!mysqli_query($objDatabase->con, $sql))
die('Could not delete data: ' . mysqli_connect_error());
header("Location: ../compte");