<%@ Page Language="C#" AutoEventWireup="false" %>
<%@ Register TagPrefix="Hishop" Namespace="Hishop.Web.Controls" Assembly="Hishop.Web.Controls" %>
<%@ Register TagPrefix="Hishop" Namespace="Hishop.Web.Management" Assembly="Hishop.Web.Management" %>
<%@ Register TagPrefix="Kindeditor" Namespace="kindeditor.Net" Assembly="kindeditor.Net" %>
<%@ Register TagPrefix="Hishop" Namespace="Hishop.Web.Validator" Assembly="Hishop.Web.Validator" %>
<%@ Register TagPrefix="UI" Namespace="ASPNET.WebControls" Assembly="ASPNET.WebControls" %>
<%@ Import Namespace="Hishop.SystemServices" %>

<!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>
    <Hishop:HeadContainer ID="HeadContainer1" runat="server" />
    <Hishop:PageTitle ID="PageTitle1" runat="server" />
    <link rel="stylesheet" href="../../utility/validate/pagevalidator.css" type="text/css" />
    <link rel="stylesheet" href="../css/Hishopv5.css" type="text/css" />
    <script type="text/javascript" src="../../utility/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../../utility/validate/pagevalidator.js"></script>
    
    <script type="text/javascript" src="../js/Hishopv5.js"></script>
<script type="text/javascript" language="javascript">
    function AddAttachment() {
        var objTable = $("#ImagesFtp");
        var intCount = $("#ImagesFtp tr").children().size() / 2;
        if (intCount >= 10)
        { alert("附件不能超过10个"); return; }
        objTable.append("<tr><td width=\"100%\"><input type='file' name='fileFtp' onchange='FileExtChecking(this)' /></td><td nowrap=\"nowrap\"><a href='javascript:void(0);' onclick='DisposeTr(this)' class='del'>移除</a></td></tr>");
    }
    function DisposeTr(arg_obj_item) {
        var objTr = $(arg_obj_item).parent().parent();
        objTr.remove();
    }

    function DisposeTr(arg_obj_item) {
        var objTr = $(arg_obj_item).parent().parent();
        objTr.remove();
    }

    function FileExtChecking(obj) {
        var ErrMsg = "";
        var AllowExt = ".jpg|.gif|.png|.jpeg|.bmp|"  //允许上传的文件类型 每个扩展名后边要加一个"|" 小写 
        var FileExt = obj.value.substr(obj.value.lastIndexOf(".")).toLowerCase();
        if (AllowExt != 0 && AllowExt.indexOf(FileExt + "|") == -1)  //判断文件类型是否允许上传
        {
            ErrMsg = "\n该类型不允许上传！</br>请上传:" + AllowExt + "类型的文件!";
            obj.value = "";
            alert(ErrMsg);
            return false;
        }
    }
</script>
    
</head>
<body>
    <form id="form1" runat="server">
        <div>           
            <div class="PageTitleArea">
                <div class="PageTitle">上传图片</div>
                <div style="width: 80%;">上传图片到图库</div>
            </div>
            <div>
                <ul class="anchors clearfix">
                <li><a href='./ImageGallery.aspx'><img src="../images/bmquanxian.gif" alt="" />图库管理</a></li>
                <li class="tabs-selected"><a href='./ImageUploader.aspx'><img src="../images/guoqidecuxiao.gif" alt="" />上传图片</a></li>
                <li><a href='./ImageCategorys.aspx'><img src="../images/shiyoudecuxiao.gif" alt="" />分类管理</a></li>
                </ul>
            </div>
            <Hishop:ImageUploader ID="ImageCategorys" runat="server">
                <SkinTemplate> 
                    <Hishop:StatusMessage ID="Status" runat="server" Visible="False" />
                    <div class="dataarea mainwidth clearfix">
  <table width="100%" border="0" cellspacing="5" cellpadding="0">
  <tr>
  <td width="100%" valign="top"><!--搜索-->
                <div class="functionHandleArea">
                  <table width="100%" border="0" cellspacing="5" cellpadding="0">
                  <tr>
                    <td width="6%" nowrap="nowrap">
                     上传到：
                    </td>
                    <td width="94%">               
                      <Hishop:ImageDataGradeDropDownList ID="dropImageFtp" runat="server" />                      
                  </td>
                  </tr>
                </table>
               </div>
                <!--添加上传图片列表-->
                <div class="imageDataLeft">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="66%" valign="top">
                    <table cellpadding="0" cellspacing="5" id="ImagesFtp" class="ImagesFtp">
                      <tr>
                        <td width="100%"><!--<input type="file" onchange="FileExtChecking(this)" name="file" />-->
                         <asp:FileUpload ID="FileUpload" runat="server" onchange="FileExtChecking(this)"/>
                        </td>
                        <td width="54" nowrap="nowrap"><a onclick="AddAttachment()" href="javascript:void(0)" class="add">添加</a></td>
                      </tr>
                    </table>
                    </td>
                    <td width="34%" rowspan="2" valign="top">
                    <div class="ImagesMsg"><strong>提示：</strong><br/>
                        1.您一次最多可以上传10张图片。<br/>
                        2.请勿重复选择同一个图片文件。<br/>
                        3.图片文件的大小建议控制在500KB以内，图片太大会影响网站打开速度
                     </div>
                    </td>
                  </tr>
                   <tr>
                    <td valign="top" style="padding-left:100px;padding-top:20px;">
                    <a class="linkSub float"><asp:Button ID="btnSaveImageFtp" runat="server" Text="确定上传"  CssClass="submit_DAqueding"/></a>                    
                 </tr>
                </table>
               </div>                
                <!--添加上传图片列表--></td>
    <td valign="top" width="160">
    <!--右边-->
     <div class="imageDataRight">
       <div class="borderthin">
         <ul class="RightHead">图片分类:</ul>       
         <Hishop:ImageTypeLabel runat="server" ID="ImageTypeID" />
        <ul class="pad10"><a href="<%= Globals.ApplicationPath%>/admin/shop/ImageCategorys.aspx" class="submit_type" style="display:block;text-align:center;">分类管理</a></ul>
        
      </div>
      </div> 
    </td>
  </tr>
  </table>
</div>	
                </SkinTemplate>
            </Hishop:ImageUploader>
        </div>
        <br />
       <div style="margin:0px auto;width:500px;clear:both;">
            <hr style="width:500px;" />
            <Hishop:SiteCopyright ID="SiteCopyright1" runat="server" />
        </div>
        <br />
        <Hishop:ValidatorContainer runat="server" ID="ValidatorContainer" />
    </form>
</body>
</html>