function _submitMatchResult($vmkey, $eventid, $vtid, $vsets, $vlegs) { /* * unlike the saveMatch function this is triggered by non-priviledged users * here we have only calculated values - no check save as they are ... * TODO -> this is 60% identical to _saveMatch function ... * TODO -> check if this can be replaced by the axEditor ... * + saveresults status GreenRing ($$greencrosspic) and send message URL */ global $event, $dbi, $LS_LEVEL, $usertoken; $editmode = 0; $editmode = retAccessThisMatchKey($vmkey); if ($LS_LEVEL < 2 && $editmode == 0) { die("<h3>No access ...{$editmode}</h3>"); } # // save values into the match-team-assignment table $ret = DB_UpdateMatchTeamResults($vmkey, $eventid, $vtid, $vsets, $vlegs); if ($ret != 2) { die("<h3>Error saving Match result values...</h3>"); } // JUST set STATUS to SUBMITTED $ret = DB_setMatchStatus($vmkey, 5); if ($ret != 1) { die('<h3>Event: (' . $event['evname'] . ') Match: ' . $vmkey . ' Status Update failed ...</h3>'); } dsolog(1, $usertoken['uname'], 'Result ' . $vsets[0] . ':' . $vsets[1] . ' for Match $vmkey submitted for review'); // MESSAGE BUS if ($usertoken['ttypeuser_id'] < 3) { $msg = $event['evname'] . ' Result ' . $vsets[0] . ':' . $vsets[1] . ' submitted by Account ' . $usertoken['uname'] . ' - please review using the system link below.'; $url = 'ls_system.php?func=showmatch&vmkey=' . $vmkey . '&eventid=' . $eventid; $ret = DB_setMessage($usertoken['uname'], 1, 1, $msg, $url, $event['mgroup_id']); if ($ret != 1) { die('<h3>Event: (' . $event['evname'] . ') Match: ' . $vmkey . ' Request for approval could not be sent.</h3>'); } } _sendpendingmails(); }
if (isset($_POST['r1'])) { $aRes[] = $_POST['r1']; } if (isset($_POST['r2'])) { $aRes[] = $_POST['r2']; } if (isset($_POST['r3'])) { $aRes[] = $_POST['r3']; } if (isset($_POST['r4'])) { $aRes[] = $_POST['r4']; } // SECURITY Event Admins only ... $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname); $usertoken = initLsdbSec($dbi); $editmode = retAccessThisMatchKey($match_key); // if this is a verein_account then no need to check the eventMap ... if ($usertoken['usertype_id'] == 2) { if (!$editmode == 1) { die_red('E43:Game:AC'); } } else { if ($usertoken['eventmap'][$eventID] < 2) { die_red('E43:Game:AC'); } } /** * purpose: return a Complete Game as Table to be included into the MatchSheet DIV * renders both single or pairs depending on the gtype * parts of this code are similar/identical to the generation of the MatchSheet in ls_system.php * params: $GameID,$eventID