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

    <!--#include file="../config.asp" -->
<!--#include file="../../inc/page.asp" -->
<%
call zwtj()
sub tssx(sx1,sx2)
if sx1=1 then
Response.Write("<span class=""fontr"">[置顶]<span>")
end if
if sx2=1 then
Response.Write("<span class=""fontr"">[禁用]<span>")
end if
end sub

function ymdh()
if fid=0 then 
ymdh="" 
end if
dim fpath,path,i
fpath=getmc("Jw_linksclass","id",fid,"fpath")
path=split(fpath,",")
for i=1 to (ubound(path)-1)
ymdh=ymdh&"<a href=""?fid="&path(i)&""">"&getmc("Jw_linksclass","id",path(i),"mc")&"</a> &gt; "
next
end function

mytit=mytit&"<a href=""?fid=0"">链接栏目管理</a> > "

select case action
case "add"
mytit=mytit&ymdh()&"添加栏目"
call add()
case "del"
call del()
case "show",""
mytit=mytit&ymdh()&"栏目列表"
call show()
case "ups"
mytit=mytit&ymdh()&"编辑栏目"
call ups()
case "px"
mytit=mytit&ymdh()&"栏目排序"
call cdpx()
case "zd"
call zd()
case "qxzd"
call qxzd()
case "jy"
call jy()
case "qy"
call qy()
case "aadd"
call aadd()
case "doup"
call doup()
case "qqzz"
call qqzz()
end select

'显示
sub show()
sql="select * from Jw_linksclass where fid="&fid&" order by id asc"
call record(rs,sql,1)
call head()
%>
<link href="../inc/mm.css" rel="stylesheet" type="text/css" />
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<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"><%= mytit %> || <a href="?action=add&amp;fid=<%= fid %>">添加栏目 </a></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="5%" align="center" bgcolor="#C5E0F3"><strong>ID</strong></td>
<td width="41%" bgcolor="#C5E0F3"><strong>栏目名称</strong></td>
<td width="15%" align="center" bgcolor="#C5E0F3"><strong>创建人</strong></td>
<td width="13%" align="center" bgcolor="#C5E0F3"><strong>所属分类</strong></td>
<td width="11%" align="center" bgcolor="#C5E0F3"><strong>属性</strong></td>
<td width="11%" align="center" bgcolor="#C5E0F3"><strong>操作</strong></td>
<td width="4%" 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>
<% If rs("path")<>"" Then %>
<a href="<%= rs("path") %>?fid=<%= rs("id") %>" target="_blank"><%= rs("mc") %></a>
<% Else %>
<%= rs("mc") %>
<% End If %>
<% call tssx(0,rs("show")) %></td>
<td align="center"><%= rs("creater") %>&nbsp;</td>
<td align="center"><%
If fid=0 Then
Response.Write("根目录")
else
Response.Write(getmc("Jw_linksclass","id",fid,"mc"))
end if
%></td>
<td align="center">
<%
If fid=0 Then
Response.Write("1级")
else
Response.Write(getjs("Jw_linksclass")&"级")
end if
%></td>
<td align="center"><table border="0" cellpadding="2" cellspacing="0">
<tr>
<td valign="bottom"><a href="?fid=<%= rs("id") %>"><img src="../../images/admin/20060713191005984.gif" alt="子栏目管理" width="16" height="16" border="0" align="absbottom"/></a></td>
<td valign="bottom"><a href="?action=ups&amp;fid=<%= fid %>&amp;id=<%= rs("id") %>"><img src="../../images/admin/20050703091537508.gif" alt="编辑信息" width="14" height="15" border="0" align="absbottom" /></a></td>
<td valign="bottom"><a href="links.asp?fid=<%= rs("id") %>"><img src="../../images/admin/20060713191007148.gif" alt="链接管理" width="16" height="16" border="0" align="absbottom" /></a></td>
<td valign="bottom"><% If rs("show")=0 Then %>
<a href="?action=jy&fid=<%= fid %>&id=<%= rs("id") %>"><img src="../../images/admin/20050703091539318.gif" alt="锁定" width="13" height="13" border="0" align="absbottom" /></a>
<% Else %>
<a href="?action=qy&amp;fid=<%= fid %>&amp;id=<%= rs("id") %>"><img src="../../images/admin/20050703091613193.gif" alt="解锁" width="12" height="13" border="0" align="absbottom" /></a>
<% End If %></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="7" bgcolor="#C5E0F3">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="7%"><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="93%" align="right"><% 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 chkqx(8,1)
'继承父栏目属性
dim pxzd,pxgz,perpage,path,newspath,show
if fid=0 then 
pxzd=""
pxgz=""
perpage=20
path=""
newspath=""
show=0
else
pxzd=getmc("Jw_linksclass","id",fid,"pxzd")
pxgz=getmc("Jw_linksclass","id",fid,"pxgz")
perpage=getmc("Jw_linksclass","id",fid,"perpage")
path=getmc("Jw_linksclass","id",fid,"path")
newspath=getmc("Jw_linksclass","id",fid,"newspath")
show=getmc("Jw_linksclass","id",fid,"show")
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"><%= mytit %></td>
</tr>
<tr>
<td>

<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
<form action="" name="form1" id="form1" method="post">
<tr>
<td width="15%" align="right" bgcolor="#D9ECF7">所属分类:</td>
<td bgcolor="#D9ECF7"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input name="fidstr" readonly type="text" class="inp" id="fidstr" size="50" value="<%= getlmdh("Jw_linksclass",fid) %>" onFocus="this.className='focus'" onBlur="this.className='inp'" style="cursor:hand;" onClick="MM_openBrWindow('../selfid.asp?tab=Jw_linksclass&amp;fid=<%= fid %>','','scrollbars=yes,resizable=yes,width=400,height=300')"/>
<input name="fid" type="hidden" id="fid" value="<%= fid %>" /></td>
<td width="40" align="center"><img src="../../images/admin/20061205172113303.gif" alt="选择分类" width="27" height="20" style="cursor:hand;" onClick="MM_openBrWindow('../selfid.asp?tab=Jw_linksclass&amp;fid=<%= fid %>','','scrollbars=yes,resizable=yes,width=400,height=300')" /></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right" bgcolor="#D9ECF7">栏目名称:</td>
<td bgcolor="#D9ECF7"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="47%"><input name="mc" type="text" class="inp" id="mc" size="50" onFocus="this.className='focus'" onBlur="out_mc();this.className='inp'"/></td>
<td width="53%"><div id="cmc"></div></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right" bgcolor="#D9ECF7">每页显示记录:</td>
<td bgcolor="#D9ECF7">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="300"><input name="perpage" type="text" class="inp" id="perpage" size="20" maxlength="5" value="<%= perpage %>" onFocus="this.className='focus'" onBlur="out_perpage();this.className='inp'"/>
条 </td>
<td width="342"><div id="cperpage"></div></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right" bgcolor="#D9ECF7">前台路径:</td>
<td bgcolor="#D9ECF7"><input name="path" type="text" class="inp" id="path" size="50" onFocus="this.className='focus'" onBlur="this.className='inp'"/ value="<%= path %>"></td>
</tr>
<tr>
<td align="right" bgcolor="#D9ECF7">栏目属性:</td>
<td bgcolor="#D9ECF7"><table border="0" cellspacing="0" cellpadding="2">
<tr>
<td>审核</td>
<td><input name="show" type="checkbox" id="show" value="0" <% If show=0 Then Response.Write("checked") end if%>/></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right" bgcolor="#D9ECF7">栏目简介:</td>
<td bgcolor="#D9ECF7"><textarea name="content" cols="60" rows="4" 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 onClick="goo('?action=aadd')" name="go" type="button" 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&fid=<%= fid %>');
</SCRIPT>
<%
call connend()
call foot()
end sub

'执行添加/////////////////////////////////////////////////////////////////////////////////////
sub aadd()
call chkqx(8,1)
dim mc,fid1,fpath,fpath1,content,xid,perpage,show,path
mc=getform("mc",1,1)
perpage=getform("perpage",2,1)
show=getform("show",2,1)
path=getform("path",1,1)
content=getform("content",1,1)
if perpage="" then 
perpage=0
end if
if show="" then 
show=0
end if
fid1=getform("fid",2,1)

if fid1=0 then
fpath1="0,"
else
fpath1=getmc("Jw_linksclass","id",fid1,"fpath")
end if

call record(rs,"select top 1 * from Jw_linksclass where 1=1",3)
rs.addnew()
rs("fid")=fid1
rs("fpath")="0"
rs("mc")=mc
rs("ctim")=now()
rs("content")=content
rs("show")=show
rs("perpage")=perpage
rs("show")=show
rs("path")=path
rs("creater")=creater
rs.update()
xid=rs("id")
call recordend(rs)

fpath=fpath1&xid&","
conn.execute("update Jw_linksclass set fpath='"&fpath&"' where id="&xid)

if err.number>0 then 
call errs("有错误发生")
end if
call errs(0)
end sub
'添加END//////////////////////////////////////////////////////////////////////////

'修改
sub ups()
call chkqx(8,2)
set rs=conn.execute("select * from Jw_linksclass 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"> <%= mytit %> || <a href="?action=add&amp;fid=<%= fid %>">添加栏目 </a></td>
</tr>
<tr>
<td>

<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
<form action="" name="form1" id="form1" method="post">
<tr>
<td width="15%" align="right" bgcolor="#D9ECF7">所属分类:</td>
<td bgcolor="#D9ECF7"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input name="fidstr" readonly type="text" class="inp" id="fidstr" size="50" value="<%= getlmdh("Jw_linksclass",rs("fid")) %>" style="cursor:hand;" onClick="MM_openBrWindow('../selfid.asp?tab=Jw_linksclass&fid=<%= fid %>','','scrollbars=yes,resizable=yes,width=400,height=300')"/>
<input name="fid" type="hidden" id="fid" value="<%= rs("fid") %>" /></td>
<td width="40" align="center"><img src="../../images/admin/20061205172113303.gif" alt="选择分类" width="27" height="20" style="cursor:hand;" onClick="MM_openBrWindow('../selfid.asp?tab=Jw_linksclass&amp;fid=<%= fid %>','','scrollbars=yes,resizable=yes,width=400,height=300')"/></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right" bgcolor="#D9ECF7">栏目名称:</td>
<td bgcolor="#D9ECF7"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="47%"><input name="mc" type="text" class="inp" id="mc" size="50" onFocus="this.className='focus'" onBlur="out_mc();this.className='inp'" value="<%= rs("mc") %>"/></td>
<td width="53%"><div id="cmc"></div></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right" bgcolor="#D9ECF7">每页显示记录:</td>
<td bgcolor="#D9ECF7"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="304"><input name="perpage" type="text" class="inp" id="perpage" size="20" maxlength="5" value="<%= rs("perpage") %>" onFocus="this.className='focus'" onBlur="out_perpage();this.className='inp'"/>
条 </td>
<td width="338"><div id="cperpage"></div></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right" bgcolor="#D9ECF7">前台路径:</td>
<td bgcolor="#D9ECF7"><input name="path" type="text" class="inp" id="path" size="50" onFocus="this.className='focus'" onBlur="this.className='inp'" value="<%= rs("path") %>"/></td>
</tr>
<tr>
<td align="right" bgcolor="#D9ECF7">栏目属性:</td>
<td bgcolor="#D9ECF7"><table border="0" cellspacing="0" cellpadding="2">
<tr>
<td>审核</td>
<td><input name="show" type="checkbox" id="show" value="0" <% If rs("show")=0 Then Response.Write("checked") end if%>/></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right" bgcolor="#D9ECF7">栏目简介:</td>
<td bgcolor="#D9ECF7"><textarea name="content" cols="60" rows="4" class="inp" id="content" onFocus="this.className='focus'" onBlur="this.className='inp'"><%= rs("content") %></textarea></td>
</tr>
<tr>
<td align="right" bgcolor="#D9ECF7">最后更新:</td>
<td bgcolor="#D9ECF7"><input name="lastm" type="text" class="inp" id="lastm" size="50" disabled="disabled" value="<%= rs("lastm") %>" 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 onClick="goo('?action=doup&id=<%= rs("id") %>&fid=<%= fid %>')" name="go" type="button" 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=<%= rs("id") %>&fid=<%= fid %>');
</SCRIPT>
<%
call connend()
call foot()
end sub

'执行修改
sub doup()
call chkqx(8,2)
dim mc,fid1,fpath,fpath1,content,perpage,show,path

mc=getform("mc",1,1)
perpage=getform("perpage",2,1)
show=getform("show",2,1)
path=getform("path",1,1)
content=getform("content",1,1)
if perpage="" then 
perpage=0
end if
if show="" then 
show=0
end if

fid1=getform("fid",2,1)
if fid1=0 then 
fpath1="0,"&id&","
else
fpath1=getmc("Jw_linksclass","id",fid1,"fpath")&id&","
end if

dim fidy,fpathy
fidy=getmc("Jw_linksclass","id",id,"fid")
fpathy=getmc("Jw_linksclass","id",id,"fpath")

'判断所属分类是否改变
if int(fidy)<>int(fid1) then 
if fidy=0 then
call errs("对不起!一级栏目不能移动!")
end if
if instr(fpathy,fpath1)>0 then
call errs("对不起!不能将栏目转移到该栏目的子栏目下!")
end if
end if

'更新记录
call record(rs,"select * from Jw_linksclass where id="&id,3)
rs("fid")=fid1
rs("fpath")=fpath1
rs("mc")=mc
rs("content")=content
rs("show")=show
rs("perpage")=perpage
rs("show")=show
rs("path")=path
rs.update()
call recordend(rs)

'更新子目录
if fidy<>fid1 then
call record(rs,"select * from Jw_linksclass where instr(fpath,'"&fpathy&"')>0",3)
if not rs.eof then 
rs("fpath")=replace(rs("fpath"),fpathy,fpath1)
rs.update
end if
call recordend(rs)
'更新记录
call record(rs,"select * from Jw_links where instr(fpath,'"&fpathy&"')>0",3)
if not rs.eof then 
rs("fpath")=replace(rs("fpath"),fpathy,fpath1)
rs.update
end if
call recordend(rs)
end if
call zhgx("Jw_linksclass",id)
if err.number>0 then 
call errs("有错误发生")
end if
call errs(0)
end sub

'删除
sub del()
call chkqx(8,3)
dim fpath,dJw_links,j,folder
dim idstr,iid,i
idstr=replace(Trim(Request.Form("idstr"))," ","")
iid=split(idstr,",")

for i=0 to ubound(iid)
fpath=getmc("Jw_linksclass","id",iid(i),"fpath") 
'删除记录
set rs=conn.execute("select * from Jw_links where instr(fpath,'"&fpath&"')>0")
do while not rs.eof 
if not rs("pic")="" then
call delfile(rs("pic"))
end if
rs.movenext
loop
call recordend(rs)
'删除记录
conn.execute("delete * from Jw_links where instr(fpath,'"&fpath&"')>0")
'删除子栏目
conn.execute("delete * from Jw_linksclass where instr(fpath,'"&fpath&"')>0")
'删除记录
conn.execute("delete * from Jw_linksclass where id="&iid(i))
next
call connend()
response.Redirect(request.ServerVariables("HTTP_REFERER"))
end sub

'停用//////////////////////////////////////////////////////////////////////////////////////
sub jy()
call chkqx(8,2)
dim val
val=1
if id<>"" then
call uptab("Jw_linksclass","show",val,"id",id)
call zhgx("Jw_linksclass",id)
end if 
call connend()
response.Redirect(request.ServerVariables("HTTP_REFERER"))
end sub

'起用//////////////////////////////////////////////////////////////////////////////////////
sub qy()
call chkqx(8,2)
dim val
val=0
if id<>"" then
call uptab("Jw_linksclass","show",val,"id",id)
call zhgx("Jw_linksclass",id)
end if 
call connend()
response.Redirect(request.ServerVariables("HTTP_REFERER"))
end sub
%>
<script language="javascript" src="/<%= hturl %>/inc/chk.js"></script>
<script language="javascript">
function goo(act)
{
var chk=true;
if (!out_mc()){chk=false;}
if (!out_perpage()){chk=false;}

if (chk==true){
GE("go").disabled="disabled";
GE("reset").disabled="disabled";

var fid=GE("fid").value;
var mc=escape(GE("mc").value);
var perpage=GE("perpage").value;
var content=escape(GE("content").value);
var path=escape(GE("path").value);
var show;
if(GE("show").checked==true)
{show=0}
else
{show=1}

//alert(show);
//alert(zd);

var Ajax = new oAjax(act,backs);
var arrKey = new Array("fid","mc","perpage","show","content","path");
var arrValue =new Array(fid,mc,perpage,show,content,path);
Ajax.Post(arrKey,arrValue);
GE("msg").innerHTML=loading;
function backs(str)
{
if(str=="0")
{
GE("msg").innerHTML=ok+"&nbsp;&nbsp;操作成功";
window.location.href="?fid=<%= fid %>"
}
else
{
GE("msg").className="d_err";
GE("msg").innerHTML=err+"&nbsp;&nbsp;"+unescape(str);
GE("go").disabled="";
GE("reset").disabled="";
}
}
}
}
</script>