We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 5 |
| Paths | 8 |
| Total Lines | 26 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 19 | public function build(AbstractSmrPlayer $player, Template $template): void { |
||
| 20 | $db = Database::getInstance(); |
||
| 21 | |||
| 22 | if (!$player->isPresident()) { |
||
| 23 | create_error('Only the president can view the embassy.'); |
||
| 24 | } |
||
| 25 | |||
| 26 | $template->assign('PageTopic', 'Ruling Council Of ' . $player->getRaceName()); |
||
| 27 | |||
| 28 | Menu::council($player->getRaceID()); |
||
| 29 | |||
| 30 | $voteRaces = []; |
||
| 31 | foreach (Race::getPlayableIDs() as $raceID) { |
||
| 32 | if ($raceID == $player->getRaceID()) { |
||
| 33 | continue; |
||
| 34 | } |
||
| 35 | $dbResult = $db->read('SELECT 1 FROM race_has_voting |
||
| 36 | WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' |
||
| 37 | AND race_id_1 = ' . $db->escapeNumber($player->getRaceID()) . ' |
||
| 38 | AND race_id_2 = ' . $db->escapeNumber($raceID)); |
||
| 39 | if ($dbResult->hasRecord()) { |
||
| 40 | continue; |
||
| 41 | } |
||
| 42 | $voteRaces[$raceID] = (new EmbassyProcessor($raceID))->href(); |
||
| 43 | } |
||
| 44 | $template->assign('VoteRaceHrefs', $voteRaces); |
||
| 45 | } |
||
| 48 |