<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>

<script type="text/javascript">	
//기타 클릭시
	function etcManage(service_code, client_name){
		if(service_code != undefined && service_code != null){
			//location.replace("etcManage.sev?service_code="+service_code+"&client_name="+client_name);
			window.location = "etcManage.sev?service_code="+service_code+"&client_name="+client_name+"&mkworker="+member.name;
		}
	}
	
	//일회성 클릭시
	function clickOntime(service_code, client_name, flag){
		if(service_code != undefined && service_code != null){		
			//window.location = "additionalService.sev?service_code="+service_code+"&flag="+flag;
			location.replace("additionalService.sev?service_code="+service_code+"&flag="+flag);
		}
	}
$(function()
{
	$("#addCS").click(function()
	{
		var d = $("#cs_service_code").val();
		var d2= $("#cs_server_code").val();
		var sendData = "&service_code="+d+"&server_code="+d2;
		$.ajax(
		{
			url:"IdcAddCS.jso",
			data:sendData,
			dataType:"json",
			type:"get",
			cache:false,
			success:function(data)
			{
				if(data.a==true)
					alert("cs추가 완료.");
				else
					alert("cs가 이미 8개 입니다.")
			},
			error:function()
			{
				alert("실패");
			}
		});
	})
});
</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">
	   			<div class="table-responsive">
					<table class="table table-bordered table-hover table-striped">
						<thead>
							<tr>
								<td>고객명</td>
								<td>장비번호</td>
								<td>장비사양</td>
								<td>월과금정보</td>
								<td>현재예치금</td>
								<td>상면:${amount_dto.amount_rack}/회선:${amount_dto.amount_line}/장비임대:${amount_dto.amount_cpu}</td>
							</tr>
						</thead>
						<tbody>
							<tr>
								<td>${iasd.client_name}</td>
								<td>${iasd.server_code}</td>
								<td>${iasd.server_spec} ${iasd.server_cpuname} ${iasd.server_ram} ${iasd.server_hdd}</td>
								<td>${iasd.service_amount}</td>
								<td>${iasd.client_money}</td>
								<td>IP:${amount_dto.amount_ip}/CS:${amount_dto.amount_cs}/VPN:${amount_dto.amount_vpn}/방어:${amount_dto.amount_defence}</td>
							</tr>
						</tbody>
						<tfoot>
						</tfoot>
					</table>
				</div>
				<!-- table-responsive -->				
				<!-- row -->
				<div class="table-responsive">
					<table class="table table-bordered table-hover table-striped">
						<thead>
						</thead>
						<tbody>
							<tr rowspan="4">
								<td>IP 추가<br>
									${start_dto.ip_date} ${start_dto.ip}<br>									
									<form action="ipAdd.sev" method="get">
										<input type="hidden" name="service_code" value="${iasd.service_code}"/>
										<input type="hidden" name="client_name" value="${iasd.client_name}" />
										<input type="hidden" name="addDB_case" value="ip"/>
										<input type="hidden" name="mkworker" value="${member.name}" />
										<input class="btn btn-outline btn-default" type="submit" value="IP추가" >										
									</form>
								</td>
								<td>IP 변경<br><br>
									<form action="IdcIPChangeForm.sev" method="get">
										<input type="hidden" name="service_code" value="${iasd.service_code}"/>
										<input type="hidden" name="mkworker" value="${member.name}" />
										<input class="btn btn-outline btn-default" type="submit" value="IP변경" >										
									</form>																	
								</td>
								<td>방어서비스 추가<br>
									${start_dto.defence_date} ${start_dto.defence}<br>
									<form action="ipAdd.sev" method="get">
										<input type="hidden" name="service_code" value="${iasd.service_code}"/>
										<input type="hidden" name="client_name" value="${iasd.client_name}" />
										<input type="hidden" name="addDB_case" value="defence"/>
										<input type="hidden" name="mkworker" value="${member.name}" />
										<input class="btn btn-outline btn-default" type="submit" value="방어추가" >										
									</form>																	
								</td>
								<td>기타 부가서비스 추가<br>
									<form action="IdcETCAddForm.sev" method="get">
									<br>
										<input type="hidden" name="service_code" value="${iasd.service_code}"/>
										<input type="hidden" name="mkworker" value="${member.name}" />
										<input class="btn btn-outline btn-default" type="submit" value="기타 부가서비스 추가" >										
									</form>																	
								</td>
								<td>1회성 및 기타서비스 (닷디펜더 등) <br>
									${start_dto.onetime_date} ${start_dto.onetime}<br>
									<form action="etcManage.sev" method="get">
										<input type="hidden" name="service_code" value="${iasd.service_code}"/>
										<input type="hidden" name="client_name" value="${iasd.client_name}" />
										<input type="hidden" name="mkworker" value="${member.name}" />
										<input class="btn btn-outline btn-default" type="submit" value="ETC관리" >										
									</form>									
								</td>
							</tr>
						</tbody>
						<tfoot>
						</tfoot>
					</table>
				</div>
				<!-- table-responsive -->
				<!-- 
				<div class="table-responsive">
					<table class="table table-bordered table-hover table-striped">
						<thead>
							<tr>
								<td colspan="3">부가 서비스 진행 내역</td>
							</tr>
							<tr> 
								<td>일자</td>
								<td>내용</td>
								<td>처리자</td>
							</tr>		
						</thead>
						<tbody>
							<c:if test="${flag == 'now'}">	
								<c:forEach items="${add_list }" var="add">
									<tr>
										<td>${add.addDB_handle_date}</td>
										<td>${add.addDB_case}추가 ${add.addDB_ip} 할당</td>
										<td>${add.addDB_manager}</td>
									</tr>
								</c:forEach>
								<c:forEach items="${etc_list }" var="etc">
									<tr>
										<td>${etc.onetime_handle_date}</td>
										<td>${etc.onetime_case}추가 ${etc.onetime_sub} 할당</td>
										<td>${etc.onetime_manager}</td>
									</tr>
								</c:forEach>	
							</c:if>
							<c:if test="${flag == 'ip'}">	
								<c:forEach items="${add_list }" var="add">
									<tr>
										<td>${add.addDB_handle_date}</td>
										<td>${add.addDB_case}추가 ${add.addDB_ip} 할당</td>
										<td>${add.addDB_manager}</td>
									</tr>
								</c:forEach>
							</c:if>			
							<c:if test="${flag == 'etc'}">
								<c:forEach items="${etc_list }" var="etc">
									<tr>
										<td>${etc.onetime_handle_date}</td>
										<td>${etc.onetime_case}추가 ${etc.onetime_sub} 할당</td>
										<td>${etc.onetime_manager}</td>
									</tr>
								</c:forEach>	
							</c:if>
						</tbody>
						<tfoot>
							<tr>
								<td colspan="3">일할 정산/결제일 통합 내역</td>			
							</tr>
							<tr>
								<td>일자</td> 
								<td>내용</td>
								<td>처리자</td>
							</tr>												
						</tfoot>						
					</table>
					<a class="btn btn-outline btn-default " href="serviceList.sev?client_code=${iasd.client_code}">서비스 리스트</a>
				</div>
				 -->
				 <a class="btn btn-outline btn-default " href="serviceDetail.sev?client_code=${iasd.client_code}">서비스 리스트</a>
				<!-- table-responsive -->
			</div>
			<!-- panel-body -->
		</div>
		<!-- panel panel-default -->
	</div>
	<!-- col-lg-12 -->
</div>
<!-- row -->
<!-- /#page-wrapper -->
