www.gusucode.com > 漂亮的地方旅游景点景观介绍网站源代码 > admin/road/xc.asp
<!--#include file="../config.asp" --> <!--#include file="../../inc/page.asp" --> <% call zwtj() dim lx lx=Trim(Request.QueryString("lx")) if lx="" then call cc("参数错误") end if mytit=mytit&"<a href=""road.asp?action=ups&id="&lx&""">"&getmc("jw_road","id",lx,"mc")&"</a> > <a href=""?lx="&lx&"""> 行程管理</a> > " 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_xc where lx="&lx&" 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&lx=<%= lx %>">添加行程 </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("ts") %>天</td> <td align="center"><%= getmc("jw_road","id",lx,"mc") %> </td> <td align="center"><table border="0" cellpadding="2" cellspacing="0"> <tr> <td valign="bottom"><a href="?action=ups&lx=<%= lx %>&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&lx=<%= lx %>" name="form1" id="form1" method="post"> <tr> <td width="63" bgcolor="#D9ECF7">路 线:</td> <td width="652" bgcolor="#D9ECF7"><input name="lx" type="text" class="inp" id="lx" size="40" onfocus="this.className='focus'" onblur="this.className='inp'" disabled value="<%= getmc("jw_road","id",lx,"mc") %>"/></td> </tr> <tr> <td bgcolor="#D9ECF7">天 数:</td> <td bgcolor="#D9ECF7">第 <input name="ts" type="text" class="inp" id="ts" size="10" onfocus="this.className='focus'" onblur="this.className='inp'" value="<%= getnum(" jw_xc where lx="&lx)+1 %>" readonly/> 天</td> </tr> <tr> <td bgcolor="#D9ECF7">交通工具:</td> <td bgcolor="#D9ECF7"><input name="jt" type="text" class="inp" id="jt" size="40" onfocus="this.className='focus'" onblur="this.className='inp'"/></td> </tr> <tr> <td bgcolor="#D9ECF7">当天行程:</td> <td bgcolor="#D9ECF7"><textarea name="xc" cols="60" rows="5" class="inp" id="xc" onFocus="this.className='focus'" onBlur="this.className='inp'"></textarea></td> </tr> <tr> <td bgcolor="#D9ECF7">用 餐:</td> <td bgcolor="#D9ECF7"><input name="yc" type="text" class="inp" id="yc" size="40" onfocus="this.className='focus'" onblur="this.className='inp'"/></td> </tr> <tr> <td bgcolor="#D9ECF7">住 宿:</td> <td bgcolor="#D9ECF7"><input name="zs" type="text" class="inp" id="zs" size="40" onfocus="this.className='focus'" onblur="this.className='inp'"/></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> <SCRIPT language="javascript" event="onkeydown" for="document"> if(event.keyCode==13&&event.srcElement.type!='button'&&event.srcElement.type!='submit'&&event.srcElement.type!='reset'&&event.srcElement.type!='textarea'&&event.srcElement.type!='') goo('?action=aadd'); </SCRIPT> <% call connend() call foot() end sub '执行添加////////////////////////////////////////////////////////////////////////////////////// sub aadd() dim ts,jt,xc,yc,zs ts=getform("ts",2,0) jt=getform("jt",1,0) xc=getform("xc",1,0) yc=getform("yc",1,0) zs=getform("zs",1,0) '插入记录//////////////////////////////////////////////////////////////////////////////////// call record(rs,"select top 1 * from jw_xc where 1=1",3) rs.addnew() rs("lx")=lx rs("ctim")=now() rs("ts")=ts rs("jt")=jt rs("xc")=xc rs("yc")=yc rs("zs")=zs rs.update() call recordend(rs) if err.number>0 then call errs("有错误发生") end if call connend() response.Redirect("xc.asp?lx="&lx)end sub '修改//////////////////////////////////////////////////////////////////////////////////////////// sub ups() set rs=conn.execute("select * from jw_xc 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&lx=<%= lx %>">添加行程 </a></strong></td> </tr> <tr> <td> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF"> <form action="?action=doup&id=<%= rs("id") %>&lx=<%= lx %>" name="form1" id="form1" method="post"> <tr> <td width="66" bgcolor="#D9ECF7">路 线:</td> <td width="649" bgcolor="#D9ECF7"><input name="lx" type="text" class="inp" id="lx" size="40" onfocus="this.className='focus'" onblur="this.className='inp'" disabled value="<%= getmc("jw_road","id",rs("lx"),"mc") %>"/></td> </tr> <tr> <td bgcolor="#D9ECF7">天 数:</td> <td bgcolor="#D9ECF7">第 <input name="ts" type="text" class="inp" id="ts" size="10" onfocus="this.className='focus'" onblur="this.className='inp'" value="<%= rs("ts") %>" readonly/> 天</td> </tr> <tr> <td bgcolor="#D9ECF7">交通工具:</td> <td bgcolor="#D9ECF7"><input name="jt" type="text" class="inp" id="jt" size="40" onfocus="this.className='focus'" onblur="this.className='inp'" value="<%= rs("jt") %>"/></td> </tr> <tr> <td bgcolor="#D9ECF7">当天行程:</td> <td bgcolor="#D9ECF7"><textarea name="xc" cols="60" rows="5" class="inp" id="xc" onFocus="this.className='focus'" onBlur="this.className='inp'"><%= rs("xc") %></textarea></td> </tr> <tr> <td bgcolor="#D9ECF7">用 餐:</td> <td bgcolor="#D9ECF7"><input name="yc" type="text" class="inp" id="yc" size="40" onfocus="this.className='focus'" onblur="this.className='inp'" value="<%= rs("yc") %>"/></td> </tr> <tr> <td bgcolor="#D9ECF7">住 宿:</td> <td bgcolor="#D9ECF7"><input name="zs" type="text" class="inp" id="zs" size="40" onfocus="this.className='focus'" onblur="this.className='inp'" value="<%= rs("zs") %>"/></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> <SCRIPT language="javascript" event="onkeydown" for="document"> if(event.keyCode==13&&event.srcElement.type!='button'&&event.srcElement.type!='submit'&&event.srcElement.type!='reset'&&event.srcElement.type!='textarea'&&event.srcElement.type!='') goo('?action=doup&id=<%= id %>'); </SCRIPT> <% call connend() call foot() end sub '执行修改//////////////////////////////////////////////////////////////////////////////////// sub doup() dim ts,jt,xc,yc,zs ts=getform("ts",2,0) jt=getform("jt",1,0) xc=getform("xc",1,0) yc=getform("yc",1,0) zs=getform("zs",1,0) '更新记录//////////////////////////////////////////////////////////////////////////////////// call record(rs,"select * from jw_xc where id="&id,3) rs("lx")=lx rs("ts")=ts rs("jt")=jt rs("xc")=xc rs("yc")=yc rs("zs")=zs rs.update call recordend(rs) '结束///////////////////////////////////////////////////////////////////////////////////// if err.number>0 then call errs("有错误发生") end if call connend() response.Redirect("xc.asp?lx="&lx) 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_xc where id="&iid(i)) next call connend() response.Redirect(request.ServerVariables("HTTP_REFERER")) end sub %>