<?php if( !defined( 'ONGPHP')) exit( 'Error ONGSOFT');
$D = db('');
$shezhi = $Mem1->g('shezhi');

$m = isset($_GET['m']) ? $_GET['m'] :'index';
$ac = isset($_GET['ac']) ? $_GET['ac'] :'list';



$tong = tongjiz();  

$tiaojian = array( 
      'id' => $_SESSION['houid']
    ) ;
$order = '  ';
$hou = $D -> setbiao('admin') -> where( $tiaojian ) ->order(  ) -> find();

$houtype = $hou['type'];




  
  
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>设置</title>
	<script type="text/javascript" src="/jquery-2.1.1.js"></script>
	<link rel="stylesheet" type="text/css" href="/layui/css/layui.css">
	<script type="text/javascript" src="/layui/layui.js" ></script>
	<link rel="stylesheet" type="text/css" href="/webuploader/webuploader.css">

<!--引入JS-->
<script type="text/javascript" src="/webuploader/webuploader.js"></script>

</head>
<body>

<style type="text/css">
	
.manman{
	padding: 2%;
}

</style>

<?php 
  if ($ac=='index') {?>

  <div class="manman">
  





</div>
  <?php
    
  }elseif ($ac=='add') {
    ?>


    <table class="layui-table">
      
    <tr>


    <td>
 
    支付方式
  


    </td>

    <td>
        <select class="zhifufs">
          <option>支付宝</option>
        </select>

    </td>
    </tr>

        <tr>

        <td>
 


        姓名

    </td>
    <td>
        <input type="text" name="" class="xingming layui-input">

    </td>
    </tr>

    <tr>

        <td>
 


        账号

    </td>
    <td>
        <input type="text" name="" class="zhanghao layui-input">

    </td>
    </tr>


    <tr>

        <td colspan="2">
 

        <span class="btn layui-btn shenqingtixian"  > 申请提现 </span>

    </td>
    
    </tr>




    </table>

    <?php
  }elseif ($ac=='list') {





    ?>


    <div class="manman">
  

  <form class="layui-form layui-form-pane" action=""   id="biaobiao">
   






  </form>

  <table class="layui-table">
  <colgroup>
    <col width="">
    <col width="">
    <col>
  </colgroup>
  <thead>
    <tr>
      <th>ID</th>
      <th>金额</th>
      <th>代理会员</th>
      <th>状态</th>


    </tr> 
  </thead>
  <tbody>



<?php 
  
  //分页开始
  //$WHERE['guanjian OLK'] = '%'.$ju.'%';

  if ($houtype>=1) {
    
    $WHERE['adminid']  =  $_SESSION['houid'] ;
    
  }
  

  $order = 'id desc';
  $PAGE  = (int) isset( $_GET['page']) ? $_GET['page'] : 0;
  $limit = listmit( $CONN['hnum'] ,$PAGE);
  $ZSHU = $D -> setbiao('dailitixian')->where( $WHERE ) ->  total();
  $rs = $D ->order( $order )->where( $WHERE )-> limit( $limit )-> select();



if (is_array($rs)) {

  foreach($rs as  $k => $v){
?>


    <tr>
      <td><?php echo $v['id'] ?></td>
      <td><?php echo $v['jine'] ?></td>
      <td>
        
      <?php 
        
      $tiaojian = array( 
            'id' => $v['adminid'],
          ) ;
      $order = '  ';
      $jiang11 = $D -> setbiao('admin') -> where( $tiaojian ) ->order(  ) -> find();


      echo $jiang11['name'];
      ?>


      </td>
<td>
  
<?php 
  if ($v['off']==1) {



    ?>
    审核成功
    <?php
  }elseif ($v['off']==0) {


      ?>
      <?php 
        
      if ($houtype<1) {
        ?>

     <span class="sheee" zhi="<?php echo $v['id'] ?>">审核</span>   



        <?php

      }

      ?>

      
      <?php

  }
?>

</td>




    </tr>

<?php 
  }
}
?>
  </tbody>
</table>


<?php 
   if($ZSHU > $CONN['hnum']){

          $_GET['guan']  = isset( $_GET['guan']) ? $_GET['guan'] :'';
      $_GET['fenqu'] = isset( $_GET['fenqu']) ? $_GET['fenqu'] :'';
      $_GET['type']  = isset( $_GET['type']) ? $_GET['type'] :'';

   
         echo pagec( $LANG['PAGE'], $CONN['hnum'], $ZSHU, $CONN['hpage'], $PAGE, '?action='.$_GET['action'].'&page=','&guan='.$_GET['guan'].'&type='.$_GET['type'].'&fenqu='.$_GET['fenqu'] );
   } 
?>

</div>





    <?php

  }
?>






</body>
<script>
layui.use(['form', 'layedit', 'laydate'], function(){
  var form = layui.form()
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate;
  
  //创建一个编辑器
  var editIndex = layedit.build('LAY_demo_editor');
 
  //自定义验证规则
  form.verify({
    title: function(value){
      if(value.length < 5){
        return '标题至少得5个字符啊';
      }
    }
    ,pass: [/(.+){6,12}$/, '密码必须6到12位']
    ,content: function(value){
      layedit.sync(editIndex);
    }
  });
  
  //监听指定开关
  form.on('switch(switchTest)', function(data){
    // layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {
    //   offset: '6px'
    // });
    // layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
  });
  
  //监听提交
  form.on('submit(demo1)', function(data){
    layer.alert(JSON.stringify(data.field), {
      title: '最终的提交信息'
    })
    return false;
  });
  
  
});
</script>









<script type="text/javascript">
jQuery(function(){



  jQuery(".sheee").click(function(){
    var zhi = jQuery(this).attr('zhi');

    $.ajax({
      async: true,
      type:"POST",
      url:"?action=ajax",
      data:{
        action:'dailishenhe',
        zhi:zhi,

      },
      dataType:'json',
      success:function(data){
        if (data.o=='yes') {
          location.reload(true);
        }
        
      }
    })


  })


  /*立即提现*/
  jQuery(".shenqingtixian").click(function(){

    var zhifufs = jQuery(".zhifufs").val();
    var xingming = jQuery(".xingming").val();
    var zhanghao = jQuery(".zhanghao").val();
    var adminid = "<?php echo $_SESSION['houid'] ?>";

    $.ajax({
      async: true,
      type:"POST",
      url:"?action=ajax",
      data:{
        action:'dailitixian',
        zhifufs:zhifufs,
        xingming:xingming,
        zhanghao:zhanghao,
        adminid:adminid
      },
      dataType:'json',
      success:function(data){
        if (data.o=='yes') {
          alert('审核成功');
          location.reload(true);
        }else if (data.o=='no') {
          alert('审核失败');
          location.reload(true);
        }
        

      }
    })





  })





});
</script>


<script type="text/javascript">
  

   // 初始化Web Uploader
    var uploader = WebUploader.create({
        // 选完文件后，是否自动上传。
        auto: true,
            fileVal: 'all',
        // swf文件路径
        swf:   'http://cdn.staticfile.org/webuploader/0.1.0/Uploader.swf',
        // 文件接收服务端。
        server: '<?php  echo '?action=ajax&upload=yes&uplx=all'?>',

        // 选择文件的按钮。可选。
        // 内部根据当前运行是创建，可能是input元素，也可能是flash.
        pick: '#filePicker',

        // 只允许选择图片文件。
        accept: {
            title: 'Images',
            extensions: 'gif,jpg,jpeg,bmp,png',
            mimeTypes: 'image/jpg,image/jpeg,image/png'
        }
    });



    // 文件上传成功，给item添加成功class, 用样式标记上传成功。
    uploader.on( 'uploadSuccess', function( file,respond ) {
        var tupian = respond.url;
        jQuery(".tpul").html('');

        jQuery(".tpul").append('<li><img style="width:100px;" src="'+tupian+'" alt=""><input type="hidden" name="data[beijing]" value="'+tupian+'" /> </li>');
    });

</script>

</html>