You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

168 lines
7.1 KiB
HTML

<extend name="Public/manage" />
<block name="head">
<link href="__CSS__/user_zxy.css" rel="stylesheet">
<script src="__JS__/bootstrap-datetimepicker.min.js"></script>
<script src="__JS__/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="__JS__/bootstrap-select.min.js"></script>
<style type="text/css">
.form-horizontal .control-label{text-align: right;padding-right: 20px;color: #666666;font-size: 14px;}
.mrc_left{width: 120px;}
.bootstrap-select.btn-group .btn .filter-option{color: #999;}
::-webkit-input-placeholder{color: #999;}
:-moz-placeholder{color: #999;}
::-moz-placeholder{color: #999;}
:-ms-input-placeholder{color: #999;}
.mrc_colum2_5{height: auto;}
a.btn.btn_default{width: 76px;border-radius: 5px;border: none;background: #ccc;color: #fff;}
</style>
</block>
<block name="location">
<a class="z_nav" href="{:U('server/index')}">开服管理</a>
<a class="z_nav curt_nav" href="{:U('Server/add')}">发布区服</a>
</block>
<block name="body" >
<div class="matter_right_content">
<div class="title"><i class="qufu_icon"></i><span>发布区服</span></div>
<form id="addServer" method="post" class="form-horizontal" enctype="multipart/form-data" novalidate="novalidate">
<div class="form-group clearfix">
<label class="mrc_left mrc control-label"><span class="must_red">*</span> 游戏名称</label>
<div class="mrc_right4_3_3 mrc input-format">
<select name="game_id" id="game_id" class="form-control" aria-required="true" aria-invalid="true" aria-describedby="game-error">
<option value="">选择游戏</option>
<volist name=":getDevelopGameList(UID)" id="vo">
<option value="{$vo.id}">{$vo.game_name}</option>
</volist>
</select>
</div>
<div class="clearfix"></div>
<div class="mrc_colum_ml mrc_colum4_1_6 mrc input-status"></div>
</div>
<div class="form-group clearfix">
<label class="mrc_left mrc control-label"><span class="must_red">*</span> 区服名称</label>
<div class="mrc_right4_3_3 mrc input-format">
<input type="text" class="form-control" name="server_name" placeholder="不超过10个字" value="">
</div>
<div class="clearfix"></div>
<div class="mrc_colum_ml mrc_colum4_1_6 mrc input-status"></div>
</div>
<input type="hidden" name="server_version" id="server_version">
<div class="form-group clearfix">
<label class="mrc_left mrc control-label"><span class="must_red">*</span> 开始时间</label>
<div class="mrc_right4_3_3 mrc input-format">
<input type="text" class="form-control" name="start_time" placeholder="开始时间" value="">
</div>
<div class="clearfix"></div>
<div class="mrc_colum_ml mrc_colum4_1_6 mrc input-status"></div>
</div>
<div class="form-group clearfix">
<label class="mrc_left mrc control-label"></label>
<div class="mrc_colum4_1_6 mrc">
<input type="submit" class="btn btn_primary user_btn" id="editServer" value="提交">&nbsp;&nbsp;&nbsp;
<a href="javascript:history.go(-1);" class="btn btn_default user_btn_default">取消</a>
</div>
</div>
</form>
</div>
<script>
$(function() {
$('#game_id').selectpicker({
size: 15
});
function giftbag_version(gid){
var url = "{:U('Gift/giftbag_version')}";
$.ajax({
type:"post",
url:url,
dataType:"json",
data:{game_id:gid},
success:function(data){
$("#server_version").val(data);
},
error:function(){
layer.msg('服务器异常',{icon:5});
}
})
}
$('#game_id').change(function(){
if($("#game_id").val()){
giftbag_version($("#game_id").val());
}
})
$('input[name=start_time]').datetimepicker({
language:"zh-CN",
hour: 13,
minute: 15,
autoclose:true,
});
$('input[name=end_time]').datetimepicker({
language:"zh-CN",
hour: 13,
minute: 15,
autoclose:true,
});
});
$("#addServer").validate({
//定义规则
rules:{
game_id: {
required: true,
},
server_name: {
maxlength:10,
required: true,
},
systems: {
required: true,
},
time_start: {
required: true,
},
time_end: {
required: true,
},
},
messages:{
game_id: {
required: "请选择游戏",
},
server_name: {
required: "请填写区服名称",
maxlength: "区服名称不应超过10个字",
},
systems: {
required: "请选择平台类型",
},
time_start: {
required: "请填写开始时间",
},
time_end: {
required: "请填写结束时间",
},
},
submitHandler: function (form) {
//$(form).ajaxSubmit();
$.post("{:U('Server/add')}", $("#addServer").serializeArray(), function(result){
if(result.status == 1){
layer.msg(result.info);
setTimeout(function(){
location.href = "{:U('Server/index')}";
},1500);
}else{
layer.msg(result.info);
}
})
}
});
$.VMenu.show('#menu');
$.VMenu.open('m2.3');
</script>
</block>