<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PicList.aspx.cs" Inherits="KstCMS.KstCMS_Manager.WebSet.Ad.PicList" %>

<html>
<head id="Head1" runat="server">
    <title>广告图片</title>
    <script type="text/javascript">
        function selectall() {

            var obj = document.getElementById("chxall");
            var chxobj = document.getElementsByTagName("input");

            for (var i = 0; i < chxobj.length; i++) {
                if (chxobj[i].type == "checkbox") {
                    if (obj.checked) {
                        chxobj[i].checked = true;
                    } else {
                        chxobj[i].checked = false;
                    }
                }
            }
        }

        function isSelectPro() {
            var obj = document.getElementById("chxall");
            var chxobj = document.getElementsByTagName("input");
            var SelectNum = 0;
            for (var i = 0; i < chxobj.length; i++) {
                if (chxobj[i].type == "checkbox") {
                    if (chxobj[i].checked) {
                        if (chxobj[i] != obj) {
                            SelectNum++;
                        }
                    }
                }
            }
            return SelectNum;
        }

        function checkupdate() {
            if (isSelectPro() == 0) {
                alert("请选择要更新的项！");
                return false;
            }
            return true;
        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <div class="mainbox">
<table width="100%" border="0" cellspacing="1" cellpadding="4" style="border-bottom:1px solid #cccccc; background-color:Menu">
  <tr>
    <td>
        <b><asp:Literal ID="Literal1" runat="server"></asp:Literal></b>
    </td>
  </tr>
</table>
      
       
<asp:Repeater ID="RepMain" runat="server">
       <HeaderTemplate>    
       <table width="100%" border="0" cellspacing="1" cellpadding="5" class="Table_Gray">
  <tr class="TableHeader">
    <td>选中</td>
    <td>排序</td>
    <td>标题名称</td>
    <td>图片</td>
    <td>链接</td>
    <td>操作</td>
  </tr>
  </HeaderTemplate>
  <ItemTemplate>
  <tr class="TableTd_Gray">
    <td align="center"><input type="checkbox" id="chxbox" name="chxbox" value="<%#DataBinder.Eval(Container.DataItem,"PicID") %>" /></td>
    <td align="center"><input type="text" class="input_text"  size="4" id="txt_SortNo" name="txt_SortNo_<%#DataBinder.Eval(Container.DataItem,"PicID") %>" value="<%#DataBinder.Eval(Container.DataItem,"SortNo") %>" /></td>
    <td align="center">
       <input type="text" id="txt_AdTitle" class="input_text"  name="txt_AdTitle_<%#DataBinder.Eval(Container.DataItem,"PicID") %>" size="30" maxlength="100" value="<%#DataBinder.Eval(Container.DataItem,"AdTitle") %>" />
    </td>
    <td align="center"><a href="<%#DataBinder.Eval(Container.DataItem,"PicPath") %>" target="_blank">打开</a></td>
    <td align="center"><a href="<%#DataBinder.Eval(Container.DataItem,"LinkUrl") %>" target="_blank">打开</a></td>
    <td align="center"> 
        <asp:Button ID="Button1" runat="server" Text="删除" CommandArgument="0" CommandName=<%#DataBinder.Eval(Container.DataItem,"PicID") %>  OnClientClick="return confirm('真的删除此图片码？');" />
    </td>
  </tr>
  </ItemTemplate>
  <AlternatingItemTemplate>
    <tr class="TableTd_Gray1">
    <td align="center"><input type="checkbox" id="chxbox" name="chxbox" value="<%#DataBinder.Eval(Container.DataItem,"PicID") %>" /></td>
    <td align="center"><input type="text" size="4" class="input_text" id="txt_SortNo" name="txt_SortNo_<%#DataBinder.Eval(Container.DataItem,"PicID") %>" value="<%#DataBinder.Eval(Container.DataItem,"SortNo") %>" /></td>
    <td align="center">
       <input type="text" id="txt_AdTitle" class="input_text"  name="txt_AdTitle_<%#DataBinder.Eval(Container.DataItem,"PicID") %>" size="30" maxlength="100" value="<%#DataBinder.Eval(Container.DataItem,"AdTitle") %>" />
    </td>
    <td align="center"><a href="<%#DataBinder.Eval(Container.DataItem,"PicPath") %>" target="_blank">打开</a></td>
    <td align="center"><a href="<%#DataBinder.Eval(Container.DataItem,"LinkUrl") %>" target="_blank">打开</a></td>
    <td align="center"> 
        <asp:Button ID="Button1" runat="server" Text="删除" CommandArgument="0" CommandName=<%#DataBinder.Eval(Container.DataItem,"PicID") %>  OnClientClick="return confirm('真的删除此图片码？');" />
    </td>
  </tr>
  </AlternatingItemTemplate>
  <FooterTemplate>
</table>
</FooterTemplate>
   </asp:Repeater> 
  <table width="100%" border="0" cellspacing="2" cellpadding="0" align="center"  class="PageBox">
  <tr>
    <td>
                    <input type="checkbox" id="chxall" name="chxall" onclick="selectall();" />
                  
                    <asp:Button ID="btn_Sort" runat="server" Text="更新" CssClass="uPageBtn" OnClientClick="return checkupdate();" />
    
    </td>
  </tr>
</table>   
<fieldset>
<legend><span style="color:red">增加图片[最多6张图片]</span></legend>
<div style="padding:4px">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="11%" nowrap>标题：</td>
    <td width="89%">
        <asp:TextBox ID="txt_adtitle" MaxLength="100" Width="200" runat="server" CssClass="input_text"></asp:TextBox>
        <asp:TextBox ID="txt_PicPath" runat="server" Width="200"   BackColor="ButtonFace" CssClass="input_text"></asp:TextBox>
         <input type="button" class="uPageBtn" value="上传" onclick="OpenDialog('../../Module/Upload/index.aspx?FromUpload=4&TextBoxId=txt_PicPath',400,150);" />
    </td>
  </tr>
  <tr>
    <td nowrap>链接：</td>
    <td><asp:TextBox ID="txt_LinkUrl" MaxLength="255" Width="200" runat="server" CssClass="input_text"></asp:TextBox> 排序：<asp:TextBox ID="txt_SortNo" Width="50" runat="server" CssClass="input_text"></asp:TextBox></td>
  </tr>
  <tr>
    <td nowrap>&nbsp;</td>
    <td>
        <asp:Button ID="Okbtn" runat="server" Text=" 增 加 " CssClass="uPageBtn1" OnClientClick="return checkForm(this.form);" /> 
        <input type="button" value=" 关 闭 " class="uPageBtn1" onclick="window.close();" />
        </td>
  </tr>
</table>

</div>
</fieldset>

    </div>
    </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
    <ProgressTemplate>正在处理中，请稍候...</ProgressTemplate>
    </asp:UpdateProgress>
    </form>
</body>
</html>