Пример #1
0
if (!CheckTourSession()) {
    print get_text('CrackError');
    exit;
}
$error = 0;
$tourId = StrSafe_DB($_SESSION['TourId']);
if (!IsBlocked(BIT_BLOCK_PARTICIPANT)) {
    $recalc = false;
    $indFEvent = $teamFEvent = $country = $div = $cl = $zero = null;
    // se cambio status ricalcolo gli spareggi
    $query = "SELECT EnClass FROM Entries WHERE EnId=" . StrSafe_DB($id) . " AND EnStatus<>" . StrSafe_DB($status) . " ";
    //print $query;exit;
    $rs = safe_r_sql($query);
    if ($rs && safe_num_rows($rs) == 1) {
        $recalc = true;
        $x = Params4Recalc($id);
        if ($x !== false) {
            list($indFEvent, $teamFEvent, $country, $div, $cl, $zero) = $x;
        }
    }
    //Adesso aggiorno lo status
    $query = "UPDATE " . "Entries " . "SET " . "EnStatus=" . StrSafe_DB($status) . " " . "WHERE " . "EnId=" . StrSafe_DB($id) . " ";
    $rs = safe_w_sql($query);
    if (!$rs) {
        $error = 1;
    }
    if ($recalc) {
        // ricalcolo il vecchio e il nuovo
        if (!is_null($indFEvent)) {
            RecalculateShootoffAndTeams($indFEvent, $teamFEvent, $country, $div, $cl, $zero);
        }
Пример #2
0
$id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
$row = isset($_REQUEST['row']) ? $_REQUEST['row'] : null;
$col = isset($_REQUEST['col']) ? $_REQUEST['col'] : null;
if (!CheckTourSession() || is_null($id) || is_null($row) || is_null($col)) {
    print get_text('CrackError');
    exit;
}
$tourId = $_SESSION['TourId'];
$error = 0;
if (!IsBlocked(BIT_BLOCK_PARTICIPANT)) {
    // Verifico che l'id esista per la gara aperta
    $query = "SELECT " . "EnId " . "FROM " . "Entries " . "WHERE EnId=" . StrSafe_DB($id) . " AND EnTournament=" . $tourId . " ";
    $rs = safe_r_sql($query);
    if (safe_num_rows($rs) == 1) {
        $indFEvent = $teamFEvent = $country = $div = $cl = $zero = null;
        $recalc = Params4Recalc($id);
        if ($recalc !== false) {
            $recalc = true;
            list($indFEvent, $teamFEvent, $country, $div, $cl, $zero) = $recalc;
        }
        // cancello da Entries
        $query = "DELETE FROM Entries WHERE EnId=" . StrSafe_DB($id) . " AND EnTournament=" . StrSafe_DB($tourId) . " ";
        $rs = safe_w_sql($query);
        // cancello da Qualifications
        $query = "DELETE FROM Qualifications WHERE QuId=" . StrSafe_DB($id) . " ";
        $rs = safe_w_sql($query);
        if ($recalc) {
            RecalculateShootoffAndTeams($indFEvent, $teamFEvent, $country, $div, $cl, $zero);
            // rank di classe x tutte le distanze
            $q = "SELECT ToNumDist FROM Tournament WHERE ToId={$_SESSION['TourId']}";
            $r = safe_r_sql($q);
Пример #3
0
/*
													- DeleteRow.php -
	Elimina un partecipante e ritorna il suo id
*/
define('debug', false);
require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Qualification/Fun_Qualification.local.inc.php';
require_once 'Partecipants/Fun_Partecipants.local.inc.php';
if (!isset($_REQUEST['id']) || !CheckTourSession()) {
    print get_text('CrackError');
    exit;
}
if (!IsBlocked(BIT_BLOCK_PARTICIPANT)) {
    $indFEvent = $teamFEvent = $country = $div = $cl = $zero = null;
    $recalc = Params4Recalc($_REQUEST['id']);
    if ($recalc !== false) {
        $recalc = true;
        list($indFEvent, $teamFEvent, $country, $div, $cl, $zero) = $recalc;
    }
    $Delete = "DELETE FROM Entries WHERE EnId=" . StrSafe_DB($_REQUEST['id']) . " ";
    $Rs = safe_w_sql($Delete);
    $Delete = "DELETE FROM Qualifications WHERE QuId=" . StrSafe_DB($_REQUEST['id']) . " ";
    $Rs = safe_w_sql($Delete);
    // ricalcolo
    if ($recalc) {
        RecalculateShootoffAndTeams($indFEvent, $teamFEvent, $country, $div, $cl, $zero);
        // rank di classe x tutte le distanze
        $q = "SELECT ToNumDist FROM Tournament WHERE ToId={$_SESSION['TourId']}";
        $r = safe_r_sql($q);
        $tmpRow = safe_fetch($r);
Пример #4
0
if (!IsBlocked(BIT_BLOCK_PARTICIPANT)) {
    foreach ($_REQUEST as $Key => $Value) {
        if (substr($Key, 0, 13) == 'd_e_EnStatus_') {
            $Campo = '';
            $Id = '';
            list(, , $Campo, $Id) = explode('_', $Key);
            $EnId = $Id;
            // se cambio status ricalcolo gli spareggi
            $recalc = false;
            $indFEvent = $teamFEvent = $country = $div = $cl = $zero = null;
            $query = "SELECT EnClass FROM Entries WHERE EnId=" . StrSafe_DB($Id) . " AND EnStatus<>" . StrSafe_DB($Value) . " ";
            //print $query;exit;
            $rs = safe_r_sql($query);
            if ($rs && safe_num_rows($rs) == 1) {
                $recalc = true;
                $x = Params4Recalc($Id);
                if ($x !== false) {
                    list($indFEvent, $teamFEvent, $country, $div, $cl, $zero) = $x;
                }
            }
            $Update = "UPDATE Entries SET " . "ENStatus=" . StrSafe_DB($Value) . " " . "WHERE EnId=" . StrSafe_DB($Id) . " ";
            $RsUp = safe_w_sql($Update);
            if (debug) {
                print $Update . '<br><br>';
            }
            if ($recalc) {
                // ricalcolo il vecchio e il nuovo
                if (!is_null($indFEvent)) {
                    RecalculateShootoffAndTeams($indFEvent, $teamFEvent, $country, $div, $cl, $zero);
                }
                // rank di classe x tutte le distanze
Пример #5
0
     $query = "SELECT" . " DivAthlete and ClAthlete as Athlete  " . "FROM " . " Divisions " . " INNER JOIN Classes on DivTournament=ClTournament " . "WHERE " . " DivTournament={$_SESSION['TourId']} " . " AND DivId=" . StrSafe_DB($tmp->EnDivision) . " AND ClID=" . StrSafe_DB($tmp->EnClass);
     //print $query;exit;
     $t = safe_r_sql($query);
     $EnAthlete = intval($u = safe_fetch($t) and $u->Athlete);
 }
 $Update = "UPDATE Entries SET " . "EnAthlete=" . $EnAthlete . " " . "WHERE EnId=" . StrSafe_DB($_REQUEST['EnId']) . " ";
 //print $Update;Exit;
 $RsUp = safe_w_sql($Update);
 if (debug) {
     print $Update . '<br><br>';
 }
 if (!$RsUp) {
     $Errore = 1;
 } else {
     if ($recalc) {
         $x = Params4Recalc($_REQUEST['EnId']);
         if ($x !== false) {
             list($indFEvent, $teamFEvent, $country, $div, $cl, $zero) = $x;
         }
         // ricalcolo il vecchio e il nuovo
         RecalculateShootoffAndTeams($indFEventOld, $teamFEventOld, $countryOld, $divOld, $clOld, $zeroOld);
         RecalculateShootoffAndTeams($indFEvent, $teamFEvent, $country, $div, $cl, $zero);
         // rank di classe x tutte le distanze
         $q = "SELECT ToNumDist FROM Tournament WHERE ToId={$_SESSION['TourId']}";
         $r = safe_r_sql($q);
         $tmpRow = safe_fetch($r);
         for ($i = 0; $i < $tmpRow->ToNumDist; ++$i) {
             CalcQualRank($i, $divOld . $clOld);
             CalcQualRank($i, $div . $cl);
         }
         // individuale abs
Пример #6
0
 }
 $Rs = safe_r_sql($Select);
 if (debug) {
     print $Select . '<br><br>';
 }
 if (!$Rs || safe_num_rows($Rs) != 1) {
     $Errore = 1;
 } else {
     $Row = safe_fetch($Rs);
     //print '..' . stripslashes($Value) ;
     if ($Row->{$Campo} != stripslashes($passValue)) {
         $Errore = 1;
     } else {
         $Value = $Row->{$Campo};
         if ($recalc) {
             $x = Params4Recalc($Chiave);
             if ($x !== false) {
                 list($indFEvent, $teamFEvent, $country, $div, $cl, $zero) = $x;
             }
             // ricalcolo il vecchio e il nuovo
             RecalculateShootoffAndTeams($indFEventOld, $teamFEventOld, $countryOld, $divOld, $clOld, $zeroOld);
             RecalculateShootoffAndTeams($indFEvent, $teamFEvent, $country, $div, $cl, $zero);
             // rank di classe x tutte le distanze
             $q = "SELECT ToNumDist FROM Tournament WHERE ToId={$_SESSION['TourId']}";
             $r = safe_r_sql($q);
             $tmpRow = safe_fetch($r);
             for ($i = 0; $i < $tmpRow->ToNumDist; ++$i) {
                 CalcQualRank($i, $divOld . $clOld);
                 CalcQualRank($i, $div . $cl);
             }
             // individuale abs