<div class="panel panel-info">
	<div class="panel-heading espcms_page_navigation_title"><h5>Online message</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);
			//定义limit开始数字 当前页数*每页显示的数量
			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>Submit Message</span></div>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/espcms_formvalidation.js"></script>
		<script type="text/javascript">
		$(function () {
			$("#messformsave").espcms_formvalidation();
		});
		</script>
		<form name="messformsave" id="messformsave" method="post" class="form-horizontal admin-form" action="{%$formlink.save%}">
			<input type="hidden" name="tokenname" value="{%$tokenkey.token_name%}"/>
			<input type="hidden" name="tokenkey" value="{%$tokenkey.token_key%}"/>
			<input type="hidden" name="addtype" value="ajaxlistadd"/>
			<input type="hidden" name="sourcecode" value="{%$source_array.key%}"/>
			<input type="hidden" name="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">Name</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="Please enter your name, length: 2-50 characters" title="Please enter your name, length: 2-50 characters" data-validation-msg="Sorry, name entered incorrectly , length: 2-50 characters"/>
				</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="Please enter E-mail" title="Please enter E-mail" data-validation-msg="Sorry: E-mail input error, please re-enter!" validation-warning="Sorry: E -mail already exists" />
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">Content</label>
				<div class="col-sm-9">
					<textarea name="content" class="form-control" style="width:100%;height:250px" id="content"  title="Please fill in the message content" placeholder="Please fill in the message content" data-validation-minlength="10"  data-validation-maxlength="5000" data-validation-msg="Sorry, the message cannot be empty, please go back and re-enter"></textarea>
				</div>
			</div>
			{%if $type_read.isseccode==1%}
			<div class="form-group">
				<label class="col-sm-2 control-label">Verification</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="Please enter a verification code of 4 English characters." title="Please enter a verification code of 4 English characters." maxlength="4" data-validation-msg="Error: Verification code input errors">
					</div>
					<div class="col-sm-6 col-md-6 col-mm-6 pl0">
						<img title="Click to replace the verification code" 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="Submit"/>
				</div>
			</div>
		</form>
	</div>
	{%/if%}
</div>

