⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_addxl.asp

📁 一个有用的东西 希望大家喜欢 谢谢大家对本站的支持
💻 ASP
📖 第 1 页 / 共 2 页
字号:
end if
img=trim(request("img"))
conn.execute("delete from xianlu where id="&id)
if instr(img,"system/uploadimages/")>0 then
img=replace(img,"system/uploadimages/","")
Set fso = CreateObject("Scripting.FileSystemObject")
Set f2 = fso.getfile(server.mappath("system/uploadimages/"&img))
f2.delete
set fso=nothing
set f2=nothing
end if
response.write("<script>alert('删除操作成功!按确定后新载入!');location='admin_addxl.asp?action=del';</script>")
end sub
sub edit
%>
<table width="618" border="0" cellspacing="0" cellpadding="0">
  <tr>
<%
set rs11=conn.execute("select id,board from board")
while not rs11.eof
response.write("<td height=24 bgcolor=#f5f5f5 align=center><a href=""admin_addxl.asp?action=edit&id="&rs11("id")&""">"&mfkiqpl(rs11("board"))&"</a></td>")
rs11.movenext
wend
response.write("</tr></table>")
closers(rs11)
%>
<table width="618" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="4"></td>
  </tr>
</table>
<table width="618" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr align="center" bgcolor="#f5f5f5">
    <td width="520" height="24">前20条线路名称,更多请点击上面分类(点击查看详细信息)</td>
    <td width="55">类别标识</td>
    <td width="39">编辑</td>
  </tr>
<%
dim id
id=trim(request("id"))
if id="" or not isnumeric(id) then
tt="select top 20 id,x_name,x_leiid,x_top from xianlu order by x_top desc"
else
tt="select id,x_name,x_leiid,x_top from xianlu where x_leiid="&id&" order by x_top desc"
end if
set er=conn.execute(tt)
while not er.eof
%>
  <tr bgcolor="#FFFFFF">
    <td height="24">
<%
if trim(er("x_top"))=1 then
response.write ("<img src=images/mfk_top.gif width=16 height=16 alt=""置顶线路"">")
else
response.write ("<img src=images/mfk5.gif width=16 height=16 alt=""普通线路"">")
end if
%>
	<a href="listxianlu.asp?id=<%=er("id")%>" target="_blank"><%=er("x_name")%></a></td>
    <td align="center"><%=er("x_leiid")%></td>
    <td align="center"><a href="admin_addxl.asp?action=editok&id=<%=er("id")%>" title='编辑'><img src=images/mfk30.gif border="0"></a></td>
  </tr>
<%
er.movenext
wend
closers(er)
%>
</table>

<%
end sub
sub editok
dim id
id=trim(request("id"))
set rs=conn.execute("select * from xianlu where id="&id)
%>
<script>
function check(){
if(form1.ta.value=='' || form1.tb.value=='' || form1.tc.value=='' || form1.td.value=='' || form1.te.value=='' || form1.tf.value=='' || form1.tg.value=='' || form1.th.value==''){
alert("请认真填写上面所有项!");
return false;
}
}
</script>
<table width="618" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<form action="?action=editok1" method="post" enctype="multipart/form-data" name="form1" onSubmit="return check();">
  <tr bgcolor="#FFFFFF">
    <td width="135" height="24" align="center" bgcolor="#f5f5f5">线路名称:</td>
    <td width="480">   
    <input name="ta" type="text" id="ta" value="<%=rs("x_name")%>" size="50"><input name="xid" type="hidden" value="<%=rs("id")%>"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="24" align="center" bgcolor="#f5f5f5">线路报价:</td>
    <td> 
    <input name="tb" type="text" id="tb" value="<%=rs("x_baojia")%>" size="15">    </td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="24" align="center" bgcolor="#f5f5f5">线路类型:</td>
    <td> 
    <input name="tc" type="text" id="tc" value="<%=rs("x_leixun")%>" size="15"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="24" align="center" bgcolor="#f5f5f5">线路类别:</td>
    <td> 
      <select name="td" id="td">
<%
set leirs=conn.execute("select id,board from board order by id desc")
while not leirs.eof
s=trim(leirs("id"))
d=trim(rs("x_leiid").value)
response.write("<option value="""&s&"""")
if s=d then
response.write(" selected")
end if
response.write(">"&leirs("board")&"</option>")
leirs.movenext
wend
closers(leirs)
%>
      </select>
</td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="24" align="center" bgcolor="#f5f5f5">置顶情况:</td>
    <td> 
      <select name="x_top" id="select3">
        <option value="0" <%if trim(rs("x_top"))=0 then response.write("selected")%>>不置顶</option>
        <option value="1" <%if trim(rs("x_top"))=1 then response.write("selected")%>>置 顶</option>
      </select></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="24" align="center" bgcolor="#f5f5f5">线路时间:</td>
    <td> 
    <input name="te" type="text" id="te" value="<%=rs("x_shijian")%>" size="20">    </td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="110" align="center" bgcolor="#f5f5f5">行程安排:</td>
    <td height="110"> 
    <textarea name="tf" cols="60" rows="6" id="tf"><%=rs("x_anpai")%></textarea></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="110" align="center" bgcolor="#f5f5f5">线路途经景点:</td>
    <td height="110"> 
    <textarea name="tg" cols="60" rows="6" id="tg"><%=rs("x_jingdian")%></textarea></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="110" align="center" bgcolor="#f5f5f5">线路、行程说明:</td>
    <td height="110"> 
    <textarea name="th" cols="60" rows="6" id="th"><%=rs("x_shuoming")%></textarea></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="110" align="center" bgcolor="#f5f5f5">备   注:</td>
    <td height="110"> 
      <textarea name="tk" cols="60" rows="6" id="tk"><%=rs("x_zhushi")%></textarea></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="24" align="center" bgcolor="#f5f5f5">线路景点图片:</td>
    <td>     
	<input name="ttt" type="file" id="ttt" size="40"><input name="rimg" type="hidden" value="<%=rs("x_jingdiantupian")%>">    </td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="36" align="center" bgcolor="#f5f5f5">原图片情况:</td>
    <td height="36"><%
if instr(rs("x_jingdiantupian"),"system/uploadimages/")=0 then
response.write (" 无内部图片或图片是外部,建议重新上传内部图片来覆盖此! <br> 当前图片地址:")
response.write ("<a href="&rs("x_jingdiantupian")&" target=_blank>"&rs("x_jingdiantupian")&"</a>")
else
response.write(" 内部图片地址:<a href="&rs("x_jingdiantupian")&" target=_blank>"&rs("x_jingdiantupian")&"</a><br> 要删除此图片只要重新上传,不做操作则保持图片不变。")
end if
	%></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="24" colspan="2">  *上传文件类型为:gif,jpg,bmp,大小<2M。除图片外所有项均为必填写项。</td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="24" colspan="2" align="center"><input type="submit" name="Submit" value="确 定 修 改"></td>
    </tr>
</form>
</table>
<%
closers(rs)
end sub
sub editok1
set upload=new upload_5xsoft
dim id,ta,tb,tc,td,te,tf,tg,tj,tk,x_top
id=trim(upload.form("xid"))
ta=replace(trim(upload.Form("ta")),"'","’")
tb=replace(trim(upload.Form("tb")),"'","’")
tc=replace(trim(upload.Form("tc")),"'","’")
td=replace(trim(upload.Form("td")),"'","’")
te=replace(trim(upload.Form("te")),"'","’")
tf=replace(trim(upload.Form("tf")),"'","’")
tg=replace(trim(upload.Form("tg")),"'","’")
th=replace(trim(upload.Form("th")),"'","’")
tk=replace(trim(upload.Form("tk")),"'","’")
x_top=trim(upload.form("x_top"))
img=trim(upload.form("rimg"))
IDstring="mfkiqpl"&date & time
IDstring=Replace(IDstring,"-","")
IDstring=Replace(IDstring,":","")
pthString="system/uploadimages/"
set file=upload.file("ttt")
if file.filesize>0 then
if instr(img,pthstring)=0 then
response.write ("不是内部图,无须删除!")
else
img1=replace(img,"system/uploadimages/","")
Set fso = CreateObject("Scripting.FileSystemObject")
Set f2 = fso.getfile(server.mappath("system/uploadimages/"&img1))
f2.delete
conn.execute("update xianlu set x_jingdiantupian='' where id="&id)
end if
if file.filesize>2097152 then
set file=nothing
response.write("<script>alert('上传图片的大小不能大于2M,即:2097152字节!');history.back(1);</script>")
else
FileTpe=Mid(file.filename,Len(file.filename)-2)
if not (ucase(fileTpe)="JPG" or ucase(fileTpe)="BMP" or ucase(fileTpe)="GIF") then
response.write("<script>alert('上传图片格式只能为:JPG,BMP,GIF。');history.back(1);</script>")
else
file.saveAs Server.mappath(pthString & IDstring & "." & FileTpe)
filepath=pthString & IDstring & "." & FileTpe
conn.execute("update xianlu set x_jingdiantupian='"&filepath&"' where id="&id)
set f2=nothing
set file=nothing
end if
end if
end if
sss="update xianlu set x_name='"&ta&"',x_baojia='"&tb&"',x_leixun='"&tc&"',x_shijian='"&te&"',x_shuoming='"&th&"',x_jingdian='"&tg&"',x_anpai='"&tf&"',x_zhushi='"&tk&"',x_leiid='"&td&"',x_top="&x_top&" where id="&id
conn.execute(sss)
closeconn
response.write("<script>alert('此线路编辑修改完成!按确定重新载入!');location='admin_addxl.asp?action=editok&id="&id&"';</script>")
end sub
manageend
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -