if (selectCount("fch_players", " WHERE playerID = \"PassedPick\"") == 0) { executeGenericSQL("INSERT INTO fch_players SET playerID = \"PassedPick\", schoolID = \"pc\" , season = \"{$season}\""); } $leagueAdmin = getSingleton("fch_leagues", "admin_user", " WHERE id = {$leagueID} and season = \"{$season}\""); // Is user the admin? if (intval($leagueAdmin) == intval($userID)) { $userIsAdmin = true; } else { $userIsAdmin = false; } if (getSingleton("fch_leagues", "draftStatus", " WHERE id = {$leagueID} and season = \"{$season}\"") != "open") { $isDraftOpen = false; } else { $isDraftOpen = true; } $nextToDraft = onTheClock($leagueID); if ($userIsAdmin) { ?> <h3>Administrator Draft Controls</h3><table border width = 100%><tr><td> <script> isAdmin = true; </script> <?php if ($isDraftOpen) { $closeDraftButton = '<button class="btn btn-primary validate" type="button" id = "close_draft_button" onclick="javascript:closeDraft(' . $leagueID . ');">Close Draft >></button>'; echo $closeDraftButton . '<p/>'; debug("Next To Draft (at load time): " . $nextToDraft["gmName"]); $skipTurn .= '<form method = "post" name = "skip_pick" enctype="multipart/form-data" >'; $skipTurn .= '<input type = "hidden" name = "action" value = "skipPick" >'; $skipTurn .= '<input type = "hidden" name = "skipPickID" id = "skipPickID" value = "' . $nextToDraft["pickSeq"] . '" >';
<?php define('_JEXEC', 1); define('JPATH_BASE', realpath(dirname(__FILE__) . '/')); require_once JPATH_BASE . '/includes/defines.php'; require_once JPATH_BASE . '/includes/framework.php'; $app = JFactory::getApplication('site'); $user = JFactory::getUser(); require_once "fch-lib.php"; require_once "config.php"; enableDebug(false); echo json_encode(onTheClock(leagueHandlerNoUI(null, getUserID())));
debug($sql); $con = initializeDB(); //echo $sql; $result = $con->query($sql); if ($result->num_rows > 10) { echo "<h3>Too Many Results</h3>{$tryAgain}"; return; } $transactionID = getNextTransactionID($userID, $leagueID); $passButton .= '<form method = "post" name = "submit_PassedPick_a" enctype="multipart/form-data" >'; $passButton .= '<input name = "transactionID" value = "' . $transactionID . '" type = "hidden">'; $passButton .= '<input type = "hidden" name = "action" value = "doAcquire" >'; $passButton .= '<input type = "hidden" name = "playerID" value = "PassedPick">'; $passButton .= '<button class="btn btn-primary validate" type="button" id = "button_submit_PassedPick_a" onclick="javascript:submitForm(\'submit_PassedPick_a\',\'button_submit_PassedPick_a\');">Skip Your Turn (Pass) >></button> </form>'; //$passButton = "<form method = \"post\" name = \"submit_PassedPick_a\" name = \"tryAgain\"><input name = \"transactionID\" value = \"$transactionID\" type = \"hidden\"><input value = \"doAcquire\" type = \"hidden\" name = \"action\"><button class=\"btn btn-primary validate\" type=\"button\" id = \"button_submit_PassedPick_a\" onclick=\"javascript:submitForm('submit_PassedPick_a','button_submit_PassedPick_a');\">Pass >></button></form>"; $whoseTurn = onTheClock($leagueID); $usingWithdrawn = 0; $allowPick = 1; debug("User : "******"userID"]) == intval($userID))) { if (intval(selectCount("fch_draft", " WHERE userID = {$userID} and leagueID = {$leagueID} and playerID = \"WithdrawnPick\"")) > 0) { $alert = "<h3>You are not on the clock. This pick will replace your prior withdrawn pick.</h3>"; $usingWithdrawn = 1; $allowPick = 1; } else { if (intval(selectCount("fch_draft", " WHERE userID = {$userID} and leagueID = {$leagueID} and playerID = \"PassedPick\"")) > 0) { $alert = "<h3>You are not on the clock. This pick will replace your prior withdrawn pick.</h3>"; $usingWithdrawn = 1; $allowPick = 1; } else { $alert = "<h3>You are not on the clock.</h3>";