<%--
  Class Name : IpList.jsp
  Description : 아이피 관리 화면
  Modification Information
 
      수정일         수정자                   수정내용
    -------    --------    ---------------------------
     2018.06.11   ITN              최초 생성
 
    author   : ITN
    since    : 2018.06.11
--%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html> 
<head>
	<meta http-equiv="Content-Language" content="ko">
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<title>자산명 불러오기</title>
	<link rel="stylesheet" href="/direct/css/font.css">
	<link rel="stylesheet" href="/direct/css/reset.css">
	<link rel="stylesheet" href="/direct/css/enroll_popup.css">
	<link rel="stylesheet" href="/direct/css/nice-select.css">
	<!--[if IE]>
<link rel="stylesheet" type="text/css" href="/direct/css/ie_popup.css" />
<![endif]-->
<script src="/direct/js/jquery-1.11.3.min.js"></script>
<script src="/direct/js/jquery-ui.min.js"></script>
<script src="/direct/js/jquery.nice-select.js"></script>
<script src="/direct/js/script.js"></script>
<script src="/direct/js/popup_open_2.js"></script>
<script>
$(document).ready(function() {
	{
	    var w = $('.enroll_popup').width();
	    var h = $('.enroll_popup').height();
	    window.resizeTo(w+25, h+50);
	}
});

function insertCompany(){
    var selected = $('#myform input:radio[name=del]:checked').val();
    if(selected == undefined || selected==""){
    	alert("자산명을 선택해 주세요.");
    	return;
    }
    
    if(opener.location.href.indexOf('/uss/itsm/ip/IpList.do')  > -1){ //IP관리의 소속
    	if(opener != null){
			opener.$('#astIdText').val($("#tr_list_"+selected).find('.td_astName').text().trim() );
			opener.$('#astId').val(selected ); 
		}
    }
    window.self.close() ;
}
 
function linkPage(pageNo){
	var searchForm = document.searchForm ;
	searchForm.pageIndex.value = pageNo ;
	searchForm.searchKeyword.value = $('#searchKeyword').val();
	searchForm.searchCondition.value = $('#searchCondition').val();
	searchForm.submit();
}
</script>
</head>
	<body>
		<form name="myform" id="myform">
		<div class="enroll_popup enterprise_call_popup" style="height: 713px;">
			<div class="enroll_popup_title asset_popup_title">
				<img src="/direct/img/enroll_popup_title_bg.png" alt=""> 자산명 불러오기
			</div>
			<div class="enroll_input_left asset_exposure_list">
				<ul>
					<li>검&emsp;&emsp;색<input hidden="hidden"/> <input type="text" id="searchKeyword" value="${assetVO.searchKeyword}"  class="business_call_serch" onkeypress="if(event.keyCode==13) {linkPage('1');}"/><input type="button" value="검색" class="serch_btn" onclick="linkPage('1');">
					</li>
					<li>
						<div class="enterprise_right_table ptr_List">
							<table>
								<thead><!-- 리스트 시작 -->
						            <tr>
						                <th></th>
						                <th>번호</th>
						                <th style="width: 150px;">자산명</th>
						                <th style="width: 100px;">모델명</th>
						                <th style="width: 100px;">취득일자</th>
						                <th style="width: 100px;">자산위치</th>
						                <th style="width: 100px;">도입부서</th>
						                <th style="width: 100px;">사용부서</th>
						            </tr>
						        </thead>
								<tbody style="height: 370px;">
									<c:forEach var="result" items="${assetVOListDb}" varStatus="status">
						            <tr class="tr_list" id="tr_list_${result.astId}">
						               <td><input type="radio" name="del" id="check${status.index}" value="${result.astId}"><label for="check${status.index}"></label></td>
						               <td class="td_list" value="${result.astId}">
						                	<c:out value="${(assetVO.pageIndex - 1) * assetVO.pageUnit + status.count}"/>
						                </td><!--번호  -->
					                	<td style="width: 150px;" class="td_astName" value="${result.astId}"><!-- 자산명 -->
					                		<label for="check${status.index}">${result.astName}</label>
					                	</td>
					                	<td style="width: 100px;" class="td_list" value="${result.astId}"><!-- 모델 -->
					                		<label for="check${status.index}">${result.astModel}</label>
					                	</td>
					                	<td style="width: 100px;" class="td_list" value="${result.astId}"><!-- 취득일자 -->
					                		<label for="check${status.index}">${result.astAcqDate}</label>
					                	</td>
					                	<td style="width: 100px;" class="td_list" value="${result.astId}"><!-- 자산위치 -->
					                		<label for="check${status.index}">${result.astLoc}</label>
					                	</td>
					                	<td style="width: 100px;" lass="td_list" value="${result.astId}"><!-- 도입부서 -->
					                		<label for="check${status.index}">${result.astDept}</label>
					                	</td>
					                	<td style="width: 100px;" class="td_list" value="${result.astId}"><!-- 사용부서 -->
					                		<label for="check${status.index}">${result.astUseDept}</label>
					                	</td>
						            </tr>
						            </c:forEach>
						            <c:if test="${empty assetVOListDb}">
						         	<tr class="noSerchTr">
						         		<td colspan="16" class="noSerch"><spring:message code="common.nodata.msg" /></td>
						         	</tr>
						            </c:if>  
								</tbody>
							</table>
						</div>
					</li>
				</ul>
			</div>
			<div class="page">
		        <ul>
		  			<ui:pagination paginationInfo = "${paginationInfo}"  type="image" jsFunction="linkPage" />
		  		</ul>
		    </div>
			<div class="main1_btn_div">
				<input type="button" class="save_btn" value="선택" onclick="insertCompany(); return false;">
				<input type="button" class="close_btn" value="닫기" onclick="javascript:window.close();">
			</div>
		</div>
		</form>
		<form name="searchForm" method="get" action="<c:url value='/uss/itsm/asset/AssetSelectPopup.do'/>">
			<input name="pageIndex" type="hidden" value="1" />
			<input name="searchCondition" type="hidden" />
			<input name="searchKeyword" type="hidden" />
			<input name="pageUnit" type="hidden" value="10" />
		</form>	
	</body>
</html>