<%@ page language="C#" autoeventwireup="true" inherits="admin_youqing, App_Web_5fvwns4r" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<!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>
    <title>上海和尘网站系统管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> 
<link rel="stylesheet" href="style/css.css" type="text/css" /> 
<link rel="stylesheet" href="style/page.css" type="text/css" /> 

<script src="uploadify/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="uploadify/swfobject.js" type="text/javascript"></script>
<script src="uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="uploadify/uploadify.css" />


</head>
<body>
    <form id="form1" runat="server">


<table width="100%" border="0" cellpadding="0" cellspacing="0" class="map">
  <tr>
    <td>图片管理</td>
    <td align="right"><a href="?" class="sixlink">图片信息</a> </td>
  </tr>
</table>
 
<table width="98%" border="0" cellpadding="0" cellspacing="0" class="title" align="center">
  <tr>
    <td>图片信息</td>
    <td width="50%"><span style="color:Red;"><%=classname9 %></span></td>
  </tr>
</table>


  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="list">
    <thead>
    <tr class="header">
      <td align="center">类别</td>
      <td align="center">名称</td>
      <td align="center">链接</td>
      <td align="center">排序</td>
      <td align="center">图片</td>
      <td align="center">操作</td>
    </tr>
     </thead>

	 <asp:Repeater ID="RepeaterN" runat="server" OnItemDataBound="Repeater1_ItemDataBound" OnItemCommand="Repeater1_ItemCommand">
         <ItemTemplate>     
    <tr>
      <td align="center">
          <asp:DropDownList ID="Lb" runat="server">
            <asp:ListItem Value="首页banner">首页banner</asp:ListItem>
          </asp:DropDownList>
      
      </td>
      
      <td align="center"><asp:TextBox ID="Title" Width="100px" CssClass="input" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "title")%>' /></td>
      <td align="center"><asp:TextBox ID="Url" Width="200px" CssClass="input" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "url")%>' /></td>
      <td align="center"><asp:TextBox ID="Ordernumber" Width="30px" CssClass="input" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "ordernumber")%>' /></td>
      <td align="center">
      <%#(Eval("img1")).ToString()==""?"":"<img  border='0' src='../"+ Eval("img1")+"' width=120 />" %>
      <asp:FileUpload ID="fileUp" runat="server" Width="200px" Height="20px" Visible="false" />
      
      </td>
      <td align="center">
      
          <asp:ImageButton ID="ImgBtn" CommandName="Update" ImageUrl="images/icon_edit.gif" runat="server" />
          <asp:HiddenField ID="Youqingid" Value='<%#DataBinder.Eval(Container.DataItem, "youqingid")%>' runat="server" />
      
      &nbsp;&nbsp;
      
     <a href="youqing.aspx?youqingid=<%#Eval("youqingid")%>&action=del&img=<%#Eval("img1")%>" onClick="javascript:return confirm('确定删除吗?');"><img src="images/icon_drop.gif" border="0" alt="删除" /></a>

      </td>
    </tr>
	     </ItemTemplate>
      </asp:Repeater> 
          
  </table>
   




<br>
<br>

<table width="98%" border="0" cellpadding="0" cellspacing="0" class="title" align="center">
  <tr>
    <td>添加图片</td>
  </tr>
</table>


  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="add">
    <tr>
      <td width="30%" align="right">名称：</td>
      <td align="left"> <input runat="server" name="title" type="text" maxlength="50" class="input" id="title" style="width:300px;" />
      </td>
    </tr>
    <tr>
      <td width="30%" align="right">网址：</td>
      <td align="left"> <input runat="server" name="url" type="text" maxlength="50" class="input" id="url" style="width:300px;" />
      </td>
    </tr>
    <tr>
      <td align="right">排序：</td>
      <td align="left"><input runat="server" name="ordernumber" type="text" maxlength="6" value="0" class="input" id="ordernumber" style="width:50px;" /></td>
    </tr>
   
    <tr>
      <td align="right">类别：</td>
      <td align="left">
          <asp:DropDownList ID="Lb" runat="server">
            <asp:ListItem Value="首页banner">首页banner</asp:ListItem>
          </asp:DropDownList>
      </td>
    </tr>


    <tr> 
        <th>上传：</th>
        <td><div style="float:left;"><input name="img1" maxlength="100" type="text" class="input" id="img1" style="width:300px; margin-bottom:5px;" />      
        <br />
        <div style=""><input id="file_upload" type="file" name="file_upload" /></div>
        </div>  
        <div style="float:left; margin-left:20px;"><span class="imgbox" style="display:none;"><img height="50" id="pic" style="margin-top:8px;" /></span></div>
        <div id="uploadfileQueue" style="padding: 3px;"></div>
    </td>
    </tr>

    <tr>
      <td align="right">&nbsp;</td>
      <td align="left" valign="middle"><label>
        <asp:Button ID="Btn" runat="server" Text="确定" CssClass="btn" OnClick="Btn_Click" />
        <input name="button1" type="reset" class="btn" id="button1" value="清除" />

      </label></td>
    </tr>
  </table>

</form>


 
<!--#include file="footer.htm"-->


<script type="text/javascript">
        $(function(){
        $("#file_upload").uploadify({
        //开启调试
        'debug' : false,
        //是否自动上传
        'auto':true,
        'buttonText':'选择照片',
        //flash
        'swf': "uploadify/uploadify.swf",
        //文件选择后的容器ID
        'queueID':'uploadfileQueue',
        'uploader':'uploadify/upload.aspx',
        'width':'75',
        'height':'24',
        'multi':false,
        'fileTypeDesc':'支持的格式：',
        'fileTypeExts':'*.jpg;*.jpge;*.gif;*.png',
        'fileSizeLimit':'1MB',
        'removeTimeout':0.5,

        //返回一个错误，选择文件的时候触发
        'onSelectError':function(file, errorCode, errorMsg){
        switch(errorCode) {
        case -100:
        alert("上传的文件数量已经超出系统限制的"+$('#file_upload').uploadify('settings','queueSizeLimit')+"个文件！");
        break;
        case -110:
        alert("文件 ["+file.name+"] 大小超出系统限制的"+$('#file_upload').uploadify('settings','fileSizeLimit')+"大小！");
        break;
        case -120:
        alert("文件 ["+file.name+"] 大小异常！");
        break;
        case -130:
        alert("文件 ["+file.name+"] 类型不正确！");
        break;
        }
        },
        //检测FLASH失败调用
        'onFallback':function(){
        alert("您未安装FLASH控件，无法上传图片！请安装FLASH控件后再试。");
        },
        //上传到服务器，服务器返回相应信息到data里
        'onUploadSuccess':function(file, data, response){
			   var img1=$("#img1").val();
			   $("#img1").val("upload/"+data);
			   $(".imgbox").css("display","");
			   $("#pic").attr("src",'../upload/'+data);
			   //$("#Btn").attr("disabled",false);
			   if(img1!="")
			       $.ajax({url:"uploadify/upload.aspx?action=delimg&img="+encodeURI(img1),async:false}).responseText;        
        }
        });
        });

      </script>











    
</body>
</html>
