<!--#include file="inc/Conn.asp"-->
<!--#include file="inc/jle_sub.asp"-->
<!--#include file="inc/function.asp"-->
<%
'Dim ID,ReName,nm,ReContent,title,PostTime,ADPostName
Dim ReName,nm,ReContent,PostTime,ADPostName
'Dim ClassBig,ClassSmall,AreaSmall,Contact,Tel,QQ,Address,IP,EndTime,Price,Pic,ClassBigName,ClassSmallName,AreaBigName,AreaSmallName
Dim  ClassBig,ClassSmall,AreaSmall,Contact,Tel,Address,EndTime,Price,Pic,ClassBigName,ClassSmallName,AreaBigName,AreaSmallName
username=request.cookies("jle")("username")
Select Case Request("Action")
  Case "Re"
    nm=CheckStr(Request.form("nm"),1)
    ID=CheckStr(Request("ID"),1)
    If ID = "" Then Call ErrView("操作错误<meta http-equiv=refresh content='1;URL=../Index.asp'>",0)
    If nm=1 then
    ReName = Null
    Else
      If username = "" Then Call ErrView("你还没有登录<br><a href=../Login.asp?ComeUrl="&Replace(Request.ServerVariables("HTTP_REFERER"),"&","δ")&">现在登录</a><br><a href="&Request.ServerVariables("HTTP_REFERER")&">返回上一页</a><br>3秒钟后自动返回上一页<meta http-equiv=refresh content='3;URL="&Request.ServerVariables("HTTP_REFERER")&"'>",0)
      ReName = username
    End If
    'ReContent = replace(replace(request("ReContent"),chr(13),"<br>"),"   ","&nbsp;")
    'ReContent = HtmlEncodes(request("ReContent"))
    ReContent = HTMLEncodes(Request.Form("ReContent"))
	ReContent = Replace(ReContent,"[em]","<img src='../image/emot/em")
	ReContent = Replace(ReContent,"[/em]",".gif'>")

    If ReContent = "" Then Call ErrView("评论内容没有填写<meta http-equiv=refresh content='1;URL=../Index.asp'>",0)

'   Call closedb()
'    Set Rs = Conn.ExeCute("Select * From jle_info Where id="&ID&" ")
'   If Not Rs.Eof Then
'    Title = Rs("biaoti")
 '   Email = Rs("email")
'	PostTime = Rs("fbsj")
'   if Rs("username")="" then
 '  ADPostName = Null
 '  else
  ' ADPostName = Rs("username")
  ' end if
   'End If
  ' Rs.Close
    
    Set Rs=server.createobject("adodb.recordset")
    Rs.Open"Select username,xxid,neirong,hfsj From reply",Conn,1,3
    Rs.AddNew
      Rs("username") = ReName
      Rs("xxid") = ID
      Rs("neirong") = ReContent
      Rs("hfsj") = Now()
    Rs.Update
    Rs.Close
    Set Rs = Nothing

    Conn.Execute("Update jle_info Set hfcs=hfcs+1 where id="&ID)

'	MailBody = jle_Temp.SiteLabel(Site_MailServer(8))
'	MailBody = Replace(MailBody,"{$Url}",Site_Setting(3)&GetClassURL(1,"",ID,PostTime,0,1))
'	MailBody = Replace(MailBody,"{$Title}",Title)
'   FromName = title&"管理员"
'   Subject = title&"信息回复提醒！"
'   Call SendMail(mailbody,FromName,Subject,Email)
    
	Call closedb()

     Call ErrView("评论发表成功<meta http-equiv=refresh content='1;URL="&Request.ServerVariables("HTTP_REFERER")&"'>",1)

  Case Else
   ID=CheckStr(Request.QueryString,1)
   If ID = "" Then Call ErrView("操作错误<meta http-equiv=refresh content='1;URL=../Index.asp'>",0)

   Call closedb()
     Set Rs=server.createobject("adodb.recordset")
     Rs.Open"select biaoti,fbsj,jle_Content,jle_ClassBig,jle_ClassSmall,jle_AreaSmall,jle_Post,jle_Contact,jle_Tel,jle_QQ,jle_AddRess,jle_IP,jle_EndTime,jle_Price,jle_Pic from jle_info where jle_Key=1 and id="&ID,Conn,1,1
     If Rs.eof then
       Call ErrView("该信息不存在或还没有通过管理员审核<meta http-equiv=refresh content='1;URL=../Index.asp'>",0)
	 End If
       '如果启用静态页，则
	   Title = Rs(0)
	   PostTime = Rs(1)
	   Content = Rs(2)
	   ClassBig = Rs(3)
	   ClassSmall = Rs(4)
	   AreaSmall = Rs(5)
	   ADPostName = Rs(6)
	   Contact = Rs(7)
	   Tel = Rs(8)
	   QQ = Rs(9)
	   AddRess = Rs(10)
	   IP = Rs(11)
	   EndTime = Rs(12)
	   Price = Rs(13)
	   Pic = Rs(14)
	 Rs.Close
	 Set Rs = Conn.Execute("Select A.jle_ClassSmall,B.jle_ClassBig from jle_ClassSmall A Inner Join jle_ClassBig B on A.jle_ClassBig = B.id Where A.id="&ClassSmall)
	 If Not Rs.Eof Then
	   ClassBigName = Rs(1)
	   ClassSmallName = Rs(0)
	 End If
	 Rs.Close
	 Set Rs = Conn.Execute("Select A.jle_AreaSmall,B.jle_AreaBig from jle_AreaSmall A Inner Join jle_AreaBig B on A.jle_AreaBig = B.id Where A.id="&AreaSmall)
	 If Not Rs.Eof Then
	   AreaBigName = Rs(1)
	   AreaSmallName = Rs(0)
	 End If
	 Rs.Close
	 Set Rs = Nothing
	 
	 Call FsoBegin()
	 TempContent = jle_Temp.GetTempHtml(1,3)
	 TempContent = jle_Temp.ClassADShow(TempContent)
	 TempContent = jle_Temp.ClassADClass(TempContent)
	 TempContent = jle_Temp.SiteLabel(TempContent)
	 Call FsoEnd()
	 Response.Write TempContent
   Call closedb()
   
End Select
%>

