📄 companyall.asp
字号:
<!--#include file="check_login.asp"-->
<!--#include file="conn.asp"-->
<% UPdateDOO="NODO" %>
<%
'==============================================
'添加栏目
'==============================================
Addyes=trim(request.QueryString("addcompany"))
if Addyes="DOADD" then
ComName=trim(request.Form("NameClass"))
MyID=trim(request.Form("MyID"))
HomeAbout=trim(request.Form("HomeAbout"))
set rs=server.CreateObject("adodb.recordset")
rs.open "select myid from Company where myid="&MyID&"",conn,1,1
if rs.recordcount>0 then
response.write "<Script language='JavaScript'>window.alert('您输入的栏目排序号重复了,请返回重新输入!');history.back(-1);</Script>"
response.End()
end if
set rsw=Server.CreateObject("Adodb.Recordset")
sqlw="Select id,MyID,ComName,HomeAbout From Company where (id is null)"
rsw.open sqlw,conn,1,3
rsw.addnew
rsw("HomeAbout")=HomeAbout
rsw("MyID")=MyID
rsw("ComName")=ComName
rsw.update
rsw.close
set rsw=nothing
end if
%>
<%
'==========================================
'删除栏目
'==========================================
delCOM=trim(request.QueryString("delCOM"))
if delCOM="DOdel" then
delid=trim(request.QueryString("delid"))
myid=trim(request.QueryString("delmyid"))
'=========================
if myid=1 or myid=99 then
response.write "<script language=JavaScript>" & chr(13) & "alert('公司简介/联系我们为固定栏目,不可以删除!');" & "history.back()" & "</script>"
else
conn.execute("Delete From Company where id="&delid&" and myid="&myid&"")
end if
'==========================
end if
%>
<%
'==========================================
'取得修改栏目框
'==========================================
UPyes=trim(request.QueryString("updatecom"))
if UPyes="UPdateYes" then
UPid=cint(trim(request.QueryString("upcomid")))
MyID=trim(request.Form("MyID"))
ComName=trim(request.Form("NameClass"))
set rsw=Server.CreateObject("Adodb.Recordset")
sqlw="Select id,MyID,ComName,HomeAbout From Company where id="&UPid
rsw.open sqlw,conn,1,3
UpdateHomeAbout=rsw("HomeAbout")
UpdateMyID=rsw("MyID")
UpdateComName=rsw("ComName")
UPDATEDOID=rsw("id")
rsw.close
set rsw=nothing
UPdateDOO="YESDO"
end if
%>
<%
'==============================================
'修改栏目Updatecompany=DOUPDate
'==============================================
UPdateyes=trim(request.QueryString("Updatecompany"))
if UPdateyes="DOUPDate" then
ComName=trim(request.Form("NameClass"))
HomeAbout=trim(request.Form("HomeAbout"))
MyID=trim(request.Form("MyID"))
UPTOID=trim(request.QueryString("DOID"))
set rs=server.CreateObject("adodb.recordset")
rs.open "select myid,id from Company where myid="&MyID&"",conn,1,1
if rs.recordcount >=2 then
response.write "<Script language='JavaScript'>window.alert('您输入的栏目排序号重复了,请返回重新输入!');history.back(-1);</Script>"
response.End()
else
if rs.recordcount =1 then
if rs("id")<>Cint(UPTOID) then
response.write "<Script language='JavaScript'>window.alert('您输入的栏目排序号重复了,请返回重新输入!');history.back(-1);</Script>"
response.End()
end if
end if
end if
set rsw=Server.CreateObject("Adodb.Recordset")
sqlw="Select id,MyID,ComName,HomeAbout From Company where id="&UPTOID
rsw.open sqlw,conn,1,3
rsw("MyID")=MyID
rsw("HomeAbout")=HomeAbout
rsw("ComName")=ComName
rsw.update
rsw.close
set rsw=nothing
end if
%>
<html>
<head>
<title>修改/添加本栏信息内容</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="text.css" rel="stylesheet" type="text/css">
<%
set rs = server.createobject("adodb.recordset")
rs.source = "select id,myid,ComName,HomeAbout from Company order by myid "
rs.open rs.source,conn,1,1
dim i,intPage,page,pre,last,filepath
set rsp = server.createobject("adodb.recordset")
productsSQL= "select id,myid,ComName,Content,kig from Company order by myid "
'rsp.open productsSQL,conn,1,1
rsp.PageSize = 20 '这里设定每页显示的记录数
rsp.CursorLocation = 3
rsp.Open productsSQL,conn,0,2,1 '这里执行你查询SQL并获得结果记录集
pre = true
last = true
page = trim(Request.QueryString("page"))
if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page)>=rsp.PageCount then
intpage = rsp.PageCount
last = false
else
intpage = cint(page)
end if
end if
end if
if not rsp.eof then
rsp.AbsolutePage = intpage
end if
%>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" <%=kkk%>>
<!--#include file="top/Ltop03.asp"-->
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" style='BORDER-BOTTOM:#666666 1px solid; BORDER-LEFT:#CECFCE 1px solid; BORDER-RIGHT:#CECFCE 1px solid; BORDER-TOP: #666666 0px solid;'>
<tr>
<td valign="top">
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td height="26" bgcolor="#F2F2F2" ><p><font color="#0000FF"><strong>注意 </strong>:删除目录同时将删除该目录下所有产品并同时删除该目录下的下属分类和其中产品! </font></p></td>
</tr>
</table> <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" >
<tr>
<td bgcolor="#CCCCCC" style='BORDER-BOTTOM:#666666 1px solid '><strong> 企业信息栏目列表(栏目名):</strong><a href="companyall.asp">添加新栏目</a></td>
<td bgcolor="#CCCCCC" style='BORDER-BOTTOM:#666666 1px solid '>是否为首页关于内容(注:仅能一条为是)</td>
<td width="44%" align="center" bgcolor="#CCCCCC" style='BORDER-BOTTOM:#666666 1px solid '> 操 作</td>
</tr>
<%
if not rs.EOF then
while not rs.eof
%>
<tr bgcolor="#F2F2F2" >
<td width="29%" bgcolor="#F2F2F2" style='BORDER-BOTTOM:#CCCCCC 1px solid;'> ┣ <%=rs("ComName")%> <font color="#ff0000"><%=rs("myid")%></font></td>
<td width="27%" bgcolor="#F2F2F2" style='BORDER-BOTTOM:#CCCCCC 1px solid;'>
<%
if rs("HomeAbout")="T" then
response.write "是"
else
response.write "否"
end if %></td>
<td style='BORDER-BOTTOM:#CCCCCC 1px solid;'>
<%response.write "<a href='javascript:ConfirmDelCompanyall(" & rs("id") & ", "& rs("myid") & ")'>"%>删除</a>
| <a href="companyall.asp?updatecom=UPdateYes&upcomid=<%=rs("id")%>">栏目修改</a> | <a href="CompanyAdd.asp?CompanyID=<%=rs("id")%>">修改/添加本栏信息内容</a></td>
</tr>
<%
rs.movenext
wend
else
response.Write"<tr bgcolor='#e4f1d8' height='40'>"
response.Write"<td colspan='3'align='center' bgcolor='#F1FAF1' style='BORDER-BOTTOM:#CCCCCC 1px solid;'><font color=red>未设企业信息栏目</font></td>"
response.Write"</tr>"
End if
rs.close
set rs=nothing
%>
</table>
<% if UPdateDOO="NODO" then %>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<form name="formaddcompany" method="post" onSubmit="return CheckCompanyData()" action="companyall.asp?addcompany=DOADD" >
<td width="9%"> 添加栏目:</td>
<td width="18%">
<input name="NameClass" type="text" style='BORDER-TOP-WIDTH:1px;BORDER-LEFT-WIDTH:1px;FONT-SIZE:9pt;BORDER-BOTTOM-WIDTH:2px;FONT-FAMILY:"宋体";BORDER-RIGHT-WIDTH:2px' value="<%=UpdateComName%>">
</td>
<td width="14%">设为首页关于内容:</td>
<td width="9%">
否<input name="HomeAbout" type="radio" value="F" checked>是
<input name="HomeAbout" type="radio" value="T"></td>
<td width="6%">顺序:</td>
<td width="9%"><input name="MyID" type="text" id="MyID" style='BORDER-TOP-WIDTH:1px;BORDER-LEFT-WIDTH:1px;FONT-SIZE:9pt;BORDER-BOTTOM-WIDTH:2px;FONT-FAMILY:"宋体";BORDER-RIGHT-WIDTH:2px' size="3" maxlength="5">
<span class="BLUE">*</span></td>
<td width="39%"><input type="submit" name="Submit" value="提 交" class="btnadd_1"></td>
</form>
</tr>
</table>
<% end if
if UPdateDOO="YESDO" then %>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<form name="formaddcompany" method="post" onSubmit="return CheckCompanyData()" action="companyall.asp?Updatecompany=DOUPDate&DOID=<%=UPDATEDOID%>" >
<td width="9%"> <font color="#0000FF">修改栏目:</font></td>
<td width="18%">
<input name="NameClass" type="text" style='BORDER-TOP-WIDTH:1px;BORDER-LEFT-WIDTH:1px;FONT-SIZE:9pt;BORDER-BOTTOM-WIDTH:2px;FONT-FAMILY:"宋体";BORDER-RIGHT-WIDTH:2px' value="<%=UpdateComName%>">
</td>
<td width="14%">设为首页关于内容:</td>
<td width="9%">
<%
if UpdateHomeAbout<>"T" then
response.write "否<input name='HomeAbout' type='radio' value='F' checked>是<input name='HomeAbout' type='radio' value='T'>"
else
response.write "否<input name='HomeAbout' type='radio' value='F'>是<input name='HomeAbout' type='radio' value='T' checked>"
end if %>
</td>
<td width="6%">顺序:</td>
<td width="9%"><input name="MyID" type="text" id="MyID" style='BORDER-TOP-WIDTH:1px;BORDER-LEFT-WIDTH:1px;FONT-SIZE:9pt;BORDER-BOTTOM-WIDTH:2px;FONT-FAMILY:"宋体";BORDER-RIGHT-WIDTH:2px' value="<%=UpdateMyID%>" size="3" maxlength="5">
<span class="BLUE">*</span></td>
<td width="39%"><input type="submit" name="Submit" value="修 改" class="btnadd_1" onClick="ConfirmModCompany()"></td>
</form>
</tr>
</table>
<% end if %>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td bgcolor="#CECFCE" style='BORDER-BOTTOM:#666666 1px solid '><strong> 企业信息内容列表:</strong></td>
</tr>
<tr>
<td bgcolor="#F1F1F1"><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
<tr align="center" bgcolor="#DEDBDE">
<td width="14%">编号</td>
<td width="13%" bgcolor="#DEDBDE">排序号</td>
<td width="28%" bgcolor="#DEDBDE">企业栏目名称</td>
<td width="15%">点击数次</td>
<td width="30%">操作</td>
</tr>
<%
if rsp.BOF then
response.write "<tr><td colspan='7' width='100%' height='50'' align='center'>无相关内容!</td>"
end if
for i=1 to rsp.PageSize
if rsp.EOF or rsp.BOF then exit for
%>
<tr bgcolor="#F2F2F2" onMouseOver = "this.style.backgroundColor = '#EEEEEE'" onMouseOut = "this.style.backgroundColor = ''" style="CURSOR:hand">
<td height="18"> <%=rsp("id")%></td>
<td><font color="#ff0000"> <%=rsp("myid")%></font></td>
<td> <%=rsp("ComName")%></td>
<td width="15%"> <%=rsp("kig")%></td>
<td width="30%"> <a href="CompanyAdd.asp?CompanyID=<%=rsp("id")%>">修改/添加本栏信息内容</a> | <%response.write "<a href='javascript:ConfirmDelCompanyall("&rsp("id")&","&rsp("myid")&")'>"%>删除本栏</a>
</td>
</tr>
<%
rsp.movenext
next
%>
</table>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" borderColorLight=#808080 borderColorDark=#ffffff bgcolor="#DEDBDE">
<tr>
<%if rsp.pagecount>0 then%>
<td width="13%" height="23" align="left">当前页<%=intpage%>/<%=rsp.PageCount%> </td>
<%else%>
<td width="15%" height="23" align="left">当前页0/0</td>
<%end if%>
<td width="26%" align="left">|共有<%=rsp.recordcount%>条记录,每页20条记录</td>
<td width="46%" align="right"> <a href="companyAll.asp?page=1">首页</a>|
<%if pre then%>
<a href="companyAll.asp?page=<%=intpage -1%>">上页</a>|
<%end if%>
<%if last then%>
<a href="companyAll.asp?page=<%=intpage +1%>">下页</a>|
<%end if%>
<a href="companyAll.asp?page=<%=rsp.PageCount%>">尾页</a>|转到第
<select name="sel_page" onChange="javascript:location=this.options[this.selectedIndex].value;">
<%
for i = 1 to rsp.PageCount
if i = intpage then%>
<option value="companyAll.asp?page=<%=i%>" selected><%=i%></option>
<%else%>
<option value="companyAll.asp?page=<%=i%>"><%=i%></option>
<%
end if
next
%>
</select>页</font>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#F2F2F2">
<td height="22" align="center"><span class="BLUE">说明:</span>请将企业介绍栏和联系方式的排序号分别设置为[<span class="BLUE"> 1</span>,<span class="BLUE">99</span> ],其余可随意为[ 2-98 ]之间的数字,否则会出错。</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -