diff --git a/gatherling/admin/clean_decks.php b/gatherling/admin/clean_decks.php index 74e5637f..7e06b5fe 100644 --- a/gatherling/admin/clean_decks.php +++ b/gatherling/admin/clean_decks.php @@ -1,5 +1,9 @@ autocommit(true); info('DB is up to date!'); diff --git a/gatherling/api.php b/gatherling/api.php index f25612af..69e78847 100644 --- a/gatherling/api.php +++ b/gatherling/api.php @@ -38,9 +38,9 @@ try { $series = new Series($seriesname); $result = repr_json_series($series); - $result['sucess'] = true; + $result['success'] = true; } catch (Exception $e) { - $result['sucess'] = false; + $result['success'] = false; $result['error'] = $e->getMessage(); } break; diff --git a/gatherling/api_lib.php b/gatherling/api_lib.php index 3ff2f0f8..0cfde655 100644 --- a/gatherling/api_lib.php +++ b/gatherling/api_lib.php @@ -1,5 +1,7 @@ name)."\n\n"; } + /** + * @param string $name + * + * @return bool + */ public function isHost($name) { $ishost = !is_null($this->host) && strcasecmp($name, $this->host) == 0; @@ -507,11 +512,17 @@ public function isHost($name) return $ishost || $iscohost; } + /** @return bool */ public function isFinalized() { return $this->finalized != 0; } + /** + * @param string $name + * + * @return bool + */ public function isOrganizer($name) { $isOrganizer = false; @@ -528,6 +539,11 @@ public function isOrganizer($name) return $isOrganizer; } + /** + * @param string $playername + * + * @return bool + */ public function authCheck($playername) { $player = new Player($playername); @@ -541,6 +557,11 @@ public function authCheck($playername) return false; } + /** + * @throws Exception + * + * @return int + */ public function getPlayerCount() { return Database::single_result_single_param('SELECT count(*) FROM entries WHERE event_id = ?', 'd', $this->id); @@ -1707,6 +1728,8 @@ public function AssignMedalsbyStandings() $t8 = []; $t4 = []; + $sec = null; + $win = null; switch ($medalCount) { case 8: diff --git a/gatherling/models/Pagination.php b/gatherling/models/Pagination.php index 1a95530e..828a6ec6 100644 --- a/gatherling/models/Pagination.php +++ b/gatherling/models/Pagination.php @@ -97,7 +97,7 @@ class Pagination * * Initializes the class and the default properties. * - * @return void + * @return void */ public function __construct() { @@ -117,14 +117,14 @@ public function __construct() * $pagination->always_show_navigation(false); * * - * @param bool $show (Optional) If set to FALSE, the "previous page" and "next page" links will only be - * shown if there are more pages than set through {@link selectable_pages()}. + * @param bool $show (Optional) If set to FALSE, the "previous page" and "next page" links will only be + * shown if there are more pages than set through {@link selectable_pages()}. * * Default is TRUE. * * @since 2.0 * - * @return void + * @return void */ public function always_show_navigation($show = true) { @@ -150,14 +150,14 @@ public function always_show_navigation($show = true) * $pagination->avoid_duplicate_content(false); * * - * @param bool $avoid_duplicate_content (Optional) If set to FALSE, the library will have for the first - * page (or last, if you are displaying links in {@link reverse() reverse} - * order) a different path than the one you have when you are accessing - * the page for the first (unpaginated) time. + * @param bool $avoid_duplicate_content (Optional) If set to FALSE, the library will have for the first + * page (or last, if you are displaying links in {@link reverse() reverse} + * order) a different path than the one you have when you are accessing + * the page for the first (unpaginated) time. * * Default is TRUE. * - * @return void + * @return void * * @since 2.0 */ @@ -201,17 +201,17 @@ public function avoid_duplicate_content($avoid_duplicate_content = true) * * If you want to preserve the hash in the URL, make sure you load the zebra_pagination.js file! * - * @param string $base_url (Optional) The base URL to be used when generating the navigation - * links + * @param string $base_url (Optional) The base URL to be used when generating the navigation + * links * * Defaults is whatever returned by * {@link http://www.php.net/manual/en/reserved.variables.server.php $_SERVER['REQUEST_URI']} - * @param bool $preserve_query_string (Optional) Indicates whether values in query strings, other than - * those set in $base_url, should be preserved + * @param bool $preserve_query_string (Optional) Indicates whether values in query strings, other than + * those set in $base_url, should be preserved * * Default is TRUE * - * @return void + * @return void */ public function base_url($base_url = '', $preserve_query_string = true) { @@ -242,7 +242,7 @@ public function base_url($base_url = '', $preserve_query_string = true) * echo $pagination->get_page(); * * - * @return int Returns the current page's number + * @return int Returns the current page's number */ public function get_page() { @@ -318,8 +318,8 @@ public function get_page() * * @since 2.1 * - * @return int Returns the total number of pages, based on the total number of records and the number of - * records to be shown per page. + * @return int Returns the total number of pages, based on the total number of records and the number of + * records to be shown per page. */ public function get_pages() { @@ -335,14 +335,14 @@ public function get_pages() * $pagination->labels('Previous', 'Next'); * * - * @param string $previous (Optional) The label for the "previous page" link. + * @param string $previous (Optional) The label for the "previous page" link. * * Default is "Previous page". - * @param string $next (Optional) The label for the "next page" link. + * @param string $next (Optional) The label for the "next page" link. * * Default is "Next page". * - * @return void + * @return void * * @since 2.0 */ @@ -361,7 +361,7 @@ public function labels($previous = 'Previous page', $next = 'Next page') * $pagination->method('url'); * * - * @param string $method (Optional) The method to be used for page propagation. + * @param string $method (Optional) The method to be used for page propagation. * * Values can be: * @@ -398,8 +398,8 @@ public function method($method = 'get') * These links can also be shown both on the left or on the right of the links to individual pages by setting the * method's argument to "left" or "right" respectively. * - * @param string $position Setting this argument to "left" or "right" will instruct the script to show next/previous - * page links on the left or on the right of the links to individual pages. + * @param string $position Setting this argument to "left" or "right" will instruct the script to show next/previous + * page links on the left or on the right of the links to individual pages. * * Allowed values are "left", "right" and "outside". * @@ -407,7 +407,7 @@ public function method($method = 'get') * * @since 2.1 * - * @return void + * @return void */ public function navigation_position($position) { @@ -425,12 +425,12 @@ public function navigation_position($position) * $pagination->padding(false); * * - * @param bool $enabled (Optional) Setting this property to FALSE will disable padding rather than - * enabling it. + * @param bool $enabled (Optional) Setting this property to FALSE will disable padding rather than + * enabling it. * * Default is TRUE. * - * @return void + * @return void */ public function padding($enabled = true) { @@ -451,9 +451,9 @@ public function padding($enabled = true) * $pagination->records(100); * * - * @param int $records The total number of records that need to be paginated + * @param int $records The total number of records that need to be paginated * - * @return void + * @return void */ public function records($records) { @@ -474,11 +474,11 @@ public function records($records) * $pagination->records_per_page(20); * * - * @param int $records_per_page The number of records displayed on one page. + * @param int $records_per_page The number of records displayed on one page. * * Default is 10. * - * @return void + * @return void */ public function records_per_page($records_per_page) { @@ -498,12 +498,12 @@ public function records_per_page($records_per_page) * $output = $pagination->render(true); * * - * @param bool $return_output (Optional) Setting this argument to TRUE will instruct the script to - * return the generated output rather than outputting it to the screen. + * @param bool $return_output (Optional) Setting this argument to TRUE will instruct the script to + * return the generated output rather than outputting it to the screen. * * Default is FALSE. * - * @return void + * @return void */ public function render($return_output = false) { @@ -579,11 +579,11 @@ public function render($return_output = false) * $pagination->reverse(true); * * - * @param bool $reverse (Optional) Set it to TRUE to generate navigation links in reverse order. + * @param bool $reverse (Optional) Set it to TRUE to generate navigation links in reverse order. * * Default is FALSE. * - * @return void + * @return void * * @since 2.0 */ @@ -601,15 +601,15 @@ public function reverse($reverse = false) * $pagination->selectable_pages(15); * * - * @param int $selectable_pages The number of links to be displayed at once (besides the "previous page" - * and "next page" links). + * @param int $selectable_pages The number of links to be displayed at once (besides the "previous page" + * and "next page" links). * * You should set this to an odd number so that the same number of links * will be shown to the left and to the right of the current page. * * Default is 11. * - * @return void + * @return void */ public function selectable_pages($selectable_pages) { @@ -626,7 +626,7 @@ public function selectable_pages($selectable_pages) * $pagination->set_page(5); * * - * @param int $page The page's number. + * @param int $page The page's number. * * A number lower than 1 will be interpreted as 1, while a number * greater than the total number of pages will be interpreted as the last page. @@ -635,7 +635,7 @@ public function selectable_pages($selectable_pages) * records (set through {@link records()}) and the number of records that are * shown on one page (set through {@link records_per_page()}). * - * @return void + * @return void */ public function set_page($page) { @@ -663,12 +663,12 @@ public function set_page($page) * $pagination->trailing_slash(false); * * - * @param bool $enabled (Optional) Setting this property to FALSE will disable trailing slashes on generated - * URLs when {@link method} is "url". + * @param bool $enabled (Optional) Setting this property to FALSE will disable trailing slashes on generated + * URLs when {@link method} is "url". * * Default is TRUE (trailing slashes are enabled by default). * - * @return void + * @return void */ public function trailing_slash($enabled) { @@ -686,11 +686,11 @@ public function trailing_slash($enabled) * $pagination->variable_name('foo'); * * - * @param string $variable_name A string representing the variable name to be used for page propagation. + * @param string $variable_name A string representing the variable name to be used for page propagation. * * Default is "page". * - * @return void + * @return void */ public function variable_name($variable_name) { @@ -702,7 +702,7 @@ public function variable_name($variable_name) * Generate the link for the page given as argument. * * - * @return void + * @return void */ private function _build_uri($page) { diff --git a/gatherling/models/Series.php b/gatherling/models/Series.php index 8187787d..cb10ed47 100644 --- a/gatherling/models/Series.php +++ b/gatherling/models/Series.php @@ -22,6 +22,7 @@ class Series public $prereg_default; public $discord_guild_id; + public $discord_channel_id; public $discord_channel_name; public $discord_guild_name; public $discord_guild_invite; @@ -46,7 +47,7 @@ public function __construct($name) } $db = Database::getConnection(); - $sql = 'SELECT isactive, day, normalstart, prereg_default, mtgo_room, discord_guild_id, discord_channel_name, discord_guild_name, discord_guild_invite, discord_require_membership FROM series WHERE name = ?'; + $sql = 'SELECT isactive, day, normalstart, prereg_default, mtgo_room, discord_guild_id, discord_channel_id, discord_channel_name, discord_guild_name, discord_guild_invite, discord_require_membership FROM series WHERE name = ?'; $stmt = $db->prepare($sql); $stmt or exit($db->error); $stmt->bind_param('s', $name); @@ -58,6 +59,7 @@ public function __construct($name) $this->prereg_default, $this->mtgo_room, $this->discord_guild_id, + $this->discord_channel_id, $this->discord_channel_name, $this->discord_guild_name, $this->discord_guild_invite, diff --git a/gatherling/models/Standings.php b/gatherling/models/Standings.php index 924401f6..d10e7833 100644 --- a/gatherling/models/Standings.php +++ b/gatherling/models/Standings.php @@ -87,6 +87,12 @@ public function save() } } + /** + * @param string $eventname + * @param int $isactive + * + * @return Standings[] + */ public static function getEventStandings($eventname, $isactive) { $db = Database::getConnection();