www.gusucode.com > 漂亮的地方旅游景点景观介绍网站源代码 > admin/road/innpic.asp

    <!--#include file="../config.asp" -->
<!--#include file="../../inc/page.asp" -->
<%
call zwtj()

dim jd
jd=Trim(Request.QueryString("jd"))

if jd="" then 
call cc("参数错误")
end if

mytit=mytit&"<a href=""inn.asp?action=ups&id="&jd&""">"&getmc("jw_inn","id",jd,"mc")&"</a> &gt; <a href=""?jd="&jd&"""> 图片管理</a> &gt; "

select case action
case "add"
mytit=mytit&"添加图片"
call add()
case "aadd"
call aadd()
case "del"
call del()
case "doup"
call doup()
case "show",""
mytit=mytit&"图片列表"
call show()
case "ups"
mytit=mytit&"编辑图片"
call ups()
end select

'图片列表///////////////////////////////////////////////////////////////////////////////////////
sub show()
sql="select * from jw_innpic where jd="&jd&" order by id asc"
call record(rs,sql,1)
call head()
%>
<link href="../inc/mm.css" rel="stylesheet" type="text/css" />
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#116BAE">
<tr>
<td bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td id="tit"><strong><%= mytit %> || <a href="?action=add&jd=<%= jd %>">添加图片 </a></strong></td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF">
<form name="form1" id="form1" method="post" action="">
<tr>
<td width="6%" align="center" bgcolor="#C5E0F3"><strong>ID</strong></td>
<td width="45%" bgcolor="#C5E0F3"><strong>图片名称</strong></td>
<td width="37%" align="center" bgcolor="#C5E0F3"><strong>酒店</strong></td>
<td width="9%" align="center" bgcolor="#C5E0F3"><strong>操作</strong></td>
<td width="3%" align="center" bgcolor="#C5E0F3"><input type="checkbox" name="selectall" onClick="selectit()"/></td>
</tr>
<% 
dim i,sz
sz=20
i=sz
dim bgc
%>
<div style="display:none"><% call fenpage(sz,rs,10) %></div>
<%
do while not rs.eof and i>0 
if i mod 2=0 then 
bgc="#D2E9FF"
else
bgc="#D2E1EE"
end if
%>
<tr id="r<%=rs("id")%>" bgcolor=<%= bgc %> onMouseOver="museing(r<%=rs("id")%>,0,'<%= bgc %>')" onMouseOut="museing(r<%=rs("id")%>,1,'<%= bgc %>')">
<td align="center"><%= rs("id") %></td>
<td><%= rs("mc") %></td>
<td align="center"><%= getmc("jw_inn","id",jd,"mc") %>&nbsp;</td>
<td align="center"><table border="0" cellpadding="2" cellspacing="0">
<tr>
<td valign="bottom"><a href="?action=ups&jd=<%= jd %>&id=<%= rs("id") %>"><img src="../../images/admin/20050703091537508.gif" alt="编辑信息" width="14" height="15" border="0" align="absbottom" /></a></td>
</tr>
</table></td>
<td align="center"><input name="idstr" type="checkbox" value="<%= rs("id") %>" onClick="td_bgcolor(r<%=rs("id")%>,1);"></td>
</tr>
<% 
i=i-1
rs.movenext 
loop
%>
<tr>
<td colspan="5" bgcolor="#C5E0F3">

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="8%"><input name="del" type="button" class="button_1" id="del" value="删除所选" onMouseUp="tjqr('您确定要删除?此操作无法逆转!','?action=del')" onMouseOver="this.className='button_2'" onMouseOut="this.className='button_1'"/></td>
<td width="92%"><% call fenpage(sz,rs,10) %></td>
</tr>
</table></td>
</tr>
</form>
</table></td>
</tr>
</table></td>
</tr>
</table>
<%
call recordend(rs)
call connend()
call foot()
end sub

'添加//////////////////////////////////////////////////////////////////////////////////////////
sub add()
call head()
%>
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#116BAE">
<tr>
<td bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td id="tit"><strong><%= mytit %></strong></td>
</tr>
<tr>
<td>

<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
<form action="?action=aadd&jd=<%= jd %>" name="form1" id="form1" method="post">
<tr>
<td width="63" bgcolor="#D9ECF7">酒&nbsp;&nbsp;&nbsp;&nbsp;店:</td>
<td width="652" bgcolor="#D9ECF7"><input name="jd" type="text" class="inp" id="jd" size="40" onfocus="this.className='focus'" onblur="this.className='inp'"value="<%= getmc("jw_inn","id",jd,"mc") %>" disabled/></td>
</tr>
<tr>
<td bgcolor="#D9ECF7">名&nbsp;&nbsp;&nbsp;&nbsp;称:</td>
<td bgcolor="#D9ECF7"><input name="mc" type="text" class="inp" id="mc" size="40" onFocus="this.className='focus'" onBlur="this.className='inp'" /></td>
</tr>
<tr>
<td bgcolor="#D9ECF7">缩&nbsp;略&nbsp;图:</td>
<td bgcolor="#D9ECF7"><input name="simg" type="text" class="inp" id="simg" size="40" onfocus="this.className='focus'" onblur="this.className='inp'" /></td>
</tr>
<tr>
<td bgcolor="#D9ECF7">原&nbsp;&nbsp;&nbsp;&nbsp;图:</td>
<td bgcolor="#D9ECF7">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input name="bimg" type="text" class="inp" id="bimg" size="40" onfocus="this.className='focus'" onblur="this.className='inp'"/></td>
<td><img src="../../images/admin/img.gif" alt="上传" width="20" height="20" onclick="MM_openBrWindow('../upfile.asp?lx=1&f1=bimg&f2=simg&bj=1','','left='+(event.clientX+205)+',top='+(event.clientY+115)+',width=350,height=20')" style="cursor:hand;"/></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" bgcolor="#D9ECF7"><div id="msg"></div></td>
</tr>
<tr>
<td colspan="2" bgcolor="#D9ECF7"><input name="go" type="submit" class="button_1" id="go" value="提交" onMouseOver="this.className='button_2'" onMouseOut="this.className='button_1'">
<input name="reset" type="reset" class="button_1" id="reset" value="重置" onMouseOver="this.className='button_2'" onMouseOut="this.className='button_1'"/></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
call connend()
call foot()
end sub

'执行添加//////////////////////////////////////////////////////////////////////////////////////
sub aadd()
dim mc,simg,bimg
mc=getform("mc",1,0)
simg=getform("simg",1,0)
bimg=getform("bimg",1,0)
'插入记录////////////////////////////////////////////////////////////////////////////////////
call record(rs,"select top 1 * from jw_innpic where 1=1",3)
rs.addnew()
rs("jd")=jd
rs("mc")=mc
rs("simg")=simg
rs("bimg")=bimg
rs.update()
call recordend(rs)

if err.number>0 then 
call errs("有错误发生")
end if
call connend()
response.Redirect("?jd="&jd)
end sub

'修改////////////////////////////////////////////////////////////////////////////////////////////
sub ups()
set rs=conn.execute("select * from jw_innpic where id="&id)
if rs.eof then 
call cc("记录不存在!")
end if

call head()
%>

<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#116BAE">
<tr>
<td bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td id="tit"> <strong><%= mytit %> || <a href="?action=add&jd=<%= jd %>">添加图片 </a></strong></td>
</tr>
<tr>
<td>

<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
<form action="?action=doup&id=<%= rs("id") %>&jd=<%= jd %>" name="form1" id="form1" method="post">

<tr>
<td width="71" bgcolor="#D9ECF7">酒&nbsp;&nbsp;&nbsp;&nbsp;店:</td>
<td width="644" bgcolor="#D9ECF7"><input name="jd" type="text" class="inp" id="jd" size="40" onfocus="this.className='focus'" onblur="this.className='inp'"value="<%= getmc("jw_inn","id",jd,"mc") %>" disabled/></td>
</tr>
<tr>
<td bgcolor="#D9ECF7">名&nbsp;&nbsp;&nbsp;&nbsp;称:</td>
<td bgcolor="#D9ECF7"><input name="mc" type="text" class="inp" id="mc" size="40" onFocus="this.className='focus'" onBlur="this.className='inp'" value="<%= rs("mc") %>" /></td>
</tr>
<tr>
<td bgcolor="#D9ECF7">缩&nbsp;略&nbsp;图:</td>
<td bgcolor="#D9ECF7"><input name="simg" type="text" class="inp" id="simg" size="40" onfocus="this.className='focus'" onblur="this.className='inp'" value="<%= rs("simg") %>" /></td>
</tr>
<tr>
<td bgcolor="#D9ECF7">原&nbsp;&nbsp;&nbsp;&nbsp;图:</td>
<td bgcolor="#D9ECF7">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input value="<%= rs("bimg") %>" name="bimg" type="text" class="inp" id="bimg" size="40" onfocus="this.className='focus'" onblur="this.className='inp'"/></td>
<td><img src="../../images/admin/img.gif" alt="上传" width="20" height="20" onclick="MM_openBrWindow('../upfile.asp?lx=1&id=<%= rs("id") %>&up=1&f1=bimg&f2=simg&bj=1&tab=Jw_innpic','','left='+(event.clientX+205)+',top='+(event.clientY+115)+',width=350,height=20')" style="cursor:hand;"/></td>
</tr>
</table></td>
</tr>

<tr>
<td colspan="2" bgcolor="#D9ECF7"><div id="msg"></div></td>
</tr>
<tr>
<td colspan="2" bgcolor="#D9ECF7"><input name="go" type="submit" class="button_1" id="go" value="提交" onMouseOver="this.className='button_2'" onMouseOut="this.className='button_1'">
<input name="reset" type="reset" class="button_1" id="reset" value="重置" onMouseOver="this.className='button_2'" onMouseOut="this.className='button_1'" /></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
call connend()
call foot()
end sub

'执行修改////////////////////////////////////////////////////////////////////////////////////
sub doup()

dim mc,simg,bimg
mc=getform("mc",1,0)
simg=getform("simg",1,0)
bimg=getform("bimg",1,0)

'更新记录////////////////////////////////////////////////////////////////////////////////////
call record(rs,"select * from jw_innpic where id="&id,3)
rs("jd")=jd
rs("mc")=mc
rs("simg")=simg
rs("bimg")=bimg
rs.update
call recordend(rs)
'结束/////////////////////////////////////////////////////////////////////////////////////
if err.number>0 then 
call errs("有错误发生")
end if
call connend()
response.Redirect("?jd="&jd)
end sub

'删除//////////////////////////////////////////////////////////////////////////////////////////
sub del()
dim dpic,j
dim idstr,iid,i
idstr=replace(Trim(Request.Form("idstr"))," ","")
iid=split(idstr,",")

for i=0 to ubound(iid)
conn.execute("delete * from jw_innpic where id="&iid(i))
next
call connend()
response.Redirect(request.ServerVariables("HTTP_REFERER"))
end sub
%>