<%@ page language="C#" autoeventwireup="true" inherits="V5Shop.Admin.Template_Picture_Manage, V5Shop.Shop.Template" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Src="control/ManageHeader.ascx" TagName="ManageHeader" TagPrefix="uc3" %>
<%@ Register Src="control/PageBottom.ascx" TagName="PageBottom" TagPrefix="uc2" %>
<%@ Register Src="control/HiddenField.ascx" TagName="HiddenField" TagPrefix="uc1" %>
<%@ Register TagPrefix="V5Shop" Namespace="V5Shop.Control" Assembly="V5Shop.Control" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>模板图片管理</title>
    <link href="css/css.css" rel="stylesheet" type="text/css" />
    <link href="css/css_list.css" rel="stylesheet" type="text/css" />
    <link href="css/control.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript" src="js/Common.js"></script>
</head>
<body>
    <form id="photoupload" runat="server">
    <div id="AlphaField" runat="server" style="background-color:#EEE;filter:alpha(opacity=50); position:absolute; left:0px; height:0px; width:100%; height:600px; z-index:9999; display:none;"></div>
    <div>
        <uc3:ManageHeader ID="ManageHeader1" runat="server" />
        <img id="review" style="display:none; cursor:pointer; position:absolute; top:120px; left:50px;z-index:19999;" alt="点击隐藏图片" onclick="HiddenImg(this)" />
        <div id="searcharea">
            <asp:Label ID="lblName" runat="server" Text="图片名称：" ForeColor="#4B6888" Font-Bold="true" meta:resourcekey="lblTitleResource1"></asp:Label>
                <asp:TextBox ID="txtName" Width="100px" runat="server" meta:resourcekey="txtTitleResource2"></asp:TextBox>

                <asp:Label ID="lblCategory" runat="server" Text="图片类别：" ForeColor="#4B6888" Font-Bold="true" meta:resourcekey="lblAuthorResource1"></asp:Label>
                <asp:DropDownList ID="listCategory" runat="server"></asp:DropDownList>
                
                <asp:Button ID="btnSearch" runat="server" Text="查询" OnClick="btnSearch_Click" meta:resourcekey="btnSearchResource1" CssClass="button" />
            
        </div>
          
        <div id="content">
            <div id="tool">
              <input type="checkbox" class="checkbox" id="CheckAllBox" onclick="CheckAll()" /> 全选
        　    <asp:LinkButton ID="btnAdd" runat="server" ForeColor="#4B6888" OnClick="btnAdd_Click" CausesValidation="false"><img src="images/icon/key_add.gif" alt="" /> 添加</asp:LinkButton>
        　    <asp:LinkButton ID="btnEdit" runat="server" ForeColor="#4B6888" OnClick="btnEdit_Click" OnClientClick="return CheckEdit()" CausesValidation="false"><img src="images/icon/key_edit.gif" alt="" /> 编辑</asp:LinkButton>
        　    <asp:LinkButton ID="btnDel" runat="server" ForeColor="#4B6888" OnClick="btnDel_Click" OnClientClick="return CheckDel()" CausesValidation="false" meta:resourcekey="btnDelResource2"><img alt="" src="images/icon/key_delete.gif" /> 删除</asp:LinkButton>
        　  </div>
            
            <asp:DataList ID="GridViewShow" Width="100%" runat="server" GridLines="Horizontal" RepeatColumns="8">
                <ItemTemplate>
                    <table>
                        <tr>
                            <td>
                                <div><img id="img_<%#Eval("Name") %>" onclick="ShowOldImg('../Template/<%=path %>/Images/<%=imagespath %>/<%# DataBinder.Eval(Container,"DataItem(Name)","{0}") %>')" src="../Template/<%=path %>/Images/<%=imagespath %>/<%# DataBinder.Eval(Container,"DataItem(Name)","{0}") %>" style="cursor:pointer;" alt="点击查看原图" onmousemove="this.parentNode.parentNode.style.backgroundColor='#006699'" onmouseout="this.parentNode.parentNode.style.backgroundColor='white'" width="80" height="80" /></div>
                            </td>
                        </tr>
                        <tr>
                            <td align="center" style="width: 80px">
                                <input runat="server" class="checkbox" value='<%# Eval("Name") %>' onmouseover="this.mouse='over'" onmouseout="this.mouse='out'" mouse="out" id="CheckBoxID" type="checkbox" title='<%# "该图片上传于" + DataBinder.Eval(Container,"DataItem(date)","{0}") %>'/>
                                <asp:Label ID="imgName" Visible="false" runat="server" Text='<%# DataBinder.Eval(Container,"DataItem(name)","{0}") %>'></asp:Label>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </asp:DataList>
            
            <asp:Panel ID="AddField" runat="server" Visible="false">
                <div align="center" style="position:absolute; left:200px; top:140px; border:solid 3px #B8C9D6; z-index:10000">
					<table cellpadding="0" cellspacing="0" width="500">
						<tr>
							<td width="20%" height="30" align="right" bgcolor="#ffffff">
							<asp:Label ID="lblPictureCategory" runat="server" Text="图片类别：">
							</asp:Label>
							</td>
							<td align="left" bgcolor="#ffffff">
							<asp:DropDownList ID="listPictureCategory" runat="server" Width="150px">
							</asp:DropDownList>
							<input type="button" value="管理" onclick="window.location.href='Template_PictureCategory_Manage.aspx'" class="button" />
							<span class="NeedMsg">*</span> </td>
						</tr>
						<tr>
							<td width="20%" align="right" style="height: 30px" bgcolor="#ffffff">
							<asp:Label ID="Label1" runat="server" Text="上传方式：">
							</asp:Label>
							</td>
							<td align="left" style="height: 30px" bgcolor="#ffffff">
							<input type="radio" class="radio" name="UploadType" id="Type_1" value="0" onclick="HiddenField(this)" checked="checked" /><label for="Type_1">单图上传</label>
							<input type="radio" class="radio" name="UploadType" id="Type_2" value="1" onclick="HiddenField(this)" /><label id="Type_2_Label" for="Type_2">批量上传</label>
							</td>
						</tr>
						<tr id="UploadType_1">
							<td width="20%" height="30" align="right" bgcolor="#ffffff">
							<asp:Label ID="lblSrc" runat="server" Text="上传图片：">
							</asp:Label>
							<asp:Label ID="lblOldSrc" runat="server" Visible="false"></asp:Label>
							</td>
							<td align="left" bgcolor="#ffffff">
							<asp:FileUpload ID="fileSrc" runat="server" Width="300px" />
							</td>
						</tr>
						<tr id="UploadType_2" style="height:30px" bgcolor="#ffffff">
							<td width="20%" height="30" align="right">
							<asp:Label ID="Label2" runat="server" Text="批量上传：">
							</asp:Label>
							</td>
							<td align="left" bgcolor="#ffffff">
							<input type="button" class="button" value="批量上传图片" onclick="OpenDialogLable('Template_Picture_Upload_Dialog.aspx',600,600)" />
							</td>
						</tr>
						<tr>
							<td align="center" colspan="2" style="height: 30px" bgcolor="#ffffff">
							<asp:Button ID="btnAddSubmit" runat="server" Text="确定" OnClick="btnAddSubmit_Click" CssClass="button" />&nbsp;<asp:Button
                                ID="Btnrevoke" runat="server" CssClass="button" Text="取消" OnClick="Btnrevoke_Click" />
                                <asp:Button ID="btnEditSubmit" runat="server" Text="修改" OnClick="btnEditSubmit_Click" Visible="false" CssClass="button" />
							<input id="iptReset" runat="server" type="reset" value="重置" class="button" />
							</td>
						</tr>
					</table>
				</div>
            </asp:Panel>
        </div>
        
        <script type="text/javascript">
            
            //打开标签选择对话框
            function OpenDialogLable(url, w, h){
                if (navigator.appVersion.indexOf("MSIE") == -1){
                    this.returnAction=function(strResult){
                        if(strResult!=null){
                            
                        }
                    }
                    window.open("swfupload/" + url + '?f=<%=imagespath %>&d=' + Date(),'newWin','modal=yes,width='+w+',height='+h+',top=200,left=300,resizable=no,scrollbars=no');
                    return;
                }else{
                    this.returnAction=function(strResult){
                        if(strResult!=null){
                            
                        }
                    }
                    window.open("swfupload/" + url + '?f=<%=imagespath %>&d=' + Date(),'newWin','modal=yes,width='+w+',height='+h+',top=200,left=300,resizable=no,scrollbars=no');
                    return;
                }
            }
	        var isFF = false;
	        if (navigator.appVersion.indexOf("MSIE") == -1){
		        //isFF = true;
		    }
		    
            function HiddenField(obj){
                var value = obj.value;
                document.getElementById("UploadType_1").style.display = value == "0" ? "" : "none";
                document.getElementById("UploadType_2").style.display = value == "1" ? "" : "none";
            }
            
            if(isFF){
                document.getElementById("Type_2").disabled = true;
                document.getElementById("Type_2_Label").innerHTML += "(FF下无法使用图片批量上传功能)";
            }
	    </script>
        
        <div style="display:none">
            <div class="note" id="photoupload-status"></div>
			<ul class="photoupload-queue" id="photoupload-queue">
				<li style="display: none" />
			</ul>
        </div>
        <div id="hiddenfield">
            <asp:HiddenField ID="CheckedIDS" runat="server" Value="0" />
            <asp:HiddenField ID="PageIndex" runat="server" Value="0"/>
            <asp:HiddenField ID="MaxPageIndex" runat="server" Value="0"/>
            <uc1:HiddenField ID="Alert" runat="server" />
        </div>
        <uc2:PageBottom ID="PageBottom1" runat="server" />
    </div>
    </form>
</body>
</html>