<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:57:"E:\xampp\htdocs\public/../app/admin\view\goods\index.html";i:1540537168;s:57:"E:\xampp\htdocs\public/../app/admin\view\public\base.html";i:1532530212;}*/ ?>
<!DOCTYPE html><html><head><title>商品列表_后台管理</title><meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="<?php echo sysconfig('CMS_BASEHOST'); ?>/css/bootstrap.min.css"><link rel="stylesheet" href="<?php echo sysconfig('CMS_BASEHOST'); ?>/css/admin.css">
<script src="<?php echo sysconfig('CMS_BASEHOST'); ?>/js/jquery.min.js"></script><script src="<?php echo sysconfig('CMS_BASEHOST'); ?>/js/respond.min.js"></script><script src="<?php echo sysconfig('CMS_BASEHOST'); ?>/js/ad.js"></script><script src="<?php echo sysconfig('CMS_BASEHOST'); ?>/js/bootstrap.min.js"></script><script type="text/javascript" src="<?php echo sysconfig('CMS_BASEHOST'); ?>/js/jquery.uploadify.min.js"></script></head><body>

<h5 class="sub-header"><a href="<?php echo url('admin/Goodstype/index'); ?>">商品分类</a> > <a href="<?php echo url('index'); ?>">商品列表</a> [ <a href="<?php echo url('add'); if(!empty($_GET["id"])){echo '?catid='.$_GET["id"];}?>">发布商品</a> ]</h5>

<div class="table-responsive">
<table class="table table-striped table-hover">
  <thead>
	<tr>
	  <th>ID</th>
	  <th>选择</th>
	  <th>商品标题</th>
	  <th>更新时间</th>
	  <th>类目</th><th>点击</th><th>操作</th>
	</tr>
  </thead>
  <tbody>
  <?php foreach($posts as $row){ ?>
	<tr>
	  <td><?php echo $row["id"]; ?></td>
	  <td><input name="arcID" type="checkbox" value="<?php echo $row["id"]; ?>" class="np"></td>
	  <td><a href="<?php echo url('edit'); ?>?id=<?php echo $row["id"]; ?>"><?php echo $row["title"]; ?></a> <?php if(!empty($row["litpic"])){echo "<small style='color:red'>[图]</small>";} ?> </td>
	  <td><?php echo date('Y-m-d',$row["pubdate"]); ?></td>
	  <td><a href="<?php echo url('index'); ?>?id=<?php echo $row["typeid"]; ?>"><?php echo $row["name"]; ?></a></td><td><?php echo $row["click"]; ?></td><td><a target="_blank" href="<?php echo get_front_url(array("type"=>"content","catid"=>$row["typeid"],"id"=>$row["id"])); ?>">预览</a>&nbsp;<a href="<?php echo url('edit'); ?>?id=<?php echo $row["id"]; ?>">修改</a>&nbsp;<a onclick="delconfirm('<?php echo url('del'); ?>?id=<?php echo $row["id"]; ?>')" href="javascript:;">删除</a></td>
	</tr>
	<?php } ?>
	<tr>
		<td colspan="8">
		<a href="javascript:selAll('arcID')" class="coolbg">反选</a>&nbsp;
		<a href="javascript:delArc()" class="coolbg">删除</a>&nbsp;
		<a href="javascript:tjArc()" class="coolbg">特荐</a>
		</td>
	</tr>
  </tbody>
</table>
</div><!-- 表格结束 -->
<div>
<form id="searcharc" class="navbar-form" action="<?php echo url('index'); ?>" method="get">
<select name="typeid" id="typeid" style="padding:6px 5px;vertical-align:middle;border:1px solid #DBDBDB;border-radius:4px;">
<option value="0">选择栏目...</option>
<?php $catlist = tree(get_category('goods_type',0));foreach($catlist as $row){ ?><option value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "—";}echo $row["name"]; ?></option><?php } ?>
</select>
<div class="form-group"><input type="text" name="keyword" id="keyword" class="form-control required" placeholder="搜索关键词..."></div>
<button type="submit" class="btn btn-info" value="Submit">搜索一下</button></form>

<div class="backpages"><?php echo $page; ?></div>

<script>
//批量删除商品
function delArc(aid)
{
	var checkvalue=getItems();
	
	if(checkvalue=='')
	{
		alert('必须选择一个或多个文档！');
		return;
	}
	
	if(confirm("确定删除吗"))
	{
		location="<?php echo url('del'); ?>?id="+checkvalue;
	}
	else
	{
		
	}
}

//推荐商品
function tjArc(aid)
{
	var checkvalue=getItems();
	
	if(checkvalue=='')
	{
		alert('必须选择一个或多个文档！');
		return;
	}
	
	if(confirm("确定要推荐吗"))
	{
		location="<?php echo url('recommendarc'); ?>?id="+checkvalue;
	}
	else
	{
		
	}
}

$(function(){
	$('.required').on('focus', function() {
		$(this).removeClass('input-error');
	});
	
    $("#searcharc").submit(function(e){
		$(this).find('.required').each(function(){
			if( $(this).val() == "" )
			{
				e.preventDefault();
				$(this).addClass('input-error');
			}
			else
			{
				$(this).removeClass('input-error');
			}
		});
    });
});
</script>

</body></html>