function PageHeader($page, $noheader = false, $leftmenu = true, $redirect_page = "", $redirect_sec = 0) { global $pagetime; global $GlobalUser; global $GlobalUni; BrowseHistory(); $mtime = microtime(); $mtime = explode(" ", $mtime); $mtime = $mtime[1] + $mtime[0]; $pagetime = $mtime; $unitab = $GlobalUni; $uni = $unitab['num']; echo "<html>\n"; echo " <head>\n"; echo " <link rel='stylesheet' type='text/css' href='css/default.css' />\n"; echo " <link rel='stylesheet' type='text/css' href='css/formate.css' />\n"; echo " <script language=\"JavaScript\">var session=\"" . $GlobalUser['session'] . "\";</script>\n"; echo " <meta http-equiv='content-type' content='text/html; charset=UTF-8' />\n"; if ($redirect_page !== "") { echo " <meta http-equiv=\"refresh\" content=\"" . $redirect_sec . "; URL=index.php?page=" . $redirect_page . "&session=" . $GlobalUser['session'] . "&redirect=1\">\n\n"; } echo "<link rel='stylesheet' type='text/css' href='css/combox.css'>\n"; echo "<link rel='stylesheet' type='text/css' href='" . UserSkin() . "formate.css' />\n"; echo "<title>Вселенная {$uni} ОГейм</title>\n"; echo " <script src='js/utilities.js' type='text/javascript'></script>\n"; echo " <script language='JavaScript'>\n"; echo " </script>\n"; echo "<script type='text/javascript' src='js/overLib/overlib.js'></script>\n"; echo "<!-- HEADER -->\n\n"; echo "<script language='JavaScript'>\n"; echo "function onBodyLoad() {\n"; echo " window.setTimeout('reloadImages()', 100);\n"; echo "}\n"; echo "function reloadImages() {\n"; echo " for (var i = 0; i < document.images.length; ++i) {\n"; echo " if ((document.images[i].className == 'reloadimage') && (document.images[i].title != '')) {\n"; echo " document.images[i].src = document.images[i].title;\n"; echo " }\n"; echo " }\n"; echo "}\n"; echo "</script>\n"; echo "</head>\n"; echo "<body style='overflow: hidden;' onload='onBodyLoad();' onunload='' >\n"; echo "<div id='overDiv' style='position:absolute; visibility:hidden; z-index:1000;'></div>\n"; if ($noheader == false) { echo "<div id='header_top'><center>\n"; echo "<table class='header'>\n"; echo "<tr class='header' >\n"; $aktplanet = GetPlanet($GlobalUser['aktplanet']); PlanetsDropList($page); ResourceList(floor($aktplanet['m']), floor($aktplanet['k']), floor($aktplanet['d']), $aktplanet['e'], $aktplanet['emax'], $GlobalUser['dm'] + $GlobalUser['dmfree'], $aktplanet['mmax'], $aktplanet['kmax'], $aktplanet['dmax']); $coma = OficeerList(); echo "</tr>\n"; echo "</table>\n"; echo "</div><!-- END HEADER -->\n\n"; } else { $end = GetOfficerLeft($GlobalUser['player_id'], 'CommanderOff'); $coma = $end > time(); } echo "<!-- LEFTMENU -->\n\n"; if ($leftmenu) { LeftMenu($coma); } echo "<!-- END LEFTMENU -->\n\n"; }
<?php // Быстрая отправка флотов из Галактики посредством AJAX. // Переменные снаружи : aktplanet - текущая планета. BrowseHistory(); $uni = LoadUniverse(); if ($uni['freeze']) { AjaxSendError(); } // Вселенная на паузе. $unispeed = $uni['fspeed']; $fleetmap = array(202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215); function AjaxSendError($id = 601) { header('Content-Type: text/html;'); echo "{$id} 0 0 0 0"; ob_end_flush(); die; } function AjaxSendDone($slots, $probes, $recyclers, $missiles) { header('Content-Type: text/html;'); echo "600 {$slots} {$probes} {$recyclers} {$missiles}"; ob_end_flush(); die; } // Проверить наличие параметров. if (!key_exists("order", $_POST) || !key_exists("galaxy", $_POST) || !key_exists("system", $_POST) || !key_exists("planet", $_POST) || !key_exists("planettype", $_POST) || !key_exists("shipcount", $_POST)) { AjaxSendError(); } $order = intval($_POST['order']);