<?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> 
 |