<div class="panel panel-info">
	<div class="panel-heading espcms_page_navigation_title"><h5>在线留言</h5></div>
	{%if $view_purview==1%}
	<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/espcms_pagebotton.js"></script>
	<script type="text/javascript">
		$().ready(function () {
			var loadurl = $('#loadurl').val();
			var limit = $('#limit').val();
			var countnum = $('#countnum').val();
			var maxpage = $('#maxpage').val();
			var nowpage = $('#nowpage').val();
			var loadname = $('#loadname').val();
			var pagetextname = $('#pagetextname').val();
			var pagebottonname = $('#pagebottonname').val();
			pageload(loadurl, limit, countnum, maxpage, nowpage, loadname, pagetextname, pagebottonname, 'ajaxFormlist');
		});

		function pageselectCallback(limit, nowpage, maxpage, countnum, pagetextname, loadname, loadurl) {
			$("#nowpage").val(nowpage);
			var limitstard = (limit * nowpage);
			$.ajax({
				type: "get", url: loadurl, data: {'limitstard': limitstard, 'nowpage': nowpage, 'limit': limit}, global: false,
				beforeSend: function () {
					$('#espcms_loading').removeClass("displaynone");
				},
				success: function (data) {
					$('#espcms_loading').addClass("displaynone");
					$(loadname).empty().append(data);
				}
			});
			if (countnum > 1) {
				$(pagetextname).text("共有 " + countnum + " 条记录  当前第 " + (Number(nowpage) + 1) + " 页/共有 " + maxpage + "  页   每页显示 " + limit + " 条");
			}
		}
	</script>
	<form name="ajaxFormlist" id="ajaxFormlist" method="post">
		<input type="hidden" name="loadurl" id="loadurl" value="{%$formlink.ajaxdoclist%}">
		<!--每页显示数量-->
		<input type="hidden" name="limit" id="limit" value="{%$limit%}"/>
		<!--数量总数量-->
		<input type="hidden" name="countnum" id="countnum" value="{%$countnum%}"/>
		<!--总翻页数量-->
		<input type="hidden" name="maxpage" id="maxpage" value="{%$maxpage%}"/>
		<!--当前翻页数-->
		<input type="hidden" name="nowpage" id="nowpage" value="0"/>
		<input type="hidden" name="loadname" id="loadname" value="#bbsajaxlist"/>
		<input type="hidden" name="pagetextname" id="pagetextname" value="#espcms_bbs_pagelist"/>
		<input type="hidden" name="pagebottonname" id="pagebottonname" value="#espcms_bbs_pagination"/>
		<div class="panel-body">
			<div id="espcms_loading" class="displaynone"><img src="{%$rootpath%}images/lightbox-ico-loading.gif"></div>
			<ul id="bbsajaxlist" class="bbsajaxlist unstyled"></ul>
		</div>
	</form>
	{%if $countnum>0%}
	<div class="panel-menu text-center" id="espcms_bbs_pagelist"></div>
	<div class="panel-menu">
		<div class="espcms_ajax_page_button">
			<div class="btn-toolbar" id="espcms_bbs_pagination"></div>
		</div>
	</div>
	{%/if%}
	{%/if%}
	{%if $add_purview==1%}
	<div class="panel-body">
		<div class="section-divider mb40"><span>提交留言</span></div>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/espcms_formvalidation.js"></script>
		<script type="text/javascript">
		$(function () {
			$("#messformsave").espcms_formvalidation();
			$("#messformsave").espcms_token_js({url: '{%$formlink.token%}'});
		});
		</script>
		<form name="messformsave" id="messformsave" method="post" class="form-horizontal admin-form" action="{%$formlink.save%}">
			<input type="hidden" name="tokenname" id="tokenname" value="{%$tokenkey.token_name%}"/>
			<input type="hidden" name="tokenkey" id="tokenkey" value="{%$tokenkey.token_key%}"/>
			<input type="hidden" name="addtype" value="ajaxlistadd"/>
			<input type="hidden" name="sourcecode" id="sourcecode" value="{%$source_array.key%}"/>
			<input type="hidden" name="sourceurl" id="sourceurl" value="{%$source_array.url%}"/>
			<input type="hidden" name="sourcetitle" value="{%$source_array.title%}"/>
			<input type="hidden" name="btid" value="{%$type_read.btid%}"/>
			<div class="form-group">
				<label class="col-sm-2 control-label">姓名</label>
				<div class="col-sm-9">
					<input type="text" class="form-control" name="addname" id="addname" value="{%$member.username%}" data-validation-minlength="2" data-validation-maxlength="60" placeholder="请输入您的姓名，长度：2-50个字符" title="请输入您的姓名，长度：2-50个字符" data-validation-msg="抱歉，姓名输入错误，长度：2-50个字符"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">E-mail</label>
				<div class="col-sm-9">
					<input type="text" name="email" id="email" class="form-control" value="{%$member.email%}" data-validation="^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$"  placeholder="请输入E-mail" title="请输入E-mail" data-validation-msg="抱歉：E-mail输入错误，请重新输入！" validation-warning="抱歉：E-mail已存在" />
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">内容</label>
				<div class="col-sm-9">
					<textarea name="content" class="form-control" style="width:100%;height:250px" id="content" title="请详细填写留言内容" placeholder="请详细填写留言内容" data-validation-minlength="10"  data-validation-maxlength="5000" data-validation-msg="抱歉，留言内容不能为空，请返回重新输入"></textarea>
				</div>
			</div>
			{%if $type_read.isseccode==1%}
			<div class="form-group">
				<label class="col-sm-2 control-label">验证码</label>
				<div class="col-sm-9">
					<div class="col-sm-6 col-md-6 col-mm-6 p0">
						<input type="text" name="seccode" class="form-control" style="text-transform: uppercase;" id="seccode" data-validation="^[A-Za-z]{4}$" placeholder="请输入4位英文字符的验证码" title="请输入4位英文字符的验证码" maxlength="4" data-validation-msg="错误：验证码输入错误，请输入4位英文字符的验证码">
					</div>
					<div class="col-sm-6 col-md-6 col-mm-6 pl0">
						<img title="点击更换验证码" id="memberseccodesrc" onclick="sessionimg('memberseccodesrc', '{%$rootdir%}')" src="{%$seccodelink%}" class="img-rounded" style="cursor: pointer;height:33px;" align="absmiddle"/>
					</div>
				</div>
			</div>
			{%/if%}
			<div class="form-group">
				<label class="col-sm-2 control-label"></label>
				<div class="col-sm-9">
					<input type="submit" class="btn btn-success btn-lg" formmethod="POST" value="确认提交"/>
				</div>
			</div>
		</form>
	</div>
	{%/if%}
</div>

