<%@ 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 prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ page import="com.eactive.eai.rms.common.login.SessionManager"%>
<%@ page import="com.eactive.eai.common.util.SystemUtil"%>
<%
	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="/bap/admin/message/flowRuleMan.json" />';
	var url_view = '<c:url value="/bap/admin/message/flowRuleMan.view" />';
	var url_excel= '<c:url value="/bap/admin/message/flowRuleMan.excel"/>';
	
	var isDetail = false;
    var isClone  = false;
	
	var roleString	= "<%=SessionManager.getRoleIdString(request)%>";
	var devSvr		= <%=SystemUtil.isDevServer()%>;
	var prdSvr		= <%=SystemUtil.isProdServer()%>;
	var stgSvr		= <%=SystemUtil.isStagingServer()%>;
	var svrType		= '';
	
	function isValid() {
		if ($('input[name=bjobBzwkPrcssDstcd]').val() == "") {
			alert("업무처리구분코드를 입력하여 주십시요.");
			return false;
		} else if ($('input[name=flowRulePtrnDesc]').val() == "") {
			alert("흐름규칙유형설명을 입력하여 주십시요.");
			return false;
		}

		return true;
	}
	function isValidGrid() {
		if ($('input[name=bjobBzwkPrcssDstcd]').val() == "") {
			alert("업무처리구분코드를 입력하여 주십시요.");
			return false;
		} else if ($('input[name=flowRulePtrnDesc]').val() == "") {
			alert("흐름규칙유형설명을 입력하여 주십시요.");
			return false;
		}

		return true;
	}
	function reloadGridWithScrollPosition(){
			
		//scroll 위치 유지
		var scrollPosition = $('#grid').closest(".ui-jqgrid-bdiv").scrollTop();
		$("#grid").trigger('reloadGrid');
		
		//scroll 위치 설정
		$('#grid').closest(".ui-jqgrid-bdiv").scrollTop(scrollPosition);	
	
	}
	function swapRow(prerow, nextrow){
		var rowid = nextrow;
		var preRowid = prerow;
		
		var rowData = $("#grid").jqGrid('getRowData',rowid);
		var newVal = "000"+(rowData['BJOBSTGESERNO']-1);
		newVal = newVal.substring(newVal.length,newVal.length-3);
		rowData['BJOBSTGESERNO'] = newVal;
		
		var preRowData = $("#grid").jqGrid('getRowData',preRowid);
		var preNewVal = "000"+(Number(preRowData['BJOBSTGESERNO'])+1);
		preNewVal = preNewVal.substring(preNewVal.length, preNewVal.length-3);
		preRowData['BJOBSTGESERNO'] = preNewVal;
		
		$('#grid').jqGrid('setRowData',rowid, preRowData);
		$('#grid').jqGrid('setRowData',preRowid, rowData);
		
		$("#grid").jqGrid('sortGrid','BJOBSTGESERNO',true);
		reloadGridWithScrollPosition();
	}

	function imgUpunformatter(cellvalue, options, rowObject) {
		return "";
	}

	function imgDownunformatter(cellvalue, options, rowObject) {
		return "";
	}

	function imgUpformatter(cellvalue, options, rowObject) {
		var rowId = options["rowId"];
		var url = 'src=<c:url value="/img/btn_grid_up.png" />';
		return "<img id='btn_move_up' name='img_up_"+rowId+"' "+url+ " class='btn_img' />";
	}

	function imgDownformatter(cellvalue, options, rowObject) {
		var rowId = options["rowId"];
		var url = 'src=<c:url value="/img/btn_grid_down.png" />';
		return "<img id='btn_move_down' name='img_down_"+rowId+"' "+url+ " class='btn_img'/>";
	}
	function unformatterFunction(cellvalue, options, rowObject) {
		return "";
	}

	function formatterFunction(cellvalue, options, rowObject) {
		var rowId = options["rowId"];
		var url = 'src=<c:url value="/img/btn_grid_delete.png" />';
		return "<img id='btn_pop_delete' name='img_del_"+rowId+"' "+url+ " class='btn_img'/>";
	}
	
	function cloneunformatter(cellvalue, options, rowObject) {
		return "";
	}
	function cloneformatter(cellvalue, options, rowObject) {
		var rowId = options["rowId"];
		var url = 'src=<c:url value="/img/btn_grid_clone.png" />';
		return "<img id='btn_pop_clone' name='img_clone_"+rowId+"' "+url+ " class='btn_img'/>";
	}

	function gridRendering() {
		$('#grid').jqGrid(
				{
					datatype : "local",
					loadonce : true,
					rowNum : 10000,
					colNames : [ '처리구분코드', '일련번호', '구분코드', '유형명', '변동조건설명',
							'유형구분', '세부운영코드','BATCH작업공통전문거래코드','타임아웃값','작업반복횟수',
							'조건항목결정내용','처리우선','전문클래스ID','조건전문유형코드','조건전문관리코드',
							'조건거래분류코드', '조건응답코드', '다음단계구분코드명' , '▲', '▼','삭제','복제'],
					colModel : [ 
							{ name : 'BJOBBZWKPRCSSDSTCD'	, align : 'left'	, sortable:false, hidden:true},
							{ name : 'BJOBSTGESERNO'		, align : 'left'	, sortable:false},
							{ name : 'BJOBSTGEDSTCD'		, align : 'left'	, sortable:false},
							{ name : 'BJOBSTGEPTRNNAME'		, align : 'left'	, sortable:false},
							{ name : 'BJOBSTGEFLXBLCNDNDESC', align : 'left'	, sortable:false, width : 400},
							{ name : 'TELGMPTRNDSTCD'		, align : 'left'	, sortable:false},
							{ name : 'TELGMDTALSOPERCD'		, align : 'left'	, sortable:false},
							{ name : 'BJOBCMNTELGMTRANCD'	, align : 'left'	, sortable:false},
							{ name : 'TOUTVAL'				, align : 'left'	, sortable:false},
							{ name : 'BJOBITERNOTMS'		, align : 'left'	, sortable:false},
							{ name : 'CNDNITEMDCSNCTNT'		, align : 'left'	, sortable:false},
							{ name : 'TRANPRCSSPRITY'		, align : 'left'	, sortable:false},
							{ name : 'TELGMCLSID'			, align : 'left'	, sortable:false, width : 300},
							{ name : 'CNDNTELGMPTRNCD'		, align : 'left'	, sortable:false},
							{ name : 'CNDNTELGMMGTCD'		, align : 'left'	, sortable:false},
							{ name : 'CNDNTRANCLSFICD'		, align : 'left'	, sortable:false},
							{ name : 'CNDNRSPNSCD'			, align : 'left'	, sortable:false},
							{ name : 'NEXTSTGEDSTCDNAME'	, align : 'left'	, sortable:false},
							{ name : 'MOVEUP'	, align : 'center', sortable:false,	width : '80', unformat : imgUpunformatter,		formatter : imgUpformatter}, 
							{ name : 'MOVEDOWN' , align : 'center', sortable:false,	width : '80', unformat : imgDownunformatter,	formatter : imgDownformatter},								
							{ name : 'DELETEYN' , align : 'center', sortable:false,	width : '80', unformat : unformatterFunction,	formatter : formatterFunction}, 
							{ name : 'CLONE' 	, align : 'center', sortable:false,	width : '80', unformat : cloneunformatter,		formatter : cloneformatter, hidden: true} 
							],
					jsonReader : {
						repeatitems : false
					},
					loadComplete : function(rowId) {
						
						$("img[name^=img_del]").click(function() {
							//alert(rowid);
 							var name = $(this).attr("name");
							var rowId = name.split("_")[2];
							var rows = $('#grid').jqGrid('getGridParam','reccount');					
							
							for ( var i = Number(rowId)+1 ; i <= rows; i ++){
								var newVal = $('#grid').jqGrid('getCell',i,'BJOBSTGESERNO');
								newVal = "000"+(Number(newVal)-1);
								newVal = newVal.substring(newVal.length,newVal.length-3);
								$('#grid').jqGrid('setCell',i,'BJOBSTGESERNO',newVal);
							}
							
							$('#grid').jqGrid('delRowData', rowId);
							reloadGridWithScrollPosition();
							//$('#grid').trigger('reloadGrid'); 
							
						});	
						$("img[name^=img_clone]").click(function() {
							var name = $(this).attr("name");
							var rowId = name.split("_")[2];
							var rowData = $('#grid').getRowData(rowId);
							
							var rows = $("#grid")[0].rows;
							var index = Number($(rows[rows.length - 1]).attr("id"));
							if (isNaN(index))
								index = 0;
							var cloneRowid = index + 1;
							var serno = "000"+cloneRowid;
							
							rowData["BJOBSTGESERNO"] = ("000"+cloneRowid).substring(serno.length, serno.length-3); 
							
 							$("#grid").jqGrid('addRow', {
								rowID : cloneRowid,
								initdata : rowData,
								position : "last", //first, last
								useDefValues : false,
								useFormatter : false,
								addRowParams : { 
									extraparam : {}
								}
							});
 							
 							// 복제 대상항목 다음 순서로 이동하기
 							for ( var i = cloneRowid; i >= Number(rowId)+1; i--){
 								var preRowid = String(Number(i)-1);
 								swapRow(preRowid,i);
 								$('#grid').jqGrid("setSelection",i);
 							}
						});	
						$("img[name^=img_up]").click(function() {
							var name = $(this).attr("name");
							var rowid = name.split("_")[2];
							if(rowid==1) return;
							
							var preRowid = String(Number(rowid)-1);
							swapRow(preRowid,rowid);
							$('#grid').jqGrid("setSelection",preRowid);
						
						});
				
						$("img[name^=img_down]").click(function() {
							var name = $(this).attr("name");
							var rowid = name.split("_")[2];						
							var rows = $('#grid').jqGrid('getGridParam','reccount');
							if( rowid==rows.toString()) return;							
							var nextRowid = String(Number(rowid)+1);
							swapRow(rowid, nextRowid);
							$('#grid').jqGrid("setSelection",nextRowid);			
						}); 	
					
					},
					gridComplete : function() {
						$("#clonYn").val("0").attr("selected","selected");
					},
					onSelectRow : function(rowid, status){
					},
					afterInsertRow : function (rowid, data){		
						$("img[name='img_del_"+rowid+"']").click(function() {
							//alert(rowid);
 							var name = $(this).attr("name");
							var rowId = name.split("_")[2];
							var rows = $('#grid').jqGrid('getGridParam','reccount');					
							
							for ( var i = Number(rowId)+1 ; i <= rows; i ++){
								var newVal = $('#grid').jqGrid('getCell',i,'BJOBSTGESERNO');
								newVal = "000"+(Number(newVal)-1);
								newVal = newVal.substring(newVal.length,newVal.length-3);
								$('#grid').jqGrid('setCell',i,'BJOBSTGESERNO',newVal);
							}
							
							$('#grid').jqGrid('delRowData', rowId);
							reloadGridWithScrollPosition();
							//$('#grid').trigger('reloadGrid'); 
							
						});	
						$("img[name=img_up_"+rowid+"]").click(function() {
							
							if(rowid==1) return;
							
							var preRowid = String(Number(rowid)-1);
							swapRow(preRowid,rowid);
							$('#grid').jqGrid("setSelection",preRowid);
						
						});
				
						$("img[name=img_down_"+rowid+"]").click(function() {
							var rows = $('#grid').jqGrid('getGridParam','reccount');
							if( rowid==rows.toString()) return;							
							var nextRowid = String(Number(rowid)+1);
							swapRow(rowid, nextRowid);
							$('#grid').jqGrid("setSelection",nextRowid);			
						}); 											
					},
					ondblClickRow: function(rowId) {
						if (!isValidGrid()) {
							return;
						}
						
						var args = new Object();
				    	args['data'] = $("#grid").jqGrid('getRowData',rowId);
				    	args['ispop'] = true;
				    	args['rowId'] = rowId;
					    var url = '<c:url value="/bap/admin/message/flowRuleMan.view" />';
					    url = url + "?cmd=POPUP";
					    var result = showModal(url,args,1000,600, function(arg){
					    	var args = null;
						    if(arg == null || arg == undefined ) {//chrome
						        args = this.dialogArguments;
						        args.returnValue = this.returnValue;
						    } else {//ie
						        args = arg;
						    }
						    
						    if( !args || !args.returnValue ) return;
						    
						    var ret = args.returnValue;
						    if(ret) {
						    	$("#grid").jqGrid('setRowData', rowId,ret);
						    }
					    });
					},							
					height : '350',
					autowidth : true,
					viewrecords : true
				});

		resizeJqGridWidth('grid', 'content_middle', '1000');
	}
	
	function init(url, key, callback) {

		if (typeof callback === 'function') {
			callback(url, key);
		}				
	}
	
	function detail(url, key) {
		if (!isDetail)
			return;
		$.ajax({
			type : "POST",
			url : url,
			dataType : "json",
			data : {
				cmd : 'DETAIL',
				key : key
			},
			success : function(json) {
				var data = json;
				var detail = json.detail;
				var list = json.list;
				//adapterType
				$("input[name=bjobBzwkPrcssDstcd]").attr('readonly', true);
				$("input,select").each(function() {
					var name = $(this).attr('name').toUpperCase();
					$(this).val(detail[name]);
				});
				//Prop 
				$("#grid").setGridParam({
					dataType : "local",
					data : list
				}).trigger("reloadGrid");
				
			},
			error : function(e) {
				alert(e.responseText);
			}
		});

	}
	
	function viewChange(e) {
		if (e.value == "1"){
			$("#clone").show();
			$("input[name=cloneBjobBzwkPrcssDstcd]").css({'background-color' : '#e5e5e5'});
			$("input[name=cloneTelgmClsID]").css({'background-color' : '#e5e5e5'});
			$("input[name=cloneBjobBzwkPrcssDstcd]").focus();
	    } else {
			$("#clone").hide();
		}
	}
	
	$(document).ready(function() {
		
		var returnUrl = getReturnUrlForReturn();
		var key = "${param.key}";

		if (key != "" && key != "null") {
			isDetail = true;
		}

		if(devSvr) {
			svrType = "stg";
		} else if (stgSvr){
			svrType = "prod";
		} else if (!prdSvr){
			svrType = "dev";
		}
		
		gridRendering();

		init(url, key, detail);
		
		$("#grid").jqGrid('setGroupHeaders', {
	  		useColSpanStyle: true, 
	  		groupHeaders:[
				{startColumnName: 'BJOBSTGESERNO', numberOfColumns: 4, titleText: 'BATCH작업단계'},
				{startColumnName: 'TELGMPTRNDSTCD', numberOfColumns: 13, titleText: ''}
	  		]
		});

		$("#btn_excel").click(function(event) {
	        event.stopPropagation(); // Do not propagate the event.
	        // Create an object that will manage to download the file.
	        var target = "excelDown" ; // iframe의 name
	        //(url,cmd,gridObj,formObject,fileName,merge)
			gridToExcelSubmit(url_excel,"LIST_GRID_TO_EXCEL",$("#grid"),$("#ajaxForm"),'메시지흐름규칙 관리');
			return false;
		});
		
		$("#btn_modify").click(function() {
			if (!isValid()) return;
			
			if (isDetail && isClone) {
				if ( confirm( "복제하시겠습니까?" ) != true ) return;
			} else if (isDetail) {
				if ( confirm( "수정하시겠습니까?" ) != true ) return;
			} else {
				if ( confirm( "등록하시겠습니까?" ) != true ) return;
			}

			var data = $("#grid").getRowData();
			var gridData = new Array();
			for (var i = 0; i < data.length; i++) {
				gridData.push(data[i]);
			}

			//공통부만 form으로 구성
			var postData = $('#ajaxForm').serializeArray();

			postData.push({
				name : "gridData",
				value : JSON.stringify(gridData)
			});

			if (isDetail && isClone){
				postData.push({ name: "cmd" , value:"INSERT"});
			} else if (isDetail) {
				postData.push({ name: "cmd" , value:"UPDATE"});
			} else {
				postData.push({ name: "cmd" , value:"INSERT"});
			}
			$.ajax({
				type : "POST",
				url : url,
				data : postData,
				success : function(args) {
					if (isClone) {
						alert('복제 되었습니다.');
						goNav(returnUrl);//LIST로 이동
					} else {
						alert("저장 되었습니다.");
						if (!isDetail)
							goNav(returnUrl);//LIST로 이동
					}
					$("#grid").trigger("reloadGrid");//LIST로 이동
				},
				error : function(e) {
					alert(e.responseText);
				}
			});
		});
		$("#btn_delete").click(function() {
			if ( confirm( "삭제하시겠습니까?" ) != true ) return;
			
			var postData = $('#ajaxForm').serializeArray();
			postData.push({
				name : "cmd",
				value : "DELETE"
			});
			$.ajax({
				type : "POST",
				url : url,
				data : postData,
				success : function(args) {
					alert("삭제 되었습니다.");
					goNav(returnUrl);//LIST로 이동

				},
				error : function(e) {
					alert(e.responseText);
				}
			});
		});
		$("#btn_previous").click(function() {
			goNav(returnUrl);//LIST로 이동
		});
		$("#btn_pop_input").click(function() {
	 		if (!isValidGrid()) {
				return;
			}
			
			var args = new Object();
			var value = $("input[name=bjobBzwkPrcssDstcd]").val();
	    	args['data'] = {BJOBBZWKPRCSSDSTCD:value};
	    	args['ispop'] = false;
		    var url = '<c:url value="/bap/admin/message/flowRuleMan.view" />';
		    url = url + "?cmd=POPUP";
		    var ret = showModal(url,args,1000,600, function(arg){
		    	var args = null;
			    if(arg == null || arg == undefined ) {//chrome
			        args = this.dialogArguments;
			        args.returnValue = this.returnValue;
			    } else {//ie
			        args = arg;
			    }
		    	
		    	if( !args || !args.returnValue) return;
				var data = new Object();
				data = args.returnValue;

				var rows = $("#grid")[0].rows;
				var index = Number($(rows[rows.length - 1]).attr("id"));
				if (isNaN(index))
					index = 0;
				var rowid = index + 1;
				var serno = "000"+rowid;
				
				
				data["BJOBSTGESERNO"] = ("000"+rowid).substring(serno.length, serno.length-3); 
				data["TRANPRCSSPRITY"] ='1';

				$("#grid").jqGrid('addRow', {
					rowID : rowid,
					initdata : data,
					position : "last", //first, last
					useDefValues : false,
					useFormatter : false,
					addRowParams : { 
									extraparam : {}
									}
				});
		    });
		});
		$("#" + $('#grid').jqGrid('getGridParam', 'selrow')).focus();
		
		$("#btn_pop_initialize").click(function(){
			
			$("#grid").jqGrid('clearGridData');

		});
		
		$("#btn_clone").click(function(){

			var cloneBjobBzwkPrcssDstcd = $("input[name=cloneBjobBzwkPrcssDstcd]").val();
			var searchBjobBzwkPrcssDstcd = $("input[name=bjobBzwkPrcssDstcd]").val();
			var cloneTelgmClsID = $("input[name=cloneTelgmClsID]").val();
			
			if (cloneBjobBzwkPrcssDstcd == "") {
				alert("복제 BATCH작업업무처리구분코드를 입력해 주세요.");
				return;
			} else if (cloneTelgmClsID == "") {
				alert("복제 전문클래스ID를 입력해 주세요.");
				return;
			} else {
				$("input[name=bjobBzwkPrcssDstcd]").val(cloneBjobBzwkPrcssDstcd.trim());
			}

			$("input[name=cloneBjobBzwkPrcssDstcd]").val("");
			$("input[name=cloneTelgmClsID]").val("");

			var data = $("#grid").getRowData();
			var gridData = new Array();
			for (var i = 0; i < data.length; i++) {
				data[i]["BJOBBZWKPRCSSDSTCD"] = cloneBjobBzwkPrcssDstcd;
				var sourceTelgmClsID = data[i]["TELGMCLSID"].split("_")[1];
				if (cloneTelgmClsID != "" && sourceTelgmClsID != "") {
					data[i]["TELGMCLSID"] = data[i]["TELGMCLSID"].replace(sourceTelgmClsID,cloneTelgmClsID);
				}
				$("#grid").setRowData(i+1,data[i]);
			}


			isClone = true;
			
		});
		
 		$("#btn_download_sql").click(function() {
			
 			if ( confirm( "입력쿼리를 다운로드하시겠습니까?" ) != true ) return;
 			
			var postData = $('#ajaxForm').serializeArray();
			var sqlFileName = "FLOW_RULE_INPUT_QUERY.sql";
			postData.push({
				name : "cmd",
				value : "LIST_DOWNLOAD_SQL"
			});
			postData.push({
				name : "fileName",
				value : sqlFileName
			});

			$.ajax({
				type : "POST",
				url : url,
				data : postData,
				success : function(args) {
 					var filePath = args.path;
					var url2 = url_view + "?cmd=LIST_FILE_DOWNLOAD";
 			      	url2 = url2 + '&returnUrl='+getReturnUrl();
			      	url2 = url2 + '&menuId='+'${param.menuId}';
				    url2 = url2 + '&filePath='+filePath;
				    url2 = url2 + '&fileName='+sqlFileName;
			            	
					goNav(url2);
					
					alert("메시지흐름규칙 입력 SQL문이 다운로드되었습니다.");
				},
				error : function(e) {
					alert(e.responseText);
				}
			});
		});
		
 		$("img[id=btn_clone_"+svrType+"]").click(function() {
 			
 			if ( confirm( "복사하시겠습니까?" ) != true ) return;
 			
 			var postData = $('#ajaxForm').serializeArray();
 			postData.push({
 				name : "cmd",
 				value : "LIST_DOWNLOAD_SQL"
 			});
 			postData.push({
 				name : "svrType",
 				value : svrType
 			});
 			
 			$.ajax({
 				type : "POST",
 				url : url,
 				data : postData,
 				success : function(args) {
 	 				if (args.result != "" && args.error == "") {
 						alert("메시지흐름규칙이 복사되었습니다.");
 					} else if (args.error != "") {
 						if ("${fn:contains(args.error,'SqlIntegrityConstraintViolationException')}") {
 							alert("메시지흐름규칙이 이미 존재하여 복사되지 않었습니다.");
 						} else {
 							alert("오류가 발생하여 복사되지 않았습니다. 오류 : "+args.error);
 						}
 					}
 	 				goNav(returnUrl);
 				},
 				error : function(e) {
 					alert(e.responseText);
 				}
 			});
 			
 		});
 		
		buttonControl(isDetail);
		titleControl(isDetail);
 		
		if(devSvr) {
			setBtnHide(roleString, " ", "btn_clone_dev");
			setBtnHide(roleString, " ", "btn_clone_prod");
			setBtnHide(roleString, isDetail ? "admin" : " ", "btn_clone_stg");
		} else if (stgSvr){
			setBtnHide(roleString, " ", "btn_clone_dev");
			setBtnHide(roleString, " ", "btn_clone_stg");
			setBtnHide(roleString, isDetail ? "admin" : " ", "btn_clone_prod");
		} else if (prdSvr){
 			setBtnHide(roleString, " ", "btn_clone_stg");
			setBtnHide(roleString, " ", "btn_clone_prod");		
  			setBtnHide(roleString, " ", "btn_clone_dev");
		} else {
 			setBtnHide(roleString, " ", "btn_clone_stg");
			setBtnHide(roleString, " ", "btn_clone_prod");		
  			setBtnHide(roleString, isDetail ? "admin" : " ", "btn_clone_dev");
		}
	});
</script>
</head>
	<body>
		<div class="right_box">
			<div class="content_top">
				<ul class="path">
					<li><a href="#">${rmsMenuPath}</a></li>					
				</ul>					
			</div><!-- end content_top -->
			<div class="content_middle" id="content_middle">
				<div class="search_wrap">
					<%-- <img src="<c:url value="/img/btn_clone.png"/>" alt="" id="btn_clone_stg" level="W" status="DETAIL"/>
					<img src="<c:url value="/img/btn_clone_prod.png"/>" alt="" id="btn_clone_prod" level="W" status="DETAIL"/>
					<img src="<c:url value="/img/btn_clone_dev.png"/>" alt="" id="btn_clone_dev" level="W" status="DETAIL"/>
					<img src="<c:url value="/img/btn_excel.png"/>" alt=""  id="btn_excel" level="W" status="DETAIL"/>	 --%>					
					<img src="<c:url value="/img/btn_modify.png"/>" alt="" id="btn_modify" level="W" status="DETAIL,NEW" />				
					<img src="<c:url value="/img/btn_delete.png"/>" alt="" id="btn_delete" level="W" status="DETAIL"/>
					<img src="<c:url value="/img/btn_previous.png"/>" alt="" id="btn_previous" level="R" status="DETAIL,NEW"/>
				</div>
				<div class="title">메시지흐름규칙</div>						
				
				<form id="ajaxForm">
					<table class="table_row" cellspacing="0">
						<!-- 공통-->
						<tr>
							<th style="width:200px;">BATCH작업업무처리구분코드</th>
							<td colspan="3"><input type="text" name="bjobBzwkPrcssDstcd" /></td>
						</tr>
						<tr>
							<th style="width:200px;">흐름규칙 유형 설명</th>
							<td style="width:400px;"><input type="text" name="flowRulePtrnDesc"/></td>
							<th style="width:120px;">복제 사용여부</th>
							<td style="width:400px;">
								<div class="select-style">							
								<select name="clonYn" id="clonYn" readonly="readonly" onchange="viewChange(this)" >
									<option value="1">사용함</option>
									<option value="0">사용안함</option>
								</select>								
							</td>								
						</tr>
 						<tr id="clone" hidden="hidden">
							<th style="width:200px;">복제 BATCH작업업무처리구분코드</th>
							<td style="width:310px;"><input type="text" name="cloneBjobBzwkPrcssDstcd"/></td>
							<th style="width:120px;">복제 전문클래스ID</th>
							<td style="width:200px;">
								<input type="text" name="cloneTelgmClsID" style="display:inline-block; width:calc(100% - 90px);"/> 
								<img id="btn_clone" src="<c:url value="/img/btn_clone1.png" />" level="W" status="DETAIL" class="btn_img"/>
								<img id="btn_download_sql" src="<c:url value="/img/icon_download.png"/>" class="btn_img" level="W" status="DETAIL"/>						
							</td>
						</tr>
					</table>
				</form>

				<div style="margin-bottom:15px; text-align:right;">
					<img id="btn_pop_input"	src="<c:url value="/img/btn_input.png"/>" level="W" status="DETAIL,NEW"  class="btn_img" /> 
					<img id="btn_pop_initialize" src="<c:url value="/img/btn_initialize.png"/>" level="W"	status="DETAIL,NEW" class="btn_img" />
				</div>
				<!-- grid -->
				<table id="grid"></table>



			</div><!-- end content_middle -->
		</div><!-- end right_box -->	
	</body>
</html>

