www.gusucode.com > 漂亮的地方旅游景点景观介绍网站源代码 > admin/road/innfx.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_innfx 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("fx") %></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="79" bgcolor="#D9ECF7">酒&nbsp;&nbsp;&nbsp;&nbsp;店:</td>
<td width="765" 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="fx" type="text" class="inp" id="fx" size="40" onFocus="this.className='focus'" onBlur="this.className='inp'" /></td>
</tr>
<tr>
<td bgcolor="#D9ECF7">市&nbsp;场&nbsp;价:</td>
<td bgcolor="#D9ECF7"><input name="price" type="text" class="inp" id="price" size="40" onFocus="this.className='focus'" onBlur="this.className='inp'" /></td>
</tr>
<tr>
<td bgcolor="#D9ECF7">优&nbsp;惠&nbsp;价:</td>
<td bgcolor="#D9ECF7"><input name="price1" type="text" class="inp" id="price1" size="40" onFocus="this.className='focus'" onBlur="this.className='inp'" /></td>
</tr>
<tr>
<td bgcolor="#D9ECF7">早&nbsp;&nbsp;&nbsp;&nbsp;餐:</td>
<td bgcolor="#D9ECF7"><select name="zaocan" class="inp" id="zaocan" onFocus="this.className='focus'" onBlur="this.className='inp'" style="width:120px;">
<option value="0">有</option>
<option value="1">无</option>
</select></td>
</tr>
<tr>
<td bgcolor="#D9ECF7">简&nbsp;&nbsp;&nbsp;&nbsp;介:</td>
<td bgcolor="#D9ECF7"><textarea name="content" cols="60" rows="6" class="inp" id="content" onFocus="this.className='focus'" onBlur="this.className='inp'"></textarea></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 fx,content,price,price1,zaocan

fx=getform("fx",1,0)
content=getform("content",1,0)
price=getform("price",3,0)
price1=getform("price1",3,0)
zaocan=getform("zaocan",1,0)

'插入记录////////////////////////////////////////////////////////////////////////////////////
call record(rs,"select top 1 * from jw_innfx where 1=1",3)
rs.addnew()
rs("jd")=jd
rs("fx")=fx
rs("content")=content
rs("price")=price
rs("price1")=price1
rs("zaocan")=zaocan
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_innfx 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="77" bgcolor="#D9ECF7">酒&nbsp;&nbsp;&nbsp;&nbsp;店:</td>
<td width="767" 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="fx" type="text" class="inp" id="fx" size="40" onFocus="this.className='focus'" onBlur="this.className='inp'" value="<%= rs("fx") %>" /></td>
</tr>
<tr>
<td bgcolor="#D9ECF7">市&nbsp;场&nbsp;价:</td>
<td bgcolor="#D9ECF7"><input name="price" type="text" class="inp" id="price4" size="40" onFocus="this.className='focus'" onBlur="this.className='inp'" value="<%= rs("price") %>" /></td>
</tr>
<tr>
<td bgcolor="#D9ECF7">优&nbsp;惠&nbsp;价:</td>
<td bgcolor="#D9ECF7"><input name="price1" type="text" class="inp" id="price3" size="40" onFocus="this.className='focus'" onBlur="this.className='inp'" value="<%= rs("price1") %>"/></td>
</tr>
<tr>
<td bgcolor="#D9ECF7">早&nbsp;&nbsp;&nbsp;&nbsp;餐:</td>
<td bgcolor="#D9ECF7"><select name="zaocan" class="inp" id="zaocan" onFocus="this.className='focus'" onBlur="this.className='inp'" style="width:120px;">
<option value="0" <% If rs("zaocan")=0 Then Response.Write("selected") end if%>>有</option>
<option value="1" <% If rs("zaocan")=1 Then Response.Write("selected") end if%>>无</option>
</select>
</td>
</tr>
<tr>
<td bgcolor="#D9ECF7">简&nbsp;&nbsp;&nbsp;&nbsp;介:</td>
<td bgcolor="#D9ECF7"><textarea name="content" cols="60" rows="6" class="inp" id="content" onFocus="this.className='focus'" onBlur="this.className='inp'"><%= rs("content") %></textarea></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 fx,content,price,price1,zaocan

fx=getform("fx",1,0)
content=getform("content",1,0)
price=getform("price",3,0)
price1=getform("price1",3,0)
zaocan=getform("zaocan",1,0)

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

'删除//////////////////////////////////////////////////////////////////////////////////////////
sub del()
call chkqx(9,6)
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_innfx where id="&iid(i))
next
call connend()
response.Redirect(request.ServerVariables("HTTP_REFERER"))
end sub
%>