<%@ Control Language="C#" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.BLL" %>
<%@ Import Namespace="Kesion.Config" %>
<%@ Import Namespace="Kesion.Components" %>
<%@ Import Namespace="Kesion.HtmlTags" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="Kesion.Course" %>
<script runat="server" type="text/C#">

    dynamic __user = HttpContext.Current.Items["user"];                //初始化用户信息，
    private static dynamic __info = new System.Dynamic.ExpandoObject();   //初始化当前页信息

    public int recordcount, pagecount;
    public int PageIndex = new BasicField().GetCurrPage;
    public int pagesize = 10;


    public void reckonCashMoneys() 
    {
        using (DataTable dt = DataFactory.GetDataTable("select *  from  KS_CosLiveac a inner join KS_CosLiveacclass b on a.acid=b.ID where  acepter='"+__user.UserName+"'")) 
        {
            if (dt.Rows.Count > 0)
            {
                float count = 0;
                foreach (DataRow dr in dt.Rows)
                {
                    int num = Utils.StrToInt(dr["sendnum"].ToString());//赠送数量
                    float money = Utils.StrToFloat(dr["CASHMONEYS"].ToString());
                    count = (Utils.StrToFloat(num.ToString()) * money)+count;
                }
                KSCMS.W(count.ToString());
            } 
            else {
                KSCMS.W("0");
            }
        }
    }
    
</script>


<div class="t_tybox ">
    <div class="tytitle"><h4>直播道具提现</h4></div>
    <div class="clear"></div>
    <div class="tabs">	
      <ul class="clearfix">
          <li class="puton"><a href="<%=BasicField.GetUserUrl("Course/MyInteractRecord") %>">道具提现</a></li>	  			
      </ul>
    </div>
    <div>
        可提现额度：<%reckonCashMoneys(); %>
    </div>
           <table id="tablist" width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
                 <tr align="center" class="title">
                    <td>编号</td>
                    <td>赠送者</td>
                    <td>赠送数量</td>
                    <td>赠送时间</td>
                    <td>赠送道具</td>
                    <td>获得的提现额度</td>
                </tr>
        <%
            string sqlParam = " KS_CosLiveac  Where acepter='" + __user.UserName+"'";
            using (DataTable dt = DataFactory.GetPage("*", sqlParam, "id", "order by id desc", PageIndex, pagesize, out recordcount, out pagecount))
            {
                if (dt.Rows.Count > 0)
                {
                    foreach(DataRow dr in dt.Rows)
                    {
                    %>
         <tr class="tdbg">
             <td  align="center"><%=dr["id"].ToString() %></td> 
             <td  align="center"><%=dr["sender"].ToString() %></td>
             <td  align="center"><%=dr["sendnum"].ToString() %></td>  
             <td  align="center"><%=dr["senddate"].ToString() %></td>
             <td  align="center"><%=DataFactory.GetOnlyValue("select top 1 acname from KS_CosLiveacclass where id="+dr["acid"].ToString()) %></td>
             <td  align="center"><%=Kesion.APPCode.Public.ReturnShopPrice(DataFactory.GetOnlyValue("select top 1 cashmoneys from KS_CosLiveacclass where id="+dr["acid"].ToString()))+"数量："+dr["sendnum"].ToString()  %></td> 
        </tr>
        <%
                    }
                }
                else {
                    KSCMS.W("<tr class=\"tdbg\"> <td colspan=\"6\" style=\"border-bottom:0px;\"><div class=\"clear blank10\"></div><div class=\"empty\">暂无收到的道具记录！</div></td></tr>");
                }
            }
             
              %>
    </table>
      <div class="fy_box fy_center">
	 <%
            #region 分页
            string PageStr = "[KS:PageStr1]";
            BasicField.ReplaceFilterPage(ref PageStr, PageIndex, pagesize, pagecount, recordcount);
            KSCMS.W(PageStr);
            #endregion
         %>
     </div>

</div>














































