<?php
/*
	[Phpup.Net!] (C)2009-2011 Phpup.net.
	This is NOT a freeware, use is subject to license terms

	$Id: admin.class.php 2010-08-24 10:42 $
*/

if(!defined('IN_PHPUP')) {
	exit('Access Denied');
}
?>
<?php include ROOT_PATH.'/views/admin/header.php';?>
<body>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <A HREF="index.php?pluginid=coupon&con=admin&act=couponattach"  class="add fb"><em>采集优惠券</em></A> <A HREF="index.php?pluginid=coupon&con=admin&act=couponmodify"  class="add fb"><em>添加优惠券</em></A>
	</div>
</div>

<form action="index.php?pluginid=coupon&con=admin&act=multicoupon" method="post">
<input type="hidden" name="commit" value="1"/>
<div class="table-list">
<TABLE cellpadding="1" cellspacing="1" width="100%">
<thead>
<TR>
	<TH></TH>
	<TH width="500px">标题</TH>
	
	<TH>价格</TH>
	<TH>已领取</TH>
	<TH>有效期</TH>
	<TH>发券商家</TH>
	<TH>所属分类</TH>
	<TH>状态</TH>
	<TH>操作</TH>
</TR>
</thead>
<tbody>
<?php foreach($coupons['data'] as $key=>$val){?>
<TR class="tr<?php echo $key%2;?>" id="groups<?php echo $val['id'];?>">
	<td> <input type="checkbox" value="<?php echo $val['id'];?>"  name="gid[]" class="checkedall"></td>

	<TD style="text-align:left;">
	<div><?php echo $val['title'];?></div>
	</TD>

	<TD style="text-align:center;">
	<div id="groupsite-<?php echo $val['id'];?>" ><?php echo $val['sale_price'];?></div>
	</TD>

	<TD style="text-align:center;">
	<?php  echo $val['sales_num']; ?>
	</TD>

	<TD style="text-align:center;"><?php  echo date('Y-m-d',$val['start_time']);  ?>-<?php  echo date('Y-m-d',$val['close_time']);  ?>
	</TD>
	<TD style="text-align:center;">
	<?php echo $val['merchant_name'];?>
	</TD>

	<TD style="text-align:center;">
	<?php echo isset($tempcate[$val['class']])?$tempcate[$val['class']]:'未分类';?>
	</TD>	
	


	<TD  style="text-align:center;"><?php if($val['close_time'] > time() ) { echo "未过期";  }else{ echo "已过期"; }   ?></TD>


	<TD style="text-align:center;">
	<A HREF="index.php?pluginid=coupon&con=admin&act=couponmodify&updateid=<?php echo $val['id'];   ?>">修改</A>
	<A HREF="javascript:deleteVal('plugin_coupon','<?php echo $val['id'];?>','groups<?php echo $val['id'];?>','id')">删除</A>
	</TD>
</TR>
<?php }?>
</tbody>
</TABLE>
</div>


<div class="btn">
<INPUT TYPE="checkbox" NAME="" id="checkall" onclick="$('.checkedall').attr('checked',$(this).attr('checked'));">&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" class="normal_button" value="批量删除" onclick="return confirm('确认删除？');" name="confirmbutton"/>

</div>
<div class="pages" style="padding:10px;text-align:center;"><?php echo $coupons['pageinfo'];?></div>
</form>



</body>
</html>
