<!DOCTYPE html>
<html>
	<?php echo $this->fetch('head.html'); ?>
	<body>
<?php echo $this->fetch('fenlei/nav.html'); ?>
 <div id="searchbox" class="search-form" >
	<form id="searchform" action="/moduleadmin.php" autocomplete="off">
		<input type="hidden" name="m" value="fenlei">
		ID <input type="text"  class="w50" name="id" value="<?php echo intval($_GET['id']); ?>" />
		主题 <input type="text" class="w150" name="title" value="<?php echo $_GET['title']; ?>" />
	 
		分类 
		<select name="catid" class="w100">
			<option value="0">请选择</option>
			<?php $_from = $this->_var['catlist']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
				<option value="<?php echo $this->_var['c']['catid']; ?>" <?php if (get ( "catid" ) == $this->_var['c']['catid']): ?>selected<?php endif; ?>><?php echo $this->_var['c']['title']; ?></option>
				<?php if ($this->_var['c']['child']): ?>
				<?php $_from = $this->_var['c']['child']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'cc');if (count($_from)):
    foreach ($_from AS $this->_var['cc']):
?>
				<option value="<?php echo $this->_var['cc']['catid']; ?>" <?php if (get ( "catid" ) == $this->_var['cc']['catid']): ?>selected<?php endif; ?>>|--<?php echo $this->_var['cc']['title']; ?></option>
				<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
				<?php endif; ?>
			<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
		</select>
		红包<input type="checkbox" <?php if (get ( "hb_on" ) == 1): ?>checked<?php endif; ?> name="hb_on" value="1" />
		推荐 <input <?php if (get ( "isrecommend" )): ?>checked<?php endif; ?> type="checkbox" name="isrecommend" value="1" />
		首页 <input <?php if (get ( "isindex" )): ?>checked<?php endif; ?> type="checkbox" name="isindex" value="1" />
		<button type="submit" class="btn" >搜索</button>
		 
	</form>
</div>
<div class="main-body">
<form id="cForm">	
 <table class="tbs">
<thead>  <tr>
   <td>id</td>
   <td>标题</td>
   <td>图片</td>
 <td>分类</td>
   <td>电话</td>
   
   <td>状态</td>
   <td>首页</td>
   <td>推荐</td>
   <td>支付</td>
   <td>红包</td>
   <td>访问</td>
 
<td>操作</td></tr>
  </tr>
</thead> <?php $_from = $this->_var['list']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
<tr>
   <td><?php echo $this->_var['c']['id']; ?><input type="checkbox" class="ids"  name="ids[]" value="<?php echo $this->_var['c']['id']; ?>" /></td>
   <td style="width: 180px;"><?php echo $this->_var['c']['title']; ?></td>
   <td><?php if ($this->_var['c']['imgurl']): ?><img src="<?php echo images_site($this->_var['c']['imgurl']); ?>.100x100.jpg" width="50" /><?php endif; ?></td>
  <td><?php echo $this->_var['c']['catid_name']; ?></td>
   <td><?php echo $this->_var['c']['telephone']; ?></td>
   
   
   <td><div class="<?php if ($this->_var['c']['status'] == 1): ?>yes<?php else: ?>no<?php endif; ?> js-toggle-status" url="/moduleadmin.php?m=fenlei&a=status&id=<?php echo $this->_var['c']['id']; ?>&ajax=1" ></div></td>
    <td><div class="<?php if ($this->_var['c']['isindex'] == 1): ?>yes<?php else: ?>no<?php endif; ?> js-toggle-status" url="/moduleadmin.php?m=fenlei&a=index&id=<?php echo $this->_var['c']['id']; ?>&ajax=1" ></div></td>
    <td><div class="<?php if ($this->_var['c']['isrecommend'] == 1): ?>yes<?php else: ?>no<?php endif; ?> js-toggle-status" url="/moduleadmin.php?m=fenlei&a=recommend&id=<?php echo $this->_var['c']['id']; ?>&ajax=1" ></div></td>
   <td><?php if ($this->_var['c']['ispay']): ?>已支付<?php else: ?>未支付<?php endif; ?>/￥<?php echo $this->_var['c']['paymoney']; ?></td>
   
   
   <td><?php echo $this->_var['c']['hb_money']; ?>元</td> 
  
    
   
   <td><?php echo $this->_var['c']['view_num']; ?></td>
   
<td><a href="/moduleadmin.php?m=fenlei&a=add&id=<?php echo $this->_var['c']['id']; ?>">编辑</a> 
<a href="/module.php?m=fenlei&a=show&id=<?php echo $this->_var['c']['id']; ?>" target="_blank">查看</a> 
<a href="javascript:;" class="js-delete" url="/moduleadmin.php?m=fenlei&a=delete&id=<?php echo $this->_var['c']['id']; ?>&ajax=1">删除</a></td>
  </tr>
   <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
 </table>
 <div class="flex flex-ai-center pdt-5">
  	<input type="checkbox" class="chkall"  />&nbsp;
  	分类：    <select name="catid" class="w100 mgr-5">
  	<option value="0">请选择</option>
  	<?php $_from = $this->_var['catlist']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
  		<option value="<?php echo $this->_var['c']['catid']; ?>" <?php if (get ( "catid" ) == $this->_var['c']['catid']): ?>selected<?php endif; ?>><?php echo $this->_var['c']['title']; ?></option>
  		<?php if ($this->_var['c']['child']): ?>
  		<?php $_from = $this->_var['c']['child']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'cc');if (count($_from)):
    foreach ($_from AS $this->_var['cc']):
?>
  		<option value="<?php echo $this->_var['cc']['catid']; ?>" <?php if (get ( "catid" ) == $this->_var['cc']['catid']): ?>selected<?php endif; ?>>|--<?php echo $this->_var['cc']['title']; ?></option>
  		<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
  		<?php endif; ?>
  	<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
  	</select>
  	
  	<div  class="btn mgr-10"  id="changeCategory">修改分类</div>
 		聚合：
 		<select name="tagid" class="w100 mgr-5">
 			<option value="0">请选择</option>
 			<?php $_from = $this->_var['taglist']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
 			<option value="<?php echo $this->_var['c']['tagid']; ?>"><?php echo $this->_var['c']['title']; ?></option>
 			<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
 		</select>
 		<div  class="btn"  id="changeGroup">聚合产品</div>
 	 </div>
 </form>	
<div><?php echo $this->_var['pagelist']; ?></div>
</div> 
<?php echo $this->fetch('footer.html'); ?>
<script src="/plugin/laydate/laydate.js"></script>
<script>
	laydate.render({
		elem:"#stime"
	})
	laydate.render({
		elem:"#etime"
	});
</script>
<script>
		$(".chkall").click(function(){
			if($(this).prop("checked")==true){
				$(".ids").prop("checked",true);
			}else{
				$(".ids").prop("checked",false);
			}
		});
		$(document).on("click","#changeCategory",function(){
			$.post("/moduleadmin.php?m=fenlei&a=category&ajax=1",$("#cForm").serialize(),function(res){
				skyToast(res.message);
				if(!res.error){
					window.location.reload();
				}
			},"json");
		})
		$(document).on("click","#changeGroup",function(){
			$.post("/moduleadmin.php?m=fenlei&a=tags&ajax=1",$("#cForm").serialize(),function(res){
				skyToast(res.message);
				if(!res.error){
					window.location.reload();
				}
			},"json");
		})
		</script>
</body>
</html>