<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/function.asp"-->
<!--#include file="../inc/page.asp"-->
<%
dim strFileName
const MaxPerPage=8
dim totalPut,CurrentPage,TotalPages
if request("page")<>"" then
    currentPage=cint(request("page"))
else
	currentPage=1
end if
strFileName="index.asp?"'页面的设置！-提示
%>
<%
sql="select * from book where pass=1 order by id desc"
set rs=server.CreateObject("ADODB.recordset")
rs.open sql,conn,1,1
totalPut=rs.recordcount
%>
<html>
<head>
<title>在线留言-<%=web_name%></title>
<META name="keywords" content="在线留言,<%=web_keywords%>">
<META name="description" content="<%=web_description%>">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/style.css" rel="stylesheet" type="text/css">
<script language = "JavaScript">
function re_info(){
if (document.myform.userid.value.length=="")
{alert("操作失败：留言者不能为空!");
document.myform.userid.focus();
return false;}
if (document.myform.title.value.length=="")
{alert("操作失败：留言标题不能为空!");
document.myform.title.focus();
return false;}
if (document.myform.content.value.length=="")
{alert("操作失败：请输入留言内容!");
document.myform.content.focus();
return false;}
return true;   
}
</script>
</head>
<body>
<%if request("action")="" then%>
<!--#include file="../inc/top.asp"-->
<table width="960" height="26" border="0" align="center" cellpadding="0" cellspacing="0" class="tb_dh">
  <tr>
    <td valign="top" style="padding-left:10px;padding-top:8px; "><a href="../">首页</a> > <a href="index.asp">在线留言</a></td>
  </tr>
</table>
<table width="960" height="5" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table>
<table width="960" height="127" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="250" height="127" align="left" valign="top" class="tb3">
<%call line(6)%>
<%call hotel(6)%>
<%call gonglue(5)%>
<%call tour(4)%>
<%call daohang(5)%>
    </td>
    <td width="710" align="right" valign="top"><table width="700" height="100" border="0" cellpadding="0" cellspacing="0" class="tb1">
      <tr>
        <td align="center" valign="top"><table width="100%" height="25" border="0" cellpadding="0" cellspacing="0" background="../images/T1.gif">
            <tr>
              <td width="93%" class="T1" style="padding-top:3px ">&nbsp;在线留言</td>
              <td width="7%" style="padding-top:3px "></td>
            </tr>
          </table>
          <table width="100%" height="179" border="0" align="center" cellpadding="0" cellspacing="0" style="border-collapse:collapse ">
            <form action="index.asp?action=doinfo" method="post" name="myform" onSubmit="return re_info();">
              <tr>
                <td height="177" align="center" valign="top"><table width="100%" height="119" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td height="119" align="left" valign="top"><table width="100%" height="266" border="1" cellpadding="3" cellspacing="0" bordercolor="#eeeeee" style="border-collapse:collapse ">
                          <tr>
                            <td width="18%" height="30" align="right" bgcolor="#E9F7FE">留 言 者：</td>
                            <td width="82%"><input name="userid" type="text" class="form1" id="userid" value="游客" size="25" maxlength="15">
                                <span class="F5">*</span></td>
                          </tr>
                          <tr>
                            <td height="30" align="right" bgcolor="#E9F7FE">留言类型：</td>
                            <td><select name="classid" class="form1" id="classid" style="width:147">
                                <option value="线路咨询" selected>线路咨询</option>
                                <option value="酒店咨询" >酒店咨询</option>
                                <option value="机票咨询" >机票咨询</option>
                                <option value="租车咨询" >租车咨询</option>
                                <option value="景区咨询" >特产咨询</option>
                                <option value="其他咨询" >其他咨询</option>
                            </select></td>
                          </tr>
                          <tr>
                            <td height="30" align="right" bgcolor="#E9F7FE">留言标题：</td>
                            <td><input name="title" type="text" class="form1" id="title" size="54" maxlength="40"> <span class="F5">*</span></td>
                          </tr>
                          <tr>
                            <td height="139" align="right" bgcolor="#E9F7FE">留言内容：</td>
                            <td><textarea name="content" cols="80" rows="8" class="form2" id="content"></textarea></td>
                          </tr>
                          <tr align="center">
                            <td height="34" colspan="2"><input name="Submit" type="submit" class="form3" value="提交留言">
&nbsp;
<input name="Submit" type="reset" class="form3" value="重写填写"></td>
                            </tr>
                      </table></td>
                    </tr>
                  </table>
                  </td>
              </tr>
            </form>
          </table>
          <table width="80%" border="0" cellspacing="0" cellpadding="0" height="10">
            <tr>
              <td></td>
            </tr>
          </table>
<%
if rs.eof and rs.bof then
response.write ""
else%>
          <%
if currentpage<1 then
   		currentpage=1
   	end if
   	if (currentpage-1)*MaxPerPage>totalput then
   		if (totalPut mod MaxPerPage)=0 then
     		currentpage= totalPut \ MaxPerPage
	  	else
	      	currentpage= totalPut \ MaxPerPage + 1
   		end if
   	end if
    if currentPage=1 then
       	showContent
       	showpage strFileName,totalput,MaxPerPage,true,true,"条信息"
 	else
     	if (currentPage-1)*MaxPerPage<totalPut then
       	   	rs.move  (currentPage-1)*MaxPerPage
       		dim bookmark
           	bookmark=rs.bookmark
            showContent
            showpage strFileName,totalput,MaxPerPage,true,true,"条信息"
       	else
	        currentPage=1
           	showContent
          	showpage strFileName,totalput,MaxPerPage,true,true,"条信息"
	    end if
	end if
rs.close
set rs=nothing %>
          <%sub showContent
   	dim page_Num
    page_Num=0%>
          <%do while not rs.eof%>
          <table width="100%" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="#E9F7FE">
            <tr>
              <td width="79%" height="18"  class="font_black_14bold">&nbsp;&nbsp;<font color="#FF6600"><%=rs("userid")%></font>&nbsp;&nbsp;<strong><%=rs("title")%><font color="#006600">（<%=rs("classid")%>）</font></strong></td>
              <td width="21%" class="p1"><%=rs("addtime")%></td>
            </tr>
          </table>
          <table width="80%" height="8" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td></td>
            </tr>
          </table>
          <table width="95%" height="18" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width="100%" height="18" valign="top" class="h1"><%=replace(rs("content"),vbcrlf,"<br>")%></td>
            </tr>
          </table>
          <%if rs("rem_pass")=1 then%>
          <table width="96%" height="4" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width="100%" valign="bottom"></td>
            </tr>
          </table>
		  
          <table width="95%" height="21" border="1" cellpadding="5" cellspacing="0" bordercolor="#FFD16D" bgcolor="#FFFCDB" style="border-collapse:collapse">
            <tr>
              <td height="21" align="left" valign="top" class="h1"><font color="#723000">
                <%if trim(rs("rem_content"))<>"" then%>
                <%=replace(rs("rem_content"),vbcrlf,"<br>")%>
                <%else%>
                <%=rs("rem_content")%>
                <%end if%>
              </font></td>
            </tr>
          </table>
          <%end if%>
          <table width="80%" height="15" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td></td>
            </tr>
          </table>
          <%
        PhotoNum=PhotoNum+1
	   	if PhotoNum>=MaxPerPage then exit do
rs.movenext
loop
%>
          <table width="100%" height="25" border="0" cellpadding="0" cellspacing="0" bgcolor="#E9F7FE">
            <tr>
              <td height="30" align="center" valign="middle"><%end sub%></td>
            </tr>
          </table>
          <%end if
rs.close
set rs=nothing%> <table width="80%" height="12" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td height="12"></td>
            </tr>
          </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<!--#include file="../inc/bottom.asp"-->
<%end if%>
<%
if request("action")="doinfo" then
if trim(Request("userid"))="" or trim(Request("content"))="" then
response.Redirect"../"
end if
    set rs=server.CreateObject("adodb.Recordset")
    sql="select * from book"
    rs.open sql,conn,1,3
	rs.addnew
	rs("addtime") =now()
	rs("userid")=trim(Request("userid"))
	rs("classid")=trim(Request("classid"))
	rs("title")=trim(Request("title"))
	rs("content") =left(trim(Request("content")),400)
	rs("getip") =request.ServerVariables("REMOTE_HOST")
	rs("pass")=0
	rs("rem_pass")=0
	rs.Update 
	rs.Close 
set rs=nothing
%>
<script language=javascript>  
alert( "留言已经提交成功，我们会在第一时间处理您问题，谢谢您的支持！"  );
location.href = "../book/"  
</script>
<%end if%>
</body>
</html>
