$Set_Error = array(); // contiene gl'indici dei set che superano il max if (isset($_REQUEST['Command']) && $_REQUEST['Command'] == 'SAVE' && !IsBlocked(BIT_BLOCK_IND)) { // Update dei punti e dei tie $AllowedEvents = array(); foreach ($_REQUEST as $Key => $Value) { if (strpos($Key, 'S_') === 0) { if (!(is_numeric($Value) && $Value >= 0)) { $Value = 0; } $ee = ""; $mm = ""; // evento e matchno estratti dal nome campo list($ee, $mm) = explode('_', substr($Key, 2)); // get the match maximum values $MaxScores = GetMaxScores($ee, $mm); if (empty($AllowedEvents[$ee])) { // dal matchno recupero la fase $t = safe_r_sql("select GrPhase from Grids where GrMatchNo=" . intval($mm)); if ($u = safe_fetch($t)) { $AllowedEvents[$ee] = $u->GrPhase; } } if ($Value > ($MaxScores['MaxSetPoints'] ? $MaxScores['MaxSetPoints'] : $MaxScores['MaxMatch'])) { $Score_Error[$ee . '_' . $mm] = true; } else { if (debug) { print $mm . ' - '; } $Update = "UPDATE Finals SET " . (isset($_REQUEST['X_' . $ee . '_' . $mm]) && $_REQUEST['X_' . $ee . '_' . $mm] == 0 ? "FinScore" : "FinSetScore") . "=" . StrSafe_DB($Value) . " "; //Cerco i punti dei set, SE gara a set
$queryMatch = $match; $match2edit = $match; $match = $match2edit + 1; $m2edit = 1; // 1 o 2 a seconda di quale matchno è stato passato $m = 2; } else { $queryMatch = $match - 1; $match2edit = $match; $match = $match2edit - 1; $m2edit = 2; $m = 1; } //Carico il vettore dei dati validi $CurrentTarget = array(); $validData = GetMaxScores($event, $match, $TeamEvent); //Se ho la posizione, salvo la posizione e ri-setto per i punti if (!(is_null($size) || is_null($xpos) || is_null($ypos))) { $target = new Obj_Target($validData["Arrows"]); $arrowHit = $target->getHitValue($size, $xpos, $ypos); $arrUpdate = UpdateArrowPosition($match2edit, $event, $TeamEvent, $arrowHit["X"], $arrowHit["Y"]); if (!is_null($arrUpdate)) { list($what, $index) = preg_split("/[|]/", $arrUpdate); $what = $what == 1 ? 't' : 's'; $arrow = DecodeFromLetter($arrowHit["V"]); } } // if($arrow==='0') $arrow='M'; // elseif($arrow==='0*') $arrow='M*'; //Se ho i valori di freccia, indice della textbox e tipo textbox (std o so) procedo con il salvataggio dei punti if (!(is_null($what) || is_null($arrow) || is_null($index) || !preg_match('/^[st]{1}$/i', $what))) {
$Set_Error = array(); // contiene gl'indici dei set che superano il max if (isset($_REQUEST['Command']) && $_REQUEST['Command'] == 'SAVE' && !IsBlocked(BIT_BLOCK_TEAM)) { // Update dei punti e dei tie $AllowedEvents = array(); foreach ($_REQUEST as $Key => $Value) { if (strpos($Key, 'S_') === 0) { if (!(is_numeric($Value) && $Value >= 0)) { $Value = 0; } $ee = ""; $mm = ""; // evento e matchno estratti dal nome campo list($ee, $mm) = explode('_', substr($Key, 2)); // get the match maximum values $MaxScores = GetMaxScores($ee, $mm, '1'); if (empty($AllowedEvents[$ee])) { // dal matchno recupero la fase $t = safe_r_sql("select GrPhase from Grids where GrMatchNo=" . intval($mm)); if ($u = safe_fetch($t)) { $AllowedEvents[$ee] = $u->GrPhase; } } if ($Value > ($MaxScores['MaxSetPoints'] ? $MaxScores['MaxSetPoints'] : $MaxScores['MaxMatch'])) { $Score_Error[$ee . '_' . $mm] = true; } else { if (debug) { print $mm . ' - '; } $Update = "UPDATE TeamFinals SET " . (isset($_REQUEST['X_' . $ee . '_' . $mm]) && $_REQUEST['X_' . $ee . '_' . $mm] == 0 ? "TfScore" : "TfSetScore") . "=" . StrSafe_DB($Value) . " "; //Cerco i punti dei set, SE gara a set
<?php require_once dirname(dirname(__FILE__)) . '/config.php'; require_once 'Common/Lib/ArrTargets.inc.php'; require_once "Obj_Target.php"; CheckTourSession(true); $Event = isset($_REQUEST['Event']) ? $_REQUEST['Event'] : null; $Match = isset($_REQUEST['Match']) ? $_REQUEST['Match'] : null; $Team = isset($_REQUEST['Team']) ? $_REQUEST['Team'] : 0; $Size = isset($_REQUEST['Size']) ? $_REQUEST['Size'] : 100; $validData = GetMaxScores($Event, $Match, $Team); $target = new Obj_Target($validData["Arrows"]); if (!empty($_REQUEST['Arrows'])) { $target->setArrowPos($_REQUEST['Arrows']); } $target->draw($Size);
if (!($r = safe_fetch($q))) { $Error = 'no match now'; } $XML = '<r>' . '<e>' . intval(!empty($Error)) . '</e>' . '<t>' . ($Error ? 0 : $r->DateTime) . '</t>' . '<c><![CDATA[' . $Error . ']]></c>' . '</r>'; // No changes so exits immediately if ($Error or !$r->Updated) { header('Content-Type: text/xml'); die($XML); } $d_Event = $r->Event; $d_Match = $r->MatchNo; $team = $r->Team; // tiro fuori le info x lo scontro $rs = GetFinMatches($d_Event, null, $d_Match, $team, false, $TourId); //Carico il vettore dei dati validi $validData = GetMaxScores($d_Event, $d_Match, $team, $TourId); if (safe_num_rows($rs) != 1) { exit; } $EnCours = false; $myRow = safe_fetch($rs); // debug_svela($myRow, true); // righe e colonne e so nel caso di individuali cumulativi $rows = 4; $cols = 3; $so = 1; list($rows, $cols, $so) = CalcScoreRowsColsSO($myRow, $TourId); // i due score da stampare a video $scores = array(1 => '', 2 => ''); for ($archer = 1; $archer < 3; $archer++) { for ($row = 0; $row < $rows; $row++) {
require_once 'Fun_Final.local.inc.php'; CheckTourSession(true); $d_Event = isset($_REQUEST['d_Event']) ? $_REQUEST['d_Event'] : null; $d_Match = isset($_REQUEST['d_Match']) ? $_REQUEST['d_Match'] : null; $team = isset($_REQUEST['d_Team']) ? $_REQUEST['d_Team'] : 0; $chunkMode = isset($_REQUEST['d_Mode']) ? $_REQUEST['d_Mode'] : 0; if (is_null($d_Event) || is_null($d_Match) || !CheckTourSession()) { exit; } if ($d_Match == '' || $d_Event == '') { exit; } // tiro fuori le info x lo scontro $rs = GetFinMatches($d_Event, null, $d_Match, $team, false); //Carico il vettore dei dati validi $validData = GetMaxScores($d_Event, $d_Match, $team); if (safe_num_rows($rs) != 1) { exit; } $myRow = safe_fetch($rs); // righe e colonne e so nel caso di individuali cumulativi $rows = 4; $cols = 3; $so = 1; list($rows, $cols, $so) = CalcScoreRowsColsSO($myRow); // i due score da stampare a video $scores = array(1 => '', ''); /* * $setPoints contiene contiene i progressivi dei set. * Quando entrambi gli score sono riempiti, si calcolerà il vincitore di ogni set * e si aggiornerà la cella sostituendo il riferimento nella stringa.