<?php
if(!defined('InEmpireCMS'))
{
	exit();
}
?>
<?php
$public_diyr['pagetitle']='消费记录';
$url="<a href=../../../>首页</a>&nbsp;>&nbsp;<a href=../cp/>会员中心</a>&nbsp;>&nbsp;消费记录";
require(ECMS_PATH.'e/template/incfile/header.php');
?>
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="tableborder">
          <tr class="header"> 
            <td width="55%" height="25"><div align="center">标题</div></td>
            <td width="16%" height="25"><div align="center">扣除点数</div></td>
            <td width="29%" height="25"><div align="center">时间</div></td>
          </tr>
	<?php
	while($r=$empire->fetch($sql))
	{
		$bk_in=$empire->fetch1("select * from {$dbtbpre}ecms_bookname_index where id=$r[bookid]");
		$bk=$empire->fetch1("select * from {$dbtbpre}ecms_bookname where id=$r[bookid]");
		if(!$bk[id]){
			$bookname='此书已删除';
		}else{
			$tbname=$emod_r[$bk_in[tid]][tbname];
			$nr=$empire->fetch1("select * from {$dbtbpre}ecms_".$tbname." where id='$r[id]'");
			//标题链接
			$titlelink=$nr[titleurl];
			if(!$nr['id'])
			{
				$r[title]="此信息已删除";
				$titlelink="#EmpireCMS";
			}
			if($r['online']==0)
			{
				$type='下载';
			}
			elseif($r['online']==2)
			{
				$type='阅读';
			}
		}

	?>
          <tr bgcolor="#FFFFFF"> 
            <td height="25">&nbsp;[<?=$type?>]&nbsp;<a href='<?=$titlelink?>' target='_blank'> 
              《<?=$bookname?>》<?=$r[title]?>
              </a> </td>
            <td height="25"><div align="center"> 
                <?=$r[cardfen]?>
              </div></td>
            <td height="25"><div align="center"> 
                <?=date("Y-m-d H:i:s",$r[truetime])?>
              </div></td>
          </tr>
          <?
	}
	?>
          <tr bgcolor="#FFFFFF"> 
            <td height="25" colspan="3"> 
              <?=$returnpage?> &nbsp;</td>
          </tr>
        </table>
<?php
require(ECMS_PATH.'e/template/incfile/footer.php');
?>