hxp
2025-06-04 f4a514d5ac952110da846636ecbb9de951eaf3d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?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>