<?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>
									</div>
									<div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
										<div class="am-form-group tpl-table-list-select">
											<select data-am-selected="{btnSize: 'sm'}">
												<option value="">所有类别</option>
												<?php
												$status=get_field_attr(36,'status');
												foreach ($status as $k => $v) {
													echo '<option value="'.$v[0].'">'.$v[1].'</option>';
												}
												?>
											</select>
										</div>
									</div>
									<div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
										<div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
											<input type="text" class="am-form-field" placeholder="订单号">
											<span class="am-input-group-btn">
											<button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" type="button"></button> </span>
										</div>
									</div>
									<div class="am-u-sm-12">
										<?php 
											$list = M('download_log')->where(array('uid'=>session('user_auth.id')))->select();
											foreach($list as $k=>&$v){
												$v['file'] = M('file')->find($data['file_id']);
												$v['ctime'] = date('Y-m-d',$v["ctime"]);
											}
											?>
										<table width="100%" class="am-table am-table-compact tpl-table-black am-table-hover" >
											<thead>
												<tr>
													<th>ID</th>
													<th>文件名</th>
													<th>下载地址</th>
													<th>下载时间</th>
												</tr>
											</thead>
											<tbody>
												<?php foreach($list as $k=>$v){?>
												<tr>
													<td><?php echo $k+1;?></td>
													<td><?php echo $v['file']['name'];?></td>
													<td><?php echo $v['url'];?></td>
													<td><?php echo $v['ctime'];?></td>
												</tr>
												<?php }?>
											</tbody>
										</table>
									</div>
									<div class="am-u-lg-12 am-cf">
										<div class="am-fr">
											<ul class="am-pagination tpl-pagination">
											</ul>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<?php
		include 'Inc_files_boot.php';
		?>

	</body>

</html>