<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<% pageContext.setAttribute("phpurl",request.getScheme()+"://"+request.getServerName()); %>

<script src="IDC/js/setToken.js"></script>
<script>
//방어존 추가 눌렀을경우
function addDadd(deffence_num, deffence_case){	
	window.location = "addD1add.sev?deffence_num="+deffence_num+"&deffence_case="+ deffence_case;
}

//방어존1 개설
function deffence_zone1(){
	window.location = "deffenceInfo.sev?";
}

//방어존2 개설
function deffence_zone2(){
	window.location = "deffenceInfo.sev?deffence_case=2";
}

//방어존3 개설
function deffence_zone3(){
	window.location = "deffenceInfo.sev?deffence_case=3";
}

//방어존4 개설
function deffence_zone4(){
	window.location = "deffenceInfo.sev?deffence_case=4";
}
//방어존5 개설
function deffence_zone5(){
	window.location = "deffenceInfo.sev?deffence_case=5";
}
//방어존 내 하위 제거
function sub_delBtn(deffence_case, dadd_num){
	window.location = "delD1add.sev?deffence_case=" + deffence_case + "&dadd_num="+dadd_num;
}
//방어존 제거
function deffence_delBtn(client_code, service_code, server_code){
	window.location = "deleteServiceHandle.sev?client_code="+client_code+"&service_code="+service_code+"&server_code="+server_code;
}
</script>
<script type="text/javascript">
$(function()
{
	//방어존 제거시 하위 서비스 있는지 없는지 판단 후 경고
	$(".delID").click(function()
	{
				
		var subC = ".sub"+$(this).attr("value");
		var sub = $(subC);
		if(sub.length>0){
			alert("방어존에 물려있는 방어서비스를 삭제한 후 삭제해 주십시오.");
		}else{			
			
			var result = confirm("정말 삭제하시겠습니까?");
			if(result == true){
				window.location = $(this).attr("uri")+"&token="+$("#token").val();	
			}else{
				return false;
			}
		}
		
	});
	
	//하위 제거시 경고창
	$(".delID2").click(function()
	{
		var result = confirm("정말 삭제하시겠습니까?");
		if(result == true){			
			window.location = $(this).attr("uri")+"&token="+$("#token").val();
		}else{
			return false;
		}
	});
});
</script>
<!-- 여기가 본 페이지이다 -->
<div class="row">
	<div class="col-lg-12">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h4><i class="fa fa-desktop fa-fw"></i>방어라인 정보</h4>
			</div>
			<div class="panel-body">
				<c:import url="${phpurl}/defense_index.php?zone=${zone }&parents=${parents }&child=${child }" />
			</div>
			<!-- panel-body -->
		</div>
		<!-- panel panel-default -->
	</div>
	<!-- col-lg-12 -->
</div>
<!-- row -->
<!-- /#page-wrapper -->
