<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport"
		content="width=device-width,user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<title>粉丝排行榜</title>
	<link rel="stylesheet" type="text/css" href="${ctx}/styles/common/reset.css" />
	<link rel="stylesheet" type="text/css" href="${ctx}/styles/wechat/countRechargeRank.css" />
	<script type="text/javascript" src="${ctx}/scripts/common/jquery-1.11.3.min.js"></script>
	<script type="text/javascript" src="${ctx}/scripts/common/common.js"></script>
	<script type="text/javascript">
	$(function(){
		$("#organization").bind("change",function(){
			var this_=$(this);
			$("#organizationId").val(this_.val());
			$("#organizationName").html($("#organization").find("option:selected").text()+"<i class='arrowicon'></i>");
			
			$(".searchbar").submit();
		});
		
		$(".searchbtn").click(function(){
			$(".searchbar").submit();
		});
	});
	</script>
</head>
<body>
	<input type="hidden" id="contextPath" value="${ctx }" />
	<form class="searchbar" action="${ctx}/wechat/countServer/fansRank" method="POST">
		<input type="hidden" name="organizationId" id="organizationId" value="${organizationId }">
		<input type="hidden" name="month" id="month" value="${month}">
		<div class="searchentry">
			<input type="text" name="keyWords" placeholder="搜索项目名称或编号" value="${keyWords}" />
		</div>
		<input type="button" value="搜索" class="searchbtn" />
	</form>
	<div class="selectnav clearfix">
		<div class="selectitem">
			<span id="organizationName">${organizationName }<i class="arrowicon"></i></span> 
			<select name="" id="organization" class="selectentry">
				<option value="">选择</option>
				<c:forEach items="${organizationList }" var="organization">
					<c:choose>
						<c:when test="${organization.id==organizationId }"><option value="${organization.id }" selected="selected">${organization.name}</option></c:when>
						<c:otherwise><option value="${organization.id }">${organization.name}</option></c:otherwise>
					</c:choose>
				</c:forEach>
			</select>
		</div>
	</div>
	<c:if test="${flag=='defalut' }">
		<div class="rankinglist">
			<h3>粉丝排行榜</h3>
			<c:forEach items="${dataList}" var="model" varStatus="st">
				<c:choose>
					<c:when test="${st.count==1 }">
						<div class="rankingitem clearfix">
							<em class="rankingsort"> <i class="rangkinone"></i>
							</em><span class="money">${model.totalAmonut }(人)</span> <span class="company">${model.name}</span>
						</div>
					</c:when>
					<c:when test="${st.count==2 }">
						<div class="rankingitem clearfix">
							<em class="rankingsort"> <i class="rangkintwo"></i>
							</em> <span class="money">${model.totalAmonut }(人)</span> <span class="company">${model.name}</span>
						</div>
					</c:when>
					<c:when test="${st.count==3 }">
						<div class="rankingitem clearfix">
							<em class="rankingsort"> <i class="rangkinthree"></i>
							</em> <span class="money">${model.totalAmonut }(人)</span> <span class="company">${model.name}</span>
						</div>
					</c:when>
					<c:otherwise>
						<div class="rankingitem clearfix">
							<em class="rankingsort">${st.count }</em> <span class="money">${model.totalAmonut }(人)</span> <span
								class="company">${model.name}</span>
						</div>
					</c:otherwise>
				</c:choose>
			</c:forEach>
		</div>
	</c:if>
	
	<c:if test="${flag=='search' }">
		<div class="rankinglist" >
			<h3>搜索结果如下</h3>
			<c:forEach items="${dataList}" var="model" varStatus="st">
				<div class="rankingitem clearfix">
					<span class="money">${model.totalAmonut }(人)</span> <span
						class="company">${model.name}</span>
				</div>
			</c:forEach>
			<c:if test="${empty dataList }">
				<div class="rankingitem clearfix">
					暂无数据
				</div>
			</c:if>
		</div>
	</c:if>
	
	<div class="myfootertext">
	    <div class="mytwoText clearfix">
	        <a href="${ctx}/wechat/countServer/fansRank" class="mytext">粉丝排行榜</a>
	        <a href="${ctx}/wechat/countServer/rechargeRank">充值排行榜</a>
	     </div>
    </div>
</body>
</html>