Example #1
0
     // 	Recupero l'ultimo id inserito
     $RowId = safe_w_last_id();
     if ($RowId) {
         $_SESSION['TourId'] = $RowId;
     } else {
         print get_text('UnexpectedError');
         exit;
     }
 }
 if (isset($_REQUEST['New']) or $DoChanges) {
     //First I decide whenever, in case of new rules, I need to apply the old ones (to manage the switch on 1st April 2014)
     $useOldRules = intval($_REQUEST['xx_ToWhenFromYear']) < 2014 || intval($_REQUEST['xx_ToWhenFromMonth']) < 4;
     // Eseguo il/i file(s) di setup della gara
     GetSetupFile($_SESSION['TourId'], $_REQUEST['d_ToType'], $_REQUEST['d_Rule'], empty($_REQUEST['d_SubRule']) ? '1' : $_REQUEST['d_SubRule'], $useOldRules);
     // calcolo il numero massimo di persone in ogni team
     calcMaxTeamPerson(array(), true, $_SESSION['TourId']);
     unset($_REQUEST['New']);
 }
 // sets any options configured in this page
 if (!empty($_REQUEST['Options'])) {
     $UseAPI = false;
     foreach ($_REQUEST['Options'] as $Option => $Value) {
         switch ($Option) {
             case 'ISK-Lite-ServerUrl':
                 if ($Value and $_REQUEST['Options']['ISK-Lite-Mode']) {
                     if (substr($Value, 0, 4) != 'http') {
                         $Value = 'http://' . $Value;
                     }
                     if ($off = @strpos($Value, '/', 9)) {
                         $Value = substr($Value, 0, $off);
                     }
Example #2
0
if (!CheckTourSession() || !isset($_REQUEST['EvCode'])) {
    printCrackError();
}
require_once 'Common/Fun_FormatText.inc.php';
require_once 'Common/Lib/ArrTargets.inc.php';
require_once 'Qualification/Fun_Qualification.local.inc.php';
require_once 'Common/Fun_Sessions.inc.php';
require_once 'Common/Fun_Various.inc.php';
if (isset($_REQUEST['DelRow']) && !IsBlocked(BIT_BLOCK_TOURDATA)) {
    list($EcClass, $EcDivision) = explode('~', $_REQUEST['DelRow']);
    //print $EcClass . ' - ' . $EcDivision . '<br>';exit;
    $Delete = "DELETE FROM EventClass " . "WHERE EcCode=" . StrSafe_DB($_REQUEST['EvCode']) . " AND EcClass=" . StrSafe_DB($EcClass) . " AND EcDivision=" . StrSafe_DB($EcDivision) . " " . "AND EcTeamEvent!='0' AND EcTournament=" . StrSafe_DB($_SESSION['TourId']) . " ";
    //print $Delete;exit;
    $Rs = safe_w_sql($Delete);
    // calcolo il numero massimo di persone nel team
    calcMaxTeamPerson(array($_REQUEST['EvCode']));
    // cancello le righe di Team per l'evento passato
    $queries[] = "DELETE FROM Teams WHERE TeTournament=" . StrSafe_DB($_SESSION['TourId']) . " AND TeFinEvent=1 AND TeEvent=" . StrSafe_DB($_REQUEST['EvCode']) . " ";
    // cancello i nomi
    $queries[] = "DELETE FROM TeamComponent WHERE TcTournament=" . StrSafe_DB($_SESSION['TourId']) . " AND TcFinEvent=1 AND TcEvent=" . StrSafe_DB($_REQUEST['EvCode']) . " ";
    // cancello i nomi fin
    $queries[] = "DELETE FROM TeamFinComponent WHERE TfcTournament=" . StrSafe_DB($_SESSION['TourId']) . " AND TfcEvent=" . StrSafe_DB($_REQUEST['EvCode']) . " ";
    // elimino le griglie
    $queries[] = "DELETE FROM TeamFinals " . "WHERE TfEvent=" . StrSafe_DB($_REQUEST['EvCode']) . " AND TfTournament=" . StrSafe_DB($_SESSION['TourId']) . " ";
    $Rs = safe_w_sql($Delete);
    // reset shootoff
    ResetShootoff($_REQUEST['EvCode'], 1, 0);
    // teamabs
    MakeTeamsAbs(null, null, null);
    header('Location: SetEventRules.php?EvCode=' . $_REQUEST['EvCode']);
    exit;
function calcMaxTeamPerson_20110216($TournamentID)
{
    $events = array();
    $q = "\n\t\tSELECT EvCode\n\t\tFROM\n\t\t\tEvents\n\t\tWHERE\n\t\t\tEvTournament={$TournamentID} AND EvTeamEvent=1\n\t";
    $r = safe_r_sql($q);
    if (safe_num_rows($r) > 0) {
        while ($row = safe_fetch($r)) {
            $events[] = $row->EvCode;
        }
    }
    calcMaxTeamPerson($events, true, $TournamentID);
}