Example #1
0
    $Rs = safe_r_sql($SQL);
    if ($r = safe_fetch($Rs)) {
        $tgtType = $r->EvFinalTargetType;
        $Error = 0;
    }
    $arrowIndex = $_REQUEST['arrowindex'] + 1;
    if (empty($_REQUEST['arrowsymbol'])) {
        $tmpLetter = ' ';
    } else {
        $tmpLetter = GetLetterFromPrint($_REQUEST['arrowsymbol'], 'T', $tgtType);
        if ($tmpLetter == ' ') {
            $Error = 1;
        }
    }
    if (!$Error) {
        UpdateArrowString($MatchNo, $Event, $EventType, $tmpLetter, $arrowIndex, $arrowIndex);
    }
    $JsonResult = array();
    $JsonResult['error'] = $Error;
    $JsonResult['matchid'] = $Event . "|" . ($EventType ? "T" : "I") . "|" . $MatchNo;
    $JsonResult['distnum'] = 1;
    $JsonResult['arrowindex'] = $arrowIndex - 1;
    $JsonResult['arrowsymbol'] = $_REQUEST['arrowsymbol'];
    $JsonResult['curscore'] = 0;
    $JsonResult['curgold'] = 0;
    $JsonResult['curxnine'] = 0;
    $JsonResult['score'] = 0;
    $JsonResult['gold'] = 0;
    $JsonResult['xnine'] = 0;
}
SendResult($JsonResult);
Example #2
0
                    // rank abs totale
                    CalcRank(0);
                    // squadre
                    MakeTeams(NULL, NULL);
                    MakeTeamsAbs(NULL, null, null);
                    $Msg .= get_text('CmdImport', 'HTT') . ": " . get_text('CmdOk');
                }
                if (!empty($_SESSION['OvrHost'])) {
                    OvrExport($xSession, $Dist, $LastArr);
                }
            } else {
                $Sql = "SELECT HhtData.* " . "FROM HhtData " . ($team == 0 ? "INNER JOIN Finals ON HdEvent=FinEvent AND HdMatchNo=FinMatchNo AND HdTournament=FinTournament AND HdTeamEvent=0 " : "INNER JOIN TeamFinals ON HdEvent=TfEvent AND HdMatchNo=TfMatchNo AND HdTournament=TfTournament AND HdTeamEvent=1 ") . "WHERE HdFinScheduling=" . StrSafe_DB($when) . " AND HdTeamEvent=" . StrSafe_DB($team) . " AND HdArrowStart=" . StrSafe_DB($FirstArr) . " AND HdTournament=" . StrSafe_DB($_SESSION['TourId']) . " AND HdHhtId=" . StrSafe_DB($_REQUEST['x_Hht']) . " " . "ORDER BY HdTargetNo ASC ";
                $Rs = safe_r_sql($Sql);
                if (safe_num_rows($Rs) > 0 && !IsBlocked($team == 0 ? BIT_BLOCK_IND : BIT_BLOCK_TEAM)) {
                    while ($myRow = safe_fetch($Rs)) {
                        UpdateArrowString($myRow->HdMatchNo, $myRow->HdEvent, $myRow->HdTeamEvent, $myRow->HdArrowString, $myRow->HdArrowStart, $myRow->HdArrowEnd);
                        $Msg .= get_text('Importing', 'HTT', substr($myRow->HdTargetNo, 0)) . '...' . get_text('CmdOk') . '<br>';
                    }
                }
            }
        } else {
            $Msg = '<strong>' . get_text('SetDistanceError', 'HTT') . '</strong>';
        }
    }
    //exit;
}
$PAGE_TITLE = get_text('CmdImport', 'HTT');
include 'Common/Templates/head.php';
?>
<form name="FrmParam" method="POST" action="">
	<table class="Tabella" >
Example #3
0
     if ($firstFree !== false) {
         ${"ArrString" . $Side} = substr_replace(${"ArrString" . $Side}, $arrKey, $firstFree, 1);
         ${"ArrowPosition" . $Side}[$startArrowPos + $firstFree] = $Coords;
     }
     $MyUpQuery = "UPDATE Finals SET ";
     if ($_REQUEST["Volee"] != 'T') {
         $MyUpQuery .= "FinArrowPosition='" . implode('|', ${"ArrowPosition" . $Side}) . "',";
     } else {
         $MyUpQuery .= "FinTiePosition='" . implode('|', ${"ArrowPosition" . $Side}) . "',";
     }
     $MyUpQuery .= "FinDateTime=" . StrSafe_DB(date('Y-m-d H:i:s')) . " ";
     $MyUpQuery .= "WHERE FinMatchNo=" . StrSafe_DB($Side == "Sx" ? $MyRow->MatchNo : $MyRow->OppMatchNo) . " AND FinEvent=" . StrSafe_DB($_REQUEST['Event']) . " AND FinTournament=" . StrSafe_DB($_SESSION['TourId']);
     $RsUpdate = safe_w_sql($MyUpQuery);
 }
 UpdateArrowString($MyRow->MatchNo, $MyRow->Event, "0", $ArrStringSx, $startArrowString, $startArrowString + $nARR - 1);
 UpdateArrowString($MyRow->OppMatchNo, $MyRow->Event, "0", $ArrStringDx, $startArrowString, $startArrowString + $nARR - 1);
 //Aggiorno posizione frecce SX
 $MyUpQuery = "UPDATE Finals SET ";
 if ($_REQUEST["Volee"] != 'T') {
     $MyUpQuery .= "FinArrowPosition='" . implode('|', $ArrowPositionSx) . "',";
 } else {
     $MyUpQuery .= "FinTiePosition='" . implode('|', ArrowPositionSx) . "',";
 }
 $MyUpQuery .= "FinDateTime=" . StrSafe_DB(date('Y-m-d H:i:s')) . " ";
 $MyUpQuery .= "WHERE FinMatchNo=" . $MyRow->MatchNo . " AND FinEvent=" . StrSafe_DB($_REQUEST['Event']) . " AND FinTournament=" . StrSafe_DB($_SESSION['TourId']);
 $RsUpdate = safe_w_sql($MyUpQuery);
 //Aggiorno posizione frecce DX
 $MyUpQuery = "UPDATE Finals SET ";
 if ($_REQUEST["Volee"] != 'T') {
     $MyUpQuery .= "FinArrowPosition='" . implode('|', $ArrowPositionDx) . "',";
 } else {
Example #4
0
     // Verifico la arrow se il valore è valido per il target selezionato
     if (array_key_exists(strtoupper(GetLetterFromPrint($arrow, $CurrentTarget)), $validData["Arrows"])) {
         $arrow = GetLetterFromPrint($arrow, $CurrentTarget);
     } else {
         $arrow = ' ';
     }
     // conti
     $ArrowStart = $index + 1;
     // se però ho mandato il tie devo rifare i conti
     if ($what == 't') {
         $rs = GetFinMatches($event, null, $queryMatch, $TeamEvent, false);
         $myRow = safe_fetch($rs);
         list($rows, $cols, $so) = CalcScoreRowsColsSO($myRow);
         $ArrowStart = $rows * $cols + 1 + $index;
     }
     UpdateArrowString($match2edit, $event, $TeamEvent, $arrow, $ArrowStart, $ArrowStart);
     if ($arrow == ' ') {
         UpdateArrowPosition($match2edit, $event, $TeamEvent, '', '', ($what == 's' ? '0' : '1') . "|" . $index);
     }
     $spotLimit[0] = $what == 's' ? 0 : 1;
 }
 $Select = '';
 if ($TeamEvent == 0) {
     $Select = "SELECT " . "f.FinEvent as EvCode, f.FinMatchNo as MatchNo, f2.FinMatchNo as OppMatchNo, EvMatchMode, EvMatchArrowsNo, " . "IF(f.FinDateTime>=f2.FinDateTime, f.FinDateTime, f2.FinDateTime) AS DateTime," . "f.FinScore AS Score, f.FinSetScore AS SetScore, f.FinTie as Tie, f.FinArrowString as ArString, f.FinTieBreak as TbString, " . "f2.FinScore AS OppScore, f2.FinSetScore AS OppSetScore, f2.FinTie as OppTie, f2.FinArrowString as OppArString, f2.FinTieBreak as OppTbString, " . "GrPhase, EvMaxTeamPerson " . "FROM Finals AS f " . "INNER JOIN Finals AS f2 ON f.FinEvent=f2.FinEvent AND f.FinMatchNo=IF((f.FinMatchNo % 2)=0,f2.FinMatchNo-1,f2.FinMatchNo+1) AND f.FinTournament=f2.FinTournament " . "INNER JOIN Events ON f.FinEvent=EvCode AND f.FinTournament=EvTournament AND EvTeamEvent=0 " . "INNER JOIN Grids ON f.FinMatchNo=GrMatchNo " . "WHERE f.FinTournament=" . StrSafe_DB($_SESSION['TourId']) . " AND (f.FinMatchNo % 2)=0 AND GrMatchNo=" . StrSafe_DB($queryMatch) . " AND f.FinEvent=" . StrSafe_DB($event) . " " . "ORDER BY f.FinEvent, f.FinMatchNo ";
 } else {
     $Select = "SELECT " . "f.TfEvent as EvCode, f.TfMatchNo as MatchNo, f2.TfMatchNo as OppMatchNo, EvMatchMode, EvMatchArrowsNo, " . "IF(f.TfDateTime>=f2.TfDateTime, f.TfDateTime, f2.TfDateTime) AS DateTime," . "f.TfScore AS Score, f.TfSetScore AS SetScore, f.TfTie as Tie, f.TfArrowString as ArString, f.TfTieBreak as TbString, " . "f2.TfScore AS OppScore, f2.TfSetScore AS OppSetScore, f2.TfTie as OppTie, f2.TfArrowString as OppArString, f2.TfTieBreak as OppTbString, " . "GrPhase, EvMaxTeamPerson " . "FROM TeamFinals AS f " . "INNER JOIN TeamFinals AS f2 ON f.TfEvent=f2.TfEvent AND f.TfMatchNo=IF((f.TfMatchNo % 2)=0,f2.TfMatchNo-1,f2.TfMatchNo+1) AND f.TfTournament=f2.TfTournament " . "INNER JOIN Events ON f.TfEvent=EvCode AND f.TfTournament=EvTournament AND EvTeamEvent=1 " . "INNER JOIN Grids ON f.TfMatchNo=GrMatchNo " . "WHERE f.TfTournament=" . StrSafe_DB($_SESSION['TourId']) . " AND (f.TfMatchNo % 2)=0 AND GrMatchNo=" . StrSafe_DB($queryMatch) . " AND f.TfEvent=" . StrSafe_DB($event) . " " . "ORDER BY f.TfEvent, f.TfMatchNo ";
 }
 $Rs = safe_r_sql($Select);
 //print $Select;
 if (safe_num_rows($Rs) == 1) {
     $MyRow = safe_fetch($Rs);