<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/WEB-INF/jspf/include/taglibs.jsp"%>

<script type="text/javascript">
	function forvardPage( form, page )
	{
		form.pageIndex.value = page;
		form.submit();
	}
	function backPage( form, page )
	{
		form.pageIndex.value = page;
		form.submit();
	}
</script>

<c:if test="${not empty dataMap['page'].pageIndex}">
	
	<c:set var="pages" value="1"/>
	<c:if test="${not empty dataMap['page'].pageCount and dataMap['page'].pageCount > 0}">
		<c:set var="pages" value="${dataMap['page'].pageCount}"/>
	</c:if>
	<c:set var="page"/>
	<c:if test="${not empty dataMap['page'].pageIndex}">
		<c:set var="page" value="${dataMap['page'].pageIndex}"/>
	</c:if>
	
	<form method='get' name="page">
		<input type="hidden" name="action" value="Bill"/>
		<input type="hidden" name="module" value="${dataMap['module']}"/>
		<input type="hidden" name="mid" value="${dataMap['mid']}"/>
		<input type="hidden" name="pageIndex" value=""/>
	
	
	<table border="0" cellpadding="0" cellspacing="0" class="tablePagesBar" style="margin-top:5px ! important; margin-bottom: 5px ! important">
		<tr>
			<th style="padding-right:10px;">Страница&#x0A;</th>
	        <td>
				<c:choose>
	        		<c:when test="${page==1}">
						<!--  <img src="${pageContext.request.contextPath}/img/butt_back.gif" width="15" height="15"/>&#160;
						<img src="${pageContext.request.contextPath}/img/butt_back1.gif" width="15" height="15"/>-->
						<input type="button" value="<<">
		        		<input type="button" value="<<">
	        		</c:when>
	        		<c:otherwise>
	    	    		<!--  <img src="${pageContext.request.contextPath}/img/butt_back.gif" width="15" height="15" style="cursor:pointer;" ></img>&#160;
		        		<img src="${pageContext.request.contextPath}/img/butt_back1.gif" width="15" height="15" style="cursor:pointer;"></img>-->
		        		<input type="button" value="<<" onclick="backPage(this.form, 1 )">
	        			<input type="button" value="<<" onclick="backPage(this.form, ${page - 1})">
	        		</c:otherwise>
	        	</c:choose>
			</td>
			<th style="padding-left:5px; padding-right:5px;"> ${page}&#160;из&#160;${pages} </th>
			<td>
				<c:choose>
	        		<c:when test="${page==pages}">
	    	    		<!--  <img src="${pageContext.request.contextPath}/img/butt_foward1.gif" width="15" height="15"/>&#160;
		        		<img src="${pageContext.request.contextPath}/img/butt_foward.gif" width="15" height="15"/>-->
		        		<input type="button" value=">>">
		        		<input type="button" value=">>">
	        		</c:when>
	        		<c:otherwise>
	        			<!--  <img src="${pageContext.request.contextPath}/img/butt_foward1.gif" width="15" height="15" style="cursor:pointer;"></img>&#160;
	        			<img src="${pageContext.request.contextPath}/img/butt_foward.gif" width="15" height="15" style="cursor:pointer;"></img>-->
	        			<input type="button" value=">>" onclick="forvardPage(this.form,${page + 1} )">
	        			<input type="button" value=">>" onclick="forvardPage(this.form, ${pages})">
	        		</c:otherwise>
	        	</c:choose>
	        </td>
		</tr>
	</table>
	
	</form>
</c:if>
