<?php
if (!defined('ROOT'))
	exit ;
?>
<!DOCTYPE html>
<html>

	<head>
		<title>账户资金明细</title>
		<meta name="description" content="">
		<meta name="keywords" content="">
		<?php
		include 'Inc_files.php';
		?>
	</head>

	<body data-type="index">
		<script src="<?php echo C('TMPL_PARSE_STRING.__TPL__'); ?>/assets/js/theme.js"></script>
		<div class="am-g tpl-g">
			<?php include 'Inc_head.php'?>
			<!-- 侧边导航栏 -->
			<?php
				include 'Inc_left.php';
			?>

			<!-- 内容区域 -->
			<div class="tpl-content-wrapper">
				<div class="row-content am-cf">
					<div class="row">
						<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
							<div class="widget am-cf">
								<div class="widget-head am-cf">
									<div class="widget-title  am-cf">
										账户资金明细
									</div>
								</div>
								<div class="widget-body  am-fr">

									<div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
										<div class="am-form-group">
											<div class="am-btn-toolbar">
												<div class="am-btn-group am-btn-group-xs">
													
												</div>
											</div>
										</div>
									</div>
									<form class="form-horizontal" method="get" role="form" action="/v/lists">
										<input type="hidden" name="model_id" value="<?php echo I('model_id');?>" />
										<input type="hidden" name="uid" value="<?php echo session('user_auth.id');?>" />
										<input type="hidden" name="row" value="<?php echo I('row');?>" />
										<div class="am-u-sm-12">
											<div class="am-form-group tpl-table-list-select">
												<select data-am-selected="{btnSize: 'sm'}" name="ctime">
													<option <?php if(mktime(0,0,0,date('m'),date('d'),date('Y'))==I('ctime')){echo 'selected="selected"';}?> value="<?php echo mktime(0,0,0,date('m'),date('d'),date('Y'));?>">今日</option>
													<option <?php if(mktime(0,0,0,date('m'),1,date('Y'))==I('ctime')){echo 'selected="selected"';}?> value="<?php echo mktime(0,0,0,date('m'),1,date('Y'));?>">本月</option>
													<option <?php $time=strtotime('-5 month', time());$time=mktime(0, 0,0, date('m', $time), 1, date('Y', $time));if($time==I('ctime')){echo 'selected="selected"';}?> value="<?php echo $time;?>">近6个月</option>
												</select>
												<select name="type" data-am-selected="{btnSize: 'sm'}">
													<option value="">所有类别</option>
													<?php
													$status=get_field_attr(44,'type');
													foreach ($status as $k => $v) {
														if($v[0]==I('type')){
															echo '<option selected="selected" value="'.$v[0].'">'.$v[1].'</option>';  
														}else{
															echo '<option value="'.$v[0].'">'.$v[1].'</option>';
														}
														
													}
													?>
												</select>
											</div>
										</div>
									</form>
									<div class="am-u-sm-12">
										<table width="100%" class="am-table am-table-compact tpl-table-black am-table-hover" >
											<thead>
												<tr>
													<th>说明</th>
													<th>推广会员ID</th>
													<th class="tc">订单金额</th>
													<th class="tc">分成金额</th>
													<th class="tc">生成时间</th>
												</tr>
											</thead>
											<tbody>
												<?php foreach($list as $k=>$v){?>
												<tr>
													<td><?php echo $v['about'];?></td>
													<td><?php echo $v['subuser'];?></td>
													<td class="tc"><?php echo $v['orderprice'];?></td>
													<td class="tc"><?php echo sprintf("%.3f",$v['price']);?></td>
													<td class="tc"><?php echo wd_date('Y-m-d H:i:s',$v['ctime']);?></td>
												</tr>
												<?php }?>
											</tbody>
										</table>
									</div>
									<div class="am-u-lg-12 am-cf">

										<div class="am-fr">
											<div class="am-pagination tpl-pagination">
												<?php echo $page;?>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<?php
		include 'Inc_files_boot.php';
		?>
		<script type="text/javascript">
		jQuery(document).on('change','[name="ctime"],[name="type"]',function () {
		    var the=jQuery(this);
		    the.closest('form').submit();        
		})
		</script>
	</body>

</html>