<!--#include file=conn.asp-->
<!--#include file=cookies.asp-->
<%dim action,id,dname
id=request.QueryString("id")
action=request.querystring("action")
dimgurl=trim(request("imgurl"))
select case action
case "add" 
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from jle_picfp",conn,1,3
rs.AddNew
rs("imgurl")=dimgurl
rs("link")=trim(request("link"))
rs.Update
rs.Close
set rs=nothing

case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from jle_picfp where id="&id,conn,1,3
rs("imgurl")=dimgurl
rs("link")=trim(request("link"))
rs.Update
rs.Close
set rs=nothing

case "del"
conn.execute ("delete from jle_picfp where id="&id)
conn.close   
set conn=nothing 
response.Redirect "picfp.asp"
end select
%>
<html>
<head>
<title>翻牌广告管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="style.css" type="text/css">
<style type="text/css">
<!--
body {
	background-color: #E7EEF5;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style></head>
<body>
<table width="90%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
  <tr> 
    <td height="20" bgcolor="#C5D5E4" align="center"><span style="color: #FF0000"><strong><font style="font-size:14px">翻牌广告管理</font></strong></span></td>
  </tr>
  <tr> 
    <td bgcolor="#EAEEF4"> <br>
	<table width="98%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
        <tr align="center" bgcolor="#FFFFFF" height="20"> 
          <td width="30" bgcolor="#D9E4EE">编号</td>
          <td bgcolor="#D9E4EE">广告图片地址</td>
          <td bgcolor="#D9E4EE">广告图片链接</td>
          <td bgcolor="#D9E4EE">管理操作</td>
        </tr>
        <%set rs=server.CreateObject("adodb.recordset")
		  rs.Open "select * from jle_picfp order by id",conn,1,1
		  dim follows
		  if rs.EOF and rs.BOF then
          response.write"<tr bgcolor=#FFFFFF><td colspan='4'><p align='center'><font color='red'>无此广告！</font></td></tr></table><br>"
		  follows=0
		  else
		  do while not rs.EOF
		  i=i+1
		  %>
        <form name="form1" method="post" action="?action=edit&id=<%=int(rs("id"))%>">
          <tr bgcolor="#FFFFFF" align="center">
		  <td bgcolor="#F4F7F9"><%=i%></td>
		  
            <td bgcolor="#F4F7F9"><input name="imgurl" type="text" id="imgurl" value="<%=trim(rs("imgurl"))%>" size="32"></td>
            <td bgcolor="#F4F7F9"><input name="link" type="text" id="link" value="<%=trim(rs("link"))%>" size="20"></td>
            <td bgcolor="#F4F7F9"><input type="submit" name="Submit" value="修 改">
            &nbsp; <input type="button" name="DEL" onClick="{if(confirm('确定要删除这个广告吗？\n此操作不可以恢复！')){location.href='?id=<%=rs("id")%>&action=del';}return false;}" value="删除" >            </td>
          </tr>
        </form>
        <%
		rs.MoveNext
          loop
          follows=rs.RecordCount
          end if%>
      </table>
	<br></td>
  </tr>
</table>
<br>
<table width="90%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
  <tr> 
    <td height="20" bgcolor="#C5D5E4" align="center"><span style="color: #FF0000"><strong><font style="font-size:14px">添 加 翻 牌 广 告</font></strong></span></td>
  </tr>
  <tr> 
    <td bgcolor="#EAEEF4">
	<br>
	<table width="98%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#335078" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
        <tr align="center" bgcolor="#FFFFFF" height="20"> 
          <td width="30" bgcolor="#D9E4EE">编号 </td>
          <td bgcolor="#D9E4EE">广告图片地址</td>
          <td bgcolor="#D9E4EE">广告图片链接</td>
          <td bgcolor="#D9E4EE">确定操作</td>
        </tr>
        <form name="form1" method="post" action="?action=add">
          <tr align="center" bgcolor="#FFFFFF"> 
            <td bgcolor="#F4F7F9"><%=rs.RecordCount+1%></td>
	        <td bgcolor="#F4F7F9"><input name="imgurl" type="text" id="imgurl" size="32"></td>
	        <td bgcolor="#F4F7F9"><input name="link" type="text" id="link" size="20"></td>
	        <td bgcolor="#F4F7F9"><input type="submit" name="Submit3" value="添 加"></td>
          </tr>
        </form>
      </table>
	<br></td>
  </tr>
</table>
</body> 
</html> 