<%template _header%>
<div class="wrap s_clear pageinfo">
	<div id="nav">
		<a href="{config.forumurl}" class="title">{config.forumtitle}</a> &raquo;{ShowForumAspxRewrite(forum.Pathlist.Trim(),forumid,forumpageid)}
		 <%set {aspxrewriteurl} = this.ShowTopicAspxRewrite({topicid},0)%>
	     &raquo; <a href="{aspxrewriteurl}">{topic.title}</a> &raquo; <strong>交易信息</strong>
	</div>
</div>
<%if page_err==0%>
	<%if {ispost}%>
		<%template _msgbox%>
	<%else%>
    <div class="wrap s_clear" id="wrap">
	<div class="main datalist">
	    <%if {buyit}==1%>
		    <form id="form1" name="form1" method="post" action="">
		    <table cellpadding="0" cellspacing="0" border="0" summary="购买主题" class="datatable infotable">
		    <tbody>
		    <tr>
			    <th>用户名:</th>
			    <td>{username} [<a href="logout.aspx?userkey={userkey}">退出登录</a>]</td>
		    </tr>
		    <tr>
			    <th>作者:</th>
			    <td><%set {aspxrewriteurl} = this.UserInfoAspxRewrite({topic.Posterid})%>
			    <a href="{aspxrewriteurl}">{topic.Poster}</a>
			    </td>
		    </tr>
		    <tr>
			    <th>标题:</th>
			    <td class="datatitle">
			    <%set {aspxrewriteurl} = this.ShowTopicAspxRewrite({topicid},0)%>
			    <a href="{aspxrewriteurl}">{topic.title}</a>
			    </td>
		    </tr>
		    <tr>
			    <th>售价({userextcreditsinfo.name}):</th>
			    <td>{topicprice}</td>
		    </tr>
		    <tr>
			    <th>作者所得({userextcreditsinfo.name}):</th>
			    <td>{netamount}</td>
		    </tr>
		    <tr>
			    <th>购买后余额({userextcreditsinfo.name}):</th>
			    <td>{userlastprice}</td>
		    </tr>
		    <tr>
			    <th>&nbsp;</th>
			    <td>
			    <input type="submit" name="paysubmit" value="提交">
			    </td>
		    </tr>
		    </tbody>
		    </table>
		    </form>
        <%else%>
	        <%if {showpayments}==1%>
	            <%if {paymentloglist.Rows.Count}>0%>
		        <table cellpadding="0" cellspacing="0" border="0"  summary="购买主题"  class="datatable infotable">
			        <thead>
			        <tr>
				        <th>{userextcreditsinfo.name}</th>
				        <th>用户名</th>
				        <th>时间</th>
			        </tr>
			        </thead>
			        <%loop paymentlog paymentloglist%>
			        <tbody>
			        <tr>
				        <td><div class="ForumBuyTopicLeft">{paymentlog[amount]}</div></td>
				        <th><%set {aspxrewriteurl} = this.UserInfoAspxRewrite({paymentlog[uid]})%>
                          <a href="{aspxrewriteurl}" target="_blank">{paymentlog[username]}</a></th>
				        <td>{paymentlog[buydate]}</td>
			        </tr>
			        </tbody>
			        <%/loop%>
		        </table>
		        <%else%>
		        该主题暂无购买记录
	            <%/if%>
	        <%/if%>
	        <%if {price}>0%>
	        <h3>标题:{topic.title}</h3>
	        {postmessage}
	        <table cellpadding="0" cellspacing="0" border="0"  class="datatable infotable">
	        <thead>
	        <tr>
		        <th>&nbsp</th>
		        <td>本主题需向作者支付相应积分才能浏览，您可根据作者信誉、出售价格及已购买用户的评价确定购买与否。</td>
	        </tr>
	        </thead>
	        <tbody>
	        <tr>
		        <th >售价({userextcreditsinfo.name})</th>
		        <td>{topicprice}</td>
	        </tr>
	        <tr>
		        <th>积分交易税</th>
		        <td>{creditstax}%</td>
	        </tr>
	        <tr>
		        <th>作者所得({userextcreditsinfo.name})</th>
		        <td>{netamount}</td>
	        </tr>
	        <tr>
		        <th>已购买人数</th>
		        <td>{buyers}</td>
	        </tr>
	        <tr>
		        <th>作者最高收入({userextcreditsinfo.name})</th>
		        <td>{maxincpertopic}</td>
	        </tr>
	        <tr>
		        <th>强制免费期限(小时)</th>
		        <td>{maxchargespan}</td>
	        </tr>
	        <tr>
		        <th>&nbsp;</th>
		        <td>
		        <a href="buytopic.aspx?topicid={topicid}&showpayments=1">[查看付款记录]</a><a href="buytopic.aspx?topicid={topicid}&buyit=1">[购买主题]</a> <a href="#" onclick="history.go(-1)">[返回上一页]</a>
		        </td>
	        </tr>
	        </tbody>
	        </table>
	        <h3>最后5帖</h3>
	        <table cellpadding="0" cellspacing="0" border="0"  class="datatable infotable">
	        <%loop lastpost lastpostlist%>
	        <tbody>
	        <tr>
		        <th><%set {aspxrewriteurl} = this.UserInfoAspxRewrite({lastpost[posterid]})%>
		        <a href="{aspxrewriteurl}"><strong>{lastpost[poster]}</strong></a>&nbsp;&nbsp;{lastpost[postdatetime]}
		        </th>
	        </tr>
	        <tr>
		        <td>{lastpost[message]}</td>
	        </tr>
	        </tbody>
	        <%/loop%>
	        </table>
	        <%else%>
		        此主题无需购买
	        <%/if%>
        <%/if%>
    <%/if%>
    </div>
    </div>
<%else%>
	<%if {needlogin}%>
		<%template _login%>
	<%else%>
		<%template _errmsgbox%>
	<%/if%>
<%/if%>
<%template _copyright%>
<%template _footer%>