<?php
|
include_once "/Common/Logging.php";
|
include_once "/Account/User.php";
|
include_once "/language/lang.php";
|
|
\Logging\CreateLogging("SelectServer.php");
|
//检查$_SESSION中是否设置了选择哪个服务器
|
$server_id = "";
|
$UserAccount = $_SESSION['UserAccount'];
|
|
$user = new \User\User($UserAccount);
|
$spid = $user->GetSPID();
|
$spidAll = $user->GetSPIDAll();
|
$select_spid = array_key_exists("spid", $_GET) ? $_GET["spid"] : "";
|
if (!$select_spid || !in_array($select_spid, $spidAll)) {
|
if ($spid) {
|
$select_spid = $spid;
|
} else {
|
$select_spid = $spidAll[0];
|
}
|
}
|
|
if ($select_spid == $spid && array_key_exists('server_id', $_SESSION)) {
|
$server_id = $_SESSION['server_id'];
|
}
|
|
$serversArray = $user->GetServersCfg($select_spid);
|
// \Logging\LogInfo(print_r($serversArray, true));
|
$error = $_GET["error"];
|
|
?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
<STYLE TYPE='text/css'>
|
BODY {
|
background-image: URL(/img/bg1.jpg);
|
background-position: center;
|
background-repeat: no-repeat;
|
background-attachment: fixed;
|
}
|
</STYLE>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<title><?php echo \Lang\gettext("选择服务器") ?></title>
|
|
</head>
|
|
<body>
|
<CENTER>
|
<form id="form1" name="form1" method="post" action="SelectJump.php">
|
<br /><br /><br /><br /><br /><br /><br /><br /><br />
|
<?php echo \Lang\gettext("服务器列表") ?><br /><br />
|
|
<?php
|
if ($error == "1") {
|
echo "server is not exist.<br/><br/>";
|
}
|
echo "<select name=\"select_spid\" onchange=\"changespid(this.value)\" >";
|
if (isset($spidAll)) {
|
foreach ($spidAll as $value) {
|
if ($select_spid == $value) {
|
echo "<option value=\"" . $value . "\" selected>";
|
} else {
|
echo "<option value=\"" . $value . "\">";
|
}
|
echo $value . "</option>";
|
}
|
}
|
echo "</select>";
|
?>
|
|
<?php
|
echo "<select name=\"select_id\">";
|
foreach ($serversArray as $key => $value) {
|
if ($server_id == $key) {
|
echo "<option value=\"" . $key . "\" selected>";
|
} else {
|
echo "<option value=\"" . $key . "\" >";
|
}
|
echo $key . "</option>";
|
}
|
echo "</select>";
|
?>
|
|
</p>
|
<input name="submit" type="submit" value="<?php echo \Lang\gettext("确定") ?>"></input>
|
</form>
|
</CENTER>
|
</body>
|
|
</html>
|
<script language="JavaScript">
|
function changespid(spid) {
|
window.location.href = "SelectServer.php?spid=" + spid;
|
}
|
</script>
|