<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="True" Inherits="Admin_CosBindList_KS_CosBindList" Codebehind="KS.CosBindList.aspx.cs" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.BLL" %>


<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" Runat="Server">
    <script>
     
        $(function () {
            //全选反选
            $("#selectAll").click(function () {
                if ($(this).is(":checked")) {
                    $(".courseList").find("input[type=checkbox]").attr("checked", true);//从父标签开始找
                }
                else {
                    $(".courseList").find("input[type=checkbox]").attr("checked", false);
                };
            });
            $("#selectinfo").click(function () {
                if ($(this).is(":checked")) {
                    $(".infolist").find("input[type=checkbox]").attr("checked", true);//从父标签开始找
                }
                else {
                    $(".infolist").find("input[type=checkbox]").attr("checked", false);
                };
            });
        });
       
        //课程信息时间的开关
    </script>

    <asp:Panel ID="managepanel" runat="server" >
          <!--  页面头部样式 -->
         <!--<KS:TopNav ID="TopNav2" runat="server" Text="管理操作" />-->
		       
        <script> 
            function free(checkrad,id) {
                if (checkrad == "1") {
                    $("#tobody"+id+"").show();//显示限制条件
                } else {
                    $("#tobody"+id+"").hide();
                }
            }
            function addProductIn(proid,type){
            	if (proid!=undefined){
            		parent.openWin('设置捆绑销售价格','/plus/course/CosSetBandle.Aspx?type='+type+'&packid='+ proid,false,600,300);
            	}else{
            		KesionJS.Alert('请选择要加入捆绑销售的课程!',null);
            	}
            }
            function selectall(){
            	$(".checkids").attr("checked","checked");
            }
        </script>
         <div class="content-area mt20">

            <div class="tabs_header">
                <div class="fr">
                	<input type="button" name="addCourse" id="addcourse" class="button mr20 button_on" value="添加课程" onclick="parent.openWin('添加课程','/plus/course/CosBindListCourse.aspx?from=admin&packid=<%=KSCMS.S("courseid") %>	',true,1100,700);" />
                	<input type="button" name="addSj" id="addsj" class="button mr20 button_on" value="添加试卷" onclick="parent.openWin('添加试卷','/plus/course/CosBindListSj.aspx?from=admin&packid=<%=KSCMS.S("courseid") %>	',true,1100,700);" />
					<%if (Utils.GetSysInfo("//model/mall") == "true")
                    { %><input type="button" name="addSj" id="Button1" class="button mr20 button_on" value="添加商品" onclick="parent.openWin('添加商品','/plus/course/CosBindListPro.aspx?from=admin&packid=<%=KSCMS.S("courseid") %>	',true,1100,700);" /><%} %>
               		<input type="button" class="button" value="返回" onclick="location.href='KS.CosBinder.aspx'" />
                </div>
                <ul class="tabs">
                    <li <%=KSCMS.S("type")==""||KSCMS.S("type")=="0"?" class='active'":string.Empty %>><a href="KS.CosBindList.aspx?action=manage&courseid=<%=KSCMS.S("courseid") %>"><span>套餐内容</span></a></li>
					  <li <%=KSCMS.S("type")=="1"?" class='active'":string.Empty %>><a href="KS.CosBindList.aspx?action=manage&type=1&courseid=<%=KSCMS.S("courseid") %>"><span>套餐课程</span></a></li>
					    <li <%=KSCMS.S("type")=="2"?" class='active'":string.Empty %>><a href="KS.CosBindList.aspx?action=manage&type=2&courseid=<%=KSCMS.S("courseid") %>"><span>套餐试卷</span></a></li>
						<%if (Utils.GetSysInfo("//model/mall") == "true")
                    { %>  <li <%=KSCMS.S("type")=="3"?" class='active'":string.Empty %>><a href="KS.CosBindList.aspx?action=manage&type=3&courseid=<%=KSCMS.S("courseid") %>"><span>套餐商品</span></a></li><%} %>
                
				</ul>
            </div>
            <div class="f12 l_height36 grayFont md20">课程数量：<%= GetBindNum("0,1,5")%>门，试卷数量：<%= GetBindNum("2")%>份，商品数量：<%= GetBindNum("3")%>件</div>
            <asp:Panel ID="CoursePanel" runat="server">
                   <table width="100%"border="0" cellpadding="1" cellspacing="1" class="CTable" >
                        <tr class="CTitle">
                            <td>ID</td>
                            <td>标题</td>
                            <td>价格</td>
                            <td>添加时间</td>
                            <td>排序值</td>
                            <td>类型</td>
							<td>是否必选</td>
                            <td>操作</td>
                        </tr>
            <asp:Repeater ID="Repeater" runat="server"  >
                <ItemTemplate>
                    <tr onmouseover="this.className=&#39;CtrMouseOver&#39;" onmouseout="this.className=&#39;CtrMouseOut&#39;" onclick="chk(this)">
                        <td class="infolist" style="text-align:center"><div class="input">
						<input type="checkbox" name="ids" style="display:" class="checkids"  id="ids" value="<%#Eval("id") %>" /><%# Eval("id") %></div></td>
                        <td class="Ctd" style="text-align:left">	<input type="text" class="text" name="bindname<%#Eval("id") %>" value="<%# Eval("bindname") %>" /> </td>
                        <td class="Ctd" style="text-align:center"> <input  style='width:50px;text-align:center' type="text" class="text" name="bindprice<%#Eval("id") %>" value="<%# Kesion.APPCode.Public.ReturnShopPrice(Eval("bindprice")) %>" /> </td>
                        <td class="Ctd" style="text-align:center"><%# Eval("AddDate") %></td>
                        <td class="Ctd" style="text-align:center">
						<input type="text" class="text" style="Width:50px;text-align:center" name="order<%#Eval("id") %>" value="<%# Eval("orderid") %>"  />
                        </td>
						    <td class="Ctd" style="text-align:center"><%#GetName(Utils.StrToInt(Eval("type").ToString())) %></td>
							    <td class="Ctd" style="text-align:center">
								<input type="checkbox" name="isorno<%#Eval("id") %>"  value="1" <%# Utils.StrToInt(Eval("isselect"))==0?" ":"checked" %> />
							    </td>
                        <td class="Ctd" style="text-align:center">
                           <a title="删除" onClick="return(confirm('确认移除吗？'))" href="KS.CosBindList.aspx?action=delete&ids=<%# Eval("id") %>" class="delete"></a>
						      <a style="display:none" title="编辑" href="" onclick="addProductIn('<%#Eval("id").ToString() %>','<%#Eval("type").ToString() %>')" class="edit">编辑</a>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
                <tr style="display:<%= bool.Parse((Repeater.Items.Count==0).ToString())?"":"none"%>">
                    <td align="center" colspan="10" >
                        <div class="empty" >
                                没有查询到记录
                        </div>
                    </td>
                </tr>
            </table>
            </asp:Panel>
            <KS:Page ID="page1" runat="server" />
            <div class="listedit">
              <input name="" type="checkbox" value="" id="selectinfo"  /><label>全选</label>
              <asp:Button ID="piedit" CssClass="button" runat="server" Text="批量修改"  OnClick="Change_Click" OnClientClick="selectall()" />
              <asp:Button ID="pidelete" CssClass="button" runat="server" Text="批量删除" OnClientClick="return (confirm('确定批量删除这些内容么?'))"  OnClick="Delete_Click"/>
           </div>
        </div>

    </asp:Panel>

</asp:Content>

