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
<?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.gameVersionEdit.php");
 
$Permission = \User\Permission::P_OPSGameVersion;
$channel = $_SESSION['spid'];
$user = new \User\User($_SESSION['UserAccount']);
if (!$user->HavePermission($Permission)) {
    exit;
}
 
$opType = $_GET["opType"];
$BranchNum = intval($_GET["BranchNum"]);
$BranchName = $_GET["BranchName"];
$Version = $_GET["Version"];
 
$editInfo = array();
$pageTitle = "内容版本 - 添加";
if ($opType == "upd") {
    $pageTitle = "内容版本 - 编辑";
    $find = array("Channel" => $channel, "BranchNum" => $BranchNum, "Version" => $Version);
    DBOper\FindOne("GameVersion", $find, $editInfo, null, false);
}
 
$stateNameInfo = array();
DBOper\Find(
    "GameVersionState",
    array("Channel" => $channel, "BranchNum" => $BranchNum),
    $versionStateArray
);
 
// echo "_GET:" . print_r($_GET, true);
// 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="gameVersion.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">
                    <input type="number" name="BranchNum" id="BranchNum" value="<?php echo $BranchNum ?>" readonly />
                </td>
            </tr>
            <tr>
                <td class="formTableTDName">所属分支名称: </td>
                <td class="formTableTDValue">
                    <?php echo $BranchName; ?>
                </td>
            </tr>
            <tr>
                <td class="formTableTDName">版本号: </td>
                <td class="formTableTDValue">
                    <input type="input" name="Version" id="Version" value="<?php echo array_key_exists("Version", $editInfo)  ? $editInfo["Version"] : "" ?>" placeholder="如 1.0.1" />
                    <?php
                    if ($opType == "upd") {
                        echo "<input type='hidden' name='SrcVersion' value='" . $editInfo["Version"] . "'/>";
                    }
                    ?>
                </td>
            </tr>
            <tr>
                <td class="formTableTDName">版本状态: </td>
                <td class="formTableTDValue">
                    <select name="VersionState" id="VersionState">
                        <?php
                        $VersionState = array_key_exists("VersionState", $editInfo) ? $editInfo["VersionState"] : "";
                        foreach ($versionStateArray as $stateInfo) {
                            echo "<option value=\"" . $stateInfo["VersionState"] . "\"";
                            if ($VersionState == $stateInfo["VersionState"]) {
                                echo " selected";
                            }
                            echo ">" . $stateInfo["StateName"] . "</option>";
                        }
                        ?>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="formTableTDName">强更地址: </td>
                <td class="formTableTDValue">
                    <input type="input" name="ForceDownUrl" id="ForceDownUrl" value="<?php echo array_key_exists("ForceDownUrl", $editInfo)  ? $editInfo["ForceDownUrl"] : "" ?>" size="100" placeholder="可选,如果需要强更则输入强更地址" />
                </td>
            </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("Version").value) {
                alert("请输入版本号!");
                document.getElementById('Version').focus();
                return false;
            }
            var ForceDownUrl = document.getElementById("ForceDownUrl").value;
            if (ForceDownUrl && ForceDownUrl.substr(0, 4) != "http") {
                alert("强更地址必须以“http”开头!");
                document.getElementById('ForceDownUrl').focus();
                return false;
            }
            return true;
        }
    </script>
</body>
 
</html>