<?php
error_reporting(0); 
include("../../config/ht.php");
session_start();
if(!isset($_SESSION['adminname'])){echo "<script>alert('请重新登录!')</script><script>top.location.href='/houtai/'</script>";exit;}
$adminname=$_SESSION['adminname'];
$type="where name='$adminname'";
$adminpd=queryall(admin,$type);
if(!$adminpd){echo "<script>alert('请重新登录!')</script><script>top.location.href='/houtai/'</script>";exit;}
if($adminpd[qx]=='超级管理员'){}else{echo "<script>alert('无权限')</script><script>top.location.href='/houtai/'</script>";exit;}
$userid=ubo($_GET["userid"]);
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="gb2312">
<title>代理列表</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="/layui/css/houtai.css" media="all" />
<link rel="stylesheet" href="/2019newui/houtai/css/font-awesome.min.css" media="all" />
<link rel="stylesheet" href="/2019newui/houtai/css/admin.css" media="all">
<link rel="stylesheet" href="/2019newui/houtai/css/peizhi.css" media="all">
<script src="/2019newui/js/jquery.min.js"></script>
<script src="/layui/layui.js"></script>
<script src="/2019newui/js/bootstrap.min.js"></script>
</head>
<body style="padding:10px;">
<div class="tplay-body-div">
<?php
$sql = mysql_query("SELECT * FROM user");
$bs = mysql_num_rows($sql);
?>
<fieldset class="layui-elem-field layui-field-title" style="margin-top:20px;"><legend>代理列表(<?php if($bs==null){?>0<?php }else{?><?php echo $bs?><?php }?>个)</legend></fieldset>
<div class="layui-tab layui-tab-brief">
<div class="layui-tab-content">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">代理ID</label>
<div class="layui-input-block">
<input type="text"  name="userid"  id="userid"  autocomplete="off" class="layui-input" value="<?php if($userid){echo $userid;}?>">
</div>
</div>
<button class="layui-btn"  onclick="so()" style="margin-top:-5px;"><i class="layui-icon" style="">&#xe615;</i> 查询</button>
<div class="layui-inline">
<a class="layui-btn layui-btn-normal addNews_btn pub_btn" data-toggle="modal" data-target="#myPublic2">添加代理</a>
</div>
</div>
</div> 
<table class="layui-table">
<thead>
<tr>
<th style="text-align:center;width:34px;" >勾选</th>
<th style="text-align:center;" >使用邀请码</th>
<th style="text-align:center;" >主域名</th>
<th style="text-align:center;" >代理ID</th>
<th style="text-align:center;">用户名</th>
<th style="text-align:center;">代理昵称</th>
<th style="text-align:center;">代理密码</th>
<th style="text-align:center;">收款人</th>
<th style="text-align:center;">提现账号</th>
<th style="text-align:center;">联系QQ</th>
<th style="text-align:center;" >微信号</th>
<th style="text-align:center;">账户余额</th>
<th style="text-align:center;">已提款金额</th>
<th style="text-align:center;">审核状态</th>
<th style="text-align:center;">推荐人</th>
<th style="text-align:center;" >提现费率 %</th>
<th style="text-align:center;" >返佣比例 %</th>
<th style="text-align:center;" >登陆次数</th>
<th style="text-align:center;">操作</th>
</tr>
</thead>
<tbody>
<?php 
$page_size=10; 
$sql = "WHERE 1=1";
if($userid){
$sql .=" and userid='$userid' ";
}
$resultk = mysql_query("select id from user   ".$sql."  ");
$count = mysql_num_rows($resultk); 
if($count == 0){
echo '<tr><td colspan=19 style="text-align:center;">没有记录</td></tr>';
}
$page_count = ceil($count/$page_size); 
$init=1; 
$page_len=7; 
$max_p=$page_count; 
$pages=$page_count; 
if(empty($_GET['page'])||$_GET['page']<0){ 
$page=1; 
}else { 
$page=$_GET['page']; 
} 
$offset=$page_size*($page-1); 
$query = mysql_query("select * from  user   ".$sql." order by id desc   limit $offset, $page_size");
while ($a=mysql_fetch_array($query)) { 
$sqlx = mysql_query("SELECT * FROM userrz   where name='$a[name]' ");
$cs = mysql_num_rows($sqlx);
?> 	
<tr>
<td style="text-align:center;" ><label class="demo--label2"><input class="demo--radio" type="checkbox"   name="ids[]" id="ck-<?php echo $a['id']?>" value="<?php echo $a['id']?>"><span class="demo--checkbox demo--radioInput"></span>   </label></td>
<td style="text-align:center;"><?php echo $a[yqm]?></td>
<td style="text-align:center;"><?php echo $a[url]?></td>
<td style="text-align:center;"><?php echo $a[userid]?></td>
<td style="text-align:center;"><?php echo $a[name]?></td>
<td style="text-align:center;"> <?php echo $a[nikname]?></td>
<td style="text-align:center;"><?php echo $a[ypass]?></td>
<td style="text-align:center;"><?php echo $a[txname]?></td>
<td style="text-align:center;"><?php echo $a[tixian]?></td>
<td style="text-align:center;"><?php echo $a[qq]?> </td>
<td style="text-align:center;"><?php echo $a[weixin]?> </td>
<td style="text-align:center;">￥ <?php echo round($a[money])?> 元</td>
<td style="text-align:center;">￥ <?php echo round($a[txmoney])?> 元</td>
<td style="text-align:center;"><input type="checkbox" id="zt<?php echo $a['id']?>" onClick="zt('<?php echo $a[id]?>')"  class="md" <?php if($a['zt']=='true'){?>checked    <?php }?> ><label for="zt<?php echo $a['id']?>" class="green"<?php if($a['zt']=='true'){?> title="激活"  <?php }else{?> title="锁定"  <?php }?>></label>
</td>
<td style="text-align:center;"><?php echo $a[tjr]?></td>
<td style="text-align:center;"><?php echo $a[txfl]?> % </td>
<td style="text-align:center;"><?php if($a[fy]){?><?php echo $a[fy]?> <?php }else{?><?php echo $fy?><?php }?>% </td>
<td align="center"><?php if($cs == null){ ?> 0 <?php }else{  ?> <?php echo $cs?> <?php } ?> 次</td>
<td style="text-align:center;">
<a class="layui-btn layui-btn-xs delete layui-btn-primary"  style="margin-right: 0;font-size:12px;"  <?php if($a[pb]==0){ ?>onClick="pb('<?php echo $a[id]?>')"<?php }else{?>onClick="jcpb('<?php echo $a[id]?>')"<?php }?>>
<?php if($a[pb]==0){ ?>屏蔽<?php }else{?>解除屏蔽<?php }?></a>
<a class="layui-btn layui-btn-xs a_menu layui-btn-primary publish_btn" data-id="<?php echo $a[id]?>" data-toggle="modal" data-target="#myPublic"  data-pass="<?php echo $a[ypass]?>"   data-nikname="<?php echo $a[nikname]?>"   data-qq="<?php echo $a[qq]?>"   data-weixin="<?php echo $a[weixin]?>"   data-txname="<?php echo $a[txname]?>"   data-tixian="<?php echo $a[tixian]?>"   data-txfl="<?php echo $a[txfl]?>"   data-fy="<?php echo $a[fy]?>"     style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
<a class="layui-btn layui-btn-xs delete layui-btn-primary"  style="margin-right: 0;font-size:12px;"  onClick="sc('<?php echo $a[id]?>')"><i class="layui-icon"></i></a>

</td>
</tr>
<?php 
} 
$page_len = ($page_len%2)?$page_len:$pagelen+1;//页码个数 
$pageoffset = ($page_len-1)/2;//页码个数左右偏移量 
if($page!=1){ 
if($userid){
$keyt.="<a href=\""."/htuserlistpageso/1/$userid/\">首页</a>"; //首页 
$keyt.="<a href=\""."/htuserlistpageso/".($page-1)."/$userid/\">上一页 </a>"; //上一页 
}else{
$keyt.="<a href=\""."/htuserlistpage/1/\">首页</a>"; //首页 
$keyt.="<a href=\""."/htuserlistpage/".($page-1)."/\">上一页 </a>"; //上一页 
}
}else { 
$keyt.="<p>首页</p>"; //首页 
$keyt.="<p>上一页 </p>"; //上一页  
} 
if($pages>$page_len){ 
//如果当前页小于等于左偏移 
if($page<=$pageoffset){ 
$init=1; 
$max_p = $page_len; 
}else{//如果当前页大于左偏移 
//如果当前页码右偏移超出最大分页数 
if($page+$pageoffset>=$pages+1){ 
$init = $pages-$page_len+1; 
}else{ 
//左右偏移都存在时的计算 
$init = $page-$pageoffset; 
$max_p = $page+$pageoffset; 
} 
} 
} 
for($i=$init;$i<=$max_p;$i++){ 
if($i==$page){ 
$keyt.='<a class="cur">'.$i.'</a>'; 
} else { 
if($userid){
$keyt.="<a href=\""."/htuserlistpageso/".$i."/$userid/\">".$i."</a>"; 
}else{
$keyt.="<a href=\""."/htuserlistpage/".$i."/\">".$i."</a>"; 
}
} 
} 
if($page!=$pages){ 
if($userid){
$keyt.="<a href=\""."/htuserlistpageso/".($page+1)."/$userid/\">下一页 </a> ";//下一页 
$keyt.="<a href=\""."/htuserlistpageso/{$pages}/$userid/\">尾页</a> "; //最后一页 
}else{
$keyt.="<a href=\""."/htuserlistpage/".($page+1)."/\">下一页 </a> ";//下一页 
$keyt.="<a href=\""."/htuserlistpage/{$pages}/\">尾页</a> "; //最后一页 
}
}else { 
$keyt.="<p>下一页 </p>";//下一页 
$keyt.="<p>尾页</p>"; //最后一页 
} 
$keyt.="<p class='pageRemark' >当前第 <b>$page</b> 页/共 <b>$pages</b> 页  共 <b>$count</b> 条数据 </p>"; //第几页,共几页 
?> 
<?php if($count =="0"){?>
<?php }else{?>
<tr>
<td  colspan="19" style="text-align:left;padding-left:20px;" >
<a class="btn btn-success btn-xs chk-all" href="#" role="button">全选</a>  
<a class="btn btn-danger btn-xs unchk-all" href="#" role="button">全不选</a>
<a class="btn  btn-success  btn-xs btn-jiage plfl"  role="button">批量更改费率</a>
<a class="btn  btn-success  btn-xs btn-zt plzt"  role="button">批量更改审核状态</a>
<a class="btn  btn-success  btn-xs btn-qc plqc"  role="button">清除已提款金额</a>
<a class="btn  btn-success  btn-xs btn14"  role="button" onClick="qc()">清除账户余额</a>
<a class="btn  btn-success  btn-xs btn14"  role="button" onClick="tj()">统计代理金额</a>
</td>
</tr>
<?php }?>
</tbody>
</table>
<!--分页-->
<div style="padding:0 20px;">
<div class="pagination">
<?php if($count =="0"){?><?php }else{?><?php echo $keyt?><?php }?>
</div>
</div>
</div>
<script>
layui.use(['form', 'layedit', 'laydate', 'element', 'jquery', 'layer'], function(){
var form = layui.form
,layer   = layui.layer
,layedit = layui.layedit
,element = layui.element
,$= layui.jquery
,laydate = layui.laydate;
});
</script>
<?php if($count =="0"){?>
<?php }else{?>
<script>
function zt(id) {
var zt = $("#zt"+id+"").is(':checked');
var index = layer.load(3, {
shade: [0.1,'#fff'] 
});
$.ajax({
type : "post",
url : "/htpost<?php echo $dshz?>",
dataType: "json",  
async: true,
data: {zt:zt,id:id, lx : 'djzt'},
timeout: 10000 ,
success : function(data){
if(data.zt=='1'){  
layer.closeAll('loading');
layer.msg(data.msg);
location.reload();
} 
},
error:function(){
}
});
}
$(document).on('click', '.chk-all', function(event) {
event.preventDefault();
$('input[name="ids[]"]').prop('checked', 'checked');
});
$(document).on('click', '.unchk-all', function(event) {
event.preventDefault();
$('input[name="ids[]"]').prop('checked', false);
});
$(document).on('click', '.plqc', function(event) {
event.preventDefault();
layer.open({
title: '请输入安全码',
area: '220px',
shade: 0.8,
content: '<div class="mark"><div style="margin: 0px 0px 10px 1px;"><span><input type="text" value=""  id="aqm" style="width: 88%;height:30px;" placeholder="安全码" ><br><br><div>请输入安全码，以保证数据安全</div></div></div>',
btn: ['确认'],
shadeClose: false,
yes: function(){
var aqm = $("#aqm").val();
if (aqm == '') {
layer.msg('请输入安全码');
return false;
}
var index = layer.load(3, {
shade: [0.1,'#fff'] 
});
$.ajax({
type : "post",
url : "/htpost<?php echo $dshz?>",
dataType: "json",  
async: true,
data: {aqm:aqm, lx: 'plqc'},
timeout: 10000 ,
success : function(data){
if(data.zt=='1'){  
layer.closeAll('loading');
layer.msg('清除已提款金额成功');
location.reload();
}else{
layer.closeAll('loading');
layer.msg(data.msg);
location.reload();
} 
},
error:function(){
}
});
},
});
});
$(document).on('click', '.plfl', function(event) {
event.preventDefault();
var _ids = '';
$.each($('input[name="ids[]"]:checked'), function(index, val) {
_ids += $(val).val()+',';
});
if (_ids == '') {
layer.msg('请选择要操作的ID');
return false;
}
layer.open({
title: '批量更改费率',
area: '180px',
shade: 0.8,
content: '<div class="mark"><div style="margin: 0px 0px 0px 10px;">费率 :<span><select id="plfl" ><?php for($i=1;$i<101;$i++){?><option value="<?php echo $i?>"><?php echo $i?> % </option><?php }?></select></div></div>',
btn: ['确认修改'],
shadeClose: false,
yes: function(){
var plfl = $("#plfl").val();
var index = layer.load(3, {
shade: [0.1,'#fff'] 
});
$.ajax({
type : "post",
url : "/htpost<?php echo $dshz?>",
dataType: "json",  
async: true,
data: {id: _ids,txfl:plfl, lx : 'plfl'},
timeout: 10000 ,
success : function(data){
if(data.zt=='1'){  
layer.closeAll('loading');
layer.msg('批量更新费率成功');
location.reload();
} 
},
error:function(){
}
});
},
});
});
$(document).on('click', '.plzt', function(event) {
event.preventDefault();
var _ids = '';
$.each($('input[name="ids[]"]:checked'), function(index, val) {
_ids += $(val).val()+',';
});
if (_ids == '') {
layer.msg('请选择要操作的ID');
return false;
}
layer.open({
title: '批量更改审核状态',
area: '180px',
shade: 0.8,
content: '<div class="mark"><div style="margin: 0px 0px 0px 10px;">状态 :<span><select id="plzt" ><option value="True">激活</option><option value="False">锁定</option></select></div></div>',
btn: ['确认修改'],
shadeClose: false,
yes: function(){
var plzt = $("#plzt").val();
var index = layer.load(3, {
shade: [0.1,'#fff'] 
});
$.ajax({
type : "post",
url : "/htpost<?php echo $dshz?>",
dataType: "json",  
async: true,
data: {id: _ids,plzt:plzt, lx : 'plzt'},
timeout: 10000 ,
success : function(data){
if(data.zt=='1'){  
layer.closeAll('loading');
layer.msg('批量更改审核状态成功');
location.reload();
} 
},
error:function(){
}
});
},
});
});
</script>
<script type="text/javascript">
function tj() {
var index = layer.load(3, {
shade: [0.1,'#fff'] 
});
$.ajax({
type : "post",
url : "/htpost<?php echo $dshz?>",
dataType: "json",  
async: true,
data: {lx: 'tj'},
timeout: 10000 ,
success : function(data){
if(data.zt=='1'){  
layer.closeAll('loading');
layer.open({
id:1,
type: 1,
title:'统计信息',
skin:'layui-layer-rim',
area:['350px', '200px'],
content: ' <div class="row" style="width: 320px;  margin-left:7px; margin-top:10px;">'
+'<div class="col-sm-12">'
+'<div class="input-group">'
+'<span class="input-group-addon"> 代理账户金额总计 :￥ '+ data.money+' 元</span>'
+'</div>'
+'</div>'
+'<div class="col-sm-12" style="margin-top: 10px">'
+'<div class="input-group">'
+'<span class="input-group-addon">代理已提款金额总计:￥ '+ data.money2+' 元</span>'
+'</div>'
+'</div>'
+'</div>'
,
btn:['确定','取消'],
btn1: function (index,layero) {
},
btn2:function (index,layero) {
layer.close(index);
}
});
} 
},
error:function(){
}
});
}
function qc() {
layer.open({
title: '请输入安全码',
area: '220px',
shade: 0.8,
content: '<div class="mark"><div style="margin: 0px 0px 10px 1px;"><span><input type="text" value=""  id="aqm" style="width: 88%;height:30px;" placeholder="安全码" ><br><br><div>请输入安全码，以保证数据安全</div></div></div>',
btn: ['确认'],
shadeClose: false,
yes: function(){
var aqm = $("#aqm").val();
if (aqm == '') {
layer.msg('请输入安全码');
return false;
}
var index = layer.load(3, {
shade: [0.1,'#fff'] 
});
$.ajax({
type : "post",
url : "/htpost<?php echo $dshz?>",
dataType: "json",  
async: true,
data: {aqm:aqm, lx: 'qc'},
timeout: 10000 ,
success : function(data){
if(data.zt=='1'){ 
layer.closeAll('loading'); 
layer.msg('清理代理账户余额成功，同时将数据备份到/backup/usermoney.txt 请查阅');
location.reload();
}else{
layer.closeAll('loading'); 
layer.msg(data.msg);
location.reload();
} 
},
error:function(){
}
});
},
});
}
function sc(id) {
layer.confirm("确定要删除吗？", { title: "确认" }, function (index) {
layer.close(index);
var index = layer.load(3, {
shade: [0.1,'#fff'] 
});
$.ajax({
type : "post",
url : "/htpost<?php echo $dshz?>",
dataType: "json",  
async: true,
data: {id: id, lx: 'usersc'},
timeout: 10000 ,
success : function(data){
if(data.zt=='1'){  
layer.closeAll('loading'); 
layer.msg('删除成功');
location.reload();
} 
},
error:function(){
}
});
});
}
function pb(id) {
layer.confirm("确定屏蔽TA吗？屏蔽后所有链接将失效", { title: "确认" }, function (index) {
layer.close(index);
var index = layer.load(3, {
shade: [0.1,'#fff'] 
});
$.ajax({
type : "post",
url : "/htpost<?php echo $dshz?>",
dataType: "json",  
async: true,
data: {id: id, lx: 'userpb'},
timeout: 10000 ,
success : function(data){
if(data.zt=='1'){  
layer.closeAll('loading'); 
layer.msg('屏蔽成功');
location.reload();
} 
},
error:function(){
}
});
});
}
function jcpb(id) {
layer.confirm("确定解除屏蔽TA吗？", { title: "确认" }, function (index) {
layer.close(index);
var index = layer.load(3, {
shade: [0.1,'#fff'] 
});
$.ajax({
type : "post",
url : "/htpost<?php echo $dshz?>",
dataType: "json",  
async: true,
data: {id: id, lx: 'userpbjc'},
timeout: 10000 ,
success : function(data){
if(data.zt=='1'){  
layer.closeAll('loading'); 
layer.msg('解除屏蔽成功');
location.reload();
} 
},
error:function(){
}
});
});
}
$(function () {
$("#publish_btn").click(function () {
var id = $("#recipient-id").val();
var pass = $("#recipient-pass").val();
var nikname = $("#recipient-nikname").val();
var qq = $("#recipient-qq").val();
var weixin = $("#recipient-weixin").val();
var txname = $("#recipient-txname").val();
var tixian = $("#recipient-tixian").val();
var txfl = $("#recipient-txfl").val();
var fy = $("#recipient-fy").val();
var zym = $("#zym").val();
var index = layer.load(3, {
shade: [0.1,'#fff'] 
});
$.ajax({
type : "post",
url : "/htpost<?php echo $dshz?>",
dataType: "json",  
async: true,
data: {id:id,pass:pass,nikname:nikname,qq:qq,weixin:weixin,txname:txname,tixian:tixian,txfl:txfl, lx: 'userxg',fy:fy,zym:zym},
timeout: 10000 ,
success : function(data){
if(data.zt=='1'){  
layer.closeAll('loading');
layer.msg('更新成功');
location.reload();
}else{
layer.closeAll('loading');
layer.msg(data.msg);
location.reload();
} 
},
error:function(){
}
});
});
})
$('.publish_btn').on('click', function () {
$('#recipient-id').val($(this).data('id'));
$('#recipient-pass').val($(this).data('pass'));
$('#recipient-nikname').val($(this).data('nikname'));
$('#recipient-qq').val($(this).data('qq'));
$('#recipient-weixin').val($(this).data('weixin'));
$('#recipient-txname').val($(this).data('txname'));
$('#recipient-tixian').val($(this).data('tixian'));
$('#recipient-txfl').val($(this).data('txfl'));
$('#recipient-fy').val($(this).data('fy'));

})
</script>
<?php }?>
<script type="text/javascript">
$('.pub_btn').on('click', function () {
})
$(function () {
$("#pub_btn").click(function () {
var name = $("#name").val();
var pass = $("#pass").val();
var nikname = $("#nikname").val();
var qq = $("#qq").val();
var weixin = $("#weixin").val();
var txname = $("#txname").val();
var tixian = $("#tixian").val();
var txfl = $("#txfl").val();
var fy = $("#fy").val();
var index = layer.load(3, {
shade: [0.1,'#fff'] 
});
$.ajax({
type : "post",
url : "/htpost<?php echo $dshz?>",
dataType: "json",  
async: true,
data: {name:name,pass:pass,nikname:nikname,qq:qq,weixin:weixin,txname:txname,tixian:tixian,txfl:txfl, lx: 'useradd',fy:fy},
timeout: 10000 ,
success : function(data){
if(data.zt=='1'){  
layer.closeAll('loading');
layer.msg('添加代理成功');
location.reload();
}else{
layer.closeAll('loading');
layer.msg(data.msg);
location.reload();
} 
},
error:function(){
}
});
});
})
</script>
<div class="modal fade layui-form" id="myPublic2" tabindex="-1" role="dialog" aria-labelledby="myPublicLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">添加代理</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label  class="control-label">用户名</label>
<input type="text"  class="layui-input" id="name" placeholder="输入用户名" required >
</div>
<div class="form-group">
<label  class="control-label">密码</label>
<input type="text"  class="layui-input" id="pass" placeholder="请输入密码" required >
</div>
<div class="form-group">
<label  class="control-label">用户昵称</label>
<input type="text"  class="layui-input" id="nikname" placeholder="请输入用户昵称" >
</div>
<div class="form-group">
<label  class="control-label">联系QQ</label>
<input type="text"  class="layui-input" id="qq" placeholder="请输入联系QQ" >
</div>
<div class="form-group">
<label  class="control-label">微信号</label>
<input type="text"  class="layui-input" id="weixin" placeholder="请输入微信号" >
</div>
<div class="form-group">
<label  class="control-label">收款人</label>
<input type="text"  class="layui-input" id="txname" placeholder="请输入收款人" >
</div>
<div class="form-group">
<label  class="control-label">收款账号</label>
<input type="text"  class="layui-input" id="tixian" placeholder="请输入收款账号" >
</div>
<div class="form-group">
<label  class="control-label">提现费率</label>
<select id="txfl"    class="layui-input">
<?php 
for($i=1;$i<101;$i++){
echo "<option value='$i'>$i % </option>";
}
?>
</select>
</div>
<div class="form-group">
<label  class="control-label">返佣比例</label>
<input type="text"  class="layui-input" id="fy" placeholder="请输入返佣比例" >
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" id="pub_btn" class="btn btn-primary">确认</button>
</div>
</div>
</div>
</div>
</div>
<?php if($count =="0"){?><?php }else{?>
<div class="modal fade layui-form" id="myPublic" tabindex="-1" role="dialog" aria-labelledby="myPublicLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">修改代理资料</h4>
</div>
<div class="modal-body">
<input type="hidden" name="id" class="form-control" id="recipient-id">
<div class="form-group">
<label  class="control-label">密码</label>
<input type="text" name="pass" class="layui-input" id="recipient-pass">
</div>
<div class="form-group">
<label  class="control-label">用户昵称</label>
<input type="text" name="nikname" class="layui-input" id="recipient-nikname">
</div>
<div class="form-group">
<label  class="control-label">联系QQ</label>
<input type="text" name="qq" class="layui-input" id="recipient-qq">
</div>
<div class="form-group">
<label  class="control-label">微信号</label>
<input type="text" name="weixin" class="layui-input" id="recipient-weixin">
</div>
<div class="form-group">
<label  class="control-label">收款人</label>
<input type="text" name="txname" class="layui-input" id="recipient-txname">
</div>
<div class="form-group">
<label  class="control-label">收款账号</label>
<input type="text" name="tixian" class="layui-input" id="recipient-tixian">
</div>
<div class="form-group">
<label  class="control-label">主域名</label>
<select name="zym"    class="layui-input" id="zym">
<option value='请选择主域名'>请选择主域名</option>
<?php
$query = mysql_query("SELECT * FROM  zym where zt='正常' and qx='1'  ");
while($a = mysql_fetch_array($query)) {
?>  
<option value='<?php echo $a[url]?>'><?php echo $a[url]?></option>
<?php }?>
</select>
</div>
<div class="form-group">
<label  class="control-label">提现费率</label>
<select id="recipient-txfl"    class="layui-input">
<?php 
for($i=1;$i<101;$i++){
echo "<option value='$i'>$i % </option>";
}
?>
</select>
</div>
<div class="form-group">
<label  class="control-label">返佣比例</label>
<input type="text" name="fy" class="layui-input" id="recipient-fy">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" id="publish_btn" class="btn btn-primary">确认</button>
</div>
</div>
</div>
</div>
</div>
<?php }?>
</div>
</div>
</div>
<script type="text/javascript">
function so() {
var userid = $('#userid').val();
if (userid== '') {
layer.msg('查询条件不能为空');
return false;
}
window.location.href='/htuserlistpageso/1/'+userid+'/'; 
}
</script>
</body>
</html>