$old_code = ''; while ($MyRow = safe_fetch($Rs)) { if ($MyRow->ToCode != $old_code) { $riga = 1 - $riga; $old_code = $MyRow->ToCode; } print '<tr' . ($riga ? ' class="alt"' : '') . ' style="height:3em">'; print "<td>{$MyRow->ToCode}</td>"; print "<td>{$MyRow->ToName}</td>"; print "<td>{$MyRow->ToWhere}</td>"; if ($MyRow->ToFrom != $MyRow->ToTo) { print "<td>" . get_text('DateFmtMoreDays', '', array($MyRow->ToFrom, $MyRow->ToTo)) . "</td>"; } else { print "<td>{$MyRow->ToFrom}</td>"; } print '<td class="Left"><a target="_blank" class="Link" href="Rotation.php?Rule=' . $MyRow->TVRId . '&Tour=' . $MyRow->ToCode . '">' . ManageHTML($MyRow->TVRName) . '</a></td>'; print '<td class="Left">[ <a target="_blank" class="Link" href="LightRot.php?Rule=' . $MyRow->TVRId . '&Tour=' . $MyRow->ToCode . '">' . get_text('TvLightPage', 'Tournament') . '</a> ]</td>'; if ($TourId) { print '<td class="Left"><a class="Link" href="?edit=' . $MyRow->TVRId . '">' . get_text('Edit', 'Languages') . '</a></td>'; print '<td class="Left"><a class="Link" href="?delete=' . $MyRow->TVRId . '" onclick="return(confirm(\'' . get_text('MsgAreYouSure') . '\'))">' . get_text('CmdDelete', 'Tournament') . '</a></td>'; } print '</tr>' . "\n"; } } else { print '<tr><td class="Bold Center">' . get_text('TVOutNoRulesWithStart', 'Tournament') . '</td></tr>' . "\n"; } if ($TourId) { // new rules only in an open tournament $riga = 1 - $riga; print '<tr' . ($riga ? ' class="alt"' : '') . '>'; print "<td> </td>";
?> </th> <th class="Title" width="10%" nowrap="nowrap"><?php print get_text('TourWhen', 'Tournament'); ?> </th> <th class="Title" width="30%"><?php print get_text('TourWhere', 'Tournament'); ?> </th> <th class="Title" width="50%"><?php print get_text('TourName', 'Tournament'); ?> </th> </tr> <?php $q = safe_r_sql("select ToCode, ToName, ToWhere, DATE_FORMAT(ToWhenFrom,'" . get_text('DateFmtDB') . "') AS DtFrom, " . "DATE_FORMAT(ToWhenTo,'" . get_text('DateFmtDB') . "') AS DtTo from Tournament order by ToWhenTo desc, ToWhenFrom desc"); while ($r = safe_fetch($q)) { echo '<tr>'; echo '<td><a href="?ToCode=' . $r->ToCode . '">' . get_text('Download', 'Boinx') . '</a></td>'; print '<td>' . $r->ToCode . '</td>'; print '<td nowrap="nowrap">' . get_text('From', 'Tournament') . ' ' . $r->DtFrom . ' ' . get_text('To', 'Tournament') . ' ' . $r->DtTo . '</td>'; print '<td>' . ManageHTML($r->ToWhere) . '</td>'; print '<td>' . ManageHTML($r->ToName) . '</td>'; echo '</tr>'; } ?> </table> <?php include 'Common/Templates/tail.php';
?> " size="56" maxlength="32" value="<?php print ManageHTML($MyRow->ScDescription); ?> " onBlur="javascript:UpdateField('SC','d_ScDescription_<?php print $MyRow->ScId; ?> ');"></td> <td class="Center"><input type="text" name="d_ScViewOrder_<?php print $MyRow->ScId; ?> " id="d_ScViewOrder_<?php print $MyRow->ScId; ?> " size="3" maxlength="3" value="<?php print ManageHTML($MyRow->ScViewOrder); ?> " onBlur="javascript:UpdateField('SC','d_ScViewOrder_<?php print $MyRow->ScId; ?> ');"></td> <td class="Center"><a href="javascript:DeleteRow('SC','<?php print $MyRow->ScId; ?> ','<?php print urlencode(get_text('MsgAreYouSure')); ?> ');"><img src="<?php echo $CFG->ROOT_DIR; ?> Common/Images/drop.png" border="0" alt="#" title="#"></a></td>
print $MyRow->AwOrder; print '</td>'; print '<td class="Center">'; print $MyRow->AwEvent; print '</td>'; print '<td>'; print $evArray[$MyRow->AwFinEvent . $MyRow->AwTeam]; print '</td>'; print '<td onclick="insertInput(this,\'AwPositions\')">'; print $MyRow->AwPositions; print '</td>'; print '<td onclick="insertInput(this,\'AwDescription\')">'; print $MyRow->AwDescription; print '</td>'; print '<td onclick="insertInput(this,\'AwAwarders\')">'; print ManageHTML($MyRow->AwAwarders); print '</td>'; print '<td class="Center">'; print '<input type="button" value="' . get_text('CmdDelete', 'Tournament') . '" onClick="javascript:DeleteAwards(\'' . $MyRow->AwEvent . "'," . $MyRow->AwFinEvent . "," . $MyRow->AwTeam . ',\'' . get_text('MsgAreYouSure') . '\');">'; print '</td>'; print '</tr>' . "\n"; } } echo '<tr class="Divider"><td colspan="8"></td></tr>'; echo '<tr><th class="Title" colspan="8">' . get_text('Options', 'Tournament') . '</th></tr>'; $tmp = getModuleParameter('Awards', 'PlayAnthem', 1); echo '<tr><td class="Center" onclick="switchOption(\'PlayAnthem\')"><img src="' . $CFG->ROOT_DIR . 'Common/Images/Enabled' . $tmp . '.png" width="20" alt="' . get_text($tmp ? 'Yes' : 'No') . '"></td>'; echo '<td colspan="7">' . get_text('AwardPlayAnthem', 'Tournament') . '</td></tr>'; $tmp = getModuleParameter('Awards', 'RepresentCountry', 1); echo '<tr><td class="Center" onclick="switchOption(\'RepresentCountry\')"><img src="' . $CFG->ROOT_DIR . 'Common/Images/Enabled' . $tmp . '.png" width="20" alt="' . get_text($tmp ? 'Yes' : 'No') . '"></td>'; echo '<td colspan="7">' . get_text('AwardRepresentCountry', 'Tournament') . '</td></tr>';
if (!$Errore) { // Aggiungo la nuova riga $Insert = "INSERT IGNORE INTO Classes (ClId,ClTournament,ClDescription,ClAthlete,ClViewOrder,ClAgeFrom,ClAgeTo,ClValidClass,ClDivisionsAllowed,ClSex) " . "VALUES(" . StrSafe_DB($_REQUEST['New_ClId']) . "," . StrSafe_DB($_SESSION['TourId']) . "," . StrSafe_DB($_REQUEST['New_ClDescription']) . "," . StrSafe_DB(intval($_REQUEST['New_ClAthlete'])) . "," . StrSafe_DB($_REQUEST['New_ClViewOrder']) . ", " . StrSafe_DB($_REQUEST['New_ClAgeFrom']) . ", " . StrSafe_DB($_REQUEST['New_ClAgeTo']) . ", " . StrSafe_DB(CreateValidClass($_REQUEST['New_ClId'], $_REQUEST['New_ClValidClass'])) . ", " . StrSafe_DB($_REQUEST['New_ClValidDivision']) . ", " . StrSafe_DB($_REQUEST['New_ClSex']) . " " . ") "; $RsIns = safe_w_sql($Insert); //duplicate entries is OK if (!safe_w_affected_rows()) { $Errore = 2; $MsgErrore = get_text('DuplicateEntry', 'Tournament'); } } header('Content-Type: text/xml'); print '<response>' . "\n"; print '<error>' . $Errore . '</error>' . "\n"; print '<errormsg><![CDATA[' . $MsgErrore . ']]></errormsg>' . "\n"; print '<new_clid><![CDATA[' . $_REQUEST['New_ClId'] . ']]></new_clid>' . "\n"; print '<new_cldescr><![CDATA[' . ManageHTML($_REQUEST['New_ClDescription']) . ']]></new_cldescr>' . "\n"; print '<new_clathleteyes><![CDATA[' . ManageHTML(get_text('Yes')) . ']]></new_clathleteyes>' . "\n"; print '<new_clathleteno><![CDATA[' . ManageHTML(get_text('No')) . ']]></new_clathleteno>' . "\n"; print '<new_clathlete><![CDATA[' . $_REQUEST['New_ClAthlete'] . ']]></new_clathlete>' . "\n"; print '<new_clprogr>' . $_REQUEST['New_ClViewOrder'] . '</new_clprogr>' . "\n"; print '<new_clagefrom>' . $_REQUEST['New_ClAgeFrom'] . '</new_clagefrom>' . "\n"; print '<new_clageto>' . $_REQUEST['New_ClAgeTo'] . '</new_clageto>' . "\n"; print '<new_clvalid><![CDATA[' . $_REQUEST['New_ClValidClass'] . ']]></new_clvalid>' . "\n"; print '<new_clvaliddiv><![CDATA[' . $_REQUEST['New_ClValidDivision'] . ']]></new_clvaliddiv>' . "\n"; print '<new_clsex>' . $_REQUEST['New_ClSex'] . '</new_clsex>' . "\n"; print '<confirm_msg><![CDATA[' . get_text('MsgAreYouSure') . ']]></confirm_msg>' . "\n"; // Stringhe maschio e femmina print '<male>' . get_text('ShortMale', 'Tournament') . '</male>' . "\n"; print '<female>' . get_text('ShortFemale', 'Tournament') . '</female>' . "\n"; print '<unisex>' . get_text('ShortUnisex', 'Tournament') . '</unisex>' . "\n"; print '</response>' . "\n";
print get_text('TourWhere', 'Tournament'); ?> </th> <th class="Title" width="17%"><?php print get_text('TourWhen', 'Tournament'); ?> </th> </tr> <?php while ($MyRow = safe_fetch($Rs)) { print '<tr>'; print '<td><a class="Link" href="' . $CFG->ROOT_DIR . 'Common/TourOn.php?ToId=' . $MyRow->ToId . '">' . get_text('Open') . '</a></td>'; print '<td>' . $MyRow->ToCode . '</td>'; print '<td>' . ManageHTML($MyRow->ToName) . '</td>'; print '<td>' . $MyRow->ToCommitee . ' - ' . ManageHTML($MyRow->ToComDescr) . '</td>'; print '<td>' . ManageHTML($MyRow->ToWhere) . '</td>'; print '<td>' . get_text('From', 'Tournament') . ' ' . $MyRow->DtFrom . ' ' . get_text('To', 'Tournament') . ' ' . $MyRow->DtTo . '</td>'; print '</tr>' . "\n"; } } else { ?> <tr><td colspan="6" class="Bold Center"><?php echo get_text('NoTourExists', 'Tournament'); ?> </td></tr> <?php } ?> </table> <?php include 'Common/Templates/tail.php';
$Select = "SELECT ToOptions,ToIocCode,ToCollation,ToId,ToType,ToCode,ToName,ToCommitee,ToComDescr,ToWhere,DATE_FORMAT(ToWhenFrom,'" . get_text('DateFmtDB') . "') AS DtFrom,DATE_FORMAT(ToWhenTo,'" . get_text('DateFmtDB') . "') AS DtTo, " . "DATE_FORMAT(ToWhenFrom,'%d') AS DtFromDay,DATE_FORMAT(ToWhenFrom,'%m') AS DtFromMonth,DATE_FORMAT(ToWhenFrom,'%Y') AS DtFromYear, " . "DATE_FORMAT(ToWhenTo,'%d') AS DtToDay,DATE_FORMAT(ToWhenTo,'%m') AS DtToMonth,DATE_FORMAT(ToWhenTo,'%Y') AS DtToYear, " . "ToTypeName AS TtName,ToNumDist AS TtNumDist,ToLocRule,ToPrintPaper,ToPrintChars,ToPrintLang,ToCurrency, ToTypeSubRule, ToUseHHT " . "FROM Tournament " . "WHERE ToId=" . StrSafe_DB($_SESSION['TourId']) . " "; $Rs = safe_r_sql($Select); //print $Select;exit; } if ($Rs && safe_num_rows($Rs) == 1) { $MyRow = safe_fetch($Rs); if ($MyRow->ToOptions) { $MyRow->ToOptions = unserialize($MyRow->ToOptions); } } ?> <form name="Frm" method="post" action=""> <input type="hidden" name="Command" value="SAVE"> <table class="Tabella"> <tr><th class="Title" colspan="2"><?php print isset($_REQUEST['New']) ? get_text('NewTour', 'Tournament') : ManageHTML($MyRow->ToName); ?> </th></tr> <tr class="Divider"><td colspan="2"></td></tr> <tr><td class="Title" colspan="2"><?php echo get_text('TourMainInfo', 'Tournament'); ?> </td></tr> <tr> <th class="TitleLeft" width="15%"><?php print get_text('TourCode', 'Tournament'); ?> </th> <td> <input <?php print $Arr_Values2Check_Index['d_ToCode']['Error'] ? ' class="error"' : '';
} $JS_SCRIPT = array('<script type="text/javascript" src="' . $CFG->ROOT_DIR . 'Common/ajax/ObjXMLHttpRequest.js"></script>', '<script type="text/javascript" src="' . $CFG->ROOT_DIR . 'TV/FuncRot.js"></script>', '<script type="text/javascript" src="' . $CFG->ROOT_DIR . 'Common/ColorPicker/302pop.js"></script>'); $PAGE_TITLE = get_text('TVManagingRule', 'Tournament', ManageHTML($RULE->TVRName)); if ($DBId) { $Select = "SELECT * FROM TVParams " . "WHERE TVPId={$DBId} " . "AND TVPTournament={$TourId}"; $Rs = safe_r_sql($Select); if ($r = safe_fetch($Rs)) { $ONLOAD = ' onload="GetRuleSel(\'' . $r->TVPPage . '\', ' . $DBId . ')"'; } } include 'Common/Templates/head.php'; ?> <form name="Frm" method="post" action="" enctype="multipart/form-data" onsubmit="clearHiddenFields(this)"> <table class="Tabella"> <tr><th class="Title" colspan="2"><?php print get_text('TVManagingRule', 'Tournament', ManageHTML($RULE->TVRName)); ?> </th></tr> <?php if ($DBId or !empty($_REQUEST['NewDb'])) { require_once 'EditRule-Tour.php'; } elseif ($MMId or !empty($_REQUEST['NewMm'])) { require_once 'EditRule-Media.php'; } else { require_once 'EditRule-List.php'; } ?> </table>
<?php require_once dirname(dirname(__FILE__)) . '/config.php'; require_once 'Common/Fun_FormatText.inc.php'; if (!CheckTourSession()) { print get_text('CrackError'); exit; } $Errore = 0; $Answer = ''; if (preg_match('/^[A-Z0-9]{1,4}\\|[0-1]{1}\\|[0-1]{1}$/', $_REQUEST["id"]) && in_array($_REQUEST["field"], array('AwOrder', 'AwPositions', 'AwDescription', 'AwAwarders'))) { if (!IsBlocked(BIT_BLOCK_PARTICIPANT)) { list($Event, $isFinal, $isTeam) = explode('|', $_REQUEST["id"]); $Sql = "UPDATE Awards SET " . $_REQUEST["field"] . "=" . StrSafe_DB($_REQUEST["value"]) . "WHERE AwTournament=" . StrSafe_DB($_SESSION['TourId']) . " AND AwEvent=" . StrSafe_DB($Event) . " AND AwFinEvent=" . StrSafe_DB($isFinal) . " AND AwTeam=" . StrSafe_DB($isTeam); $RsUp = safe_w_sql($Sql); if (!$RsUp) { $Errore = 1; } $Answer = '<row>' . $_REQUEST["id"] . '</row>' . '<field><![CDATA[' . $_REQUEST["field"] . ']]></field>' . '<value><![CDATA[' . ManageHTML($_REQUEST["value"]) . ']]></value>'; } else { $Errore = 1; } } else { $Errore = 1; } header('Content-Type: text/xml'); echo '<response>'; echo '<error>' . $Errore . '</error>'; echo $Answer; echo '</response>';
><?php echo get_text('Yes'); ?> </option> </select></td> <td class="Center"><input <?php print !defined('dontEditClassDiv') ? '' : ' disabled="disabled"'; ?> type="text" name="d_ClViewOrder_<?php print $id_post; ?> " id="d_ClViewOrder_<?php print $id_post; ?> " size="3" maxlength="3" value="<?php print ManageHTML($MyRow->ClViewOrder); ?> " onBlur="javascript:UpdateField('C','d_ClViewOrder_<?php print $id_post; ?> ');"></td> <td class="Center"><input <?php print !defined('dontEditClassDiv') ? '' : ' disabled="disabled"'; ?> type="text" name="d_ClAgeFrom_<?php print $id_post; ?> " id="d_ClAgeFrom_<?php print $id_post; ?> " size="3" maxlength="3" value="<?php
require_once dirname(dirname(__FILE__)) . '/config.php'; require_once 'Common/Fun_FormatText.inc.php'; require_once 'Tournament/Fun_Tournament.local.inc.php'; if (!CheckTourSession() || !isset($_REQUEST['New_ScId']) || !isset($_REQUEST['New_ScDescription']) || !isset($_REQUEST['New_ScViewOrder'])) { print get_text('CrackError'); exit; } $Errore = 0; if (!IsBlocked(BIT_BLOCK_TOURDATA)) { // Aggiungo la nuova riga $Insert = "INSERT INTO SubClass (ScId,ScTournament,ScDescription,ScViewOrder) " . "VALUES(" . StrSafe_DB(str_pad($_REQUEST['New_ScId'], 2, ' ', STR_PAD_LEFT)) . "," . StrSafe_DB($_SESSION['TourId']) . "," . StrSafe_DB($_REQUEST['New_ScDescription']) . "," . StrSafe_DB($_REQUEST['New_ScViewOrder']) . " " . ") "; $RsIns = safe_w_sql($Insert); if (debug) { print $Insert . '<br>'; } if (!$RsIns) { $Errore = 1; } } else { $Errore = 1; } if (!debug) { header('Content-Type: text/xml'); } print '<response>' . "\n"; print '<error>' . $Errore . '</error>' . "\n"; print '<new_scid>' . str_pad($_REQUEST['New_ScId'], 2, ' ', STR_PAD_LEFT) . '</new_scid>' . "\n"; print '<new_scdescr><![CDATA[' . ManageHTML($_REQUEST['New_ScDescription']) . ']]></new_scdescr>' . "\n"; print '<new_scprogr>' . $_REQUEST['New_ScViewOrder'] . '</new_scprogr>' . "\n"; print '<confirm_msg>' . get_text('MsgAreYouSure') . '</confirm_msg>' . "\n"; print '</response>' . "\n";
echo '</tr>'; foreach (check_word($search) as $row) { echo '<tr>'; echo '<td>' . $row[0] . '</td>'; echo '<td>' . $row[1] . '</td>'; echo '<td>' . preg_replace("#({$search})#sim", '<b style="color:red">\\1</b>', $row[2]) . '</td>'; echo '<td>get_text(\'' . $row[1] . '\'' . ($row[0] != 'Common' ? ', \'' . $row[0] . '\'' : '') . ')</td>'; echo '<td>get_text(\'' . $row[1] . '\', \'' . $row[0] . '\', (mixed) $var, [(bool) $translate])</td>'; echo '</tr>'; } echo '</table>'; } echo '<form method="GET" action="">'; echo '<table class="Tabella">'; echo '<tr>'; echo '<td class="Right" nowrap="nowrap">' . get_text('Search', 'Languages') . '</td>'; echo '<td width="100%">'; echo '<input type="text" name="search" value="' . ManageHTML($search) . '" style="width:90%">'; echo '</td>'; echo '</tr>'; echo '<tr>'; echo '<td class="Center" colspan="2">' . get_text('CmdSearch', 'Languages') . '</td>'; echo '</tr>'; echo '</table>'; echo '</form>'; ?> </div> </div> <?php include 'Common/Templates/tail.php';
require_once dirname(__FILE__) . '/config.php'; require_once 'Common/Fun_FormatText.inc.php'; require_once 'Common/Fun_Sessions.inc.php'; $TourRow = NULL; $json_array = array(); $Select = "SELECT ToId,ToType,ToCode,ToName,ToCommitee,ToComDescr,ToWhere, " . " DATE_FORMAT(ToWhenFrom,'" . get_text('DateFmtDB') . "') AS DtFrom, " . " DATE_FORMAT(ToWhenTo,'" . get_text('DateFmtDB') . "') AS DtTo, " . " ToNumSession, ToTypeName, ToNumDist, ToNumEnds, ToCategory " . " FROM Tournament " . " WHERE ToId={$CompId}"; // Retrieve the Tournament info $Rs = safe_r_sql($Select); if ($TourRow = safe_fetch($Rs)) { // Now load the json array with the info we need $json_array["compcode"] = $TourRow->ToCode; $json_array["compname"] = $TourRow->ToName; $json_array["compdesc1"] = $TourRow->ToCommitee . ' - ' . $TourRow->ToComDescr; $json_array["compdesc2"] = $TourRow->ToWhere . ", " . $TourRow->DtFrom . " - " . $TourRow->DtTo; $json_array["compdesc3"] = ManageHTML(get_text($TourRow->ToTypeName, 'Tournament')) . ", " . $TourRow->ToNumDist . " " . get_text($TourRow->ToNumDist == 1 ? 'Distance' : 'Distances', 'Tournament'); $json_array["compcategory"] = (int) $TourRow->ToCategory; $json_array["numdist"] = (int) $TourRow->ToNumDist; $json_array["numsession"] = (int) $TourRow->ToNumSession; $json_array["distances"] = array(); //Retrieve all the stages $tmp_stage = array(); $tmp_stage[] = "Q"; $Select = "SELECT DISTINCTROW EvTeamEvent, EvElim1, EvElim2 FROM Events WHERE EvTournament={$CompId} AND EvFinalFirstPhase!=0 order by EvTeamEvent, EvProgr"; $Rs = safe_r_sql($Select); while ($StageRow = safe_fetch($Rs)) { if ($StageRow->EvElim1 > 0 && !in_array("E1", $tmp_stage)) { $tmp_stage[] = "E1"; } if ($StageRow->EvElim2 > 0 && !in_array("E2", $tmp_stage)) { $tmp_stage[] = "E2";
} ?> </td> </tr> <tr> <th class="TitleLeft" width="15%"><?php print get_text('StaffOnField', 'Tournament'); ?> </th> <td> <?php $Select = "SELECT ti.*, it.*" . "FROM TournamentInvolved AS ti LEFT JOIN InvolvedType AS it ON ti.TiType=it.ItId " . "WHERE ti.TiTournament=" . StrSafe_DB($_SESSION['TourId']) . " " . "ORDER BY ti.TiType ASC,ti.TiName ASC "; $RsS = safe_r_sql($Select); if (safe_num_rows($RsS) > 0) { while ($Row = safe_fetch($RsS)) { print ManageHTML($Row->TiName); if ($Row->TiCode) { print ' (' . $Row->TiCode . ')'; } print ', ' . get_text($Row->ItDescription, 'Tournament') . '<br>'; } } else { print get_text('NoStaffOnField', 'Tournament'); } ?> </td> </tr> <tr> <th class="TitleLeft" width="15%"><?php print get_text('Photo', 'Tournament'); ?>