<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Kesion.NET.WebSite.Admin.Yun.Product" Codebehind="KS.YunProduct.aspx.cs" %>
<%@ Import Namespace="Kesion.BLL" %>
<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.APPCode" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" runat="server">
  <div id="manage_top" class="menu_top_fixed">
         <ul class="titleTab">
          <li<%=String.IsNullOrEmpty(KSCMS.S("action"))?"  class='curr'":"" %>><a href="KS.YunProduct.aspx">云产品购买</a></li>
          <li<%=KSCMS.S("action").Equals("myorder")?"  class='curr'":"" %>><a href="KS.YunProduct.aspx?action=myorder">我的已购产品</a></li>
       </ul>
 </div>  
<div class="menu_top_fixed_height"></div> 
<asp:Panel ID="ListPanel" runat="server" Width="100%">
 <script>

     function YunDownLoad(templateId, page) {
         location.href="<%=KSCMS.GetInstallDir()+MyCache.GetCacheConfig(4)%>/Label/KS.TemplateSkin.aspx?action=yundown&showType=-1&page=" + page + "&templateId=" + templateId;
        }
     
     function ViewPics(id) {
         top.initialPrettyPhotoPicStr($("#p" + id).html());
     }
    </script>
<div class="content-area">
       <div class="tabs_header">
    <ul class="tabs">

 <%if(Utils.GetSysInfo("//sysinfo/showver").ToString().ToLower().IndexOf("edu")!=-1){%>
    <li<%=KSCMS.S("yuntype")==string.Empty?" class='active'":string.Empty %>><a href="KS.YunProduct.aspx"><span>云视频</span></a></li>
   <li<%=KSCMS.S("yuntype")=="4"?" class='active'":string.Empty %>><a href="KS.YunProduct.aspx?yuntype=4"><span>云直播</span></a></li>
<%} %>
   <li<%=(KSCMS.S("yuntype")=="2" || (Utils.GetSysInfo("//sysinfo/showver").ToString().ToLower().IndexOf("edu")==-1 && KSCMS.S("yuntype")==string.Empty))?" class='active'":string.Empty %>><a href="KS.YunProduct.aspx?yuntype=2"><span>云短信</span></a></li>
        <li<%=KSCMS.S("yuntype")=="3"?" class='active'":string.Empty %>><a href="KS.YunProduct.aspx?yuntype=3"><span>云模板</span></a></li>
   <li<%=KSCMS.S("yuntype")=="5"?" class='active'":string.Empty %>><a href="KS.YunProduct.aspx?yuntype=5"><span>云服务器</span></a></li>
    </ul>
    </div>
  <asp:Repeater ID="YunTemplateList" runat="server">
             <HeaderTemplate>
                  <div class="yunList clearfix">
             </HeaderTemplate>
             <ItemTemplate>
            
        	        <div class="item">
            	        <div class="border">
                            <div class="s_txt">  
                            	<div class="s_name">
                                    <%#Eval("templatename") %> &nbsp;<i class="bt">[ <%# Eval("classname") %>系列 ]</i>
                                </div>
                                <%if(KSCMS.S("yuntype")=="3"){%>
								<div class="s_intro"><%#Eval("intro") %></div>
                           		<%}%>
                              	<div class="s_attr clearfix">
                                    <%#YunType==3?"":YunType==2?"<span>短信：<em>"+Eval("capacity").ToString()+"条</em></span>":YunType==5?Eval("cpu").ToString()==string.Empty?"<span>有效期：<em>"+Eval("shixian").ToString()+"个月</em></span>":"<span>有效期：<em>"+Eval("shixian").ToString()+"个月</em></span><span class='a-intro'>"+Eval("cpu")+"</span>":YunType==1?"<span>存储空间：<em>"+Eval("capacity").ToString()+"</em></span><span>有效期：<em>"+Eval("shixian").ToString()+"个月</em></span><span>流量：<em>"+Eval("traffic").ToString()+"</em></span>":YunType==4?"<span>并发数：<em>"+Eval("capacity").ToString()+"</em></span><span>有效期：<em>"+Eval("shixian").ToString()+"个月</em></span>":"" %>
                            	</div>

                                <div class="s_intro"><%#YunType==3?"适用用于："+Eval("beapplicable"):""%></div>
                            	<span class="price"><i class="bt">价格：</i><em><%#Utils.StrToDecimal(Eval("prices"))>0?"￥"+Kesion.APPCode.Public.ReturnShopPrice(Utils.StrToDecimal(Eval("prices"))):"<font>免费</font>" %></em>
                            	</span>
                         </div>   
                         <div class="s_rbox">
                               <span id='p<%#Eval("TemplateID") %>' style="display:none"><%# Eval("pics") %></span>
                               <%#YunType==3?"<a href=\"javascript:ViewPics('"+Eval("templateid")+"')\" title=\"预览\" class=\"button yl-button\">预览</a>":"" %>
                               <%# ShowButton(YunType,Utils.StrToInt(Eval("templateid").ToString()),Utils.StrToDecimal(Eval("prices")))%>
                             
                          </div>
                       </div>   
                    </div>
                 
              </ItemTemplate>
              <FooterTemplate>
                </div>
              </FooterTemplate>
            </asp:Repeater>
         <div class="empty" style="text-align:center;" id="showEmpty" runat="server" visible="false">
                 KESION云端没有发现可购买的<%#YunType==1?"云视频":YunType==2?"云短信":YunType==3?"云模板":YunType==4?"云直播":"云服务"%>!
          </div> 
         <asp:Label ID="LabPage" runat="server"></asp:Label>
 </div> 
</asp:Panel>

<asp:Panel ID="OrderPanel" runat="server" Visible="false">
    <div class="content-area"> 
  <div class="tabs_header">
    <ul class="tabs">
         <li<%=KSCMS.S("show")==""?" class='active'":string.Empty %>><a href="KS.YunProduct.aspx?action=myorder"><span>我的云产品(<%=num[0]%>)</span></a></li>
    <%if(BaseFun.CheckModulePower("edu")){%>
      
    <li<%=KSCMS.S("show")=="1"?" class='active'":string.Empty %>><a href="KS.YunProduct.aspx?action=myorder&show=1"><span>云点播(<%=num[1]%>)</span></a></li>
    <li<%=KSCMS.S("show")=="4"?" class='active'":string.Empty %>><a href="KS.YunProduct.aspx?action=myorder&show=4"><span>云直播(<%=num[4]%>)</span></a></li>
     <%} %>
    <li<%=KSCMS.S("show")=="2"?" class='active'":string.Empty %>><a href="KS.YunProduct.aspx?action=myorder&show=2"><span>云短信(<%=num[2]%>)</span></a></li>
    <li<%=KSCMS.S("show")=="3"?" class='active'":string.Empty %>><a href="KS.YunProduct.aspx?action=myorder&show=3"><span>云模板(<%=num[3]%>)</span></a></li>
    <li<%=KSCMS.S("show")=="5"?" class='active'":string.Empty %>><a href="KS.YunProduct.aspx?action=myorder&show=5"><span>云服务器(<%=num[5]%>)</span></a></li>
    
    </ul>
    </div>
  <asp:Repeater ID="Repeater1" runat="server">
  <HeaderTemplate>
    <div class="r_padbox  wihte">	          
          <table width="98%" align="center" border="0" cellpadding="1" cellspacing="1" class="CTable">
              <tr class="CTitle">
              	<th>序号</th>
               	<th>产品类型</th>
               	<th>产品</th>
               	<th style="text-align:center">最新下单时间</th>
               	<th style="text-align:center">价格</th>
                <th style="text-align:center">状态</th>
               	<th style="text-align:center">操作</th>
              </tr>
          </HeaderTemplate>
         <ItemTemplate>
             <TR>
				 <td class="splittd" style="text-align:center">
					<%# Container.ItemIndex + 1%>
				</td>
                <td class="splittd" align="center">
                    <%#Yun.GetYunTypeName(Utils.StrToInt(Eval("yuntype").ToString ())) %>
                    <%#Eval("yuntype").ToString()=="1"?"<a href=\"KS.YunVideo.aspx?VideoType="+Eval("VideoType").ToString()+"\"></a>":"" %>
                </td>
                <td class="splittd" align="left">
                    <%#Eval("name") %>
                    <%#Eval("yuntype").ToString()=="1"||Eval("yuntype").ToString ()=="4"||Eval("yuntype").ToString ()=="5"? Eval("status").ToString()=="2"?  DateTime.Now> Convert.ToDateTime(Eval("EffectiveDate").ToString())?"<font class='redFont'>已过期</font>":"" :"" :""%>
                   <%#Utils.StrToInt(Eval("status").ToString())==0?"":Utils.StrToInt(Eval("status").ToString())==1?"":Eval("YunType").ToString()=="1"?"":Eval("YunType").ToString()=="2"?"<div class=\"userinfo-b\">短信余额："+Yun.getSmsCount(Utils.StrToInt(Eval("videoType").ToString()))+"</div>":Eval("YunType").ToString()=="4"?"":Eval("YunType").ToString()=="5"?"<div class=\"userinfo-b\">"+Yun.GetOpenUserInfo(Utils.StrToInt(Eval("infoid").ToString()),Eval("orderid").ToString(),Eval("ACCESS_KEY").ToString(),Eval("UserName").ToString(),Eval("PassWord").ToString())+"</div>":""%>
                </td>
                <td class="splittd" style="text-align:center"><%#Eval("inputtime").ToString()%></td>
                <td class="splittd" style="text-align:center">
              		<%# Kesion.APPCode.Public.ReturnShopPrice(Convert.ToString(Eval("totalPrice")))%></span></td>
               	<td align="center" class="Ctd">
                 	<%#Yun.GetOrderStatus(Utils.StrToInt(Eval("paystatus").ToString()),Utils.StrToInt(Eval("DeliverStatus").ToString()),Utils.StrToInt(Eval("YunType").ToString()),Utils.StrToDateTime(Eval("EffectiveDate").ToString()),Utils.StrToInt(Eval("infoid")))  %>
               	</td>
              	<td class="link-operate" align="center">
					<a href="KS.YunOrderItem.aspx?orderid=<%# Eval("orderid") %>">订单详情</a>
                    <%# Convert.ToString(Eval("payStatus"))=="0"?"<a href=\""+Yun.GetServerUrl+"user/Shop/MyShowOrder.aspx?action=pay&id="+(Utils.StrToInt(Eval("ID")))+"&token="+Token+"&appid="+Appid+"\"  target=\"_blank\">去支付</a><a onclick=\"return(confirm('确认删除吗？'))\"  href='KS.YunProduct.aspx?action=deleteorder&orderid="+Eval("OrderID").ToString()+"'>删除</a>":"" %>
                </td>
			</TR>
			<tr>
         </ItemTemplate>
          <FooterTemplate>
           </table>
          </FooterTemplate>
        </asp:Repeater>
         <div class="empty" style="text-align:center;" id="showMyEmpty" runat="server" visible="false">
                没有云产品的信息，<a href="KS.YunProduct.aspx"  class="link-color">赶快去购买，有更多优惠呢</a>!
          </div> 
         <asp:Label ID="LabOrderListPage" runat="server"></asp:Label>
</asp:Panel>
</asp:Content>




