?? showessay.asp
字號:
<!--#include file="config.asp"-->
<!--#include file="inc/CHAR.asp"-->
<%
dim sql
dim rs
dim CateName,CateID,SubCateName,SubCateID
if request.QueryString("SoftID")="" then
response.write "您沒有選擇介紹鏈接,請返回"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select "&CategoryName&"_Cate.CateName,"&CategoryName&"_SubCate.SubCateName,"&CategoryName&"_SoftInfo.SoftName,"&CategoryName&"_SoftInfo.CateID,"&CategoryName&"_SoftInfo.SubCateID from "&CategoryName&"_SoftInfo,"&CategoryName&"_Cate,"&CategoryName&"_SubCate where "&CategoryName&"_SoftInfo.CateID="&CategoryName&"_Cate.CateID and "&CategoryName&"_SoftInfo.SubCateID="&CategoryName&"_SubCate.SubCateID and "&CategoryName&"_SoftInfo.SoftID="&request.QueryString("SoftID")
rs.open sql,conn,1,1
if not rs.eof then
SoftName=trim(rs("SoftName"))
CateID=trim(rs("CateID"))
SubCateID=trim(rs("SubCateID"))
CateName=trim(rs("CateName"))
SubCateName=trim(rs("SubCateName"))
end if
rs.close
%>
<HTML>
<HEAD>
<TITLE><%= Title_Name %> =>> <%= CategoryName_CHS %> =>> <%=SoftName%></TITLE>
<META http-equiv=Content-Type content='text/html; charset=gb2312'>
<SCRIPT LANGUAGE=javascript>
<!--
function Juge(myform)
{
if (document.myform.UserName.value==""){
alert ("你的用戶名不可為空!");
document.myform.UserName.focus();
return(false);
}
if ((document.myform.Email.value.indexOf("@") == -1) || (document.myform.Email.value.indexOf(".") == -1)){
alert("請查看您的E-mail地址是否正確,請重錄入!");
document.myform.Email.focus();
return(false);
}
if (myform.content.value == "")
{
alert("留言內容不能為空!");
myform.content.focus();
return (false);
}
}
function SelectAll() {
for (var i=0;i<document.form1.ID.length;i++) {
var e=document.form1.ID[i];
e.checked=!e.checked;
}
}
//-->
</script>
<style type="text/css">
<!--
body {
background-color: #FFFFFF;
}
-->
</style>
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<BODY text=#003300 vLink=#002200 leftMargin=0 topMargin=0>
<TABLE width=600 height=26 border=0 align="center" cellPadding=0 cellSpacing=0 class="index">
<TR>
<TD width="282" height="53" rowspan="3" style="font-size: 12px"><div align="center"><a href="Default.asp"><img src="images/logo.jpg" border="0"></a> </div></TD>
<TD width="488" style="font-size: 12px"></TD>
</TR>
<TR>
<TD style="font-size: 12px"></TD>
</TR>
<TR>
<TD height="26" style="font-size: 12px"><div align="center">合肥诺飞科技开发有限公司    联系我们   联系我们  </div></TD>
</TR>
</TABLE>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F9F9F9">
<tr>
<td height="23"> </td>
</tr>
</table>
<table cellspacing=0 cellpadding=0 width=600 align=center border=0>
<tbody>
<tr>
<td height="200" valign=top bgcolor=#efefef>
<%
select case request("action")
case "savereinfo" '保存留言信息
call savereinfo()
case "del"
call delEssay()
case else
call ShowSoftInfo() '查看ftp信息
end select
sub SaveReInfo()
dim userip_temp
userip_temp=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
if userip_temp="" then
userip_temp=Request.ServerVariables("REMOTE_ADDR")
end if
sql="select * from "&CategoryName&"_SoftEssay where (ID is null)"
rs.open sql,conn,1,3
rs.addnew
rs("SoftID")=trim(request("SoftID"))
rs("UserName")=trim(request.form("UserName"))
rs("Email")=trim(request.form("Email"))
rs("content")=UBBCode(request.form("content"))
rs("dateTime")=Now()
rs("UserIP")=userip_temp
rs("type")="soft"
rs.update
rs.close
sql="select count(ID) as reNum from "&CategoryName&"_SoftEssay where SoftID="&request("SoftID")&" and type='soft'"
rs.open sql,conn,1,1
reNum=rs("reNum")
rs.close
conn.execute("update "&CategoryName&"_SoftInfo set EssayNum="&reNum&" where SoftID="&request("SoftID")&" ")
call ShowSoftInfo()
end sub
Sub delEssay()
if not isnull(UserName) and UserName<>"" then
if chkEditUser(UserName,trim(request("SoftID"))) then
conn.execute("delete from "&CategoryName&"_SoftEssay where ID in ("&Request("ID")&")")
reNum=0
sql="select count(ID) as reNum from "&CategoryName&"_SoftEssay where SoftID="&request("SoftID")&" and type='soft'"
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
reNum=rs("reNum")
else
reNum=0
end if
rs.close
conn.execute("update "&CategoryName&"_SoftInfo set EssayNum="&reNum&" where SoftID="&request("SoftID")&" ")
end if
end if
call ShowSoftInfo()
end sub
Sub ShowSoftinfo()
dim isMaster
if not isnull(UserName) and UserName<>"" then
if chkEditUser(UserName,trim(request("SoftID"))) then
isMaster=True
else
isMater=false
end if
end if
sql="select * from "&CategoryName&"_SoftInfo where SoftID="&request.QueryString("SoftID")
rs.open sql,conn,1,1
PubUserName=rs("UserName")
EssayNum=rs("EssayNum")
%>
<table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#CCCCCC" align="center">
<tr bgcolor="#FFFFFF">
<td width="65" align="center" height="20">物品留言</td>
<td height="20" width="88%" > <b><a href="SoftView.Asp?SoftID=<%=request.QueryString("SoftID")%>"><%=trim(rs("SoftName"))%><%=trim(rs("SoftVer"))%></a></b></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center">留言情況</td>
<td>共有 <font color="#FF0000"><%=rs("EssayNum")%></font> 人留言</td>
</tr>
<% rs.close
if isMaster then
Response.Write("<form name=""form1"" method=""post"" action="""">")
Response.Write("<input type=""Hidden"" name=""SoftID"" value="""&Trim(Request.QueryString("SoftID"))&""">")
Response.Write("<input type=""Hidden"" name=""action"" value=""del"">")
end if
sql="select * from "&CategoryName&"_SoftEssay where SoftID="&request("SoftID")&" order by ID desc "
rs.open sql,conn,1,1
if not (rs.eof and rs.bof) then
do while not rs.eof
%>
<tr bgcolor="#F7F7F7">
<td colspan="2">
<% if isMaster then
Response.Write("<input type=""checkbox"" name=""ID"" value="""&Rs("ID")&""">")
else
Response.Write("<img src=""images/dot.gif"" align=""absmiddle"">")
end if
%>
用戶:<b><%=rs("UserName")%></b> 時間:<%=DateTimeFormat(rs("DateTime"),1)%> 來自:<b><%=rs("UserIP")%></b></td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="2"><%=rs("Content")%></td>
</tr>
<%
rs.movenext
loop
end if
rs.close
if isMaster then
%>
<tr bgcolor="#FFFFFF">
<td colspan="2"><strong><font color="#FF0000">留言管理操作:</font></strong>全選/反選
<input type=checkbox name=chkall value=on onClick="javascript:SelectAll()">
<input type="submit" name="Submit" value=" 刪 除 "> </td>
</tr>
<%
Response.Write("</form>")
end if
if UserName<>pubUserName then
%>
<tr bgcolor="#FFFFFF">
<td align="center">我要留言</td>
<td> <table width="100%" border="0" cellspacing="0" cellpadding="1">
<form name="myform" method="post" action="" target="_top" onSubmit="return Juge(this)" >
<tr>
<td width="9%">用戶:</td>
<td width="37%"> <input type="text" name="UserName" maxlength="15" size="28" style="height: 16px;BORDER-BOTTOM: #888888 1px solid; BORDER-LEFT: #888888 1px solid; BORDER-RIGHT: #888888 1px solid; BORDER-TOP: #888888 1px solid; font-size: 9pt">
</td>
<td rowspan="2"> </td>
</tr>
<tr>
<td width="9%">Email:</td>
<td><input type="text" name="Email" maxlength="50" size="28" style="height: 16px;BORDER-BOTTOM: #888888 1px solid; BORDER-LEFT: #888888 1px solid; BORDER-RIGHT: #888888 1px solid; BORDER-TOP: #888888 1px solid; font-size: 9pt"></td>
</tr>
<tr>
<td>說明:</td>
<td colspan="2"> <textarea name="content" cols="35" rows="5" style="BORDER-BOTTOM: #888888 1px solid; BORDER-LEFT: #888888 1px solid; BORDER-RIGHT: #888888 1px solid; BORDER-TOP: #888888 1px solid; font-size: 9pt"></textarea>
<font color="#FF0000"><br>
* 請注意用語文明且合法,不要發布帶有攻擊性的言論,謝謝合作! </font></td>
</tr>
<tr>
<td> </td>
<td colspan="2"> <input type="submit" name="Submit" value=" 提 交 ">
<input type="reset" name="Submit2" value=" 重 設 ">
(注:“<font color="#FF0000">!</font>”為必填內容。) </td>
</tr>
</form>
</table></td>
</tr>
<%end if %>
<tr bgcolor="#FFFFFF">
<td align="center"> </td>
<td> </td>
</tr>
</table> <%end sub %> </td>
</tr>
</tbody>
</table>
</body>
</html>
<%
set rs=nothing
CloseDatabase
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -