<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ page import="java.io.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ include file="/jsp/common/include/localemessage.jsp" %>
<%
	response.setHeader("Pragma", "No-cache");
	response.setHeader("Cache-Control", "no-cache");
	response.setHeader("Expires", "0");

%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<jsp:include page="/jsp/common/include/css.jsp"/>
<jsp:include page="/jsp/common/include/script.jsp"/>
<script language="javascript" >
var url ='<c:url value="/common/acl/user/userMan.json" />';
var userId = window.dialogArguments["userId"];

$(document).ready(function() {
	$('#grid').jqGrid({
		datatype:"json",
		mtype: 'POST',
		url: url,
		postData : { cmd : 'LIST_CHANGE_HISTORY' , userId : userId}, 
		colNames:[
			'NO',
			'번호',
			'<%= localeMessage.getString("login.userId") %>',
            '<%= localeMessage.getString("user.updateType") %>',
            '<%= localeMessage.getString("user.updateDetail") %>',
            '<%= localeMessage.getString("user.updateById") %>', 
            '<%= localeMessage.getString("user.updateDate") %>'
                  ],
		colModel:[
				{ name : 'chgLogId'   , align:'center'	,sortable:false  , hidden:true},
				{ name : 'rowNum'   , align:'center', width:"30"	,sortable:false  },
				{ name : 'userId'   , align:'center' , width:"60" },
				{ name : 'chgGbName'   , align:'center' , width:"40" },
				{ name : 'chgDtl'   , align:'center' , width:"140" },
				{ name : 'amdrId'   , align:'center', width:"60"  },
				{ name : 'crtnDttm'   , align:'center', width:"60"}
				],
		jsonReader: {
             repeatitems:false
        },
        pager : $('#pager'),
		page : '${param.page}',
		rowNum : '${rmsDefaultRowNum}',
	    autoheight: true,
	    height: $("#container").height(),
	    height: "520",
		autowidth: true,
		viewrecords: true,
		rowList : eval('[${rmsDefaultRowList}]'),
		gridComplete:function (d){
			var colModel = $(this).getGridParam("colModel");
			var rowData = $(this).getDataIDs();
			
			for(var i = 0 ; i< colModel.length; i++){
				$(this).setColProp(colModel[i].name, {sortable : false});	//그리드 헤더 화살표 삭제(정렬X)		
			}
			for(var i = 0 ; i< rowData.length; i++){
				$(this).jqGrid('setCell', rowData[i], 'rowNum', i+1);
			}
		
		},
        loadError: function (jqXHR, textStatus, errorThrown) {
        		//debugger
        	if(jqXHR.status == 401) {
        		
        		var location ='<%=request.getContextPath()%>/';
	        	comloadError(jqXHR, textStatus, errorThrown ,location);
	    	}
    	}
	});
	
	resizeJqGridWidth('grid','content_middle','1000');
	
	$("#btn_close").click(function(){
		window.close();
	});
	
	buttonControl();
	
});
</script>
</head>
	<body>
		<div class="popup_box">
			<div class="search_wrap">
				<button type="button" class="cssbtn" id="btn_close" level="R" status="DETAIL,NEW"><i class="material-icons">cancel</i> <%= localeMessage.getString("button.close") %></button>
<%-- 				<img src="<c:url value="/img/btn_search.png"/>" alt="" id="btn_search" level="R" />	 --%>
<%-- 				<img id="btn_close" src="<c:url value="/img/btn_close.png"/>"         level="R" status="DETAIL,NEW"/> --%>
			</div>
			<div class="title"><%=localeMessage.getString("userPop4.title")%></div>
			<table class="grid" id="grid" cellspacing=0;>
			</table>
			<div id="pager"></div>
		</div><!-- end right_box -->	
	</body>
</html>

