<!--#Include FILE="WapConfig/WapHeader.asp"-->
<%
'以下为文件正文，利用ASP函数的部分。
'显示标题
XML.WriteOut "<h2>评论主题</h2>"
XML.WriteOut "<ul><li>"
Dim ListKey : ListKey=Request.QueryString("InfoID") 
Dim ModuleType : ModuleType=Request.QueryString("ModuleType")
If ModuleType<>"" Then
	Session("ModuleType")=ModuleType
	Session(" ListKey")= ListKey
Else
	ModuleType=Session("ModuleType")
	ListKey=Session(" ListKey")
End If

If Request("ToDo")="ToAdd" Then  
	Receive_A=Request("Send_A") '
	Receive_B=Request("Send_B")
	If Receive_A="" Then
			ErrorMessage=XML.Ascii("请输入分数。")
		ElseIf Receive_B="" Then
			ErrorMessage=XML.Ascii("请输入评论内容。") '如果没有错误，则错误信息为空
		Else
			ErrorMessage="" '如果没有错误，则错误信息为空
	End If	
If ErrorMessage="" Then
	XML.StrSql="Update SQ_Article set CommentCount=CommentCount+1 Where ArticleID=" & ListKey
	XML.MdbDo '更新评论数量
	If Session("OnlineName")="" Then Session("OnlineName")="游客" 
	If Session("OnlineName")="游客" Then UserType=0 Else UserType=1
	XML.StrSql="Insert Into SQ_Comment(Content,ModuleType,InfoID,IP,Score,UserName,WriteTime,UserType) Values ('" & Receive_B & "'," & ModuleType & "," & ListKey & ",'" & XML.PhoneIP & "','" & Receive_A & "','" & Session("OnlineName") & "',#" & Now() & "#," & UserType & ")"	
	XML.RedirectPath=XML.WapPath & "Success.asp?ToDo=AddNewsCommentOk"
	XML.MdbInsert
End If
End If
'以下为文件正文。
If ErrorMessage<>"" Then XML.WriteRow ErrorMessage
XML.WriteOut "<form method='post' action='" & XML.ThisFileName & "'>"
XML.WriteOut "<h3>评 分(1-5分):</h3>"
XML.WriteOut "<input type='text' name='Send_A' value='3'/>分"
XML.WriteOut "<h3>内 容:</h3>"
XML.WriteOut "<input type='text' name='Send_B' value=''/>"
XML.WriteRow "<input type='hidden' name='ToDo' value='ToAdd'/>"
XML.WriteOut "<input type='submit' value='提交'/>"
XML.WriteOut "</form>"

XML.WriteOut "</li></ul>"

'以下为返回链接等
XML.WriteOut XML.Div(,,"N")
XML.WriteRow XML.ImgA("","NewsComment.asp?ModuleType=" & ModuleType & "&amp;InfoID=" & ListKey,"返回上级")
%>
<!--#Include FILE="WapConfig/WapFooter.asp"--> 