<%@ 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="Kesion.XML" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Xml" %>

<script runat="server" type="text/C#">

    dynamic __user = HttpContext.Current.Items["user"];                //初始化用户信息
    string sql = string.Empty;//购买考试分类任务表查询语句

    int recordcount, pagecount;//分页的参数信息
    int pagesize =15;
    int PageIndex = new BasicField().GetCurrPage;
    protected void Page_Load(object sender, EventArgs e)
    {
        sql = " KS_SJBuyClassItem where userid=" + __user.UserID; //确定每个用户信息
        string action = KSCMS.S("action");
        if (string.IsNullOrEmpty(action)) { action = KSCMS.S("do"); }
        switch (action)
        {
            case "dobuy"://余额支付
                dobuy();
                break;


        }
    }

    //余额支付信息
    public void dobuy()
    {
        UserInfo __info = UserManage.GetUserInfo();//获取当前用户信息
        string username = UserManage.GetUserInfo().UserName;//获取用户名
        string classid = KSCMS.S("classid");
        if (classid == "0" || string.IsNullOrEmpty(classid))
        {
            Msg.Alert("选择出错，请检查您是否选择了购买考试分类信息！", KSCMS.GetComeUrl());
            return;
        }
        //先检查考核项目中是否存在选中的项目信息
        using (DataTable dt = DataFactory.GetDataTable("select top 1  classid,money,ExpiryMonth,ParentID,IsBuyChild,classname  from KS_SJclass where classid in (" + Utils.FilterIDs(classid) + ")"))
        {
            if (dt.Rows.Count <= 0)
            {
                Msg.Alert("出错啦，找不到您要购买的考试分类信息！", KSCMS.GetComeUrl());
                return;
            }
            else
            {
                //string repetitionpackname = string.Empty;//存储重复购买的项目名称
                float money = 0;
                foreach (DataRow dr in dt.Rows)
                {

                    money += Utils.StrToFloat(dr["money"].ToString());//购买所需要消费总金额
                }
                //首先检查用户余额是否能够购买项目信息
                if (__info.Money < money)
                {
                    //金额不足跳向充值页面
                    Msg.Alert("对不起，您可用金额不足，您选择的考试分类共需要消费" + money + "元，您当前的可用余额为" + __info.Money + "元，请先充值再来购买！", BasicField.GetUserUrl("basic/PayOnline"));
                    return;
                }
                //由于可以选多个  所以要用循环解决问题
                foreach (DataRow dr in dt.Rows)
                {
                    //int repetitionpackid = 0;//存储重复购买的id信息
                    int checkid = Utils.StrToInt(dr["classid"].ToString());//试卷分类的id信息
                    float price = Utils.StrToFloat(dr["money"].ToString(), 0);//试卷分类的出售价格
                    if (price > 0)
                    {
                        if (Charge.MoneyInOrOut(__info.UserID, __info.RealName, price, 1, 2, checkid.ToString(), "system", "购买考试分类[" + dr["classname"].ToString() + "]!", -502, 0, 1))//-502  购买试卷分类的信息
                        {
                            int ExpiryMonth = Utils.StrToInt(dr["ExpiryMonth"].ToString());
                            Hashtable ht = new Hashtable();
                            ht.Add("username", __info.UserName);
                            ht.Add("userid", __info.UserID);
                            ht.Add("AddDate", DateTime.Now);
                            ht.Add("ExpiryMonth",ExpiryMonth);
                            ht.Add("ExpiryDate", DateTime.Now.AddMonths(ExpiryMonth));
                            ht.Add("SjclassId", checkid);//存储考试分类信息
                            ht.Add("price", price);//存储考试分类出售价格信息
                            ht.Add("classname", dr["classname"].ToString());//存储考试分类名称
                            ht.Add("ChildClassids", Kesion.HtmlTags.Function.GetSJCategoryChildID(checkid));
                            ht.Add("ParentID", Utils.StrToInt(dr["ParentID"].ToString()));
                            try
                            {
                                if (!DataFactory.Exists("KS_SJBuyClassItem", "SjclassId=" + checkid + " and userid=" + __user.UserID))
                                {
                                    CommonData.Insert("KS_SJBuyClassItem", ht);//明细表增加信息

                                    int parentid = Utils.StrToInt(dr["ParentID"].ToString());

                                    if (parentid == 0)
                                    {
                                        #region 大分类下的子分类
                                        using (DataTable dt2 = DataFactory.GetDataTable("select classid,money,ExpiryMonth,ParentID,IsBuyChild,classname from KS_SJclass where classid in (" + Kesion.HtmlTags.Function.GetSJCategoryChildID(checkid) + ")"))
                                        {
                                            if (dt2.Rows.Count > 0)
                                            {
                                                foreach (DataRow dr2 in dt2.Rows)
                                                {
                                                    int cclasssid = Utils.StrToInt(dr2["classid"].ToString());

                                                    if (!DataFactory.Exists("KS_SJBuyClassItem", "SjclassId=" + cclasssid + " and userid=" + __user.UserID))
                                                    {
                                                        #region 不存在才插入
                                                        ht.Clear();
                                                        ht.Add("username", __info.UserName);
                                                        ht.Add("userid", __info.UserID);
                                                        ht.Add("AddDate", DateTime.Now);
                                                        ht.Add("ExpiryMonth", ExpiryMonth);
                                                        ht.Add("ExpiryDate", DateTime.Now.AddMonths(ExpiryMonth));
                                                        ht.Add("SjclassId", cclasssid);//存储考试分类信息
                                                        ht.Add("price", 0);//存储考试分类出售价格信息
                                                        ht.Add("classname", dr2["classname"].ToString());//存储考试分类名称
                                                        ht.Add("ChildClassids", Kesion.HtmlTags.Function.GetSJCategoryChildID(cclasssid));
                                                        ht.Add("ParentID", Utils.StrToInt(dr2["ParentID"].ToString()));
                                                        CommonData.Insert("KS_SJBuyClassItem", ht);//明细表增加信息
                                                        #endregion
                                                    }
                                                    else
                                                    {

                                                        ht.Clear();
                                                        ht.Add("ExpiryMonth", ExpiryMonth);
                                                        ht.Add("ExpiryDate", DateTime.Now.AddMonths(ExpiryMonth));
                                                        CommonData.Update("KS_SJBuyClassItem", ht, "where SjclassId=" + cclasssid + " and userid=" + __user.UserID);

                                                        // DataFactory.ExecuteNonQuery("update  KS_SJBuyClassItem set ExpiryMonth="+ExpiryMonth+",ExpiryDate='"+DateTime.Now.AddMonths(ExpiryMonth)+"'  where SjclassId=" + cclasssid + " and userid=" + __user.UserID);

                                                    }



                                                }
                                            }


                                        }
                                        #endregion

                                    }
                                    else
                                    {

                                        #region 子分类的情况下
                                        using (DataTable dt2 = DataFactory.GetDataTable("select classid,money,ExpiryMonth,ParentID,IsBuyChild,classname from KS_SJclass where ParentID in (" + Kesion.HtmlTags.Function.GetSJCategoryChildID(checkid) + ")"))
                                        {
                                            if (dt2.Rows.Count > 0)
                                            {
                                                foreach (DataRow dr2 in dt2.Rows)
                                                {
                                                    int cclasssid = Utils.StrToInt(dr2["classid"].ToString());

                                                    if (!DataFactory.Exists("KS_SJBuyClassItem", "SjclassId=" + cclasssid + " and userid=" + __user.UserID))
                                                    {
                                                        #region 不存在才插入表
                                                        ht.Clear();
                                                        ht.Add("username", __info.UserName);
                                                        ht.Add("userid", __info.UserID);
                                                        ht.Add("AddDate", DateTime.Now);
                                                        ht.Add("ExpiryMonth", ExpiryMonth);
                                                        ht.Add("ExpiryDate", DateTime.Now.AddMonths(ExpiryMonth));
                                                        ht.Add("SjclassId", cclasssid);//存储考试分类信息
                                                        ht.Add("price", 0);//存储考试分类出售价格信息
                                                        ht.Add("classname", dr2["classname"].ToString());//存储考试分类名称
                                                        ht.Add("ChildClassids", Kesion.HtmlTags.Function.GetSJCategoryChildID(cclasssid));
                                                         ht.Add("ParentID", Utils.StrToInt(dr2["ParentID"].ToString()));
                                                        CommonData.Insert("KS_SJBuyClassItem", ht);//明细表增加信息
                                                        #endregion
                                                    }
                                                    else
                                                    {
                                                        ht.Clear();
                                                        ht.Add("ExpiryMonth", ExpiryMonth);
                                                        ht.Add("ExpiryDate", DateTime.Now.AddMonths(ExpiryMonth));
                                                        CommonData.Update("KS_SJBuyClassItem", ht, "where SjclassId=" + cclasssid + " and userid=" + __user.UserID);
                                                    }



                                                }
                                            }


                                        }
                                        #endregion

                                    }



                                }

                                Msg.Alert("恭喜，购买考试分类成功！", BasicField.GetUserUrl("exam/Mysjclass"));
                                return;
                            }
                            catch
                            {
                                Msg.Alert("购买考试分类失败！", KSCMS.GetComeUrl());
                                return;
                            }
                        }
                        else
                        {
                            Msg.Alert("购买考试分类失败！", KSCMS.GetComeUrl());
                            return;
                        }
                    }
                    else
                    {
                        //免费直接进行记录增加
                        Msg.Alert("当前是免费无需购买!", BasicField.GetUserUrl("exam/Mysjclass"));
                        return;
                    }
                }
            }
        }
    }
    #region  获取相关信息条件
    //获取学完的课程数量

    //购买状态信息
    public int showorhide(int packid)
    {
        //int count = Utils.StrToInt(DataFactory.GetOnlyValue("select count(1) from KS_SJBuyClassItem where userid=" + __user.UserID + " and SjclassId =" + packid), 0);
        using (DataTable dt = DataFactory.GetDataTable("select ExpiryMonth,ExpiryDate,SjclassId from KS_SJBuyClassItem where  userid=" + new TemporaryVar().UserID + "  and SjclassId=" + packid))
        {
            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                int SjclassId = Utils.StrToInt(dr["SjclassId"].ToString());
                int ExpiryMonth = Utils.StrToInt(dr["ExpiryMonth"].ToString());
                if (ExpiryMonth > 0)
                {
                    if (Convert.ToDateTime(dr["ExpiryDate"]) >= Convert.ToDateTime(Utils.GetDateTime()))
                    {
                        return 1;//已购买
                    }
                    else
                    {
                        return 0;//未购买
                    }

                }
                else
                {
                    return 1;//已购买
                }
            }
            else
            {
                return 0;//未购买
            }
        }

    }
    //获取价格信息
    public string getpackageprice(string price)
    {
        string pakeprice = string.Empty;

        pakeprice = MyCache.GetCurrencySymbol + Kesion.APPCode.Public.ReturnShopPrice(price) + MyCache.GetCurrencyUnit;
        return pakeprice;


    }


    //获取试卷分类的试卷数量和试题数量
    public string getcheckInfo(int classid)
    {
        StringBuilder sb = new StringBuilder();

        string sjall = DataFactory.GetOnlyValue("select count(1) from KS_Sj where  classid in(" + Function.GetSJCategoryChildID(classid) + ")");//所有试卷
        string tkall = DataFactory.GetOnlyValue("select count(1) from KS_SJTK where classid in(" + Function.GetSJCategoryChildID(classid) + ")");//所有试题
        string childall = DataFactory.GetOnlyValue("select count(1) from KS_SJClass where ParentID in(" + Function.GetSJCategoryChildID(classid) + ")");//所有试题
        sb.AppendFormat(@"<span class=""coursenum"" data-num=""{0}"">{1}个子分类</span><span class=""coursenum"" data-num=""{0}"">{0}份试卷</span>
     <span class=""examnum"" data-num=""{2}"">{2}试题</span>", sjall, childall, tkall);
        return sb.ToString();
    }
    #endregion


    public string getClassName(int classId, string sName, Int16 Child, Int16 NextID, Int16 Depth, Int16 ClassType)
    {
        string sStr = string.Empty;
        for (int i = 1; i < Depth; i++)
        {
            sStr += "&nbsp;&nbsp;&nbsp;&nbsp;";
        }
        if (ClassType == 2)
            sName += "<font color=green>(外)</font>";
        else if (ClassType.Equals(3))
            sName += "<font color=blue>(单)</font>";
        if (Child > 0 && KSCMS.S("action") != "showall") sName += " [+]";

        if (Child > 0)
        {
            return sStr + "<span class='tree_Close' id='C" + classId + "'></span>" + sName;
        }
        else
        {
            return sStr + "<span class='tree_Open' id='C" + classId + "'></span>" + sName;
        }
    }


</script>
<style>
    .tree_Open {
    vertical-align: middle;
    background: url(/admin/images/all_icon.png) no-repeat -240px -213px;
    display: inline-block;
    height: 19px;
    width: 24px;
}
    .tree_Close {
    vertical-align: middle;
    background: url(/admin/images/all_icon.png) no-repeat -269px -213px;
    display: inline-block;
    height: 19px;
    width: 24px;
}
</style>
<div class="r_tybox nomar t_tybox nomar disting ">
    <script>
        //弹窗
        function openWin(title, url, reload, width, height) {
            if (width == null) width = 760;
            if (height == null) height = 450;
            isreload = reload;
            box = $.dialog.open(url, {
                id: 'topbox', lock: true, title: title, width: width, height: height, close: function () {
                    if (isreload) {
                        location.reload();
                    }
                }
            });
        }
        //获取复选框中的信息  前台校验
        function GetMyIds() {
            var sid = null;
            for (var i = 0; i < document.getElementsByName("packid").length; i++) {
                var KS = document.getElementsByName("packid")[i];
                if (KS.checked == true) {
                    if (sid == null)
                        sid = KS.value;
                    else
                        sid += "|" + KS.value;
                }
            }
            return sid;
        }
        //简单校验信息
        function check() {
            var sid = GetMyIds();
            if (sid == null) {
                KesionJS.Alert("请先需要购买的考试分类信息！");
                return false;
            }
            if (confirm('此操作不可逆！确定购买么？')) {
                $("#action").val("dobuy");
                return true;
            } else {
                return false;
            }
        }
    </script>
    <div class="r_title disting">
        <h4 class="disting-title disting_show">题库分类</h4>
        
        
    </div>
     <div class="top-sort  clearfix ">
          <div class="top-sort-tab lf">
             <ul>
                 <li <%if (BasicField.GetParam("show") == "") Response.Write(" class='puton'"); %>><a href="<%=BasicField.GetUserUrl("exam/MySjClass") %>">我的题库分类</a></li>
                 <li <%if (BasicField.GetParam("show") == "1") Response.Write(" class='puton'"); %>><a href="<%=BasicField.GetUserUrl("exam/MySjClass","show-1") %>">购买题库分类</a></li>
                 <li <%if (BasicField.GetParam("show") == "2") Response.Write(" class='puton'"); %>><a href="<%=BasicField.GetUserUrl("exam/MySjClass","show-2") %>">购买明细</a></li>
             </ul>
         </div>
          

       
           <div <%if (BasicField.GetParam("show") == "1") Response.Write(" class='puton_none'"); %><%if (BasicField.GetParam("show") == "2") Response.Write(" class='puton_none'"); %>  class="top-sort-option rf">
            <a href="<%=BasicField.GetUserUrl("exam/MySjClass") %>">所有记录</a>
            <a href="<%=BasicField.GetUserUrl("exam/MySjClass","showtype-1") %>">即将要到期(最近30天）</a>
            <a href="<%=BasicField.GetUserUrl("exam/MySjClass","showtype-2") %>">已过期</a>
           </div>
         </div>
  <script>
  var url = location.href.replace(location.origin,'');
  $('.top-sort-option').find('a').each(function(){
    var href = $(this).attr('href');
    if(href==url){
      $(this).addClass('on');
    }
  });

</script>
    <div class="r_tablebox">
        <span class="r_massages"> 注意:如果您先购买子分类的话，在购买父类，那么有效期是以父分类的为主的，也把相应的子分类有效期更新啦！</span>
        <%if (KSCMS.S("show") == "")
            { %>
       
        <table width="100%" cellpadding="0" cellspacing="0" class="border">
            <tr class="title">
                <td>分类名称</td>
                <td>购买时间</td>
                <td >有效期</td>
                <td>操作</td>
            </tr>
            <%  

             if(Utils.StrToInt(KSCMS.S("showtype"))==1)
            {
                sql += " and datediff(day,getdate(),ExpiryDate)<=30  and datediff(day,getdate(),ExpiryDate)> 0and ExpiryMonth>0";
            }
            else if (Utils.StrToInt(KSCMS.S("showType")) ==2)
            {
                sql += " and datediff(s,ExpiryDate,getdate())>=0 and ExpiryMonth>0";
            }
                using (DataTable dt = DataFactory.GetPage("*", sql, "orderid", "order by  orderid  desc", PageIndex, pagesize, out recordcount, out pagecount))
                {
                    if (dt.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
            %>
            <tr>
                <td class="tag_left"><strong><%=dr["classname"].ToString()%></strong><p class="p-sub-info" onclick="openWin('<%=dr["classname"]%>详情','/plus/exam/looksjclassinfo.aspx?classid=<%=dr["SjclassId"]%>',true,900,500)"><%=getcheckInfo(Utils.StrToInt(dr["SjclassId"].ToString())) %></p>
                </td>


                <td class="tag_left"><%=dr["adddate"].ToString() %></td>
                <td class="tag_left">
                    <%=Utils.StrToInt(dr["ExpiryMonth"].ToString())>0?dr["ExpiryDate"].ToString():"<font color='red'>不限制</font>" %>

                </td>
                <td>
                    <a class="green-bt bt-auto" href="<%=BasicField.GetUserUrl("exam/MySjClassRecord","classid-"+dr["SjclassId"].ToString()+"") %>"">查看详情</a>
                </td>
            </tr>
            <%
                        }
                    }
                    else
                    {
                        KSCMS.W(@"<tr class=""tr-nobor""><td colspan=""10""><div class=""empty"">
                                        暂时没有您购买考试分类的信息
                                  </div></td><tr><style>.cz_btn{display:none;}</style>");
                    }
                }
            %>
        </table>
        <div class="cz_btn">
            <div class="color-tips">
            </div>
            <div class="fr">
                <%
                    #region 分页
                    string PageStr = "[KS:PageStr2]";
                    BasicField.ReplaceFilterPage(ref PageStr, PageIndex, pagesize, pagecount, recordcount);
                    KSCMS.W(PageStr);
                    #endregion
                %>
            </div>
        </div>

        <%}
            if (KSCMS.S("show") == "1")
            { %>
       
        <form action="{$GetCurrUrl}" method="post">
            <script>
                $(".table-tr:even").css("background-color", "#f9f9f9");
                function checkbuy(money, url) {
                    if (url != "") {
                        if (confirm('确定购买该考试分类么？从当前余额中扣除' + money + '元')) {
                            location.href = url;
                            return true;
                        } else {
                            return false;
                        }
                    } else { return false; }
                }

                function ExtSub(ID,event,IsBuyChild) {//阻止冒泡调用parent
    var e = (event) ? event : window.event;
    if (window.event) {//IE
        e.cancelBubble = true;
    } else { //FF
        e.stopPropagation();
    }
    if (jQuery('#C'+ID).attr('class')=="tree_Close")
    {       
        jQuery('#C'+ID).attr('class','tree_Open');
        if ($(".border").find("tr[attr*=',"+ID+",']").length>0){
            $(".border").find("tr[attr*=',"+ID+",']").show();
        }else{
          
            jQuery.ajax({
                type: "POST",
                url: "/plus/exam/LookSjclassInfo.aspx",
                data: "parentid="+ID+"&action=ExtSub&IsBuyChild="+IsBuyChild,
                success: function (data) {
                   // alert(data);
                    jQuery("#sub" + ID).after(data);
                  
               
            }
        });
    }
}
else{
    $(".border").find("tr[attr*=',"+ID+",']").hide();
    jQuery('#C'+ID).attr('class','tree_Close');
}
}

            </script>
            <input type="hidden" name="action" id="action" value="action" />

            <table width="100%" cellpadding="0" cellspacing="0" class="border">
                <tr class="title">
                    <td>分类名称</td>
                    <td>价格</td>
                    <td>有效期</td>
                    <td>操作</td>
                </tr>

                <% 
                    string pakesql = " KS_SJClass where ishide=0 and  ParentID=0 and  money>0 ";//审核过的显示
                    using (DataTable dt = DataFactory.GetPage("*", pakesql, "classid", "order by  ClassID  asc", PageIndex, pagesize, out recordcount, out pagecount))
                    {
                        if (dt.Rows.Count > 0)
                        {
                            foreach (DataRow dr in dt.Rows)
                            {
                %>
                <tr  id='sub<%=dr["classid"].ToString() %>'   onclick="chk(this)">
                    <td class="tag_left">
               <a href="javascript:void(0)" onclick='ExtSub("<%=dr["ClassID"].ToString() %>",event,"<%=dr["IsBuyChild"].ToString() %>");' style='text-decoration:none'><%= getClassName(Convert.ToInt32(dr["ClassID"].ToString()),dr["Classname"].ToString(), Convert.ToInt16(dr["child"].ToString()), Convert.ToInt16(dr["NextID"].ToString()), Convert.ToInt16(dr["depth"].ToString()), 1)%></a>
              
                       <p class="p-sub-info"  onclick="openWin('<%=dr["classname"]%>详情','/plus/exam/looksjclassinfo.aspx?classid=<%=dr["classid"]%>',true,900,500)">

                        <%=getcheckInfo(Utils.StrToInt(dr["classid"].ToString())) %>

                    </p>


                    </td>
                    <td><%=Kesion.APPCode.Public.ReturnShopPrice(dr["money"])%>元</td>
                     <td>  <%=Utils.StrToInt(dr["ExpiryMonth"].ToString())>0?dr["ExpiryMonth"].ToString()+"个月":"<font color='red'>不限制</font>" %></td>
                    <td>
                        <a class="green-bt" href="javascript:;" onclick="checkbuy('<%=Kesion.APPCode.Public.ReturnShopPrice(dr["money"]) %>','<%=(showorhide(Utils.StrToInt(dr["classid"]))==1?"":BasicField.GetUserUrl("exam/Mysjclass","do-dobuy,classid-"+dr["classid"]))%>');"><%=(showorhide(Utils.StrToInt(dr["classid"]))==1?"已购买":"余额购买") %></a>
                        <a class="grey-bt mp_10" href="javascript:;" onclick="openWin('<%=dr["classname"]%>详情','/plus/exam/looksjclassinfo.aspx?classid=<%=dr["classid"]%>',true,900,500)">查看详情</a>

                    </td>
                </tr>
                <%    }
                        }
                        else
                        {
                            KSCMS.W(@"<tr><td><div class=""empty"">
                                        暂时没有可购买的考试分类，请等待管理员的添加！
                                  </div></td></tr>");
                        }
                    }
                %>
            </table>

        </form>

        <div class="cz_btn">
            <%
                #region 分页
                string PageStr = "[KS:PageStr2]";
                BasicField.ReplaceFilterPage(ref PageStr, PageIndex, pagesize, pagecount, recordcount);
                KSCMS.W(PageStr);
                #endregion
            %>
        </div>
        <%}
            if (KSCMS.S("show") == "2")
            { %>

        <table id="tablist" width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
            <tr align="center" class="title">
                <td>序号</td>
                <td width="45%">分类名称</td>
                <td>购买日期</td>
                <td>价格</td>
                   <td >有效期</td>
            </tr>
            <%
                int recordcount2, pagecount2;//分页的参数信息
                int pagesize2 =20;
                int PageIndex2 = new BasicField().GetCurrPage;

                using (DataTable dt = DataFactory.GetPage("*", sql, "orderid", "order by  orderid  desc", PageIndex2, pagesize2, out recordcount2, out pagecount2))
                {
                    if (dt.Rows.Count > 0)
                    {
                        int i = 0;
                        foreach (DataRow dr in dt.Rows)
                        {
            %>
            <tr>
                <td class="splittd" style="text-align: center"><%=i+1 %></td>
                <td class="splittd" style="text-align: left"><%=dr["classname"].ToString() %></td>

                <td class="splittd" style="text-align: center"><%=dr["adddate"].ToString() %></td>
                <td class="splittd" style="text-align: center"><%=getpackageprice(dr["price"].ToString()) %></td>
                 <td class="tag_left">
                    <%=Utils.StrToInt(dr["ExpiryMonth"].ToString())>0?dr["ExpiryDate"].ToString():"<font color='red'>不限制</font>" %>

                </td>
            </tr>
            <%
                            i++;
                        }
                    }
                    else
                    {
                        KSCMS.S(@"<tr><td colspan='5'><div class=""empty"">
                                        暂时没有您购买考试分类的信息
                                  </div></td></tr>");
                    }
                }
            %>
        </table>

        <div class="cz_btn">
            <%
                #region 分页
              
                string PageStr2=__user.GroupID==3||__user.GroupID==4?"[KS:PageStr1]": "[KS:PageStr2]";
                BasicField.ReplaceFilterPage(ref PageStr2, PageIndex2, pagesize2, pagecount2, recordcount2);
                KSCMS.W(PageStr2);
                #endregion
            %>
        </div>

        <%} %>

    </div>
</div>





