180 lines
7.3 KiB
HTML
180 lines
7.3 KiB
HTML
{include file="public/header"}
|
|
<style type="text/css">
|
|
textarea, input[type="text"], input[type="password"],
|
|
.uneditable-input{border: 1px solid #ccc;background-color: #fff;}
|
|
textarea{padding:6px}
|
|
.change_box a{font-size: 14px;padding: 10.5px 10px;}
|
|
.change_box .actived{border-right:1px solid #e5e5e5;border-left:1px solid #e5e5e5;border-top:1px solid #e5e5e5; position: relative; color: #3daae9; }
|
|
.change_box .actived:after{content: ""; bottom: -2px; background: #fff; width: 100%; height: 5px; position: absolute; left: 0; }
|
|
.x-nav{overflow: inherit; }
|
|
.x-nav .refresh{margin-right: 20px; }
|
|
.control-group{overflow: hidden; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px dotted #dddddd; }
|
|
.control-label{float: left; padding-top: 3px; width: 160px; text-align: right; font-size: 14px; }
|
|
.controls{text-align: left; overflow-x: auto; overflow-y: hidden; margin-left: 180px; }
|
|
.controls input{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
|
.controls select{width: 300px; height: 24px; font-size: 14px; border-radius: 4px; padding-left:6px; }
|
|
.controls textarea{width: 400px; height: 90px; border-radius: 4px; } .form-horizontal{margin: 0 10px; }
|
|
.bottom-buttom{border-top: 1px solid #e5e5e5; margin-top: 20px; background-color: #f5f5f5; padding: 30px 0; }
|
|
.submit{width: 50px; text-align: center; background-color:#3daae9; color: #fff; padding: 5px 10px; font-size: 16px; border-radius: 4px; cursor:pointer; }
|
|
</style>
|
|
<body>
|
|
<div class="x-nav" style="padding: 0px;">
|
|
<span class="change_box">
|
|
<a href="javascript:;" class="list-one" data-id="1">活动列表</a>
|
|
<a href="javascript:;" class="list-two actived" data-id="2">活动添加</a>
|
|
</span>
|
|
<a class="layui-btn layui-btn-small refresh" style="line-height:1.6em;margin-top:3px;float:right"
|
|
href="javascript:location.replace(location.href);" title="刷新">
|
|
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
|
|
</div>
|
|
<br>
|
|
<div class="info_from form-horizontal">
|
|
<div class="control-group">
|
|
<label class="control-label">请选择桌子:</label>
|
|
<div class="controls">
|
|
<select id="L_tablename" name="L_tablename" type="text" value maxlength="50" minlength="3" class="required">
|
|
<option value="-1" selected>请选择桌子</option>
|
|
<option value="all" >所有桌子</option>
|
|
<option value="all_baccarat" >百家乐桌台</option>
|
|
<option value="all_dt" >龙虎桌台</option>
|
|
{foreach name="$table_list" item="vo"}
|
|
<option value="{$vo.id}" <?php if(isset($get['table_id']) && $get['table_id'] == $vo['id']) {echo 'selected';} ?>>{$vo.table_name}</option>
|
|
{/foreach}
|
|
</select>
|
|
<span class="help-inline">
|
|
<font color="red"> * </font>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="control-group">
|
|
<label class="control-label">活动标题:</label>
|
|
<div class="controls">
|
|
<input id="L_title" name="L_title" type="text" value maxlength="50" minlength="3" class="required">
|
|
<span class="help-inline">
|
|
<font color="red"> * </font>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="control-group">
|
|
<label class="control-label">链接地址:</label>
|
|
<div class="controls">
|
|
<input id="L_url" name="L_url" type="text" value maxlength="50" minlength="3" class="required">
|
|
<span class="help-inline">
|
|
<font color="red"> * </font>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="control-group">
|
|
<label class="control-label">活动内容:</label>
|
|
<div class="controls">
|
|
<textarea id="L_content" name="L_content" type="text" value maxlength="50" minlength="3" class="required"></textarea>
|
|
<span class="help-inline">
|
|
<font color="red"> * </font>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="control-group">
|
|
<label class="control-label">备注信息:</label>
|
|
<div class="controls">
|
|
<textarea id="L_remark" name="L_remark" type="text" value maxlength="50" minlength="3" class="required"></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="control-group">
|
|
<label class="control-label">请选择活动位置:</label>
|
|
<div class="controls">
|
|
<select id="L_position" name="L_position" type="text" value maxlength="50" minlength="3" class="required">
|
|
<option value="-1" selected>请选择活动位置</option>
|
|
<option value="1">投注页面</option>
|
|
<option value="2">现场页面</option>
|
|
<option value="3">所有页面</option>
|
|
</select>
|
|
<span class="help-inline">
|
|
<font color="red"> * </font>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="bottom-buttom">
|
|
<label class="control-label"></label>
|
|
<div class="controls">
|
|
<div class='submit'>保存</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<script>
|
|
// 代理列表和添加代理切换
|
|
$('.x-nav .change_box a').click(function(){
|
|
// 样式切换
|
|
$('.x-nav .change_box a').removeClass('actived');
|
|
$(this).addClass('actived');
|
|
// 页面切换
|
|
var id = $(this).attr('data-id');
|
|
if(id == "1") location.href = '/memo/activity';
|
|
if(id == "2") location.href = '/memo/activity_add';
|
|
});
|
|
|
|
//监听提交
|
|
$('.submit').click(function (data) {
|
|
// 获取和拼装添加代理的数据
|
|
var query = new Object();
|
|
query.table_id = $('#L_tablename').val();
|
|
query.title = $('#L_title').val();
|
|
query.url = $('#L_url').val();
|
|
query.content = $('#L_content').val();
|
|
query.remark = $('#L_remark').val();
|
|
query.position = $('#L_position').val();
|
|
query.type = 2;
|
|
|
|
// 验证数据
|
|
if(query.table_id == -1){
|
|
layer.alert("请选择桌子!");
|
|
return false;
|
|
}
|
|
if(query.title.length == 0){
|
|
layer.alert("请填写活动标题!");
|
|
return false;
|
|
}
|
|
if(query.url.length == 0){
|
|
layer.alert("请填写活动链接!");
|
|
return false;
|
|
}
|
|
if(query.content.length <= 0){
|
|
layer.alert("请填写活动内容!");
|
|
return false;
|
|
}
|
|
if(query.position == -1){
|
|
layer.alert("请选择活动位置!");
|
|
return false;
|
|
}
|
|
|
|
// 发送数据到后台添加会员
|
|
var result = ajax('/memo/do_memo_add',query);
|
|
if(result.code == 1){
|
|
layer.alert(result.msg, {icon: 6}, function () {
|
|
location.href = "/memo/activity";
|
|
});
|
|
}else{
|
|
layer.alert(result.msg,{icon:2});
|
|
}
|
|
return false;
|
|
});
|
|
|
|
// AJAX函数封装
|
|
function ajax(url,query){
|
|
var returnData = 0;
|
|
$.ajax({
|
|
url:url,
|
|
data:query,
|
|
type:'POST',
|
|
dataType:'JSON',
|
|
async:false,
|
|
success:function(data){
|
|
returnData = data;
|
|
}
|
|
});
|
|
return returnData;
|
|
}
|
|
</script>
|
|
</body>
|
|
|
|
</html> |