Пример #1
0
function GetParameters($params)
{
    global $clr, $allowTransparency, $transparent, $locale;
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
    $clr = ValidateColorString(GetParameter($params, 'CLR'));
    $allowTransparency = GetIntParameter($params, 'ALLOWTRANS') == 1;
    $transparent = GetIntParameter($params, 'TRANS') == 1;
}
Пример #2
0
function GetParameters($params)
{
    global $tgt, $popup, $dwf, $locale;
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
    $tgt = GetIntParameter($params, 'TGT');
    $popup = GetIntParameter($params, 'POPUP');
    $dwf = GetIntParameter($params, 'DWF');
}
Пример #3
0
function GetParameters($params)
{
    global $mapName, $sessionId, $dwf, $locale;
    $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
    $mapName = ValidateMapName(GetParameter($params, 'MAPNAME'));
    $popup = GetIntParameter($params, 'POPUP');
    $dwf = GetIntParameter($params, 'DWF');
}
Пример #4
0
function GetParameters($params)
{
    global $taskPane, $sessionId, $webLayoutId, $dwf, $locale, $mapName;
    $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
    $webLayoutId = ValidateResourceId(GetParameter($params, 'WEBLAYOUT'));
    $dwf = GetIntParameter($params, 'DWF');
    $mapName = ValidateMapName(GetParameter($params, 'MAPNAME'));
}
Пример #5
0
function GetParameters($params)
{
    global $sessionId, $webLayout, $pageName, $dwf, $locale;
    $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
    $webLayout = ValidateResourceId(GetParameter($params, 'WEBLAYOUT'));
    $dwf = GetIntParameter($params, 'DWF') == 1;
    $pageName = GetParameter($params, 'PAGE');
}
Пример #6
0
function GetParameters($params)
{
    global $target, $cmdIndex, $clientWidth, $mapName, $sessionId, $popup, $us, $locale;
    $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
    $mapName = ValidateMapName(GetParameter($params, 'MAPNAME'));
    $popup = GetIntParameter($params, 'POPUP');
    $us = GetParameter($params, 'US');
}
Пример #7
0
function GetParameters($params)
{
    global $locale, $mapFrame;
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
    if (isset($params['MAPFRAME'])) {
        $mapFrame = ValidateFrameName(GetParameter($params, 'MAPFRAME'));
    } else {
        $mapFrame = "parent";
    }
}
Пример #8
0
function GetParameters($params)
{
    global $mapName, $sessionId, $mapFrame, $locale;
    $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
    $mapName = ValidateMapName(GetParameter($params, 'MAPNAME'));
    if (isset($params['MAPFRAME'])) {
        $mapFrame = ValidateFrameName(GetParameter($params, 'MAPFRAME'));
    } else {
        $mapFrame = "parent";
    }
}
Пример #9
0
function GetParameters($params)
{
    global $target, $cmdIndex, $clientWidth, $mapName, $sessionId, $total, $popup, $locale;
    $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
    $mapName = ValidateMapName(GetParameter($params, 'MAPNAME'));
    $target = GetIntParameter($params, 'TGT');
    $popup = GetIntParameter($params, 'POPUP');
    $cmdIndex = GetIntParameter($params, 'CMDINDEX');
    $clientWidth = GetIntParameter($params, 'WIDTH');
    $total = GetDoubleParameter($params, 'TOTAL');
    $units = GetParameter($params, 'UNITS');
}
Пример #10
0
function GetParameters($params)
{
    global $cmdIndex, $target, $clientWidth, $layerId, $popup, $locale;
    global $mapName, $sessionId, $filter, $matchLimit;
    $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
    $mapName = ValidateMapName(GetParameter($params, 'MAPNAME'));
    $cmdIndex = GetIntParameter($params, 'CMDINDEX');
    $target = GetIntParameter($params, 'TGT');
    $popup = GetIntParameter($params, 'POPUP');
    $clientWidth = GetIntParameter($params, 'WIDTH');
    $matchLimit = GetIntParameter($params, 'MR');
    $layerId = GetParameter($params, 'LAYER');
    $filter = GetParameter($params, 'FILTER');
}
Пример #11
0
function UpdatePreOpen($TournamentID)
{
    // checks if the structure of the database is consistent
    //	CheckDbStructure();
    $DbVersion = GetParameter('DBUpdate');
    $rs = safe_r_SQL("SELECT ToDbVersion, ToType, ToNumSession FROM Tournament WHERE ToId='{$TournamentID}'");
    $row = safe_fetch($rs);
    $version = $row->ToDbVersion;
    if ($version < '2010-11-26 15:50:00') {
        updateEnTimeStamp_20101126($TournamentID);
        to_save_version($TournamentID, '2010-11-26 15:50:00');
    }
    if ($version < '2010-12-11 20:30:00') {
        recalculateIndividuals_20101211($TournamentID);
        to_save_version($TournamentID, '2010-12-11 20:30:00');
    }
    if ($version < '2011-02-16 15:42:00') {
        // metto a posto il numero max di persone nei team
        calcMaxTeamPerson_20110216($TournamentID);
        // ricalcolo le rank a squadra
        recalculateTeamRanking_20110216($TournamentID);
        to_save_version($TournamentID, '2011-02-16 15:42:00');
    }
    if ($version < '2011-03-09 14:38:00') {
        initTourGoldsXNineChars_20110309($TournamentID);
        to_save_version($TournamentID, '2011-03-09 14:38:00');
    }
    if ($version < '2011-04-15 15:55:00') {
        RecalcFinRank_20110415($TournamentID);
        to_save_version($TournamentID, '2011-04-15 15:55:00');
    }
    if ($version < '2012-01-11 10:20:00') {
        Update3DIta_20120111($TournamentID);
        to_save_version($TournamentID, '2012-01-11 10:20:00');
    }
    if ($version < '2012-01-24 15:16:00') {
        $q = insertIntoGridForF2F_21($TournamentID);
        $rs2 = safe_w_sql($q, false, array(1062));
        to_save_version($TournamentID, '2012-01-24 15:16:00');
    }
    if ($version < '2012-05-18 07:10:00') {
        safe_w_sql("update Divisions set DivWaDivision=DivId, DivRecDivision=DivId where DivWaDivision='' or DivRecDivision=''");
        safe_w_sql("update Classes set ClWaClass=ClId, ClRecClass=ClId where ClWaClass='' or ClRecClass=''");
        safe_w_sql("update Events set EvWaCategory=EvCode, EvRecCategory=EvCode where EvWaCategory='' or EvRecCategory=''");
        to_save_version($TournamentID, '2012-05-18 07:10:00');
    }
    if ($version < '2013-12-19 12:30:00') {
        // Updating DistanceInformation
        require_once 'Modules/Sets/lib.php';
        require_once 'Tournament/Fun_ManSessions.inc.php';
        $Distances = getDistanceArrays($row->ToType);
        $q = safe_r_sql("select SesAth4Target, SesOrder from Session where SesTournament={$TournamentID}");
        while ($r = safe_fetch($q)) {
            CreateDistanceInformation($TournamentID, $Distances, 0, $r->SesAth4Target, $r->SesOrder);
        }
        to_save_version($TournamentID, '2013-12-19 12:30:00');
    }
    if ($version < '2014-03-22 14:00:00') {
        UpdateWinLose_20140322($TournamentID);
        to_save_version($TournamentID, '2014-03-22 14:00:00');
    }
    if ($version < '2014-04-01 00:00:00') {
        UpdateItaRules_20140401($TournamentID);
        to_save_version($TournamentID, '2014-04-01 00:00:00');
    }
    if ($version < '2014-05-23 16:00:00') {
        safe_w_sql("update Scheduler\n\t\t\tleft join Session on SchTournament=SesTournament and SchSesOrder=SesOrder and SchSesType=SesType\n\t\t\tset SchDay=date(SchDateStart), SchStart=time(SchDateStart), SchDuration=TIMESTAMPDIFF(MINUTE, SchDateStart, SchDateEnd), SchText=SchDescr, SchTitle=SesName\n\t\t\twhere SchTournament={$TournamentID}");
        $q = safe_r_sql("select * from Scheduler where SchTournament={$TournamentID} and SchDay>0 and SchStart>0 order by SchDay, SchStart, SchOrder desc");
        $oldKeys = array();
        while ($r = safe_fetch($q)) {
            $good = true;
            $key = $r->SchDay . '|' . $r->SchStart;
            while (in_array($key, $oldKeys)) {
                $key++;
                $good = false;
            }
            $oldKeys[] = $key;
            if (!$good) {
                $SQL = "update Scheduler set SchStart='" . substr($key, -8) . "' where SchDay='{$r->SchDay}' and SchStart='{$r->SchStart}' and SchDuration='{$r->SchDuration}' and SchSesOrder={$r->SchSesOrder} and SchOrder={$r->SchOrder} and SchSesType='{$r->SchSesType}' limit 1";
                safe_w_sql($SQL);
            }
        }
        to_save_version($TournamentID, '2014-04-01 00:00:00');
    }
    to_save_version($TournamentID, $DbVersion);
}
Пример #12
0
function db_save_version($newversion)
{
    //Aggiorno alla versione attuale SOLO le gare che erano alla versione immediatamente precedente
    $oldDbVersion = GetParameter('DBUpdate');
    safe_w_sql("UPDATE Tournament SET ToDbVersion='{$newversion}' WHERE ToDbVersion='{$oldDbVersion}'");
    SetParameter('DBUpdate', $newversion);
    SetParameter('SwUpdate', ProgramVersion);
}
Пример #13
0
    $filesize = filesize($_FILES['Gara']['tmp_name']);
    // 		ini_set('memory_limit',sprintf('%sM',max(128,intval(log($filesize)*18))));
    include 'Common/Fun_TourDelete.php';
    $TourId = tour_import($_FILES['Gara']['tmp_name']);
    // if an ID is returned then everything is fine!
    if ($TourId) {
        header('Location: ' . $CFG->ROOT_DIR . 'Common/TourOn.php?ToId=' . $TourId . '&BackTo=' . $CFG->ROOT_DIR . 'Main.php');
        exit;
    }
    die(get_text('IncompatibleVersions', 'Tournament', '<a href="http://www.ianseo.net/">Ianseo.net</a>'));
}
$JS_SCRIPT = array('<script type="text/javascript" src="' . $CFG->ROOT_DIR . 'Common/Fun_JS.inc.js"></script>');
$PAGE_TITLE = get_text('TournamentImport', 'Tournament');
include 'Common/Templates/head.php';
$onclick = '';
if (GetParameter('TourBusy')) {
    $onclick = ' onclick="return(confirm(\'' . str_replace("\n", '\\n', addslashes(get_text('TourBusy', 'Tournament'))) . '\'))"';
}
//$onclick=' onclick="return(confirm(\'Ciao\'))"';
?>
<div align="center">
<div class="medium">
<form method="POST" enctype="multipart/form-data">
<table class="Tabella">
<tr><th class="Title" colspan="2"><?php 
print get_text('TournamentImport', 'Tournament');
?>
</th></tr>
<tr class="Spacer"><td colspan="2"></td></tr>
<tr><th class="SubTitle"><?php 
echo get_text('SelFile2Imp', 'HTT');
Пример #14
0
function tour_import($filename)
{
    // Tabelle che hanno il codice Tournament
    $tabs_on_tour = array('AccColors' => 'Ac', 'AccEntries' => 'AE', 'AccPrice' => 'AP', 'ACL' => 'Acl', 'AclDetails' => 'AclDt', 'AvailableTarget' => 'At', 'Awards' => 'Aw', 'Awarded' => 'Aw', 'BackNumber' => 'Bn', 'CasScore' => 'CaS', 'CasTeam' => 'Ca', 'CasTeamFinal' => 'CTF', 'CasTeamTarget' => 'CTT', 'Classes' => 'Cl', 'ClubTeam' => 'CT', 'ClubTeamScore' => 'CTS', 'Countries' => 'Co', 'Divisions' => 'Div', 'DistanceInformation' => 'Di', 'Emails' => 'Em', 'Entries' => 'En', 'EventClass' => 'Ec', 'Events' => 'Ev', 'Individuals' => 'Ind', "F2FGrid" => 'F2F', "F2FEntries" => "F2F", "F2FFinal" => "F2F", 'FinalReportA' => 'Fra', 'Finals' => 'Fin', 'FinSchedule' => 'FS', 'FinTraining' => 'Ft', 'FinTrainingEvent' => 'Fte', 'FinWarmup' => 'Fw', 'HhtData' => 'Hd', 'HhtEvents' => 'He', 'HhtSetup' => 'Hs', 'IdCardElements' => 'Ice', 'IdCards' => 'Ic', 'Images' => 'Im', 'ModulesParameters' => 'Mp', 'RecTournament' => 'Rt', 'Reviews' => 'Rev', 'SubClass' => 'Sc', 'TargetFaces' => 'Tf', 'TeamComponent' => 'Tc', 'TeamFinals' => 'Tf', 'TeamFinComponent' => 'Tfc', 'Teams' => 'Te', 'TournamentDistances' => 'Td', 'TournamentInvolved' => 'Ti', 'TourRecords' => 'Tr', 'TVContents' => 'TVC', 'TVOut' => 'TV', 'TVParams' => 'TVP', 'TVRules' => 'TVR', 'TVSequence' => 'TVS', 'Session' => 'Ses', 'Scheduler' => 'Sch', 'Eliminations' => 'El', 'VegasAwards' => 'Va');
    // Tabelle che hanno il codice Countries
    $tab_to_country = array('CasTeam' => 'CaTeam', 'ClubTeam' => 'CTTeam', 'Entries' => array('EnCountry', 'EnCountry2', 'EnCountry3'), 'TeamComponent' => 'TcCoId', 'TeamFinals' => 'TfTeam', 'TeamFinComponent' => 'TfcCoId', 'Teams' => 'TeCoId');
    // Tabelle che hanno il codice Entries
    $tab_to_entry = array('AccEntries' => 'AEId', 'Awarded' => 'AwEntry', 'ElabQualifications' => 'EqId', 'Eliminations' => 'ElId', 'ExtraData' => 'EdId', 'Individuals' => 'IndId', "F2FEntries" => "F2FEnId", "F2FFinal" => "F2FEnId", 'Finals' => 'FinAthlete', 'HhtData' => 'HdEnId', 'Photos' => 'PhEnId', 'Qualifications' => 'QuId', 'TeamComponent' => 'TcId', 'TeamFinComponent' => 'TfcId', 'Vegas' => 'VeId');
    // Tabelle che dipendono SOLO da Tournament
    $tabs_only_tour = array('AccColors', 'AccPrice', 'ACL', 'AclDetails', 'AvailableTarget', 'Awards', 'BackNumber', 'CasScore', 'CasTeamFinal', 'CasTeamTarget', 'Classes', 'ClubTeamScore', 'DistanceInformation', 'Divisions', 'Emails', 'EventClass', 'Events', 'F2FGrid', 'FinalReportA', 'FinSchedule', 'FinTraining', 'FinTrainingEvent', 'FinWarmup', 'HhtEvents', 'HhtSetup', 'IdCardElements', 'IdCards', 'Images', 'ModulesParameters', 'RecTournament', 'Reviews', 'SubClass', 'TargetFaces', 'TournamentDistances', 'TournamentInvolved', 'TourRecords', 'TVContents', 'TVOut', 'TVParams', 'TVRules', 'TVSequence', 'Session', 'Scheduler', 'Eliminations', 'VegasAwards');
    $Gara = unserialize(gzuncompress(implode('', file($filename))));
    // If is not compatible, exits
    if ($Gara['Tournament']['ToDbVersion'] > GetParameter('DBUpdate')) {
        return false;
    }
    require_once 'UpdateTournament.inc.php';
    $Gara = UpdateTournament($Gara);
    // CONTROLLA SE C'E' UN TORNEO CON LO STESSO CODICE E LO SEGA!
    $q = safe_r_sql("select ToId from Tournament where ToCode=" . strsafe_db($Gara['Tournament']['ToCode']));
    if ($r = safe_fetch($q)) {
        // esiste un tournament con lo stesso codice... ranzo tutto!
        tour_delete($r->ToId);
    }
    // Inserisce il torneo
    $quer = array();
    foreach ($Gara['Tournament'] as $key => $val) {
        if ($key != 'ToId') {
            $quer[] = "{$key}=" . strsafe_db($val);
            // 			if($key=='ToImgL') debug_svela(array('SAFE' => strsafe_db($val), '','','','','', 'ORG' => $val));
        }
    }
    safe_w_sql("Insert into Tournament set " . implode(', ', $quer));
    $TourId = safe_w_last_id();
    if (debug) {
        echo "Inserito Tournament<br />";
    }
    // aggiusta il nuovo valore del torneo nell'array...
    foreach ($tabs_on_tour as $tab => $code) {
        if (isset($Gara[$tab])) {
            foreach ($Gara[$tab] as $key => $val) {
                $Gara[$tab][$key][$code . 'Tournament'] = $TourId;
            }
            if (debug) {
                echo "Aggiornato Tournament Nr. in tabella {$tab}<br />";
            }
        }
    }
    // inserisce le tabelle che hanno SOLO il tournament
    foreach ($tabs_only_tour as $tab) {
        if (isset($Gara[$tab])) {
            foreach ($Gara[$tab] as $record) {
                $query = array();
                foreach ($record as $key => $val) {
                    $query[] = "{$key} = " . strsafe_db($val);
                }
                safe_w_sql("insert into {$tab} set " . implode(', ', $query) . " on duplicate key update " . implode(', ', $query));
            }
        }
        if (debug) {
            echo "Inserita tabella {$tab}<br />";
        }
    }
    // inserisce i paesi e mantieni l'array per il cambio country
    $Countries = array();
    if (array_key_exists('Countries', $Gara) && is_array($Gara['Countries']) && count($Gara['Countries']) > 0) {
        foreach ($Gara['Countries'] as $record) {
            $query = array();
            foreach ($record as $key => $val) {
                if ($key != 'CoId') {
                    $query[] = "{$key} = " . strsafe_db($val);
                }
            }
            safe_w_sql("insert into Countries set " . implode(', ', $query));
            $Countries[$record['CoId']] = safe_w_last_id();
        }
        if (debug) {
            echo "Inserita tabella Countries<br />";
        }
    }
    //aggiorna CoParent1 della Countries stessa
    $tmpSql = "SELECT DISTINCT CoParent1 FROM Countries WHERE CoTournament=" . $TourId . " AND CoParent1!=0";
    $tmpRs = safe_r_sql($tmpSql);
    if (safe_num_rows($tmpRs) != 0) {
        while ($tmpRow = safe_fetch($tmpRs)) {
            safe_w_sql("UPDATE Countries SET CoParent1=" . $Countries[$tmpRow->CoParent1] . " WHERE CoParent1=" . $tmpRow->CoParent1 . " AND CoTournament=" . $TourId);
        }
        safe_free_result($tmpRs);
    }
    //aggiorna CoParent2 della Countries stessa
    $tmpSql = "SELECT DISTINCT CoParent2 FROM Countries WHERE CoTournament=" . $TourId . " AND CoParent2!=0";
    $tmpRs = safe_r_sql($tmpSql);
    if (safe_num_rows($tmpRs) != 0) {
        while ($tmpRow = safe_fetch($tmpRs)) {
            safe_w_sql("UPDATE Countries SET CoParent2=" . $Countries[$tmpRow->CoParent2] . " WHERE CoParent2=" . $tmpRow->CoParent2 . " AND CoTournament=" . $TourId);
        }
        safe_free_result($tmpRs);
    }
    // aggiorna i paesi nelle tabelle che ne fanno uso
    foreach ($tab_to_country as $tab => $field) {
        if (array_key_exists($tab, $Gara)) {
            foreach ($Gara[$tab] as $key => $record) {
                if (is_array($field)) {
                    foreach ($field as $ff) {
                        if (array_key_exists($ff, $record) && $record[$ff]) {
                            $Gara[$tab][$key][$ff] = $Countries[$record[$ff]];
                        }
                    }
                } else {
                    if ($record[$field] && array_key_exists($record[$field], $Countries)) {
                        $Gara[$tab][$key][$field] = $Countries[$record[$field]];
                    }
                }
            }
        }
        if (debug) {
            echo "Aggiornata il Country di tabella {$tab}<br />";
        }
    }
    // inserisce le Entries e mantieni l'array per il cambio Entry
    $Entries = array();
    if (array_key_exists('Entries', $Gara) && is_array($Gara['Entries']) && count($Gara['Entries']) > 0) {
        foreach ($Gara['Entries'] as $record) {
            $query = array();
            foreach ($record as $key => $val) {
                if ($key != 'EnId') {
                    $query[] = "{$key} = " . strsafe_db($val);
                }
            }
            safe_w_sql("insert into Entries set " . implode(', ', $query));
            $Entries[$record['EnId']] = safe_w_last_id();
        }
        if (debug) {
            echo "Inserita tabella Entries<br />";
        }
    }
    // aggiorna le rimanenti tabelle con le Entries corrette
    foreach ($tab_to_entry as $tab => $field) {
        if (array_key_exists($tab, $Gara)) {
            foreach ($Gara[$tab] as $key => $record) {
                if (array_key_exists($record[$field], $Entries) && $record[$field]) {
                    $Gara[$tab][$key][$field] = $Entries[$record[$field]];
                }
            }
        }
        if (debug) {
            echo "Aggiornata l'Entry di tabella {$tab}<br />";
        }
    }
    // inserisce le tabelle restanti
    unset($tab_to_country['Entries']);
    $final_tabs = array_unique(array_merge(array_keys($tab_to_country), array_keys($tab_to_entry)));
    foreach ($final_tabs as $tab) {
        if (array_key_exists($tab, $Gara)) {
            foreach ($Gara[$tab] as $record) {
                $query = array();
                foreach ($record as $key => $val) {
                    $query[] = "{$key} = " . strsafe_db($val);
                }
                // attenzione: questa query era "commentata" per non far apparirer errori:
                // se questo comportamento è desiderato, chiamare la funzione safe_w_sql passando
                // come terzo parametro un array con gli errori numerici ammessi
                safe_w_sql("REPLACE INTO {$tab} set " . implode(', ', $query));
            }
        }
        if (debug) {
            echo "Inserita tabella {$tab}<br />";
        }
    }
    //Gestisce la tabella Flags
    if (array_key_exists('Flags', $Gara) && is_array($Gara['Flags']) && count($Gara['Flags']) > 0) {
        foreach ($Gara['Flags'] as $record) {
            if ($record['FlTournament'] != -1) {
                $record['FlTournament'] = $TourId;
            }
            $query = array();
            foreach ($record as $key => $val) {
                $query[] = "{$key} = " . strsafe_db($val);
            }
            safe_w_sql("insert into Flags set " . implode(', ', $query) . " on duplicate key update " . implode(', ', $query));
        }
        if (debug) {
            echo "Inserita tabella Flags<br />";
        }
    }
    return $TourId;
}
Пример #15
0
    $regex_match .= "htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|";
    $regex_match .= "blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam\\-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|";
    $regex_match .= "symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte\\-|longcos|pantech|gionee|^sie\\-|portalmmm|";
    $regex_match .= "jig\\s browser|hiptop|^ucweb|^benq|haier|^lct|opera\\s*mobi|opera\\*mini|320x320|240x320|176x220";
    $regex_match .= ")/i";
    //		echo '<pre>';
    //		print_r(preg_split($regex_match, strtolower($_SERVER['HTTP_USER_AGENT'])));
    //		echo '<br />';
    //		print_r($_SERVER);
    //		echo '</pre><br />WAP '.$_SERVER['HTTP_X_WAP_PROFILE'].'<br />Profile '.$_SERVER['HTTP_PROFILE'].'<br />Agent '.$_SERVER['HTTP_USER_AGENT'].'<br />';
    //		exit;
    return isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE']) || preg_match($regex_match, strtolower($_SERVER['HTTP_USER_AGENT']));
}
CheckTourSession(true);
// tiro fuori i parametri dei timer
$param = GetParameter('SpkTimer');
$tmp = explode(';', $param);
$timers = array();
$colors = array();
for ($i = 0; $i < count($tmp); ++$i) {
    list($t, $c) = explode('|', $tmp[$i]);
    if ($t != '#') {
        $timers[$i] = $t;
    }
    if ($c != '#') {
        $colors[$i] = $c;
    }
}
/*print '<pre>';
	print_r($timers);
	print_r($colors);
Пример #16
0
function GetParameters($params)
{
    global $debug, $webLayoutDefinition, $mapName;
    global $sessionId, $username, $password, $orgSessionId, $locale;
    $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
    $webLayoutDefinition = ValidateResourceId(GetParameter($params, 'WEBLAYOUT'));
    if (isset($params['SESSION'])) {
        $orgSessionId = $sessionId;
    } else {
        if (isset($params['USERNAME'])) {
            $username = GetParameter($params, 'USERNAME');
            if (isset($params['PASSWORD'])) {
                $password = GetParameter($params, 'PASSWORD');
            }
            return;
        }
        // No session, no credentials explicitely passed. Check for HTTP Auth user/passwd.  Under Apache CGI, the
        // PHP_AUTH_USER and PHP_AUTH_PW are not set.  However, the Apache admin may
        // have rewritten the authentication information to REMOTE_USER.  This is a
        // suggested approach from the Php.net website.
        // Has REMOTE_USER been rewritten?
        if (!isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['REMOTE_USER']) && preg_match('/Basic +(.*)$/i', $_SERVER['REMOTE_USER'], $matches)) {
            list($name, $password) = explode(':', base64_decode($matches[1]));
            $_SERVER['PHP_AUTH_USER'] = strip_tags($name);
            $_SERVER['PHP_AUTH_PW'] = strip_tags($password);
        }
        // REMOTE_USER may also appear as REDIRECT_REMOTE_USER depending on CGI setup.
        //  Check for this as well.
        if (!isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['REDIRECT_REMOTE_USER']) && preg_match('/Basic (.*)$/i', $_SERVER['REDIRECT_REMOTE_USER'], $matches)) {
            list($name, $password) = explode(':', base64_decode($matches[1]));
            $_SERVER['PHP_AUTH_USER'] = strip_tags($name);
            $_SERVER['PHP_AUTH_PW'] = strip_tags($password);
        }
        // Finally, PHP_AUTH_USER may actually be defined correctly.  If it is set, or
        // has been pulled from REMOTE_USER rewriting then set our USERNAME and PASSWORD
        // parameters.
        if (isset($_SERVER['PHP_AUTH_USER']) && strlen($_SERVER['PHP_AUTH_USER']) > 0) {
            $username = $_SERVER['PHP_AUTH_USER'];
            if (isset($_SERVER['PHP_AUTH_PW']) && strlen($_SERVER['PHP_AUTH_PW']) > 0) {
                $password = $_SERVER['PHP_AUTH_PW'];
            }
            return;
        }
    }
}
Пример #17
0
<?php

die;
require_once dirname(dirname(__FILE__)) . '/config.php';
// gets the module list for this installation
$ret = new stdClass();
$ret->ProgVersion = ProgramVersion;
$ret->DbVersion = GetParameter('DBUpdate');
$ret->ProgRelease = ProgramRelease;
$ret->Action = 'list';
$ret->email = empty($_POST['email']) ? '' : $_POST['email'];
$ret->Modules = get_modules();
$ret->Sets = get_sets();
$postdata = http_build_query(array('Json' => gzcompress(serialize($Old))));
// get the online modules
$opts = array('http' => array('method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata));
$context = stream_context_create($opts);
$stream = fopen('http://ianseo.net/Ianseo/Modules.php', 'r', false, $context);
$tmp = stream_get_contents($stream);
if (!($NewIanseo = unserialize(gzuncompress($tmp)))) {
    if ($tmp == 'NothingToDo') {
        echo get_text('Done', 'Install');
    } else {
        echo get_text('Failed', 'Install');
    }
    echo '</div>';
    echo '<div><br/>' . get_text($tmp, 'Install') . '</div>';
    include 'Common/Templates/tail.php';
    die;
}
fclose($stream);
Пример #18
0
 function Serialize()
 {
     $ret = new stdClass();
     $ret->ProgVersion = ProgramVersion;
     $ret->DbVersion = GetParameter('DBUpdate');
     $ret->ProgRelease = ProgramRelease;
     // che tipo di rilascio è
     $ret->Files = $this->Files;
     return serialize($ret);
 }
Пример #19
0
function GetParameters($params)
{
    global $userInput, $target, $layerName, $popup, $locale;
    global $mapName, $sessionId, $filter, $resNames, $resProps, $matchLimit;
    $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
    $mapName = ValidateMapName(GetParameter($params, 'MAPNAME'));
    $target = GetIntParameter($params, 'TGT');
    $popup = GetIntParameter($params, 'POPUP');
    $matchLimit = GetIntParameter($params, 'MR');
    $colCount = GetIntParameter($params, 'COLS');
    if ($colCount > 0) {
        for ($i = 0; $i < $colCount; $i++) {
            array_push($resNames, GetParameter($params, 'CN' . $i));
            array_push($resProps, GetParameter($params, 'CP' . $i));
        }
    }
    $userInput = GetParameter($params, 'USERINPUT');
    $layerName = GetParameter($params, 'LAYER');
    $filter = GetParameter($params, 'FILTER');
}
Пример #20
0
function GetParameters()
{
    global $params, $selText, $locale;
    global $mapName, $sessionId, $bufferName, $lcolor, $ffcolor, $fbcolor, $layersParam, $popup;
    global $transparent, $distance, $units, $linestyle, $fillstyle, $thickness, $merge, $foretrans;
    $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
    $mapName = ValidateMapName(GetParameter($params, 'MAPNAME'));
    $lcolor = ValidateColorString(GetParameter($params, 'LCOLOR'));
    $ffcolor = ValidateColorString(GetParameter($params, 'FFCOLOR'));
    $fbcolor = ValidateColorString(GetParameter($params, 'FBCOLOR'));
    $popup = GetIntParameter($params, 'POPUP');
    $transparent = GetIntParameter($params, 'TRANSPARENT');
    $distance = GetDecimalFromLocalizedString(GetParameter($params, 'DISTANCE'), $locale);
    if (isset($params['MERGE'])) {
        $merge = 1;
    }
    $foretrans = GetDoubleParameter($params, 'FORETRANS');
    $thickness = GetDoubleParameter($params, 'THICKNESS');
    $bufferName = GetParameter($params, 'BUFFER');
    $layersParam = GetParameter($params, 'LAYERS');
    $units = GetParameter($params, 'UNITS');
    $linestyle = GetParameter($params, 'LINESTYLE');
    $fillstyle = GetParameter($params, 'FILLSTYLE');
    $selText = GetParameter($params, 'SELECTION');
    //unescape strings
    //
    if (ini_get("magic_quotes_sybase") == "1") {
        $selText = str_replace("''", "'", $selText);
    } else {
        if (get_magic_quotes_gpc() == "1") {
            //Unescape double quotes
            $selText = str_replace('\\"', '"', $selText);
            //remove additional backslash
            $selText = str_replace("\\", "", $selText);
        }
    }
    if ((int) $foretrans < 0 || (int) $foretrans > 100) {
        $foretrans = 50;
    }
}
Пример #21
0
function GetParameters($params)
{
    global $mapDefinition, $type;
    global $infoWidth, $showLegend, $showProperties, $sessionId;
    global $locale, $hlTgt, $hlTgtName, $showSlider;
    global $selectionColor, $mapImgFormat, $selImgFormat, $pointBufferSize;
    $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
    $hlTgt = ValidateHyperlinkTargetValue(GetParameter($params, 'HLTGT'));
    $hlTgtName = ValidateFrameName(GetParameter($params, 'HLTGTNAME'));
    $mapDefinition = ValidateResourceId(GetParameter($params, 'MAPDEFINITION'));
    $showLegend = GetIntParameter($params, 'SHOWLEGEND') == 1;
    $showProperties = GetIntParameter($params, 'SHOWPROP') == 1;
    $showSlider = GetIntParameter($params, 'SHOWSLIDER') == 1;
    $infoWidth = GetIntParameter($params, 'INFOWIDTH');
    $type = GetParameter($params, 'TYPE');
    $selectionColor = ValidateColorString(GetParameter($params, 'SELCOLOR'), 8);
    $mapImgFormat = GetParameter($params, 'MAPIMGFORMAT');
    $selImgFormat = GetParameter($params, 'SELIMGFORMAT');
    $pointBufferSize = GetIntParameter($params, 'POINTBUFFERSIZE');
}
Пример #22
0
     $Arr_Values2Check_Index['x_ToWhenTo']['Error'] = true;
 } else {
     $RowId = 0;
     if (empty($_REQUEST['d_ToIocCode'])) {
         $_REQUEST['d_ToIocCode'] = '';
     }
     $ToTypeSubRule = empty($_REQUEST['d_SubRule']) || empty($SetTypes[$_REQUEST['d_Rule']]['rules'][$_REQUEST['d_ToType']][$_REQUEST['d_SubRule'] - 1]) ? '' : $SetTypes[$_REQUEST['d_Rule']]['rules'][$_REQUEST['d_ToType']][$_REQUEST['d_SubRule'] - 1];
     $DoChanges = isset($_REQUEST['TourReset']);
     // check rules of the tournament
     if (!$DoChanges and !isset($_REQUEST['New'])) {
         $t = safe_r_sql("select ToType, ToLocRule, ToTypeSubRule from Tournament where ToId={$_SESSION['TourId']}");
         $u = safe_fetch($t);
         $DoChanges = ($u->ToType != $_REQUEST['d_ToType'] or $u->ToLocRule != $_REQUEST['d_Rule'] or $u->ToTypeSubRule != $ToTypeSubRule);
     }
     $ToCode = preg_replace('/[^0-9a-z.,:;_-]/sim', '', $_REQUEST['d_ToCode']);
     $Insert = "INSERT INTO Tournament (" . (!isset($_REQUEST['New']) ? 'ToId,' : '') . "ToType," . "ToCode," . "ToName," . "ToIocCode," . "ToCommitee," . "ToComDescr," . "ToWhere," . "ToWhenFrom," . "ToWhenTo," . "ToCurrency," . "ToPrintLang," . "ToPrintChars," . "ToPrintPaper," . "ToUseHHT," . "ToDbVersion," . "ToTypeSubRule," . "ToLocRule," . "ToIsORIS" . ") " . "VALUES(" . (!isset($_REQUEST['New']) ? StrSafe_DB($_SESSION['TourId']) . "," : '') . StrSafe_DB($_REQUEST['d_ToType']) . "," . StrSafe_DB($ToCode) . "," . StrSafe_DB(stripslashes($_REQUEST['d_ToName'])) . "," . StrSafe_DB(stripslashes($_REQUEST['d_ToIocCode'])) . "," . StrSafe_DB($_REQUEST['d_ToCommitee']) . "," . StrSafe_DB(stripslashes($_REQUEST['d_ToComDescr'])) . "," . StrSafe_DB(stripslashes($_REQUEST['d_ToWhere'])) . "," . StrSafe_DB(sprintf("%04d-%02d-%02d", intval($_REQUEST['xx_ToWhenFromYear']), intval($_REQUEST['xx_ToWhenFromMonth']), intval($_REQUEST['xx_ToWhenFromDay']))) . "," . StrSafe_DB(sprintf("%04d-%02d-%02d", intval($_REQUEST['xx_ToWhenToYear']), intval($_REQUEST['xx_ToWhenToMonth']), intval($_REQUEST['xx_ToWhenToDay']))) . "," . StrSafe_DB($_REQUEST['xx_ToCurrency']) . "," . StrSafe_DB($_REQUEST['xx_ToPrintLang']) . "," . StrSafe_DB($_REQUEST['xx_ToPrintChars']) . "," . StrSafe_DB(intval($_REQUEST['xx_ToPaperSize'])) . "," . StrSafe_DB(intval($_REQUEST['xx_ToUseHHT'])) . "," . StrSafe_DB(GetParameter('DBUpdate')) . "," . StrSafe_DB($ToTypeSubRule) . "," . StrSafe_DB($_REQUEST['d_Rule']) . "," . StrSafe_DB(!empty($_REQUEST['d_ORIS'])) . "" . ") " . "ON DUPLICATE KEY UPDATE " . "ToType = " . StrSafe_DB($_REQUEST['d_ToType']) . "," . "ToCode = " . StrSafe_DB($ToCode) . "," . "ToName = " . StrSafe_DB(stripslashes($_REQUEST['d_ToName'])) . "," . "ToIocCode = " . StrSafe_DB(stripslashes($_REQUEST['d_ToIocCode'])) . "," . "ToCommitee = " . StrSafe_DB($_REQUEST['d_ToCommitee']) . "," . "ToComDescr = " . StrSafe_DB(stripslashes($_REQUEST['d_ToComDescr'])) . "," . "ToWhere = " . StrSafe_DB(stripslashes($_REQUEST['d_ToWhere'])) . "," . "ToWhenFrom = " . StrSafe_DB(sprintf("%04d-%02d-%02d", intval($_REQUEST['xx_ToWhenFromYear']), intval($_REQUEST['xx_ToWhenFromMonth']), intval($_REQUEST['xx_ToWhenFromDay']))) . "," . "ToWhenTo = " . StrSafe_DB(sprintf("%04d-%02d-%02d", intval($_REQUEST['xx_ToWhenToYear']), intval($_REQUEST['xx_ToWhenToMonth']), intval($_REQUEST['xx_ToWhenToDay']))) . " " . "," . "ToCurrency = " . StrSafe_DB($_REQUEST['xx_ToCurrency']) . " " . "," . "ToPrintLang = " . StrSafe_DB($_REQUEST['xx_ToPrintLang']) . " " . "," . "ToPrintChars = " . StrSafe_DB($_REQUEST['xx_ToPrintChars']) . " " . "," . "ToPrintPaper = " . intval($_REQUEST['xx_ToPaperSize']) . "," . "ToUseHHT = " . intval($_REQUEST['xx_ToUseHHT']) . ", " . "ToDbVersion = " . StrSafe_DB(GetParameter('DBUpdate')) . ", " . "ToTypeSubRule = " . StrSafe_DB($ToTypeSubRule) . ", " . "ToLocRule=" . StrSafe_DB($_REQUEST['d_Rule']) . ", " . "ToIsORIS=" . StrSafe_DB(!empty($_REQUEST['d_ORIS'])) . "";
     $Rs = safe_w_sql($Insert);
     set_qual_session_flags();
     $_SESSION['ISORIS'] = !empty($_REQUEST['d_ORIS']);
     //print $Insert;exit;
     if (isset($_REQUEST['New'])) {
         // 	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) {
Пример #23
0
function GetParameters($params)
{
    global $inputSel, $layers, $mapName, $sessionId, $dwf;
    $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
    $mapName = ValidateMapName(GetParameter($params, 'MAPNAME'));
    $dwf = GetIntParameter($params, 'DWF');
    $inputSel = UnescapeMagicQuotes(GetParameter($params, 'SELECTION'));
    $layers = GetParameter($params, 'LAYERS');
}
Пример #24
0
    }
    cd_redirect();
}
// trucchetto per permettere o negare il debug nonostante il get di cui sopra
$ERROR_REPORT = ($ERROR_REPORT and $_SESSION['debug']);
if ($ERROR_REPORT) {
    error_reporting(E_ALL);
    ini_set('display_errors', 'On');
} else {
    error_reporting(0);
    ini_set('display_errors', 'off');
}
$_SESSION['debug'] = $ERROR_REPORT;
$CFG->TRACE_QUERRIES = ($CFG->TRACE_QUERRIES and $_SESSION['debug']);
// Autocheckin
if (!empty($CFG->ROOT_DIR) and dirname($_SERVER['PHP_SELF']) != $CFG->ROOT_DIR . 'Modules/AutoCheckin' and $Code = GetParameter('AutoCHK-Code') and !empty($_SERVER['REMOTE_ADDR']) && in_array($_SERVER['REMOTE_ADDR'], explode(',', GetParameter('AutoCHK-IP')))) {
    CreateTourSession(getIdFromCode($Code));
    CD_redirect($CFG->ROOT_DIR . 'Modules/AutoCheckin/AutoCheckin.php');
    die;
}
// RICONTROLLA TUTTE LE VOLTE GLI SPAREGGI!
//set_qual_session_flags();
/*
	deposito temporaneo per Chris nelle modifiche degli header :D
	$JS_SCRIPT=array(
		'',
		'',
		'',
		'',
		);
	include('Common/Templates/head.php');
Пример #25
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/pdf/ResultPDF.inc.php';
require_once 'Common/Fun_FormatText.inc.php';
define("HideCols", GetParameter("IntEvent"));
if (!isset($_REQUEST["Session"]) || !is_numeric($_REQUEST["Session"]) || !isset($_REQUEST["Distance"]) || !is_numeric($_REQUEST["Distance"])) {
    exit;
}
if (!isset($isCompleteResultBook)) {
    $pdf = new ResultPDF(get_text('StartlistSession', 'Tournament'));
}
/*$MyQuery = "SELECT EnCode as Bib, EnName AS Name, EnFirstName AS FirstName, SUBSTRING(QuTargetNo,1,1) AS Session, SUBSTRING(QuTargetNo,2," . (TargetNoPadding+1) . ") AS TargetNo, CoCode AS NationCode, CoName AS Nation, EnClass AS ClassCode, EnDivision AS DivCode,EnAgeClass as AgeClass,  EnSubClass as SubClass, ClDescription, DivDescription, EnStatus as Status, EnIndClEvent AS `IC`, EnTeamClEvent AS `TC`, EnIndFEvent AS `IF`, EnTeamFEvent as `TF`, EnTeamMixEvent as `TM`, ";
$MyQuery.= "QuD" . $_REQUEST["Distance"]. "Score AS Score, QuD" . $_REQUEST["Distance"]. "Gold as Gold, QuD" . $_REQUEST["Distance"]. "Xnine as Xnine,";
$MyQuery.= "QuD5Score, QuD5Rank, QuD6Score, QuD6Rank, QuD7Score, QuD7Rank, QuD8Score, QuD8Rank, ";
$MyQuery.= "ToType, TtGolds, TtXNine ";
$MyQuery.= "FROM Tournament AS t ";
$MyQuery.= "INNER JOIN Tournament*Type AS tt ON t.ToType=tt.TtId ";
$MyQuery.= "INNER JOIN Entries AS e ON t.ToId=e.EnTournament ";
$MyQuery.= "INNER JOIN Countries AS c ON e.EnCountry=c.CoId AND e.EnTournament=c.CoTournament ";
$MyQuery.= "INNER JOIN Qualifications AS q ON e.EnId=q.QuId ";
$MyQuery.= "INNER JOIN Classes AS cl ON e.EnClass=cl.ClId AND ClTournament=" . StrSafe_DB($_SESSION['TourId']) . " ";
$MyQuery.= "INNER JOIN Divisions AS d ON e.EnDivision=d.DivId AND DivTournament=" . StrSafe_DB($_SESSION['TourId']) . " ";
$MyQuery.= "WHERE EnAthlete=1 AND ToId = " . StrSafe_DB($_SESSION['TourId']) . " ";
$MyQuery.= "AND QuSession = " . StrSafe_DB($_REQUEST["Session"]) . " ";
$MyQuery.= "ORDER BY QuTargetNo, CoCode, Name, CoName, FirstName ";*/
$MyQuery = "SELECT EnCode as Bib, EnName AS Name, upper(EnFirstName) AS FirstName, SUBSTRING(QuTargetNo,1,1) AS Session, SUBSTRING(QuTargetNo,2," . (TargetNoPadding + 1) . ") AS TargetNo, CoCode AS NationCode, CoName AS Nation, EnClass AS ClassCode, EnDivision AS DivCode,EnAgeClass as AgeClass,  EnSubClass as SubClass, ClDescription, DivDescription, EnStatus as Status, EnIndClEvent AS `IC`, EnTeamClEvent AS `TC`, EnIndFEvent AS `IF`, EnTeamFEvent as `TF`, EnTeamMixEvent as `TM`, ";
$MyQuery .= "upper(right(QuTargetNo,1)) TargetLetter, QuD" . $_REQUEST["Distance"] . "Score AS Score, QuD" . $_REQUEST["Distance"] . "Gold as Gold, QuD" . $_REQUEST["Distance"] . "Xnine as Xnine,";
$MyQuery .= "QuD5Score, QuD5Rank, QuD6Score, QuD6Rank, QuD7Score, QuD7Rank, QuD8Score, QuD8Rank, ";
$MyQuery .= "ToType, ToGolds AS TtGolds, ToXNine AS TtXNine ";
$MyQuery .= "FROM Tournament AS t ";
Пример #26
0
<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require_once 'Common/Fun_FormatText.inc.php';
define('debug', true);
if (!CheckTourSession() || !isset($_REQUEST['Code']) || !isset($_REQUEST['From']) || !isset($_REQUEST['Message'])) {
    print get_text('CrackError');
    exit;
}
//	$MyPOST = array();  // Conterrà il post al sito
$URL = '';
if (!debug) {
    $URL = GetParameter('ResPath');
} else {
    $URL = 'http://ianseo/Tournament/prova/ricevi.php';
}
$MyPOST['Subject'] = $_REQUEST['Code'];
$MyPOST['From'] = $_REQUEST['From'];
$MyPOST['Message'] = $_REQUEST['Message'];
// template dei files
$Arr_Templates = array('.asc', '.lst', '_team.lst', '_rank.lst', '_rank_team.lst', '.pdf', '_team.pdf', '_rank.pdf', '_grid.pdf', '_rank_team.pdf', '_grid_team.pdf');
$Arr_Files2Send = array();
foreach ($Arr_Templates as $Value) {
    if (file_exists($CFG->DOCUMENT_PATH . 'Tournament/TmpDownload/' . $_REQUEST['Code'] . $Value)) {
        $Arr_Files2Send[] = '@' . $CFG->DOCUMENT_PATH . 'Tournament/TmpDownload/' . $_REQUEST['Code'] . $Value;
    }
}
/*print '<pre>';
	print_r($Arr_Files2Send);
	print '</pre>';exit;*/
$StrCurlError = '';
Пример #27
0
function GetParameters($params)
{
    global $mapName, $sessionId, $summary, $layerCount;
    $sessionId = ValidateSessionId(GetParameter($params, 'SESSION'));
    $mapName = ValidateMapName(GetParameter($params, 'MAPNAME'));
    if (isset($params['SUMMARY'])) {
        $summary = true;
    } else {
        $layerCount = GetIntParameter($params, 'LC');
    }
}
Пример #28
0
/**
 * Crea una sessione del torneo
 * @param $TourId: id del torneo
 * @return true se ci riesce e false altrimenti
 */
function CreateTourSession($TourId)
{
    $Select = "SELECT" . " Tournament.*" . ", UNIX_TIMESTAMP(ToWhenFrom) AS ToWhenFromUTS" . ", DATE_FORMAT(ToWhenFrom,'" . get_text('DateFmtDB') . "') AS DtFrom" . ", UNIX_TIMESTAMP(ToWhenTo) AS ToWhenToUTS" . ", DATE_FORMAT(ToWhenTo,'" . get_text('DateFmtDB') . "') AS DtTo" . ", ToTypeName AS TtName" . ", ToElimination AS TtElimination " . "FROM Tournament " . "WHERE ToId=" . StrSafe_DB($TourId) . " ";
    //print $Select;
    $Rs = safe_r_sql($Select);
    if (safe_num_rows($Rs) == 1) {
        $debug = $_SESSION['debug'];
        $debmode = !empty($_SESSION['debug-mode']) ? $_SESSION['debug-mode'] : '';
        $_SESSION = array();
        $_SESSION['debug'] = $debug;
        $_SESSION['debug-mode'] = $debmode;
        $MyRow = safe_fetch($Rs);
        $_SESSION['TourId'] = $MyRow->ToId;
        $_SESSION['TourType'] = $MyRow->ToType;
        $_SESSION['TourPrintLang'] = $MyRow->ToPrintLang;
        $_SESSION['TourLocRule'] = $MyRow->ToLocRule;
        $_SESSION['TourCode'] = $MyRow->ToCode;
        $_SESSION['TourCodeSafe'] = preg_replace('/[^a-z0-9_.-]+/sim', '', $MyRow->ToCode);
        $_SESSION['TourCollation'] = $MyRow->ToCollation;
        $_SESSION['TourName'] = $MyRow->ToName;
        $_SESSION['TourWhere'] = $MyRow->ToWhere;
        $_SESSION['TourRealWhenFrom'] = $MyRow->ToWhenFrom;
        $_SESSION['TourRealWhenTo'] = $MyRow->ToWhenTo;
        $_SESSION['TourWhenFrom'] = $MyRow->DtFrom;
        $_SESSION['TourWhenTo'] = $MyRow->DtTo;
        $_SESSION['ToWhenFromUTS'] = $MyRow->ToWhenFromUTS;
        $_SESSION['ToWhenToUTS'] = $MyRow->ToWhenToUTS;
        $_SESSION['ToPaper'] = $MyRow->ToPrintPaper;
        // parametri per le credenziali di upload verso ianseo.net
        $_SESSION['OnlineId'] = 0;
        $_SESSION['OnlineEventCode'] = 0;
        $_SESSION['OnlineAuth'] = 0;
        //Parametro per il Padding dei paglioni
        $_SESSION['TargetPadding'] = 2;
        // sets the collation for the tournament
        set_collation($MyRow->ToCollation);
        // if a collation is set for a tournament, this will be the default whatever language is chosen
        $_SESSION['COLLATION-LOCK'] = $MyRow->ToCollation != '';
        // Defines if a tournament is ORIS compliant or not
        $_SESSION['ISORIS'] = $MyRow->ToIsORIS;
        $q = "\r\n\t\t\tSELECT IFNULL(MAX(SesTar4Session),0) AS max_session\r\n\t\t\tFROM\r\n\t\t\t\tSession\r\n\t\t\tWHERE\r\n\t\t\t\tSesTournament={$MyRow->ToId}\r\n\t\t";
        $t = safe_r_sql($q);
        if ($u = safe_fetch($t)) {
            if ($u->max_session >= 100) {
                $_SESSION['TargetPadding'] = 3;
            } else {
                $_SESSION['TargetPadding'] = 2;
            }
        }
        $_SESSION['ClickMenu'] = GetParameter('OnClickMenu');
        // parametri per gli spareggi... e i menu
        set_qual_session_flags();
        return $MyRow;
    }
    return false;
}
Пример #29
0
function GetParameters($params)
{
    global $locale;
    $locale = ValidateLocaleString(GetParameter($params, 'LOCALE'));
}
Пример #30
0
<?php

// settings for the READ server
$CFG->R_HOST = 'localhost';
$CFG->R_USER = '******';
$CFG->R_PASS = '******';
// settings for the WRITE Server
$CFG->W_HOST = 'localhost';
$CFG->W_USER = '******';
$CFG->W_PASS = '******';
/* DB Name */
$CFG->DB_NAME = 'ianseo';
// set the root directory
$CFG->ROOT_DIR = '/';
// Check if the DB is up to date
$version = GetParameter('DBUpdate');
if ($version < $newversion) {
    @(include_once 'Common/UpdateDb.inc.php');
}