<%/*[comment]留言页[/comment]*/%>
<%@page pageEncoding="UTF-8"%>
<%@page trimDirectiveWhitespaces="true"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="gen" uri="http://help.jspgen.com/taglib/jstl"%>
<%@taglib prefix="cms" uri="http://help.jspgen.com/taglib/jstl/cms"%>
<!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=utf-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1" />
<title>留言板 ${config.title}</title>
<meta name="keywords" content="网站建设,网站设计,JavaCMS,JSPGenCMS,内容管理系统" />
<meta name="description" content="一款基于JSPGen框架所研发的内容管理系统，具有：安全稳定、模板标记少、扩展灵活等特点。" />
<link rel="shortcut icon" href="${config.statie}images/favicon.ico" />
<link rel="stylesheet" type="text/css" href="${config.statie}ui/cms/view/images/jspgencms.css" />
<link rel="alternate" type="application/rss+xml" title="${config.title}" href="${config.dynamie}cms/api.gen" />
</head>
<body>
<center>
  <jsp:include page="header.jsp" />
  <table width="1000" border="0" align="center" cellpadding="0" cellspacing="5" bgcolor="#FFFFFF">
    <tr>
      <td valign="top" height="100"><div class="bk bg4">
          <h2>留言列表</h2>
          <cms:guestbook var="guestbook" varPager="pager" category="默认" status="2" size="5" prompt="<p><br />&nbsp;暂无留言</p>">
            <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="80%" height="25" align="left" valign="middle">&nbsp;主题：${guestbook.subject}</td>
                <td align="right" height="25" width="20%"><font color="#808080">发表时间：</font>${guestbook.dateTime}&nbsp;&nbsp;</td>
              </tr>
            </table>
            <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr align="left">
                <td width="13%" height="25" align="right" valign="top">留言内容：</td>
                <td width="87%" align="left" valign="top">${guestbook.content}</td>
              </tr>
              <gen:if test="${guestbook.status == 2}">
                <tr>
                  <td height="30" align="right" valign="top"><strong>管理员回复：</strong></td>
                  <td align="left" valign="top"> ${guestbook.reply}</td>
                </tr>
              </gen:if>
            </table>
          </cms:guestbook>
          <div class="pages">
            <form name="search" method="post" action="?">
              <input type="submit" name="button" value="提交" style="display:none;" />
              <jsp:include page="pager.jsp" />
            </form>
          </div>
        </div></td>
    </tr>
    <tr>
      <td height="5"></td>
    </tr>
    <tr>
      <td valign="top" height="350"><div class="bk bg4">
          <h2>我要留言</h2>
          <div class="text_list">
            <style type="text/css">
.input{font-family:Verdana; font-size:14px; color: #003366; padding:2px; border:#DFDFDF 1px solid; height:20px;}
.textarea{font-family:Verdana; font-size:14px; color:#003366; padding:5px; border:#DFDFDF 1px solid; background-color:#FCFCFC;}
.submit{background:url(${config.statie}ui/cms/view/images/button.gif) 0 0 no-repeat;width:127px; height:30px; cursor:pointer; color:#FFF; font-weight:bold; border:0;}
.reset{background:url(${config.statie}ui/cms/view/images/button.gif) 0 -30px no-repeat;width:127px; height:30px; cursor:pointer; color:#FFF; font-weight:bold; border:0;}
</style>
            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
              <form id="form" name="form" method="post" action="${config.dynamie}cms/guestbook!save.gen">
              <!--<form id="form" name="form" method="post" action="${config.dynamie}cms/guestbook!result.gen">-->
                <tr>
                  <td width="19%" height="35" align="right" class="f14">您的姓名&nbsp;</td>
                  <td width="81%" height="30" align="left">&nbsp;
                    <input name="name" type="text" class="input" style="background-color:#FCFCFC; width:508px;" value=""></td>
                </tr>
                <tr>
                  <td height="35" align="right" class="f14">联系手机&nbsp;</td>
                  <td height="30" align="left">&nbsp;
                    <input name="phone" type="text" class="input" style="background-color:#FCFCFC; width:508px;" value=""></td>
                </tr>
                <tr>
                  <td height="112" align="right" valign="top" class="f14">留言内容&nbsp;</td>
                  <td height="112" align="left">&nbsp;
                    <textarea name="content" cols="7" rows="6" class="textarea" style="width:500px; max-width:500px; max-height:200px;"></textarea></td>
                </tr>
                <tr class="captcha">
                  <td height="30" align="right" valign="middle" class="f14">验 证 码&nbsp;</td>
                  <td height="13" align="left" valign="top">&nbsp;
                    <input name="captcha" type="text" class="input" style="background-color:#FCFCFC;width:50px;" value="">
                    &nbsp;<img src="" title="点击刷新" align="absmiddle" style="display:none;" /></td>
                </tr>
                <tr>
                  <td height="50" colspan="2" align="center" valign="middle"><input type="hidden" name="formHash" value="${formHash}" /><input name="category" type="hidden" value="默认" />
                    <input name="subject" type="hidden" value="" />
                    <!--<textarea name="mailtxt" style="display:none;"></textarea>-->
                    <input type="submit" name="dosubmit" value=" " class="submit">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <input type="reset" name="reset" value=" " class="reset"></td>
                </tr>
              </form>
            </table>
          </div>
        </div></td>
    </tr>
  </table>
  <jsp:include page="footer.jsp" />
</center>
</body>
<script type="text/javascript" src="${config.statie}js/jquery.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.grapes.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.feed.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.s2t.js"></script>
<script type="text/javascript" src="${config.statie}ui/js/jspgen.js"></script>
<script type="text/javascript" src="${config.statie}ui/js/jspgen.ajax.js"></script>
<script type="text/javascript" src="${config.statie}ui/cms/js/jspgencms.js"></script>
<script type="text/javascript" src="${config.statie}ui/cms/js/jspgencms.ajax.js"></script>
<script type="text/javascript" src="${config.statie}ui/cms/js/jspgencms.ready.js"></script>
<script type="text/javascript">
$(document).ready(function () {
	setnav('.nav li', '#nav_guestbook', 'hover');
	
	var $form = $('#form'), $captcha = $('input[name="captcha"]');
	var $name = $('input[name="name"]'), $phone = $('input[name="phone"]');
	var $subject = $('input[name="subject"]'), $content = $('textarea[name="content"]');
	$form.submit(function() {
		if (grapes.isEmpty($name.val())) {
			alert('请输入姓名！');
			$name.focus();
			return false;
		}
		if (grapes.isEmpty($phone.val())) {
			alert('请输入联系手机！');
			$phone.focus();
			return false;
		}
		if (grapes.isEmpty($content.val())) {
			alert('请填写内容！');
			$content.focus();
			return false;
		}
		if ($captcha.length>0 && grapes.isEmpty($captcha.val())) {
			alert('请输入验证码！');
			$captcha.focus();
			return false;
		}
		$subject.attr('value', $name.val()+' 的留言');
		return true;
	});
	$('.captcha').captcha();
});
</script>
</html>