<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>数据管理</title>
<LINK href="<?=base_url()?>csdj/admin/images/admin.css" type="text/css" rel="stylesheet">
<SCRIPT type="text/javascript" src="<?=base_url()?>csdj/admin/js/admin.js?v23"></script>
<script type="text/javascript" src="<?=base_url()?>csdj/admin/js/dialog.js"></script>
<script type="text/javascript" src="<?=base_url()?>csdj/admin/js/ajaxrequest.js"></script>
<script type="text/javascript" src="<?=base_url()?>csdj/admin/js/setcolor.js"></script>
</head>
<body style="margin:2px">
 
	<table align="center" border="1" cellspacing="0" cellpadding="5" bordercolor="#C4DFF4" width="100%" style="border-collapse:collapse;" id="m_Imgs">
	<form name=form method=post action="<?=site_url('admin/gifts')?>">
	<tr><td align="center" height="20" colspan="9" class="title">会员积分礼品兑换记录    
	 ｜ <select OnChange="location.href='<?=site_url('admin/gifts')?>?sid='+this.value" style='width:120px'><option value=''>快速查找</option><option value="1">已完成</option><option value="2">已失败</option><option value="3">审核中</option><option value="4">处理中</option></select>
	 &nbsp;&nbsp;会员名：<input style="width:150px" name="user" type="text" value="">&nbsp;&nbsp;<INPUT type="submit" name="Submit" class="italk-bt" value=" 搜 索 ">
	</td></tr></form>
	<form method="post" Name="myForm" action="<?=site_url('admin/gifts/del')?>">
	<tr align="center">
		<td width="3%">选中</td>
		<td width="6%">ID</td>
		<td width="*">礼品标题</td>
		<td width="10%">会员</td>
        <td width="8%">积分</td>
		<td width="6%">状态</td>
		<td width="25%">收货地址</td>
		<td width="8%">时间</td>
		<td width="18%">操作</td>
	</tr>

<?php
 if(empty($gifts)) echo '<tr align="center"><td colspan="9" align="center">当前没有记录!</td></tr>';
 foreach ($gifts as $row) { 
         $rowu=$this->db->query("SELECT CS_ID,CS_Name FROM ".CS_SqlPrefix."user where cs_id=".$row->CS_UID."")->row();
?>
	<tr>
		<td align="center"><input type=checkbox Name="CS_ID[]" id="CS_ID[]" Value="<?=$row->CS_ID?>"></td>
		<td align="center"><?=$row->CS_ID?></td>
		<td align="center"><?=$row->CS_Name?></td>
		<td align="center"><a href="<?=$this->CsdjSkins->userlink('index',$rowu->CS_ID,$rowu->CS_Name)?>" target="_blank"><?=$rowu->CS_Name?></a></td>
		<td align="center"><?=$row->CS_Cion?></td>
		<td align="center">
<?php
if($row->CS_SID==1){
	echo '<font color=#ff6600>审核中</font>';
}elseif($row->CS_SID==2){
	echo '<font color=#ffcc00>已发货</font>';
}elseif($row->CS_SID==4){
	echo '<font color=#0000ff>已完成</font>';
}else{
	echo '<font color=red>未完成</font>';
}
?>
			</td>
		<td id="txs_<?=$row->CS_ID?>" align="left"><?=sub_str(str_replace("<br>","",$row->CS_Neir),15)?>... <A onclick="document.getElementById('tx_<?=$row->CS_ID?>').style.display='';document.getElementById('txs_<?=$row->CS_ID?>').style.display='none';return false" href="javascript:;">[查看详细]</A></td>
		<td style="display:none;" align="left" id="tx_<?=$row->CS_ID?>"><?=$row->CS_Neir?> <A onclick="document.getElementById('txs_<?=$row->CS_ID?>').style.display='';document.getElementById('tx_<?=$row->CS_ID?>').style.display='none';return false" href="javascript:;">[隐藏]</A></td>
<?php
		if(date("Y-m-d",$row->CS_AddTime)==date('Y-m-d')){
				$addtime="<font color=red>".date("Y-m-d",$row->CS_AddTime)."</font>";
		}else{
				$addtime=date("Y-m-d",$row->CS_AddTime);
		}
?>
		<td align="center"><?=$addtime?></td>
		<td align="center">
		<?php if($row->CS_SID<3){ ?>
		    <?php if($row->CS_SID!=2){ ?>
			<a href="<?=site_url('admin/gifts/fh_save/'.$row->CS_ID)?>?sid=1" onClick="return confirm('此操作为实物礼品，确定此操作吗?');">已经发货</a> ｜
			<?php } ?>
			<a href="<?=site_url('admin/gifts/fh_save/'.$row->CS_ID)?>?sid=2" onClick="return confirm('确定此操作吗?');">已经成功</a> ｜
			<a href="<?=site_url('admin/gifts/fh_save/'.$row->CS_ID)?>?sid=3" onClick="return confirm('确定此操作吗?');">已经失败</a>
		<?php }else{ ?>
            -----------------
		<?php } ?>
		</td>
	</tr>
<?php } ?>

	<tr><td colspan='9'><span style="float:right;">数据：<?=$nums?>条&nbsp;&nbsp;&nbsp;&nbsp;<?=$pages?></span>选中<input type="checkbox" name="chkall" onclick="CheckAll(this.form)" value="ON">
	&nbsp;&nbsp;<input type="submit" name="Submit1" class="italk-st3" value="批量删除所选" onClick="return confirm('您确定删除吗?')">
	</span>
	</td></tr></form></table>
</body>
</html>

