<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<%
cid=85
sid=109

'接下来调用数据库，并显示内容，跟动态ASP一样
%>
<!--#include file="../inchuayuwebrlzywzhyweb/web_top.asp"--> 
<%if cid="" or sid="" then oa.msgshow("参数错误!")
set dh=server.CreateObject("adodb.recordset")
	dh.open"select  *from ClassList where classid="&cid&" order  by rootid,orderid",conn,1,1
	if not dh.eof then
	lxa=dh("class_show")
	cname=dh("classname")
	npic=dh("class_pic")
	end if
	dh.close
	set dh=nothing%>
<%set book=conn.execute("select * from book_setup")
sitename=book("sitename")
admin=book("admin")
password=book("password")
maxlength=cint(book("maxlength"))
view=book("view")
pages=cint(book("pages"))
html=cint(book("html"))
mailyes=cint(book("mailyes"))
book_jianju=cint(book("book_jianju"))
huifutishi=cstr(book("huifutishi"))
huifucolor=cstr(book("huifucolor"))
bad=cstr(book("bad"))
set book=nothing


'检查用户输入的内容中是否含有非法字符
function checktxt(txt)
chrtxt="33|34|35|36|37|38|39|40|41|42|43|44|47|58|59|60|61|62|63|91|92|93|94|96|123|124|125|126|128"
chrtext=split(chrtxt,"|")
for c=0 to ubound(chrtext)
txt=replace(txt,chr(chrtext(c)),"")
next
checktxt=txt
end function


if request("send")="ok" then
if len(request("url"))<6 or len(request("url"))>11  then oa.msgshow("请输入您的手机号有误！")
if Trim(Session("WellCome"))="" then
	username=trim(request.form("username"))
	usermail=trim(request.form("usermail"))

	if username="" or request.form("Comments")="" then
	response.write "<script language='javascript'>"
	response.write "alert('填写资料不完整，请检查后重新输入！');"
	response.write "location.href='javascript:history.go(-1)';"
	response.write "</script>"
	response.end
	end if

	if checktxt(request.form("username"))<>request.form("username") then
	response.write "<script language='javascript'>"
	response.write "alert('您输入的用户名中含有非法字符，请检查后重新输入！');"
	response.write "location.href='javascript:history.go(-1)';"							
	response.write "</script>"	
	response.end
	end if

	if mailyes=0 then		'邮箱为必填时检查邮箱是否合法

	if checktxt(request.form("usermail"))<>request.form("usermail") then
	response.write "<script language='javascript'>"
	response.write "alert('您输入的邮箱中含有非法字符，请检查后重新输入！');"
	response.write "location.href='javascript:history.go(-1)';"							
	response.write "</script>"	
	response.end
	end if



	end if

	if len(request.form("Comments"))>maxlength then
	response.write "<script language='javascript'>"
	response.write "alert('留言内容太长了，请不要超过"&maxlength&"个字符！');"
	response.write "location.href='javascript:history.go(-1)';"
	response.write "</script>"
	response.end
	end if

	Comments1=request.form("Comments")
	bad1=split(bad,"/")		'过滤脏话
	for t=0 to ubound(bad1)
	Comments1=replace(Comments1,bad1(t),"***")
	next

	if request.form("Comments")<>Comments1 then
	response.write "<script language='javascript'>"
	response.write "alert('出错了，您的留言包含禁止提交的内容！');"
	response.write "location.href='javascript:history.go(-1)';"							
	response.write "</script>"	
	response.end
	end if
	getcode=oa.sqlrequest("checkcode")
 if getcode<>session("getcode") then oa.msgshow("验证码错误！请返回重新输入！")

	set rs=Server.CreateObject("ADODB.RecordSet")
	sql="select * from Feedback where online='1' order by Postdate desc"
	rs.open sql,conn,1,3

			rs.Addnew
			rs("username")=oa.sqlrequest("username")
			rs("comments")=oa.sqlrequest("comments")
			rs("usermail")=oa.sqlrequest("usermail")
			rs("face")=Request("face")
			rs("pic")=Request("pic")
			rs("url")=oa.sqlrequest("url")
			rs("qq")=oa.sqlrequest("qq")
			rs("lytitle")=oa.sqlrequest("lytitle")
			rs("lylx")=oa.sqlrequest("lylx")
					view=cstr(view)
			if view<>"0" then view="1"
			rs("online")=view
			rs("IP")=Request.serverVariables("REMOTE_ADDR")
			rs.Update
		rs.close
		set rs=nothing
		Session("WellCome")="1"
	response.write "<script language='javascript'>"
	if view="0" then
	response.write "alert('留言提交成功，谢谢合作。');"
	else
	response.write "alert('留言提交成功，单击“确定”返回留言列表！');"
	end if
	response.write "location.href='../';"	


	response.write "</script>"
	response.end
else
response.write "<script language='javascript'>"	
response.write "alert('你留言过于频繁，请下一次再来！');"
response.write "location.href='../';"	
	response.write "</script>"
	response.end
	end if	
end if
%>
<LINK href="../images/page.css" rel="stylesheet" type="text/css">
<link href="../images/pro_dropdown_2.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../images/jquery-1.8.3.min.js"></script>
<SCRIPT type=text/javascript src="../images/jquery-1.7.2.js"></SCRIPT>
<SCRIPT type=text/javascript src="../images/load.js"></SCRIPT> 
<SCRIPT language="javascript" src="../images/sc.js"></SCRIPT>
<script src="../images/jquery.superslide.2.1.1.js" type="text/javascript"></script>
<link href="../images/nypage.css" rel="stylesheet" type="text/css" />
</HEAD> 
<BODY>
<!--#include file="../head.asp"--><!--#include file="../nbanner.asp"-->
<div id="hyweb"><div id="body_1"><!--#include file="../left.asp"--><div id="contain"><div id="contain-1">
                    <div id="contain-1-1">
                      <% dim sid
		  
							if sid<>"" then	 
		  	 response.Write""& oa.getclassname(sid)
		  else
		  response.Write""& oa.getclassname(cid)
		  end if%></div><div id="contain-1-2">当前位置：<a href="<%=webdir%>">网站首页</a>&nbsp;&gt;&nbsp;
                        <%response.Write oa.getclassname(Cid)%>
                        
                        <%if xl<>"" then
		%> &nbsp;&gt;&nbsp;<%response.Write  oa.getclassname(xl)%> <%end if%>        <%
			 
		  if sid<>"" and sid<>cid   then
		  if xl<>"" then
		  xlm="-"&xl&""
		  end if%>
                        &nbsp;&gt;&nbsp; <span><%response.Write oa.getclassname(sid)%></span>
                        <%  else
		 	
		  end if%></div></div><div id="contain-c">
                          
                          <table class="font" cellspacing="0" cellpadding="0" 
                              width="99%" align="center" border="0">
                            <tbody>
                              <tr>
                                <td height="110" colspan="2" valign="top" ><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
                                  <tr>
                                    <td height="35"><script language="JavaScript" type="text/javascript">
function checka()
{if (document.book.lytitle.value.length == 0) {
		alert("留言标题不能为空!");
		document.book.lytitle.focus();
		return false;
	}
	if (document.book.UserName.value.length == 0) {
		alert("您的姓名不能为空!");
		document.book.UserName.focus();
		return false;
	}
	
	
	
	

	if (document.book.url.value.length == 0) {
		alert("联系电话不能为空!");
		document.book.url.focus();
		return false;
	}
	if(isNaN(document.book.url.value)){ 
	   alert('联系电话必须是数字!') 
	   document.book.url.focus(); 
	   return false; 
	}
	if (document.book.QQ.value.length == 0) {
		alert("地址不能为空!");
		document.book.QQ.focus();
		return false;
	}	
	if (document.book.Comments.value.length == 0) {
		alert("留言内容不能为空!");
		document.book.Comments.focus();
		return false;
	}
	return true;
}
                        </script><form action="../message/" method="post" name="book" id="book"  onsubmit="return checka()">
                          <table cellspacing="1" bordercolordark="#ffffff" cellpadding="4" width="100%" align="center" bgcolor="#CCCCCC" bordercolorlight="#000000" border="0"><tr bgcolor="#ebebeb">
                            <td   width="20%" height="35" align="right" bgcolor="#FFFFFF"><div align="right">留言类型：</div></td>
                            <td height="35" bgcolor="#FFFFFF" ><label>
                              <select name="lylx" id="lylx">
                                <%
		set rn=oa.execute("select top 10 title,id,Updatetime,classid,link,DefaultPicUrl,content from c_Article where  (classid=115)   order by orderid ,id desc")
		if not rn.eof and not rn.bof then
		do while not rn.eof 
		n=n+1%><option value="<%=rn("title")%>"><%=rn("title")%></option>
                                <%rn.movenext
		loop
		else
		response.Write"没有相关新闻"
		end if
		rn.close
		%>
                              </select>
                            </label></td>
                            <td height="35" bgcolor="#FFFFFF" ><div align="right">留言标题：</div></td>
                            <td height="35" bgcolor="#FFFFFF" ><input name="lytitle" type="text" id="lytitle" size="30" maxlength="16" />
                            &nbsp;<font color="#FF0000">*</font></td>
                         </tr>
                            <tr bgcolor="#ebebeb">
                              <td   width="20%" height="35" align="right" bgcolor="#FFFFFF"><div align="right">您的姓名：</div></td>
                              <td width="20%" height="35" bgcolor="#FFFFFF" ><div align="left">
                                <input type="text" name="UserName" size="12" maxlength="16" />
                              <font color="#FF0000">*</font></div></td>
                              <td width="16%" height="35" bgcolor="#FFFFFF" ><div align="right">您的邮箱：</div></td>
                              <td width="44%" height="35" bgcolor="#FFFFFF" ><input type="text" name="UserMail" size="20"  maxlength="50" /></td>
                            </tr>
                            <tr bgcolor="#ebebeb">
                              <td   width="20%" height="35" align="right" bgcolor="#FFFFFF"><div align="right">电话：</div></td>
                              <td height="35" bgcolor="#FFFFFF"><div align="left">
                                <input type="text" name="url" size="12"  maxlength="100" />
                              <font color="#FF0000">*</font></div></td>
                              <td height="35" bgcolor="#FFFFFF"><div align="right">其它联系方式：</div></td>
                              <td height="35" bgcolor="#FFFFFF"><input name="QQ" type="text" id="QQ" value="" size="40" />
                              &nbsp;<font color="#FF0000">*</font></td>
                            </tr>
                            <tr bgcolor="#ebebeb">
                              <td   width="20%" height="30" align="right" bgcolor="#FFFFFF"><div align="right">留言内容：<br />
                              <font color="red">（<%=maxlength%>字以内）</font></div></td>
                              <td height="30" colspan="3" bgcolor="#FFFFFF"><div align="left">
                                <textarea name="Comments" rows="5" cols="66" style="overflow:auto;"></textarea>
                              <font color="#FF0000">*</font></div></td>
                            </tr>
                            <tr bgcolor="#ebebeb">
                              <td height="35" bgcolor="#FFFFFF"><div align="right">验证码：</div></td>
                              <td height="35" colspan="3" bgcolor="#FFFFFF"><div align="left">
                                <input type="hidden" name="send" value="ok" />
                                <input name="CheckCode" size="10" style="border-style:solid;border-width:1;padding-left:4;padding-right:4;padding-top:1;padding-bottom:1" onMouseOver="this.style.background='#E1F4EE';" onMouseOut="this.style.background='#FFFFFF'" onFocus="this.select(); " />
                              <font  class="fs-12px">请在左边输入</font> <img src="../inchuayuwebrlzywzhyweb/checkcode.asp"  alt="验证码,看不清楚?请点击刷新验证码" name="checkimg" align="absmiddle" id="checkimg" style="cursor : pointer;" onClick="document.getElementById('checkimg').src='../inchuayuwebrlzywzhyweb/checkcode.asp?a='+Math.random()" /></div></td>
                            </tr>
                            <tr bgcolor="#ebebeb">
                              <td height="35" colspan="4" bgcolor="#FFFFFF">
                                <div align="center">
                                  <input name="Submit2" type="submit" class="button" value="提交留言" />
                                  &nbsp;&nbsp;
                                  <input name="Submit2" type="reset" class="button" value="重新填写" />
                              </div></td></tr>
                          </table>
                        </form></td>
                      </tr>
                                 </table></td>
                </tr>
                             </tbody>
                          </table>
            <div id="contain-2">  
              <p id="title">查看留言</p>
              <IFRAME marginHeight=0 border=0       src="ly.asp" frameBorder=0 width=920 name=nr marginWidth=0 
      scrolling=no onload="this.height=this.contentWindow.document.documentElement.scrollHeight"></IFRAME>
             </div>
		  </div></div></div>
 </div>
 <!--#include file="../foot.asp"--></BODY></HTML>
