Files
Pro/application/admin/view/player/player-edit.html
T
2026-02-25 01:50:31 +08:00

389 lines
17 KiB
HTML
Executable File

{include file="public/header"}
<style>
textarea, input[type="text"], input[type="password"],
.uneditable-input{border: 1px solid #ccc;background-color: #fff; }
.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">
<input id="L_parent_agent" name="L_parent_agent" type="text" value="{$parent_agent.username}" maxlength="50" minlength="3" class="required" readonly>
<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_username" name="L_username" type="text" value="{$player.username}" readonly maxlength="50" minlength="3" class="required">
</div>
</div>
<div class="control-group">
<label class="control-label">昵称:</label>
<div class="controls">
<input id="L_nickname" name="L_nickname" type="text" value="{$player.nickname}" maxlength="50" minlength="3" class="required">
</div>
</div>
<div class="control-group">
<label class="control-label">密码:</label>
<div class="controls">
<input id="L_pass" name="L_pass" type="password" 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_repass" name="L_repass" type="password" 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_mobile" name="L_mobile" type="text" value="{$player.mobile}" maxlength="50" minlength="3" class="required">
</div>
</div>
<div class="control-group">
<label class="control-label">邮箱:</label>
<div class="controls">
<input id="L_email" name="L_email" type="text" value="{$player.email}" maxlength="50" minlength="3" class="required">
</div>
</div>
<div class="control-group">
<label class="control-label">百家乐码率(%):</label>
<div class="controls">
<input id="L_ximalv" name="L_ximalv" type="text" value="{$player.agent_ximalv}" maxlength="50" minlength="3" class="required"><span class="help-inline">
<font color="red"> * 洗码率不能超过{$parent_agent.agent_ximalv}%</font>
</span>
</div>
</div>
<div class="control-group">
<label class="control-label">龙虎码率(%):</label>
<div class="controls">
<input id="L_ximalv_dt" name="L_ximalv_dt" type="text" value="{$player.agent_ximalv_dt}" maxlength="50" minlength="3" class="required"><span class="help-inline">
<font color="red"> * 洗码率不能超过{$parent_agent.agent_ximalv_dt}%</font>
</span>
</div>
</div>
<div class="control-group">
<label class="control-label">占成(%):</label>
<div class="controls">
<input id="L_cs" name="L_cs" type="text" value="{$player.agent_cs}" maxlength="50" minlength="3" class="required"><span class="help-inline">
<font color="red"> * 洗码率不能超过{$parent_agent.agent_cs}%</font>
</span>
</div>
</div>
<div class="control-group">
<label class="control-label">最低限红:</label>
<div class="controls">
<input id="limit_low" name="limit_low" type="text" maxlength="10" class="required" value="{$player.limit_low}"><span class="help-inline">
<font color="red"> * 不填写则为0,限红将根据桌子限红</font>
</span>
</div>
</div>
<div class="control-group">
<label class="control-label">最高限红:</label>
<div class="controls">
<input id="limit_high" name="limit_high" type="text" maxlength="10" class="required" value="{$player.limit_high}"><span class="help-inline">
<font color="red"> * 不填写则为0,限红将根据桌子限红</font>
</span>
</div>
</div>
<div class="control-group">
<label class="control-label">投注方式:</label>
<div class="controls">
<select id="L_bet_type" name="L_bet_type" type="text" maxlength="20" min-length="3" class="required">
<option value="0">请选择投注方式</option>
<option value="1" <?php if($player['bet_type'] == 1) {echo 'selected';} ?>>网络投注</option>
<option value="2" <?php if($player['bet_type'] == 2) {echo 'selected';} ?>>电话投注</option>
<option value="3" <?php if($player['bet_type'] == 3) {echo 'selected';} ?>>所有投注</option>
</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="price_banker" name="price_banker" type="text" value="{$player.price_banker}" maxlength="10" 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="price_player" name="price_player" type="text" value="{$player.price_player}" maxlength="10" 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="price_tie_baccarat" name="price_tie_baccarat" type="text" value="{$player.price_tie_baccarat}" maxlength="10" 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="price_pair" name="price_pair" type="text" value="8" maxlength="10" 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="price_dragon" name="price_dragon" type="text" value="{$player.price_dragon}" maxlength="10" 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="price_tiger" name="price_tiger" type="text" value="{$player.price_tiger}" maxlength="10" 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="price_tie_dt" name="price_tie_dt" type="text" value="{$player.price_tie_dt}" maxlength="10" class="required"><span class="help-inline">
<font color="red"> * 龙虎斗 </font>
</span>
</div>
</div>
<div class="control-group">
<label class="control-label">押牛7-牛9赔率:</label>
<div class="controls">
<input id="price_n7_n9" name="price_n7_n9" type="text" value="{$player.price_n7_n9}" maxlength="10" 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="price_nn" name="price_nn" type="text" value="{$player.price_nn}" maxlength="10" 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="price_5n" name="price_5n" type="text" value="{$player.price_5n}" maxlength="10" 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="price_bomb" name="price_bomb" type="text" value="{$player.price_bomb}" maxlength="10" 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="win_limit" name="win_limit" type="text" value="{$player.win_limit}" maxlength="10" class="required" onkeyup="value=value.replace(/[^\d]/g,'')"><span class="help-inline">
<font color="red"> * 默认0则为没有限制</font>
</span>
</div>
</div>
<div class="bottom-buttom">
<label class="control-label"></label>
<div class="controls">
<div class='submit'>保存</div>
</div>
</div>
</div>
<!-- 隐藏参数 -->
<input type="hidden" id="player-id" value="{$player.id}">
<input type="hidden" id="parent-ximalv" value="{$parent_agent.agent_ximalv}">
<input type="hidden" id="parent-ximalv-dt" value="{$parent_agent.agent_ximalv_dt}">
<input type="hidden" id="parent-cs" value="{$parent_agent.agent_cs}">
<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 = '/player/index';
if(id == "2") location.href = '/player/player_edit';
});
//监听提交
$('.submit').click(function () {
// 获取和拼装添加代理的数据
var limit_checkout = new Array();
var query = new Object();
query.player_id = $('#player-id').val();
query.username = $('#L_username').val();
query.nickname = $('#L_nickname').val();
query.pass = $('#L_pass').val();
query.repass = $('#L_repass').val();
query.mobile = $('#L_mobile').val();
query.email = $('#L_email').val();
query.ximalv = $('#L_ximalv').val();
query.ximalv_dt = $('#L_ximalv_dt').val();
query.cs = $('#L_cs').val();
query.bet_type = $('#L_bet_type').val();
var parent_ximalv = $('#parent-ximalv').val();
var parent_ximalv_dt = $('#parent-ximalv-dt').val();
var parent_cs = $('#parent-cs').val();
query.limit_low = $('#limit_low').val();
query.limit_high = $('#limit_high').val();
query.price_banker = $('#price_banker').val();
query.price_player = $('#price_player').val();
query.price_tie_baccarat = $('#price_tie_baccarat').val();
query.price_pair = $('#price_pair').val();
query.price_dragon = $('#price_dragon').val();
query.price_tiger = $('#price_tiger').val();
query.price_tie_dt = $('#price_tie_dt').val();
query.price_n7_n9 = $('#price_n7_n9').val();
query.price_nn = $('#price_nn').val();
query.price_5n = $('#price_5n').val();
query.price_bomb = $('#price_bomb').val();
query.win_limit = $('#win_limit').val();
// 验证数据
if(query.pass.length > 0){
if(query.pass.length >= 6){
if(query.pass != query.repass){
layer.msg("两次密码不一致!");
return false;
}
}else{
layer.msg("密码不能少于6位字符!");
return false;
}
}
if(parseFloat(query.ximalv) > parseFloat(parent_ximalv) || parseFloat(query.ximalv_dt) > parseFloat(parent_ximalv_dt)){
layer.msg("码率不能超过父级码率");
return false;
}
if(parseFloat(query.cs) > parseFloat(parent_cs)){
layer.msg("占成不能超过父级占成");
return false;
}
if(query.bet_type <= 0){
layer.alert("请选择投注方式");
return false;
}
if(query.price_banker <= 0){
layer.alert("押庄赔率必须大于0");
return false;
}
if(query.price_player <= 0){
layer.alert("押闲赔率必须大于0");
return false;
}
if(query.price_tie_baccarat <= 0){
layer.alert("押和(百家乐)赔率必须大于0");
return false;
}
if(query.price_dragon <= 0){
layer.alert("押龙赔率必须大于0");
return false;
}
if(query.price_tiger <= 0){
layer.alert("押虎赔率必须大于0");
return false;
}
if(query.price_tie_dt <= 0){
layer.alert("押和(龙虎斗)赔率必须大于0");
return false;
}
if(query.price_n7_n9 <= 0){
layer.alert("押牛7-牛9赔率必须大于0");
return false;
}
if(query.price_nn <= 0){
layer.alert("押牛牛赔率必须大于0");
return false;
}
if(query.price_5n <= 0){
layer.alert("押五公赔率必须大于0");
return false;
}
if(query.price_bomb <= 0){
layer.alert("押四条赔率必须大于0");
return false;
}
if(query.win_limit.length <= 0){
layer.alert("日赢上限不能为空");
return false;
}
// 发送数据到后台添加会员
var result = ajax('/player/do_player_edit',query);
if(result.code == 1){
layer.alert(result.msg, {icon: 6}, function () {
location.href = '/player/index';
});
}else{
layer.msg(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>