<?php include $this->admin_tpl('meta', 'admin');?>
<title>入账记录 - YzmCMS内容管理系统</title>
<link href="<?php echo STATIC_URL;?>plugin/editable/css/jquery-editable.css" rel="stylesheet"/>
</head>
<body>
<nav class="breadcrumb"><i class="yzm-iconfont yzm-iconai-home"></i> 首页 <span class="c-gray en">&gt;</span> 会员管理 <span class="c-gray en">&gt;</span> 账单管理 <span class="c-gray en">&gt;</span> 入账记录管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="yzm-iconfont yzm-iconshuaxin"></i></a></nav>
<div class="page-container">
  <div class="sub_menu"><a href="<?php echo U('pay');?>" class="on">入账记录</a> <a href="<?php echo U('pay_spend');?>">消费记录</a> <a href="<?php echo U('recharge');?>">在线充值</a></div>
  <div> 
    <form action="<?php echo U('pay_search');?>" method="get" id="search">
	 <input type="hidden" value="<?php echo ROUTE_M;?>" name="m">
	 <input type="hidden" value="<?php echo ROUTE_C;?>" name="c">
	 <input type="hidden" value="search" name="a">
     时间：<input type="text" class="input-text laydate-icon" style="width:170px;height:30px;" id="start" name="start" <?php if(isset($_GET['start']) && $_GET['start'] != '') echo 'value="'.$_GET['start'].'"'; ?>>
     至 <input type="text" class="input-text laydate-icon" style="width:170px;height:30px;" id="end" name="end" value="<?php if(isset($_GET['end']) &&  $_GET['end'] != '') echo $_GET['end']; else echo date('Y-m-d H:i:s'); ?>">
     <span class="select-box inline">
		<select name="capital_type" class="select">
		<option value="99">类型</option>
		<option <?php if(isset($_GET['capital_type']) && $_GET['capital_type']=='2'){?> selected <?php }?> value="2">金钱</option>	
		<option <?php if(isset($_GET['capital_type']) && $_GET['capital_type']=='1'){?> selected <?php }?> value="1">积分</option>
		</select>
	  </span>
     <span class="select-box inline">
		<select name="type" class="select">
		<option <?php if(isset($_GET['type']) && $_GET['type']=='1'){?> selected <?php }?> value="1">用户名</option>
		<option <?php if(isset($_GET['type']) && $_GET['type']=='2'){?> selected <?php }?> value="2">订单号</option>	
		<option <?php if(isset($_GET['type']) && $_GET['type']=='3'){?> selected <?php }?> value="3">备注说明</option>	
		</select>
	  </span>
      <input type="text" name="searinfo" class="input-text" style="width:170px" value="<?php if(isset($_GET['searinfo'])) echo $_GET['searinfo'];?>"><button name="dosubmit" class="btn btn-success btn-search" type="submit" value="1"><i class="yzm-iconfont yzm-iconsousuo"></i> 搜索</button>
      <a href="<?php echo U(ROUTE_A);?>" class="btn btn-primary radius"><i class="yzm-iconfont yzm-iconshuaxin"></i> 重置</a>
	 </form>	
  </div>
  <div class="cl mt-15 tb-top"> <span class="l">
  <a href="javascript:;" onclick="yzm_dels('ids')" class="btn btn-danger radius"><i class="yzm-iconfont yzm-iconshanchu2"></i> 批量删除</a> 
  </span> <span class="r">共有数据：<strong><?php echo $total?></strong> 条</span> </div>
  <form method="post" action="<?php echo U('pay_del');?>" id="myform">
  <table class="table table-border table-bg table-hover yzm-table-sort">
    <thead>
      <tr class="text-c">
        <th width="25"><input type="checkbox"></th>
		<th width='60'>用户ID<?php echo field_order('userid');?></th>
		<th width='110'>用户名<?php echo field_order('username');?></th>
		<th width='155'>订单号</th>
		<th width='60'>增加量<?php echo field_order('money');?></th>
		<th width='120'>操作IP<?php echo field_order('ip');?></th>
		<th width='155'>获取时间<?php echo field_order('creat_time');?></th>
		<th width='100'>类型说明</th>
		<th>备注说明</th>
		<th width='55'>类型</th>
      </tr>
    </thead>
    <tbody>
		<?php 
		foreach($data as $val){
		?>
		  <tr class="text-c">
			<td><input type="checkbox" value="<?php echo $val['id']?>" name="ids[]"></td>
			<td><?php echo $val['userid']?></td>
			<td><?php echo $val['username'];?></td>
			<td><?php echo $val['trade_sn']?></td>
			<td><?php echo $val['money']?><?php echo $val['type']==1 ? '积分' : '元';?></td>
			<td><?php echo $val['ip']?></td>
			<td><?php echo date("Y-m-d H:i:s",$val['creat_time']) ?></td>
			<td><?php echo $val['msg']?></td>
			<td><span class="remarks" data-pk="<?php echo $val['id']?>" onmouseover="yzm_tips=layer.tips('点击修改备注', this)" onmouseout="layer.close(yzm_tips);"><?php echo $val['remarks'] ? $val['remarks'] : '无';?></span></td>
			<td><?php echo $val['type'] == '1' ? '积分' : '<span class="c-red">金钱</span>'; ?></td>
		  </tr>		
		<?php 
		}
		?>
    </tbody>
  </table>
  <?php if(!$data){ ?><div class="yzm_no_data"><i class="yzm-iconfont yzm-iconshuoming"></i> 暂无数据</div><?php } ?>
  </form>
  <div id="page"><span class="page_left">共<?php echo $total?>条记录，共<?php echo $page->total()?>页，当前显示第<?php echo $page->getpage()?>页</span>
  <span class="page_right"><?php echo $page->getfull();?></span></div>
</div>
<?php include $this->admin_tpl('footer', 'admin');?>
<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/laydate/1.1/laydate.js"></script>
<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/editable/js/jquery.poshytip.js"></script>
<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/editable/js/jquery-editable-poshytip.min.js"></script>
<script type="text/javascript">
	var start = {elem:'#start',format:'YYYY-MM-DD hh:mm:ss',min:'1999-01-01',max:'2099-01-01',istime:true,istoday:false,choose:function(datas){end.min = datas;end.start = datas}
	};
	var end = {elem:'#end',format:'YYYY-MM-DD hh:mm:ss',min:'1999-01-01',max:'2099-01-01',istime:true,istoday:false,choose:function(datas){start.max = datas;}};
	laydate(start);
	laydate(end);

	$('.remarks').editable({
	    url: '<?php echo U('public_edit_remarks');?>',
	    name: 'remarks',
	    title: '修改备注',
	    type: 'textarea',
	    params: {"type":"1"},
	    dataType: "json", 
	    validate:function (value) {
	        if(value==''){
	            return '备注说明不能为空！';
	        }
	    },
	    success: function(msg, newvalue) {
	        if(!msg.status){
	        	return msg.message; 
		    }
	    }
	});
</script>

</body>
</html>