<%@ Page Language="C#"  MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Kesion.NET.WebSite.Course.Admin_Course_KS_CsLiveConfig" Codebehind="KS.CosLiveConfig.aspx.cs" %>

<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.BLL" %>

<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" Runat="Server">
 <div id="manage_top" class="menu_top_fixed">
         <ul class="titleTab">
           <%if (KSSecurity.CheckMenuPower("Course/KS.CosConfig.aspx0", true))
                  { %>
          <li><a href="KS.CosConfig.aspx">系统设置</a></li>
             <%}
               if (KSSecurity.CheckMenuPower("Course/KS.CosConfig.aspx1",true)){ %>
          <div onmouseover="jQuery('#topcd').show();" onmouseout="jQuery('#topcd').hide();" class="liwrap">
                   <li><a href="KS.CosCategory.aspx?type=0">分类设置</a></li>
                   <div id="topcd" class="topcd" style="display:none">
                      <a href="KS.CosCategory.aspx?type=0">网授分类</a>
                      <a href="KS.CosCategory.aspx?type=1">面授分类</a>
                   </div>
           </div>
            <%}
                if (KSSecurity.CheckMenuPower("Course/KS.CosConfig.aspx2", true))
                { %>
          <li class="curr"><a href="KS.CosLiveConfig.aspx">直播道具</a></li>
             <%}
                 if (KSSecurity.CheckMenuPower("Course/KS.CosConfig.aspx3", true))
                 { %>
          <li><a href="KS.CosFaceType.aspx">面授班型</a></li>
              <%}
                  if (KSSecurity.CheckMenuPower("Course/KS.CosConfig.aspx4", true))
                  { %>
          <div onmouseover="jQuery('#topvideo').show();" onmouseout="jQuery('#topvideo').hide();" class="liwrap">
                   <li><a href="KS.CosAPIConfg.aspx">视频接口</a></li>
                   <div id="topvideo" class="topcd" style="display:none">
                      <a href="KS.CosAPIConfg.aspx">点播接口</a>
                      <a href="KS.CosLiveAPIConfig.aspx">直播接口</a>
                   </div>
             </div>
              <%} %>
            <li><a href="KS.CosVideoAdvertiseManage.aspx">设置视频广告</a></li>
       </ul>
 </div>  
<div class="menu_top_fixed_height"></div> 
     <asp:Panel ID="ListPanel" runat="server" Width="100%">

 <div class="content-area">         
       <div class="tabs_header">
            <span class="fr"><a href="?action=addcombo" class="mr20 button button_on">添加</a></span>
            <ul class="tabs">
                <li class='active'><a href="KS.CosLiveConfig.aspx"><span>道具配置</span></a></li>
                <li ><a href="KS.CsDJOrder.aspx"><span>购买记录</span></a></li>
                <li ><a href="KS.CsDJHold.aspx"><span>持有记录</span></a></li>
            </ul>
        </div>
    <KS:ksgv id="List" runat="server" AutoGenerateColumns="False" EmptyDataText="没有任何道具!" PagerType="CustomNumeric" Width="99%"    CssClass="CTable" GridLines="None" OnRowDataBound="List_RowDataBound" OnRowCommand="List_RowCommand" OnRowCreated="List_RowCreated">
        <Columns>
        	<asp:TemplateField HeaderText="&lt;input type='checkbox' name='chkall' id='chkall' onClick='CheckAll(this.form);'/&gt;">
                <itemstyle horizontalalign="Center" width="30px" />
                <itemtemplate>
                <input type="checkbox"  name="ids" id="ids" value="<%#Eval("ID") %>" />
                </itemtemplate>
            </asp:TemplateField>

             <asp:TemplateField HeaderText="ID">
                   <itemstyle  horizontalalign="Center" width="10px" />
                <itemtemplate>
            <%# Eval("ID") %>
                </itemtemplate>
            </asp:TemplateField>
			  <asp:TemplateField HeaderText="道具状态">
                   <itemstyle  horizontalalign="Center" width="10px" />
                <itemtemplate>
           <a href="?action=status&id=<%#Eval("id") %>&nowstate=<%#Eval("status") %>"> <%# Eval("status").ToString()=="1"?"<font color='green'>开启</font>":"<font color='red'>关闭</font>" %></a>
                </itemtemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="道具名称">
			 <itemstyle  horizontalalign="Center" width="100px" />
                <itemtemplate>
            <%# Eval("acname") %>
                </itemtemplate>
            </asp:TemplateField>
               <asp:TemplateField HeaderText="图片">
            <itemstyle  horizontalalign="Center" width="100px" />
                <itemtemplate> 
              <img src="<%# Eval("acimage") %>"  style="width:50px;height:50px;" /> 
                </itemtemplate>
            </asp:TemplateField>
     
			 <asp:TemplateField HeaderText="添加日期">
            <itemstyle  horizontalalign="Center" width="135px" />
                <itemtemplate> 
                <%# Eval("adddate") %>
                </itemtemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="兑换规则">
                <itemstyle horizontalalign="Center" Width="100"/>
             <itemtemplate>
			 <a href="?action=edit&id=<%# Eval("ID") %>"  class="link-color">编辑</a>
            </itemtemplate>
            </asp:TemplateField>
   <asp:TemplateField HeaderText="删除">
                <itemstyle horizontalalign="Center" Width="100"/>
             <itemtemplate>
              <asp:LinkButton runat="server"  CssClass="delete" id="delet" commandargument=<%# Eval("ID") %> commandname="del">删除</asp:LinkButton>         
            </itemtemplate>
            </asp:TemplateField>

        </Columns>
        <HeaderStyle CssClass="CTitle" />
        <EmptyDataRowStyle CssClass="emptycss" />
    </KS:ksgv>
        <div class="listedit">
      	  &nbsp;&nbsp;&nbsp;&nbsp;
          <asp:LinkButton ID="delclassbutton" CssClass="button" runat="server" OnClientClick="return(GetIDS('del'));" OnClick="delclassbutton_Click"><b></b>删除</asp:LinkButton>
      </div>
     <KS:Page ID="Page1" runat="server" />            
</asp:Panel> 
 </div>  
    <asp:Panel ID="AddPanel" runat="server" Width="100%">
<div class="content-area"> 
       <div class="myTitle"><%=KSCMS.S("action")=="edit"?"修改":"添加" %>道具</div>
     <table width="100%" border="0" cellpadding="1" cellspacing="1" class="CTable no-borderTable"> 
  <asp:TextBox ID="acID" Visible="false" runat="server"></asp:TextBox>
     <tr>
        <td align="right"  class="lefttd" height="30" ><strong>活动名称：</strong></td>
         <td ><asp:TextBox ID="acname" CssClass="textbox" runat="server"></asp:TextBox></td>
     </tr>
	 
       <tr>
       <td align="right" class="lefttd"  height="30" ><strong>图片：</strong></td>

             <td class="righttd"> <table cellspacing="0" cellpadding="0">
                     <tr>
                         <td>
                          <asp:TextBox CssClass="textbox" Width="350" ID="acimage" runat="server"></asp:TextBox>&nbsp;<input type="button" class="button" onclick="SelectFiles('<%=this.acimage.ClientID %>    ',0);" value="选择图片"></td>
                        
                         <td style="padding-left: 4px; padding-top: 15px; vertical-align: middle; *padding-top: 12px;"><%=Kesion.APPCode.UploadAPI.EchoUpload("classpic", this.acimage.ClientID, 150) %></td>
                 
                         <td>
                             <img id="show<%=acimage.ClientID %>" src="<%=acimage.Text%>" height="30" style="border: 1px solid #f1f1f1;" onerror="this.src='../../sysimg/nopic.gif'" /></td>
                     </tr>
                      </table>
                 </td>


							
     </tr>   
	<%--  <tr>
        <td align="right"  height="30" ><strong>下拉框：</strong></td>
     
		<td>
		 <asp:RadioButtonList ID="RadioButtonList1" onclick="showwatermarkarea()" runat="server"
                                RepeatDirection="Horizontal" Height="24px">
                                <asp:ListItem Value="0" Selected="True">无</asp:ListItem>
                                <asp:ListItem Value="1">有</asp:ListItem>
                              
                            </asp:RadioButtonList>
		</td>
     </tr>
	 <tr>
	   <tbody id="acselect" runat="server" style="display: none">
                        <tr>
                    <td class="lefttd" align="right" style="width: 198px">
                    <strong>下拉内容：</strong>
                    </td>
                    <td class="righttd">
                     名称： <asp:TextBox CssClass="textbox" ID="selectcontent"  Height="130" TextMode="MultiLine" Rows="7" Width="20%" runat="server"></asp:TextBox>
					  操作数量： <asp:TextBox CssClass="textbox" ID="selectnum"  Height="130" TextMode="MultiLine" Rows="7" Width="20%" runat="server"></asp:TextBox>
                        <span class="tips">一行一个选项</span>
                    </td>
                 </tr>
                    </tbody>
	</tr>--%>
	<tr>
        <td align="right" class="lefttd"  height="30" ><strong>描述量词：</strong></td>
         <td ><asp:TextBox ID="measure" CssClass="textbox" runat="server"></asp:TextBox><span class="tips">如：5（颗、个、枚、点、朵、箱）等</span></td>
     </tr>
	 <tr>
        <td align="right" class="lefttd"  height="30" ><strong>描述物品名词：</strong></td>
         <td ><asp:TextBox ID="things" CssClass="textbox" runat="server"></asp:TextBox><span class="tips">如：（树、人、金币、点券、花、酒）等</span></td>
     </tr>
	  <tr>
        <td align="right" class="lefttd" ><strong>描述：</strong></td>
         <td><textarea style="width:500px; height:100px;" runat="server" id="accontent"></textarea></td>
     </tr>  
	   <tr>
        <td align="right" class="lefttd" height="30" ><strong>贡献值：</strong></td>
         <td >1:<asp:TextBox ID="contribution" style="width:50px"  CssClass="textbox" runat="server"></asp:TextBox>
		 <span class="tips">学员发送一次道具所获得的贡献值</span>
         </td>
     </tr> 
	<tr style="display:none">
        <td align="right" class="lefttd" height="30" ><strong>添加到微直播：</strong></td>
     
		<td>
		 <asp:RadioButtonList ID="RadioButtonList1" runat="server"  onclick="showprice()" RepeatDirection="Horizontal" Height="24px">
                                <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
                                <asp:ListItem Value="1">是</asp:ListItem>
                              
                            </asp:RadioButtonList>
            
         <td ><asp:TextBox ID="cbmoneys" style="width:50px"  CssClass="textbox" runat="server"></asp:TextBox>
		</td>
     </tr>
	 	   <tr id="miniprice">
        <td align="right" class="lefttd"  height="30" ><strong>提现单价：</strong></td>
         <td ><asp:TextBox ID="cashmoneys" style="width:50px"  CssClass="textbox" runat="server"></asp:TextBox>
		 <span class="tips">教师提现道具的单价</span>
         </td>
     </tr> 
		   <tr>
        <td align="right" class="lefttd"  height="30" ><strong>兑换规则：</strong></td>
		<td>
		<asp:Panel ID="Panel1" runat="server">
			<input value="1" type="hidden"  name="addcombotype"  />
			<asp:Button ID="Button1" runat="server" Text="添加" OnClick="Button2_Click" CssClass="button" />
		  <asp:Repeater ID="Repeater1" runat="server" >
                                <HeaderTemplate>
                                    <tbody border="0" cellpadding="2" cellspacing="1" >
                                        <tr align="center" class="CTitle">
                                            <td align="center">名称</td>
                                            <td>兑换金额</td>
                                            <td align="center">兑换数量</td>
											<td align="center">删除</td>

                                        </tr>
                                </HeaderTemplate>

                                <ItemTemplate>
								    <input type="text"  name="idss" id="idss" style="display:none" value="<%#Eval("id") %>" >
                                    <tr>
                                  	 <td align="center"><input class="textbox" value="<%#Eval("cbname") %>"  name="cbname"  /> </td>
                                     
									 <td align="center"><input class="textbox" value="<%#Utils.StrToFloat(Eval("cbmoney").ToString()).ToString("0.00") %>"  name="money1"  /> </td>
                                    
									 <td align="center" class="splittd" style="width: 80px;"><input class="textbox" style="width:80px; margin-right:0;" value="<%#Eval("cbnum") %>" name="acnum1"  /></td>
									
                                    <td class="link-operate" align="center">
									 <a href="?action=del2&id=<%#Eval("id") %>">删除</a>
                                    </td>
									
                                    </tr>

                                </ItemTemplate>
                                <FooterTemplate>
								  
                                    </tbody> 
							
                                </FooterTemplate>

                            </asp:Repeater>
							</asp:Panel>
		<asp:Panel ID="Panel2" runat="server">
								<div id="add" onclick="addcombo(1)" class="button" style="border: 1px solid #e6e9ea;background: #f5f8f9;">添加</div>

								<input value="0" type="hidden"  name="addcombotype"  />
                                <table id="mycombo" width="100%" class="CTable">
                        			<tbody id="combo0">
                                    <tr>
                                    	<td align="right" class="lefttd">套餐名称：</td>
                                        <td style="padding-bottom:10px;"><input type="text" value="套餐"  name="cbname" class="textbox" /></td>
                                    </tr>
                                    <tr> 
                                    	<td align="right" class="lefttd">套餐价格：</td>
                                        <td style="padding-bottom:10px;"><input type="text" value="0.00"  name="money1" class="textbox" /></td>
                                    </tr>
                                    <tr>
                                    	<td align="right" class="lefttd">兑换数量：</td>
                                        <td style="padding-bottom:10px;"><input type="text" value="0" name="acnum1" class="textbox" /></td>
                                    </tr>
                                    <tr>
                                    	<td align="right" class="lefttd">&nbsp;</td>
                                        <td style="padding-bottom:20px"><span class="link-color" onclick="delcolumn(0)" style="cursor:pointer; font-size:14px;">删除</span></td>
                                    </tr>   
                        			</tbody>
                               </table>

								</asp:Panel>

     </td>
     </tr>
	 <%-- <tr style="opacity:0">

	      <td align="right" ><strong>兑换规则：</strong></td>
	   <td><div id="add" onclick="addcombo(1)">添加</div>
	
	   <tbody id="mycombo" style="width:50%">
	   <tr id="combo0">
                  <td align="center"><input value="套餐"  name="cbname"  /><input value="0.00"  name="money1"  /><input value="0" name="acnum1"  /> <div onclick="delcolumn(0)">删除</div></td>
                         </tr>   

	   </tbody>
	  
</td>
	   </tr>--%>

  </table>
   
 
      <KS:Foot ID="Foot1" runat="server" OnSubmit="Foot1_Submit" />

     </asp:Panel>
     <script>
     	function addcombo(i)
     	{
     		var s = "<tbody id='combo" + i + "'><tr><td align=\"right\" class=\"lefttd\">套餐名称：</td><td style=\"padding-bottom:10px;\"><input type=\"text\" value=\"套餐\"  name=\"cbname\" class=\"textbox\"  /></td></tr><tr><td align=\"right\" class=\"lefttd\">套餐价格：</td><td style=\"padding-bottom:10px;\"><input type=\"text\" value=\"0.00\"  name=\"money1\" class=\"textbox\"  /></td></tr><tr><td align=\"right\" class=\"lefttd\">兑换数量：</td><td style=\"padding-bottom:10px;\"><input type=\"text\" value=\"0\" name=\"acnum1\" class=\"textbox\"  /></td></tr><tr><td align=\"right\" class=\"lefttd\">&nbsp;</td><td style=\"padding-bottom:20px\"><span onclick='delcolumn(" + i + ")' class=\"link-color\" style=\"cursor:pointer; font-size:14px;\">删除</span></td></tr></tbody>";
     		var mycombo = $("#mycombo").html();
     		$("#add").attr("onclick", "addcombo(" + (i + 1) + ")");
     		$("#combo"+(i-1)).after(s);
     	}
     	function delcolumn(i)
     	{
     		//alert(i);
     		$("#combo" + i + "").css("display", "none");
     		$("#combo" + i + "").html("0");
     	}
     </script>
 </div>

</asp:Content>
