$saisonId = $db->getLastInsertedId(); // create matches $dateObj = DateTime::createFromFormat($website->getConfig("date_format") . ", H:i", $_POST["firstmatchday_date"] . ", " . $_POST["firstmatchday_time"]); $matchTimestamp = $dateObj->getTimestamp(); $timeBreakSeconds = 3600 * 24 * $_POST['timebreak']; $matchTable = $website->getConfig("db_prefix") . "_spiel"; foreach ($schedule as $matchDay => $matches) { // creates matches of match day foreach ($matches as $match) { $homeTeam = $match[0]; $guestTeam = $match[1]; $teamcolumns = array(); $teamcolumns["spieltyp"] = "Ligaspiel"; $teamcolumns["liga_id"] = $_POST["league"]; $teamcolumns["saison_id"] = $saisonId; $teamcolumns["spieltag"] = $matchDay; $teamcolumns["home_verein"] = $homeTeam; $teamcolumns["gast_verein"] = $guestTeam; $teamcolumns["datum"] = $matchTimestamp; $db->queryInsert($teamcolumns, $matchTable); } $matchTimestamp += $timeBreakSeconds; // add additional break between two rounds if ($matchDay % $numberOfMatchDaysPerRound == 0) { $matchTimestamp += 3600 * 24 * $_POST['timebreak_rounds']; } } echo createSuccessMessage($i18n->getMessage("generator_success"), ""); echo "<p>» <a href=\"?site=" . $site . "\">" . $i18n->getMessage("back_label") . "</a></p>\n"; } }
$homeTeam = $match[0]; $guestTeam = $match[1]; $matchcolumns = array(); $matchcolumns["spieltyp"] = "Pokalspiel"; $matchcolumns["pokalname"] = $round["cup_name"]; $matchcolumns["pokalrunde"] = $round["round_name"]; $matchcolumns["pokalgruppe"] = $groupName; $matchcolumns["home_verein"] = $homeTeam; $matchcolumns["gast_verein"] = $guestTeam; $matchcolumns["datum"] = $matchTimestamp; $db->queryInsert($matchcolumns, $dbTable); } $matchTimestamp += $timeBreakSeconds; } } echo createSuccessMessage($i18n->getMessage("alert_save_success"), ""); } // count matches $result = $db->querySelect("COUNT(*) AS hits", $website->getConfig("db_prefix") . "_spiel", "pokalname = '%s' AND pokalrunde = '%s'", array($round["cup_name"], $round["round_name"])); $matches = $result->fetch_array(); $result->free(); $matchesUrl = "?site=manage&entity=match&" . http_build_query(array("entity_match_pokalname" => escapeOutput($round["cup_name"]), "entity_match_pokalrunde" => escapeOutput($round["round_name"]))); ?> <div class="well"> <?php if (isset($matches["hits"]) && $matches["hits"]) { ?> <p><a href="<?php echo $matchesUrl; ?>
throw new Exception($i18n->getMessage("error_access_denied")); } echo "<p><a href=\"?site=manage&entity=match\" class=\"btn\">" . $i18n->getMessage("back_label") . "</a></p>"; $matchId = isset($_REQUEST["match"]) && is_numeric($_REQUEST["match"]) ? $_REQUEST["match"] : 0; $match = MatchesDataService::getMatchById($website, $db, $matchId, FALSE, FALSE); if (!count($match)) { throw new Exception("illegal match id"); } // ******** action: delete player from match if ($action == "delete") { if ($admin["r_demo"]) { throw new Exception($i18n->getMessage("validationerror_no_changes_as_demo")); } $itemId = (int) $_REQUEST["itemid"]; $db->queryDelete($website->getConfig("db_prefix") . "_matchreport", "id = %d", array($itemId)); echo createSuccessMessage($i18n->getMessage("manage_success_delete"), ""); } elseif ($action == "create") { if ($admin["r_demo"]) { throw new Exception($i18n->getMessage("validationerror_no_changes_as_demo")); } $homeActive = $match["match_home_id"] == $_POST["team_id"] ? "1" : "0"; $message_id = (int) $_POST["message_id"]; $minute = (int) $_POST["minute"]; $playerNames = $_POST["playernames"]; $goals = $_POST["intermediateresult"]; if ($message_id && $minute) { $db->queryInsert(array("match_id" => $matchId, "message_id" => $message_id, "active_home" => $homeActive, "minute" => $minute, "goals" => $goals, "playernames" => $playerNames), $website->getConfig("db_prefix") . "_matchreport"); } } // ******** form for adding new item echo "<form action=\"" . $_SERVER['PHP_SELF'] . "\" class=\"form-horizontal\" method=\"post\">";
// delete youth player if ($maxYouthAge > 0 && $maxYouthAge <= $playerage) { $db->queryDelete($conf['db_prefix'] . '_youthplayer', 'id = %d', $youthplayer['id']); // update youth player } else { $db->queryUpdate(array('age' => $playerage), $conf['db_prefix'] . '_youthplayer', 'id = %d', $youthplayer['id']); } } $youthresult->free(); // dispatch event $event = new SeasonOfTeamCompletedEvent($website, $db, $i18n, $team['id'], $season['id'], $rank); PluginMediator::dispatchEvent($event); $rank++; } $result->free(); // reset clubs statistics of teams which have not been moved $teamcolumns = array(); $teamcolumns['sa_tore'] = 0; $teamcolumns['sa_gegentore'] = 0; $teamcolumns['sa_spiele'] = 0; $teamcolumns['sa_siege'] = 0; $teamcolumns['sa_niederlagen'] = 0; $teamcolumns['sa_unentschieden'] = 0; $teamcolumns['sa_punkte'] = 0; $db->queryUpdate($teamcolumns, $conf['db_prefix'] . '_verein', 'liga_id = %d', $season['liga_id']); // update season $db->queryUpdate($seasoncolumns, $conf['db_prefix'] . '_saison', 'id = %d', $season['id']); echo createSuccessMessage($i18n->getMessage('alert_save_success'), ''); echo '<p>» <a href=\'?site=' . $site . '\'>' . $i18n->getMessage('back_label') . '</a></p>'; } }
<?php /****************************************************** This file is part of OpenWebSoccer-Sim. OpenWebSoccer-Sim is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. OpenWebSoccer-Sim is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with OpenWebSoccer-Sim. If not, see <http://www.gnu.org/licenses/>. ******************************************************/ // execute transfer DirectTransfersDataService::executeTransferFromOffer($website, $db, $website->getRequestParameter('id')); // remove pending state $db->queryUpdate(array('admin_approval_pending' => '0'), $website->getConfig('db_prefix') . '_transfer_offer', 'id = %d', $website->getRequestParameter('id')); // create success message echo createSuccessMessage($i18n->getMessage('transferoffer_approval_success'), '');
<?php if ($action == "execute" && !$admin["r_demo"]) { $jobId = $_REQUEST["id"]; $xml = simplexml_load_file(JOBS_CONFIG_FILE); $jobConfig = $xml->xpath("//job[@id = '" . $jobId . "']"); if (!$jobConfig) { throw new Exception("Job config not found."); } $jobClass = (string) $jobConfig[0]->attributes()->class; if (class_exists($jobClass)) { $job = new $jobClass($website, $db, $i18n, $jobId); } else { throw new Exception("class not found: " . $jobClass); } $job->execute(); echo createSuccessMessage($i18n->getMessage("jobs_executed"), ""); } ?> <table class="table table-striped"> <thead> <tr> <th><?php echo $i18n->getMessage("jobs_head_name"); ?> </th> <th><?php echo $i18n->getMessage("jobs_head_last_execution"); ?> </th> <th><?php
} $result->free(); // generate players $positions = array(); $positions['T'] = !empty($_POST['option_T']) ? max(0, $_POST['option_T'] - $positionsCount['T']) : 0; $positions['LV'] = !empty($_POST['option_LV']) ? max(0, $_POST['option_LV'] - $positionsCount['LV']) : 0; $positions['IV'] = !empty($_POST['option_IV']) ? max(0, $_POST['option_IV'] - $positionsCount['IV']) : 0; $positions['RV'] = !empty($_POST['option_RV']) ? max(0, $_POST['option_RV'] - $positionsCount['RV']) : 0; $positions['LM'] = !empty($_POST['option_LM']) ? max(0, $_POST['option_LM'] - $positionsCount['LM']) : 0; $positions['ZM'] = !empty($_POST['option_ZM']) ? max(0, $_POST['option_ZM'] - $positionsCount['ZM']) : 0; $positions['RM'] = !empty($_POST['option_RM']) ? max(0, $_POST['option_RM'] - $positionsCount['RM']) : 0; $positions['DM'] = !empty($_POST['option_DM']) ? max(0, $_POST['option_DM'] - $positionsCount['DM']) : 0; $positions['OM'] = !empty($_POST['option_OM']) ? max(0, $_POST['option_OM'] - $positionsCount['OM']) : 0; $positions['LS'] = !empty($_POST['option_LS']) ? max(0, $_POST['option_LS'] - $positionsCount['LS']) : 0; $positions['MS'] = !empty($_POST['option_MS']) ? max(0, $_POST['option_MS'] - $positionsCount['MS']) : 0; $positions['RS'] = !empty($_POST['option_RS']) ? max(0, $_POST['option_RS'] - $positionsCount['RS']) : 0; $playersToGenerate = FALSE; foreach ($positions as $posCount) { if ($posCount > 0) { $playersToGenerate = TRUE; break; } } if ($playersToGenerate) { DataGeneratorService::generatePlayers($website, $db, $teamId, $_POST['player_age'], $_POST['player_age_deviation'], $_POST['entity_player_vertrag_gehalt'], $_POST['entity_player_vertrag_spiele'], $strengths, $positions, $_POST['playersgenerator_label_deviation']); } } echo createSuccessMessage($i18n->getMessage('firemanagers_dismiss_success'), ''); echo '<p>» <a href=\'?site=' . $site . '\'>' . $i18n->getMessage('back_label') . '</a></p>'; } }
} $teamIds = $_POST["teams"]; shuffle($teamIds); $insertTable = $website->getConfig("db_prefix") . "_spiel"; // create combinations while (count($teamIds) > 1) { $homeTeamId = array_pop($teamIds); $guestTeamId = array_pop($teamIds); // create first round $db->queryInsert(array("spieltyp" => "Pokalspiel", "pokalname" => $round["cup_name"], "pokalrunde" => $round["round_name"], "datum" => $round["firstround_date"], "home_verein" => $homeTeamId, "gast_verein" => $guestTeamId), $insertTable); // create second round if ($round["secondround_date"]) { $db->queryInsert(array("spieltyp" => "Pokalspiel", "pokalname" => $round["cup_name"], "pokalrunde" => $round["round_name"], "datum" => $round["secondround_date"], "home_verein" => $guestTeamId, "gast_verein" => $homeTeamId), $insertTable); } } echo createSuccessMessage($i18n->getMessage("managecuprounds_generate_success"), ""); echo "<p><a href=\"?site=managecuprounds&cup=" . $round["cup_id"] . "\" class=\"btn btn-primary\">" . $i18n->getMessage("managecuprounds_generate_success_overviewlink") . "</a></p>"; } // ****** Display selection form *********** ?> <div id="noCupPossibleAlert" class="alert" style="display: none;"> <h5><?php echo $i18n->getMessage("managecuprounds_generate_noroundspossible"); ?> </h5> </div> <div id="possibleCupRoundsAlert" class="alert alert-info" style="display: none;"> <h5><?php echo $i18n->getMessage("managecuprounds_generate_possiblerounds"); ?>
$columns["M.gast_w" . $subNo . "_condition"] = "guest_sub_" . $subNo . "_condition"; } $result = $db->querySelect($columns, $fromTable, "M.id = %d", $matchId); $matchinfo = $result->fetch_array(); $result->free(); // init default simulation strategry in order to include dependend constants. Yeah, refactor this once having to much time... $dummyVar = new DefaultSimulationStrategy($website); $matchModel = SimulationStateHelper::loadMatchState($website, $db, $matchinfo); // compute audience if ($website->getRequestParameter("computetickets")) { SimulationAudienceCalculator::computeAndSaveAudience($website, $db, $matchModel); } if ($matchinfo["type"] == "Pokalspiel") { SimulationCupMatchHelper::checkIfExtensionIsRequired($website, $db, $matchModel); } // complete match $observer = new DataUpdateSimulatorObserver($website, $db); $observer->onMatchCompleted($matchModel); // show success message echo createSuccessMessage($i18n->getMessage("match_manage_complete_success"), ""); } echo "<h3><a href=\"" . $website->getInternalUrl("team", "id=" . $match["match_home_id"]) . "\" target=\"_blank\">" . escapeOutput($match["match_home_name"]) . "</a> - <a href=\"" . $website->getInternalUrl("team", "id=" . $match["match_guest_id"]) . "\" target=\"_blank\">" . escapeOutput($match["match_guest_name"]) . "</a></h3>"; echo "<div class=\"well\">" . $i18n->getMessage("match_manage_complete_intro") . "</div>"; echo "<form action=\"" . $_SERVER['PHP_SELF'] . "\" method=\"post\" class=\"form-horizontal\">"; echo "<input type=\"hidden\" name=\"site\" value=\"{$site}\"/>"; echo "<input type=\"hidden\" name=\"action\" value=\"complete\"/>"; echo "<input type=\"hidden\" name=\"match\" value=\"{$matchId}\"/>"; echo FormBuilder::createFormGroup($i18n, "computetickets", array("type" => "boolean", "value" => "1"), "1", "match_manage_complete_"); echo "<div class=\"form-actions\">"; echo "<button type=\"submit\" class=\"btn btn-primary\">" . $i18n->getMessage("match_manage_complete_button") . "</button>"; echo "</div></form>";
<?php $datei = '../generated/adminlog.php'; if (!file_exists($datei)) { echo createErrorMessage($i18n->getMessage('alert_error_title'), $i18n->getMessage('all_logging_filenotfound')); } elseif ($admin['r_demo']) { echo createErrorMessage($i18n->getMessage('error_access_denied'), ''); } else { if ($action == 'leeren') { $fp = fopen($datei, 'w+'); $ip = getenv('REMOTE_ADDR'); $content = 'Truncated by ' . $admin['name'] . ' (id: ' . $admin['id'] . '), ' . $ip . ', ' . date('d.m.y - H:i:s'); fwrite($fp, $content); fclose($fp); if ($fp) { echo createSuccessMessage($i18n->getMessage('all_logging_alert_logfile_truncated'), ''); } else { echo createErrorMessage($i18n->getMessage('alert_error_title'), $i18n->getMessage('all_logging_error_not_truncated')); } } $datei_gr = filesize($datei); $gr_kb = round($datei_gr / 1024); if ($datei_gr && !$gr_kb) { $gr_kb = 1; } echo '<div class=\'well\'>' . sprintf($i18n->getMessage('all_logging_filesize'), number_format($gr_kb, 0, ' ', ',')) . '</div>'; if (!$datei_gr) { echo '<p>' . $i18n->getMessage('empty_list') . '</p>'; } else { ?>
<?php /****************************************************** This file is part of OpenWebSoccer-Sim. OpenWebSoccer-Sim is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. OpenWebSoccer-Sim is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with OpenWebSoccer-Sim. If not, see <http://www.gnu.org/licenses/>. ******************************************************/ echo '<h1>' . $i18n->getMessage('clearcache_title') . '</h1>'; $website->resetConfigCache(); // clear templates cache $website->getTemplateEngine($i18n)->clearCache(); echo createSuccessMessage($i18n->getMessage('clearcache_success_title'), $i18n->getMessage('clearcache_success_message'));
<div class='container'> <h1><?php echo $i18n->getMessage('login_title'); ?> </h1> <?php if ($forwarded) { echo createWarningMessage($i18n->getMessage('login_alert_accessdenied_title'), $i18n->getMessage('login_alert_accessdenied_content')); } else { if ($loggedout) { echo createSuccessMessage($i18n->getMessage('login_alert_logoutsuccess_title'), $i18n->getMessage('login_alert_logoutsuccess_content')); } else { if ($newpwd) { echo createSuccessMessage($i18n->getMessage('login_alert_sentpassword_title'), $i18n->getMessage('login_alert_sentpassword_content')); } else { if (count($errors) > 0) { echo createErrorMessage($i18n->getMessage('login_alert_error_title'), $i18n->getMessage('login_alert_error_content')); } } } } ?> <p><a href='?lang=en'>English</a> | <a href='?lang=de'>Deutsch</a></p> <form action='login.php' method='post' class='form-horizontal'> <div class='control-group<?php if (isset($errors['inputUser'])) { echo ' error';