<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page import="kcg.faics.sec.LoginUserVO"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<script type="text/javaScript" defer="defer">
	<!--
	
	/* 글 상세 화면 function */
	function fn_select(id) {
		document.listForm.userid.value = id;
		document.listForm.action = "<c:url value='/fa/memberInfo.do'/>";
	   	document.listForm.submit();
	}
	
	/* 기관 선택시 호출 함수 */
    function fn_searchList(place1) {
    	document.searchForm.pageIndex.value = 1;
		document.searchForm.place1.value = place1;
       	document.searchForm.action = "<c:url value='/admin/faMemberCmmnList.do'/>";
       	document.searchForm.submit();
    }
	
	/* pagination 페이지 링크 function */
	function fn_link_page(pageNo) {
		document.searchForm.pageIndex.value = pageNo;
		document.searchForm.action = "<c:url value='/admin/faMemberCmmnList.do'/>";
		document.searchForm.submit();
	}
	//-->
</script>
<div class="placeList">
	<ul>
		<c:forEach var="item" items="${place1List}">
   			<li><a href="javascript:fn_searchList('${item.code2}')">${item.codenmYak}</a></li>
   		</c:forEach>
	</ul>
</div>
<form:form commandName="memberSearchVO" name="searchForm" method="get">
       	<form:hidden path="pageIndex" />
       	<form:hidden path="place1" />
</form:form>
<form:form name="listForm" method="get">
		<input type="hidden" name="userid" />
       	<!-- List -->
		<div class="memberList">
		<c:choose>
			<c:when test="${fn:length(resultList) > 0}">
			<!-- 수정전 파일은!! faMemberCmmnList2.jsp로 저장해놨습니다. -->
			<table class="tbl_memberList" width="100%" border="0" cellpadding="0" cellspacing="0">
				<colgroup>
					<col width="140">
					<col width="180">
					<col width="">					
					<col width="">					
					<col width="">					
					<col width="">
				</colgroup>
				<thead>
					<tr>
						<th>사진</th>
						<th>이름</th>
						<th><spring:message code="member.view.ophone" /></th>
						<th><spring:message code="member.view.hphone" /></th>
						<th><spring:message code="member.view.cphone" /></th>
						<th><spring:message code="member.view.charge" /></th>
					</tr>
				</thead>
				<c:forEach var="result" items="${resultList}" varStatus="status">
				<tr>
					<td align="center">
						<a href="javascript:fn_select('${result.userid}');">
							<img height=130 alt="<c:out value="${result.name}"/>" src="<spring:message code="Member.imgStoreUrl" /><c:if test="${result.userimg eq null}">noImage.png</c:if><c:out value="${result.userimg}"/>">
						</a>
					</td>
					<td align="center">
						<c:out value="${result.positionStr}" /> - <c:out value="${result.name}" />
					</td>			
					<td align="center">
						<c:out value="${result.ophone}" />
					</td>
					<td align="center">
						<c:out value="${result.hphone}" />
					</td>
					<td align="center">
						<c:out value="${result.cphone}" />
					</td>
					<td align="center">
						<c:out value="${result.charge}" />
					</td>
				</tr>
			</c:forEach>
			</table>
			</c:when>
			<c:otherwise>
				조회된 요원이 없습니다.
			</c:otherwise>
		</c:choose>
		</div>
		<!-- /List -->
		<c:if test="${fn:length(resultList) > 0}">
		<div id="paging">
			<ui:pagination paginationInfo="${paginationInfo}" type="image" jsFunction="fn_link_page" />
		</div>
		</c:if>
</form:form>