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
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
<?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.packBranchEdit.php");
 
$Permission = \User\Permission::P_OPSPackBranch;
$channel = $_SESSION['spid'];
$user = new \User\User($_SESSION['UserAccount']);
if (!$user->HavePermission($Permission)) {
    exit;
}
 
$editInfo = array();
$opType = $_GET["opType"];
$pageTitle = "打包分支 - 添加";
if ($opType == "upd") {
    $pageTitle = "打包分支 - 编辑";
    $find = array("Channel" => $channel, "BranchNum" => intval($_GET["BranchNum"]));
    DBOper\FindOne("GamePackBranch", $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="packBranch.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 array_key_exists("BranchNum", $editInfo) ? $editInfo["BranchNum"] : "" ?>" min="1" />
                    <?php
                    if ($opType == "upd") {
                        echo "<input type='hidden' name='SrcBranchNum' value='" . $editInfo["BranchNum"] . "'/>";
                    }
                    ?>
                </td>
            </tr>
            <tr>
                <td class="formTableTDName">打包分支名称: </td>
                <td class="formTableTDValue">
                    <input type="input" name="BranchName" id="BranchName" value="<?php echo array_key_exists("BranchName", $editInfo) ? $editInfo["BranchName"] : "" ?>" 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>
                <td class="formTableTDName">审核状态: </td>
                <td class="formTableTDValue">
                    <select name="AuditState">
                        <?php
                        $selected = array_key_exists("AuditState", $editInfo)  ? $editInfo["AuditState"] : "0";
                        foreach (array("1" => "是", "0" => "否") as $key => $value) {
                            echo "<option value='" . $key . "'";
                            if ($key == $selected) {
                                echo " selected";
                            }
                            echo ">" . $value . "</option>";
                        }
                        ?>
                    </select>
                </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("BranchNum").value || document.getElementById("BranchNum").value <= 0) {
                alert("请输入大于0的分支编号!");
                document.getElementById('BranchNum').focus();
                return false;
            }
            if (!document.getElementById("BranchName").value) {
                alert("请输入分支名称!");
                document.getElementById('BranchName').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>