<?php include $this->admin_tpl('meta', 'admin');?>
<title>轮播图管理 - YzmCMS内容管理系统</title>
</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> 轮播图管理 <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="cl tb-top"> 
	  <span class="l">
	  <a class="btn btn-primary radius" href="<?php echo U('add');?>"><i class="yzm-iconfont yzm-icontianjia"></i> 添加轮播</a>
	  <a href="javascript:;" onclick="yzm_dels('id')" 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('del');?>" id="myform">
  <table class="table table-border table-bg table-hover table-sort">
    <thead>
      <tr class="text-c">
			<th width="30"><input type="checkbox"></th>
			<th>排序</th>
			<th>名称</th>
			<th>图片</th>
			<th>链接地址</th>
			<th>添加时间</th>
			<th>分类</th>
			<th>显示</th>
			<th>管理操作</th>
      </tr>
    </thead>
    <tbody>
		<?php 
		foreach($data as $val){
		?>
		  <tr class="text-c">
			<td><input type="checkbox" value="<?php echo $val['id']?>" name="id[]"></td>
			<td><input type="text" class="input-text listorder" name="listorder[]" value="<?php echo $val['listorder']?>"><input type="hidden" name="order_id[]" value="<?php echo $val['id']?>"></td>
			<td><a href="<?php echo $val['url']?>" target="_blank"><?php echo $val['title']?></a></td>
			<td><img src="<?php echo $val['image']?>" title="点击查看大图" onclick="yzm_show_img('<?php echo $val['image'];?>',800,500)" style="max-height:90px;max-width:200px;cursor:pointer;"></td>
			<td><a href="<?php echo $val['url']?>" target="_blank" title="<?php echo $val['url']?>"><i class="yzm-iconfont yzm-iconlianjie"></i>访问</a></td>
			<td><?php echo date('Y-m-d', $val['inputtime'])?><br><?php echo date('H:i:s', $val['inputtime'])?></td>
			<td><?php echo $this->get_banner_type($val['typeid']);?></td>
			<td>
				<?php if($val['status']){ ?>
				<span class="yzm-status-enable" data-field="status" data-id="<?php echo $val['id']?>" onclick="yzm_change_status(this,'<?php echo U('public_change_status');?>')"><i class="yzm-iconfont">&#xe81f;</i>是</span>
				<?php }else{ ?>
				<span class="yzm-status-disable" data-field="status" data-id="<?php echo $val['id']?>" onclick="yzm_change_status(this,'<?php echo U('public_change_status');?>')"><i class="yzm-iconfont">&#xe601;</i>否</span>
				<?php } ?>
			</td>
			<td>
				<a title="编辑" href="<?php echo U('edit',array('id'=>$val['id']));?>" class="btn-mini btn-primary" style="text-decoration:none">编辑</a>
			</td>
		  </tr>	
		<?php 
		}
		?>
    </tbody>
  </table>
  <?php if(!$data){ ?><div class="yzm_no_data"><i class="yzm-iconfont yzm-iconshuoming"></i> 暂无数据</div><?php } ?>
  <div class="cl mt-5"> <span class="l"><input class="orderbutton btn-primary radius" onclick="mylistorder()" value="排序" type="button"></span></div>
  </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>
	//排序
	function mylistorder(){	
		document.getElementById('myform').action='<?php echo U('order');?>';
		document.getElementById('myform').submit();
	}
</script>
</body>
</html>