hxp
2025-06-09 6c3f6335c70859ded94a1ad8d218acb0ac34239c
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
include_once "/Account/User.php";
include_once "/db/DBOper.php";
include_once "/Common/Logging.php";
include_once "/Common/CommFunc.php";
include_once "/language/lang.php";
 
\Logging\CreateLogging("serverops.versionStateEdit.php");
 
$Permission = \User\Permission::P_OPSVersionState;
$channel = $_SESSION['spid'];
$user = new \User\User($_SESSION['UserAccount']);
if (!$user->HavePermission($Permission)) {
    exit;
}
 
DBOper\Find(
    "GamePackBranch",
    array("Channel" => $channel),
    $branchArray,
    array("BranchNum" => 1, "BranchName" => 1)
);
 
$editInfo = $_GET;
$opType = $_GET["opType"];
$pageTitle = "版本状态 - 添加";
if ($opType == "upd") {
    $pageTitle = "版本状态 - 编辑";
    $find = array("Channel" => $channel, "BranchNum" => intval($_GET["BranchNum"]), "VersionState" => intval($_GET["VersionState"]));
    DBOper\FindOne("GameVersionState", $find, $editInfo);
}
// echo "editInfo:" . print_r($editInfo, true);
 
?>
 
<html>
 
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title><?php echo $pageTitle; ?></title>
    <link rel="stylesheet" type="text/css" href="/css/tableform.css">
</head>
 
<body>
    <center>
        <p><b><?php echo $pageTitle; ?></b></P>
    </center>
    <hr />
    <form action="versionState.php" method="post">
        <table id="tt" class="formTable">
            <tr>
                <td class="formTableTDName">渠道: </td>
                <td class="formTableTDValue">
                    <?php echo $channel; ?>
                </td>
            </tr>
            <tr>
                <td class="formTableTDName">打包分支: </td>
                <td class="formTableTDValue">
                    <select name="BranchNum" id="BranchNum">
                        <?php
                        $BranchNum = array_key_exists("BranchNum", $editInfo) ? $editInfo["BranchNum"] : "";
                        foreach ($branchArray as $branchInfo) {
                            echo "<option value=\"" . $branchInfo["BranchNum"] . "\"";
                            if ($BranchNum == $branchInfo["BranchNum"]) {
                                echo " selected";
                            }
                            echo ">" . $branchInfo["BranchName"] . "</option>";
                        }
                        ?>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="formTableTDName">状态值: </td>
                <td class="formTableTDValue">
                    <input type="number" name="VersionState" id="VersionState" value="<?php echo array_key_exists("VersionState", $editInfo) ? $editInfo["VersionState"] : "" ?>" min="1" />
                    <?php
                    if ($opType == "upd") {
                        echo "<input type='hidden' name='SrcVersionState' value='" . $editInfo["VersionState"] . "'/>";
                    }
                    ?>
                </td>
            </tr>
            <tr>
                <td class="formTableTDName">状态名: </td>
                <td class="formTableTDValue">
                    <input type="input" name="StateName" id="StateName" value="<?php echo array_key_exists("StateName", $editInfo) ? $editInfo["StateName"] : "" ?>" placeholder="一般是中文名,用于展示" />
                </td>
            </tr>
            <tr>
                <td class="formTableTDName">选服Json分支: </td>
                <td class="formTableTDValue">
                    <input type="number" name="JsonBranch" id="JsonBranch" value="<?php echo array_key_exists("JsonBranch", $editInfo)  ? $editInfo["JsonBranch"] : "" ?>" placeholder="对应xxx_分支.json" />
                </td>
            </tr>
            <tr>
                <td class="formTableTDName">公告地址: </td>
                <td class="formTableTDValue">
                    <input type="input" name="NoticeUrl" id="NoticeUrl" value="<?php echo array_key_exists("NoticeUrl", $editInfo)  ? $editInfo["NoticeUrl"] : "" ?>" size="100" />
                </td>
            </tr>
            <tr>
                <td class="formTableTDName">资源地址: </td>
                <td class="formTableTDValue">
                    <input type="input" name="ResourceUrl" id="ResourceUrl" value="<?php echo array_key_exists("ResourceUrl", $editInfo)  ? $editInfo["ResourceUrl"] : "" ?>" size="100" />
                </td>
            </tr>
            <tr>
                <td class="formTableTDName">资源下载奖励信息: </td>
                <td class="formTableTDValue">
                    <input type="input" name="ResourceAwardInfo" id="ResourceAwardInfo" value="<?php echo array_key_exists("ResourceAwardInfo", $editInfo)  ? $editInfo["ResourceAwardInfo"] : "" ?>" size="100" placeholder="可选,格式自定义,与前端沟通" />
                </td>
            </tr>
            <tr></tr>
            <tr>
                <td class="formTableTDName"></td>
                <td class="formTableTDValue">
                    <input type="submit" name="submit" align="center" value="提交" onclick="return CheckSubmit()" />
                </td>
            </tr>
            <input type="hidden" name="opType" id="opType" value="<?php echo $opType ?>" />
        </table>
    </form>
 
    <script type="text/javascript">
        function CheckSubmit() {
            if (!document.getElementById("VersionState").value || document.getElementById("VersionState").value <= 0) {
                alert("请输入大于0的状态值!");
                document.getElementById('VersionState').focus();
                return false;
            }
            if (!document.getElementById("StateName").value) {
                alert("请输入状态名称!");
                document.getElementById('StateName').focus();
                return false;
            }
            if (!document.getElementById("JsonBranch").value || document.getElementById("JsonBranch").value <= 0) {
                alert("请输入大于0选服Json分支!");
                document.getElementById('JsonBranch').focus();
                return false;
            }
            return true;
        }
    </script>
</body>
 
</html>