<!--#include file="conn.asp"-->
<!--#include file="inc/cook2.asp"-->
<!--#include file="inc/dimflag.asp"-->
<!--#include file="inc/page.asp"-->
<%
Dim oXML, oXMLRoot, oXMLItems 
set oXML = CreateObject("MSXML2.DOMDocument") 
oXML.load Server.MapPath("../inc/fla_photo_en.xml") 
Set oXMLRoot = oXML.documentElement 
Set oXMLItems = oXMLRoot.selectNodes("//item") 
 
select case action

case "addnew" 
Dim TmpNode 
Set TmpNode = oXML.createElement("item") 
TmpNode.setAttribute "item_url","/"&Trim(Request("item_url")) 
TmpNode.setAttribute "link",Trim(Request("link")) 
TmpNode.setAttribute "itemtitle",Trim(Request("itemtitle")) 
oXMLRoot.appendChild TmpNode 
oXML.Save(Server.MapPath("../inc/fla_photo_en.xml"))
Response.Redirect "info_flash_en.asp"
Response.end()  

case "delete" 
Dim TmpNodes,Nodesss 
Set TmpNodes = oXMLItems.item(Trim(Request("index"))) 
Set Nodesss = TmpNodes.parentNode 
Nodesss.removeChild(TmpNodes) 
oXML.Save(Server.MapPath("../inc/fla_photo_en.xml")) 
Response.Redirect "info_flash_en.asp"
Response.end() 
 
case "inputedit"
attrKey = split(Trim(Request("id")), "$")(0) 
index = split(Trim(Request("id")), "$")(1) 
oXMLItems.item(index).setAttribute attrKey,Trim(Request("value")) 
oXML.Save(Server.MapPath("../inc/fla_photo_en.xml")) 
Response.Write(Trim(Request("value"))) 
Response.end()  

end select
%>
<!--#include file="top.asp"-->
<div id="container">
<div class="top_but">
 <li class="left">&nbsp;</li>
 <li><a href="?action=pageadd"><img src="images/but_1.gif" alt="添加" ></a></li>
 <li><img src="images/but_8.gif" alt="刷新" onClick="window.location.reload(true);"></li>
 <li><img src="images/but_9.gif" alt="打印" onClick="window.print() "/></li>
</div>
<div class="tableAll titlebgcolor">
 <li style="width:30px;">&nbsp;</li>
 <li style="width:50px">操作</li>
 <li style="width:50px">图片</li>
 <li style="width:300px;">图片地址(请保留flash_files/)</li>
 <li style="width:300px;">图片链接(点击修改)</li>
 <li style="width:150px;">图片标题(点击修改)</li>
</div>


<% 
For i = 0 To oXMLItems.length - 1 
namxe= oXMLItems.item(i).getAttribute("item_url")
link= oXMLItems.item(i).getAttribute("link")
itemtitle=oXMLItems.item(i).getAttribute("itemtitle")
%> 
<div class="tableAll trbgcolor">
  <li style="width:30px;">&nbsp;</li>
 <li style="width:50px"><a href="?action=delete&index=<%= i %>">删除</a></li>
 <li style="width:50px"><img src="../<%=namxe%>" height="22" width="40" align="absmiddle"></li>
 <li style="width:300px;"><span id="item_url$<%= i %>" class="edit"><%=namxe%></span></li>
 <li style="width:300px;"><span id="link$<%= i %>" class="edit"><%=link%></span></li>
 <li style="width:150px;"><span id="itemtitle$<%= i %>" class="edit"><%=itemtitle%></span></li>
</div>
<% 
Next 
%>

<%
select case action
case "pageadd" 
%>
<div class="tableAll titlebgcolor">
  <li style="width:30px;">&nbsp;</li>
 <li style="width:750px">添加新的动画图片(注：图片只能为JPG格式)</li>
</div>

<form name="myform" action="?action=addnew" method="post">
<div class="tableAll trbgcolor">
 <li style="width:30px;">&nbsp;</li>
 <li><input type="text" name="item_url" id="item_url" size="60" /></li>
 <li><iframe ID="UploadFiles" src="update_file.asp?editname=item_url&filepath=flash_files" frameborder=0 scrolling=no width="200" height="20"></iframe></li>
</div>

<div class="tableAll trbgcolor">
 <li style="width:30px;">&nbsp;</li>
 <li style="width:250px"><input type="text" name="link" id="link" style="width:240px;" /></li>
 <li style="width:210px;"><input type="text" name="itemtitle" id="itemtitle" style="width:200px;" /></li>
 <li><input type="submit" name="submit" class="button" value="新添加" /></li>
</div>
 
</form> 
<%
end select
%>
</div>
<script language="JavaScript" type="text/JavaScript" src="js/jquery.latest.js"></script> 
<!--#include file="footer.asp"-->