Пример #1
0
require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/Fun_FormatText.inc.php';
require_once 'TV/Fun_HTML.local.inc.php';
$TourId = 0;
if (!empty($_SESSION['TourId'])) {
    $TourId = $_SESSION['TourId'];
}
if (!empty($_REQUEST['TourId'])) {
    $TourId = $_REQUEST['TourId'];
}
if (!IsBlocked(BIT_BLOCK_MEDIA)) {
    if ($TourId and !empty($_POST['NewRule'])) {
        $q = safe_r_sql("SELECT IFNULL(MAX(TVRId),0) AS CurID FROM TVRules WHERE TVRTournament={$TourId}");
        $newID = safe_fetch($q)->CurID + 1;
        safe_w_sql("INSERT INTO TVRules set TVRId={$newID}, TVRTournament={$TourId}, TVRName=" . strsafe_DB($_POST['NewRule']));
        $_GET = array();
        cd_redirect(go_get('edit', $newID));
    }
    // cancella la regola e le sue associazioni
    if (!empty($_GET['delete'])) {
        $IDrule = intval($_GET['delete']);
        // controlla che non sia una regola predefinita (IDtour = -1)
        $q = safe_r_sql("SELECT * FROM TVRules WHERE TVRId={$IDrule} AND TVRTournament={$TourId}");
        if (!($r = safe_fetch($q))) {
            cd_redirect();
        }
        // non esiste la regola o
        $q = safe_r_sql("SELECT * FROM TVSequence WHERE TVSTable='DB' AND TVSRule={$IDrule} AND TVSTournament={$TourId}");
        while ($r = safe_fetch($q)) {
            safe_w_sql("DELETE FROM TVParams WHERE TVPId={$r->TVSContent} AND TVPTournament={$TourId}");
Пример #2
0
            if (intval($item)) {
                $Countries[] = intval($item);
            }
        }
    }
    if (!empty($_REQUEST['Division'])) {
        foreach ($_REQUEST['Division'] as $item) {
            if ($item) {
                $Divisions[] = strsafe_DB($item);
            }
        }
    }
    if (!empty($_REQUEST['Class'])) {
        foreach ($_REQUEST['Class'] as $item) {
            if ($item) {
                $Classes[] = strsafe_DB($item);
            }
        }
    }
    if (!empty($_REQUEST['Session'])) {
        foreach ($_REQUEST['Session'] as $item) {
            if (intval($item)) {
                $Sessions[] = intval($item);
            }
        }
    }
}
sort($Entries);
sort($Countries);
sort($Divisions);
sort($Classes);
Пример #3
0
<?php

if ($version < '2013-01-03 15:27:00') {
    safe_w_sql("update TVContents set\n\t\t\tTVCContent=" . strsafe_DB(file_get_contents(dirname(__FILE__) . '/Images/ianseo.png')) . ",\n\t\t\tTVCMimeType='image/png'\n\t\t\twhere TVCId=1 and TVCTournament=-1");
    db_save_version('2013-01-03 15:27:00');
}
if ($version < '2013-01-20 17:45:00') {
    safe_w_sql("drop table if exists Vegas ");
    safe_w_sql("CREATE TABLE IF NOT EXISTS Vegas (\n\t\tVeId int(10) unsigned NOT NULL,\n\t\tVeArrowstring varchar(90) NOT NULL,\n\t\tVeScore smallint(6) NOT NULL,\n\t\tVeX smallint(6) NOT NULL,\n\t\tVeRank smallint(6) NOT NULL,\n\t\tVeSubClass varchar(2) NOT NULL,\n\t\tVeTimestamp datetime DEFAULT NULL,\n\t\tPRIMARY KEY (VeId),\n\t\tindex VeScore (VeScore,VeX)\n\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8");
    db_save_version('2013-01-20 17:45:00');
}
if ($version < '2013-01-21 18:10:00') {
    $q = "ALTER TABLE `Tournament` ADD `ToTimeZone` varchar(6) NOT NULL DEFAULT '' AFTER `ToIocCode` ";
    $r = safe_w_sql($q, false, array(1060));
    db_save_version('2013-01-21 18:10:00');
}
if ($version < '2013-01-21 21:10:00') {
    $q = "ALTER TABLE `Tournament` change `ToTimeZone` `ToTimeZone` varchar(50) NOT NULL DEFAULT '' ";
    $r = safe_w_sql($q, false, array(1060));
    db_save_version('2013-01-21 21:10:00');
}
if ($version < '2013-01-22 13:10:00') {
    $q = "ALTER TABLE `Tournament` change `ToTimeZone` `ToTimeZone` varchar(50) NOT NULL DEFAULT '' ";
    $r = safe_w_sql($q, false, array(1060));
    db_save_version('2013-01-22 13:10:00');
}
if ($version < '2013-01-25 15:10:00') {
    safe_w_sql("drop table if exists VegasAwards ");
    $q = "CREATE TABLE IF NOT EXISTS VegasAwards (\n\t\tVaTournament int(11) NOT NULL,\n\t\tVaDivision varchar(2) NOT NULL,\n\t\tVaClass varchar(2) NOT NULL,\n\t\tVaSubClass varchar(2) NOT NULL,\n\t\tVaRank int(10) NOT NULL,\n\t\tVaAward float(15,2) not null DEFAULT 0,\n\t\tVaToDelete TINYINT not null default 0,\n\t\tPRIMARY KEY (VaTournament, VaDivision, VaClass, VaSubClass, VaRank)\n\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8";
    $r = safe_w_sql($q, false, array(1060));
    // not every country has "strong" money!
Пример #4
0
     $content[] = "TVCScroll=" . intval($_POST['d_TVDefaultScroll']);
     $q = safe_r_sql("SELECT IFNULL(MAX(TVCId),0) AS CurID FROM TVContents WHERE TVCTournament={$TourId}");
     $_POST['d_TVMultimedia'] = safe_fetch($q)->CurID + 1 . '|1';
     safe_w_sql("INSERT INTO TVContents set TVCId=" . $_POST['d_TVMultimedia'] . ", " . implode(',', $content));
     $_POST['d_TVMultimediaTime'] = intval($_POST['d_TVDefaultTime']);
     $_POST['d_TVMultimediaScroll'] = intval($_POST['d_TVDefaultScroll']);
     include_once 'Common/CheckPictures.php';
     CheckPictures();
 } elseif (!empty($_POST['d_TVMultimedia']) and !empty($_POST['d_TVContentText'])) {
     // check if a Multimedia Text has been edited in a textual context (text/html)
     // and in the current Tournament
     list($mulId, $mulTour) = explode("|", $_POST['d_TVMultimedia']);
     $q = safe_r_sql("select * from TVContents where TVCId={$mulId} AND TVCTournament=" . ($mulTour == 1 ? $TourId : "-1"));
     if ($r = safe_fetch($q) and $r->TVCMimeType == 'text/html' and $mulTour) {
         $content = array();
         $content[] = "TVCContent=" . strsafe_DB($_POST['d_TVContentText']);
         $content[] = "TVCTime=" . intval($_POST['d_TVDefaultTime']);
         $content[] = "TVCScroll=" . intval($_POST['d_TVDefaultScroll']);
         safe_w_sql("update TVContents set " . implode(',', $content) . " where TVCTournament={$TourId} and TVCId={$mulId} and TVCTournament=" . ($mulTour == 1 ? $TourId : "-1"));
     }
 }
 // Check a new MM sequence
 if (!empty($_POST['d_TVMultimedia'])) {
     list($mulId, $mulTour) = explode("|", $_POST['d_TVMultimedia']);
     $q = safe_r_sql("select * from TVContents where TVCId={$mulId} AND TVCTournament=" . ($mulTour == 1 ? $TourId : "-1"));
     if ($r = safe_fetch($q)) {
         $multimedia = array();
         $multimedia[] = "TVSContent=" . $mulId;
         $multimedia[] = "TVSCntSameTour=" . $mulTour;
         $multimedia[] = "TVSTime=" . (strlen($_POST['d_TVMultimediaTime']) > 0 ? intval($_POST['d_TVMultimediaTime']) : $r->TVCTime);
         $multimedia[] = "TVSScroll=" . (strlen($_POST['d_TVMultimediaScroll']) > 0 ? intval($_POST['d_TVMultimediaScroll']) : $r->TVCScroll);