Пример #1
0
<?php

require_once get_file_loc('menu.inc');
if (!isset($var['race_id'])) {
    SmrSession::updateVar('race_id', $player->getRaceID());
}
$raceID = $var['race_id'];
$template->assign('PageTopic', 'Ruling Council Of ' . Globals::getRaceName($raceID));
// echo menu
create_council_menu($raceID);
$RACES =& Globals::getRaces();
$raceRelations =& Globals::getRaceRelations($player->getGameID(), $raceID);
$peaceRaces = array();
$neutralRaces = array();
$warRaces = array();
foreach ($RACES as $otherRaceID => $raceInfo) {
    if ($otherRaceID != RACE_NEUTRAL && $raceID != $otherRaceID) {
        if ($raceRelations[$otherRaceID] >= 300) {
            $peaceRaces[$otherRaceID] = $raceInfo;
        } else {
            if ($raceRelations[$otherRaceID] <= -300) {
                $warRaces[$otherRaceID] = $raceInfo;
            } else {
                $neutralRaces[$otherRaceID] = $raceInfo;
            }
        }
    }
}
$template->assignByRef('PeaceRaces', $peaceRaces);
$template->assignByRef('NeutralRaces', $neutralRaces);
$template->assignByRef('WarRaces', $warRaces);
Пример #2
0
<?php

if (!$player->isPresident()) {
    create_error('Only the president can view the embassy.');
}
require_once get_file_loc('council.inc');
require_once get_file_loc('menu.inc');
$template->assign('PageTopic', 'Ruling Council Of ' . $player->getRaceName());
create_council_menu($player->getRaceID());
$voteRaces = array();
$RACES = Globals::getRaces();
foreach ($RACES as $raceID => $raceInfo) {
    if ($raceID == RACE_NEUTRAL || $raceID == $player->getRaceID()) {
        continue;
    }
    $db->query('SELECT 1 FROM race_has_voting
				WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . '
				AND race_id_1 = ' . $db->escapeNumber($player->getRaceID()) . '
				AND race_id_2 = ' . $db->escapeNumber($raceID));
    if ($db->getNumRows() > 0) {
        continue;
    }
    $voteRaces[$raceID] = SmrSession::getNewHREF(create_container('council_embassy_processing.php', '', array('race_id' => $raceID)));
}
$template->assign('VoteRaceHrefs', $voteRaces);