function show() { global $PLANET, $LNG, $resource; $this->initTemplate(); $this->setWindow('popup'); $this->tplObj->loadscript('phalanx.js'); $Galaxy = HTTP::_GP('galaxy', 0); $System = HTTP::_GP('system', 0); $Planet = HTTP::_GP('planet', 0); if (!$this->allowPhalanx($Galaxy, $System)) { $this->printMessage($LNG['px_out_of_range']); } if ($PLANET[$resource[903]] < PHALANX_DEUTERIUM) { $this->printMessage($LNG['px_no_deuterium']); } $db = Database::get(); $sql = "UPDATE %%PLANETS%% SET deuterium = deuterium - :phalanxDeuterium WHERE id = :planetID;"; $db->update($sql, array(':phalanxDeuterium' => PHALANX_DEUTERIUM, ':planetID' => $PLANET['id'])); $sql = "SELECT id, name, id_owner FROM %%PLANETS%% WHERE universe = :universe\n\t\tAND galaxy = :galaxy AND system = :system AND planet = :planet AND :type;"; $TargetInfo = $db->selectSingle($sql, array(':universe' => Universe::current(), ':galaxy' => $Galaxy, ':system' => $System, ':planet' => $Planet, ':type' => 1)); if (empty($TargetInfo)) { $this->printMessage($LNG['px_out_of_range']); } require 'includes/classes/class.FlyingFleetsTable.php'; $fleetTableObj = new FlyingFleetsTable(); $fleetTableObj->setPhalanxMode(); $fleetTableObj->setUser($TargetInfo['id_owner']); $fleetTableObj->setPlanet($TargetInfo['id']); $fleetTable = $fleetTableObj->renderTable(); $this->assign(array('galaxy' => $Galaxy, 'system' => $System, 'planet' => $Planet, 'name' => $TargetInfo['name'], 'fleetTable' => $fleetTable)); $this->display('page.phalanx.default.tpl'); }
function show() { global $USER, $PLANET, $LNG, $UNI, $resource; require_once 'includes/classes/class.FlyingFleetsTable.php'; $FlyingFleetsTable = new FlyingFleetsTable(); $this->initTemplate(); $this->setWindow('popup'); $this->tplObj->loadscript('phalanx.js'); $Galaxy = HTTP::_GP('galaxy', 0); $System = HTTP::_GP('system', 0); $Planet = HTTP::_GP('planet', 0); if (!$this->allowPhalanx($Galaxy, $System)) { $this->printMessage($LNG['px_out_of_range']); } if ($PLANET[$resource[903]] < PHALANX_DEUTERIUM) { $this->printMessage($LNG['px_no_deuterium']); } $GLOBALS['DATABASE']->query("UPDATE " . PLANETS . " SET `deuterium` = `deuterium` - " . PHALANX_DEUTERIUM . " WHERE `id` = '" . $PLANET['id'] . "';"); $TargetInfo = $GLOBALS['DATABASE']->getFirstRow("SELECT id, name, id_owner FROM " . PLANETS . " WHERE`universe` = '" . $UNI . "' AND `galaxy` = '" . $Galaxy . "' AND `system` = '" . $System . "' AND `planet` = '" . $Planet . "' AND `planet_type` = '1';"); if (empty($TargetInfo)) { $this->printMessage($LNG['px_out_of_range']); } require_once 'includes/classes/class.FlyingFleetsTable.php'; $fleetTableObj = new FlyingFleetsTable(); $fleetTableObj->setPhalanxMode(); $fleetTableObj->setUser($TargetInfo['id_owner']); $fleetTableObj->setPlanet($TargetInfo['id']); $fleetTable = $fleetTableObj->renderTable(); $this->tplObj->assign_vars(array('galaxy' => $Galaxy, 'system' => $System, 'planet' => $Planet, 'name' => $TargetInfo['name'], 'fleetTable' => $fleetTable)); $this->display('page.phalanx.default.tpl'); }
private function GetFleets() { global $USER, $PLANET; require 'includes/classes/class.FlyingFleetsTable.php'; $fleetTableObj = new FlyingFleetsTable(); $fleetTableObj->setUser($USER['id']); $fleetTableObj->setPlanet($PLANET['id']); return $fleetTableObj->renderTable(); }