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

//해당 고객의 vpc만 보여줌
function vpcShow(client_code){
	location.href ="vpcInfo.sev?client_code="+client_code+"&csInfoFlag=true&category="+$("#category").val()+"&searchContext="+$("#searchContext").val();	
}
//해당고객의 kcs만 보여줌
function kcsShow(client_code){
	location.href ="vpcInfo.sev?client_code="+client_code+"&csInfoFlag=false&category="+$("#category").val()+"&searchContext="+$("#searchContext").val();
}
$(function()
{
	//kcs vpc등록중
	$("#selCS").change(function()
	{
		if($(this).val()!="")
		{
			window.location=$(this).val();
		}
	});
	//select 초기화
	$(document).ready(function()
	{
		$("#category").val($("#category").attr("value"));
		
	});
});

</script>

<style>
table {/*table-layout:fixed;*/}
td {word-break:break-all; word-wrap:break-word;}
td { font-size: 12px;}

.ulc {overflow: auto;}
.lic {float: left;}

</style>
<!-- 여기가 본 페이지이다 -->
<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> CS정보</h4>
			</div>
			<div class="panel-body">
				<form action="vpcInfo.sev" method="get">
					<div class="input-group col-lg-12">
						<span class="input-group-btn">
							<input type="hidden" name="client_code" id="client_code" value="${client_code}"/>
							<input type="hidden" name="csInfoFlag" id="csInfoFlag" value="${csInfoFlag}"/>	
							<input class="btn btn-outline btn-default" type="button" value="VPC-CS" onclick="vpcShow('${client_code}')">
							<input class="btn btn-outline btn-default" type="button" value="KT-CS" onclick="kcsShow('${client_code}')">
							<select class="btn btn-default" id="selCS">
								<option value="">등록하기</option>
								<option value="addVPC2.sev">vpc-cs</option>
								<option value="addKCS2.sev">kt-cs</option>
							</select>
							<!-- <a class="btn btn-outline btn-default" type="button" href="vpcInfoExcel.sev?csInfoFlag=${csInfoFlag}">엑셀</a> -->							
							<select class="btn btn-info" id="category" name="category" value="mk_total">
								<option value="">선택</option>
								<option value="mk_total">전체검색</option>
								<!-- <option value="client_name">고객명</option>
								<option value="server_code">장비번호</option>
								<option value="csip">cs-ip</option>
								<option value="service_ip">서버-ip</option>
								<option value="cscode">CS장비</option>
								<option value="connect_domain">연결 도메인</option> -->
							</select>
						</span>
						<input type="text" class="form-control" id="searchContext" name="searchContext" value=${searchContext }>
						<span class="input-group-btn">
							<input type="submit" class="btn btn-default" value="검색">
						</span>
					</div>
				</form>
				<!-- row -->
				<c:if test="${csInfoFlag == 'true'}">	
		   			<div class="table-responsive">
						<table id="vpc" name="vpc" class="table table-bordered table-hover table-striped" >
							<thead>
								<tr>
									<td align=center class="col-md-1"  style="width: 40px;">No.</td>
									<td align=center class="col-md-2" style="width: 60px;">구분</td>
									<td align=center class="col-md-2" style="width: 134px;">고객명</td>
									<td align=center class="col-md-2" style="width: 80px;">장비</td>
									<td align=center class="col-md-2" style="width: 100px;">CS IP</td>
									<td align=center class="col-md-2" style="width: 110px;" >서버IP</td>
									<td align=center class="col-md-2" style="width: 94px;">장비번호</td>
									<td align=center class="col-md-6" style="width: 480px;">연결도메인</td>
									<td align=center class="col-md-4" style="width: 180px;">방화벽 설정</td>
									<!-- <td class="col-md-3">최종공격일</td>-->
									<td align=center class="col-md-4" style="width: 180px;">비고</td>
									<td align=center class="col-md-2" style="width: 80px;">수정</td>									
								</tr>
							</thead>
							<tbody>
<% 
 //String mkcheck = request.getParameter("service_code");
%>

<%//=mkcheck %>
<% 
/*
if (mkcheck !=null) 
{  
 String mkstring = "Solo" ;
 out.print(mkstring); 
} else {
	String mkstring = " ";
	 out.print(mkstring); 
}
*/
%>


								<c:forEach items="${vpcList}" var="dto">																									
									<tr>
											<td align=center>${dto.vpc_num}</td>
											<td align=center>${dto.temp}</td>
<%//= request.getParameter("referer")%> 
<%
%>																			
											<td align=center><a href="/serviceDetail<%
													if (request.getParameter("referer") != "") 
													{  
													 String mkstring = "Solo" ;
													    out.print(mkstring); 
													} else {
														String mkstring = "";
														 out.print(mkstring); 
													}
											%>.sev?client_code=${dto.client_code}&service_code=<%= request.getParameter("service_code") %>">${dto.client_name}</a></td>
											<td align=center>${dto.vpc_code}</td>
											<td align=center><nobr style=" display:block; width:90px;  ">${dto.vpc_csip}</nobr></td>
											<td align=center><nobr style=" display:block; width:90px;  ">${dto.service_ip}</nobr></td>
											<td align=center>${dto.server_code}</td>
											<td><strong>ZONE-C : </strong>${dto.vpc_connect_domain}<br>
											<strong>ZONE-D : </strong>${dto.vpc_connect_domain_dn}<br>
											<strong>ZONE-M : </strong>${dto.vpc_connect_domain_my}<br>
											<strong>ZONE-E : </strong>${dto.vpc_connect_domain_etc}
											</td>
											<td>${dto.vpc_fireWall}</td>
											<!-- <td>${dto.vpc_last_date}</td> -->
											<td>${dto.vpc_note}</td>
											<td align=center>
												<form action="vpcUpdate.sev" method="get" >
													<input type="hidden" name="vpc_num" value="${dto.num}">
													<input type="hidden" name="service_line" value="${dto.service_line}">
													<input type="hidden" name="client_name" value="${dto.client_name}">
													<input type="hidden" name="vpc_code" value="${dto.vpc_code}">
													<input type="hidden" name="vpc_csip" value="${dto.vpc_csip}">
													<input type="hidden" name="service_ip" value="${dto.service_ip}">
													<input type="hidden" name="server_code" value="${dto.server_code}">
													<input type="hidden" name="vpc_last_date" value="${dto.vpc_last_date}">
													<input type="hidden" name="vpc_note" value="${dto.vpc_note}">
													<input type="hidden" name="category" value="${category}">
													<input type="hidden" name="searchContext" value="${searchContext}" >
													<input type="submit" value="수정" class="btn btn-info"  style="text-align:center;height:22px;margin: 0px;line-height:6px;width:65px;background-color:skyblue;">
												</form>																														
											</td>																																
									</tr>									
								</c:forEach>
							</tbody>
							<tfoot>
							</tfoot>
						</table>
					</div>
					<!-- table-responsive -->
					<div>
						<ul class="pagination ulc" style="margin:0px;">
							<!-- 
							<li>
								<a class="btn btn-outline btn-default" href="vpcInfo.sev?client_code=${client_code}&csInfoFlag=true&
													category=${category}&searchContext=${searchContext}">
									<i class="fa fa-angle-double-left "></i>
								</a>
							</li>
							 -->
							<li class="lic">																			
								<form action="vpcInfo.sev" method="get">
									<input type="hidden" name="client_code" value="${client_code}"/>
									<input type="hidden" name="csInfoFlag" value="true"/>											
									<input type="hidden" name="category" value="${category}"/>
									<input type="hidden" name="searchContext" value="${searchContext}"/>
									<input type="submit" class="btn btn-info btn-outline btn-default fa fa-angle-double-left" value="<<">											
								</form>
							</li>
							<!-- 
							<li>
								<c:if test="${curPage!=1 }">
									<a class="btn btn-outline_btn-default" href="vpcInfo.sev?curPage=${curPage-1 }&csInfoFlag=true&
													category=${category}&searchContext=${searchContext}">
										<i class="fa fa-angle-left"></i>
									</a>
								</c:if>
								<c:if test="${curPage==1 }">
									<a class="btn btn-outline_btn-default" href="vpcInfo.sev?curPage=1&csInfoFlag=true&
													category=${category}&searchContext=${searchContext}">
										<i class="fa fa-angle-left"></i>
									</a>
								</c:if>
							</li>
							 -->
							<li class="lic">							
								<c:if test="${curPage!=1 }">												
									<form action="vpcInfo.sev" method="get">
										<input type="hidden" name="client_code" value="${client_code}"/>
										<input type="hidden" name="curPage" value="${curPage-1}"/>
										<input type="hidden" name="csInfoFlag" value="true"/>											
										<input type="hidden" name="category" value="${category}"/>
										<input type="hidden" name="searchContext" value="${searchContext}"/>
										<input type="submit" class="btn btn-info btn-outline btn-default fa fa-angle-double-left" value="<">																				
									</form>
								</c:if>
								<c:if test="${curPage==1 }">												
									<form action="vpcInfo.sev" method="get">
										<input type="hidden" name="client_code" value="${client_code}"/>
										<input type="hidden" name="curPage" value="1"/>
										<input type="hidden" name="csInfoFlag" value="true"/>											
										<input type="hidden" name="category" value="${category}"/>
										<input type="hidden" name="searchContext" value="${searchContext}"/>
										<input type="submit" class="btn btn-info btn-outline btn-default fa fa-angle-double-left" value="<">																				
									</form>
								</c:if>
							</li>
																					
							<c:forEach var="i" begin="${firstPage }" end="${endPage }">
								<li class="lic">
									<!-- 
									<a class="btn btn-outline btn-defualt" href="vpcInfo.sev?client_code=${client_code}&curPage=${i}&csInfoFlag=true&
													category=${category}&searchContext=${searchContext}">${i}</a>
									-->
									<form action="vpcInfo.sev" method="get">
										<input type="hidden" name="client_code" value="${client_code}"/>
										<input type="hidden" name="curPage" value="${i}"/>
										<input type="hidden" name="csInfoFlag" value="true"/>											
										<input type="hidden" name="category" value="${category}"/>
										<input type="hidden" name="searchContext" value="${searchContext}"/>
										<input type="submit" class="btn btn-info btn-outline btn-default fa fa-angle-double-left" value="${i}">																				
									</form>														
								</li>
								
							</c:forEach>
							<li class="lic">
								<c:if test="${curPage!=pageCnt }">
									<!-- 
									<a class="btn btn-outline_btn-default" href="vpcInfo.sev?client_code=${client_code}&curPage=${curPage+1 }&csInfoFlag=true&
													category=${category}&searchContext=${searchContext}">
										<i class="fa fa-angle-right"></i>
									</a>
									 -->
									<form action="vpcInfo.sev" method="get">
										<input type="hidden" name="client_code" value="${client_code}"/>
										<input type="hidden" name="curPage" value="${curPage+1}"/>
										<input type="hidden" name="csInfoFlag" value="true"/>											
										<input type="hidden" name="category" value="${category}"/>
										<input type="hidden" name="searchContext" value="${searchContext}"/>
										<input type="submit" class="btn btn-info btn-outline btn-default fa fa-angle-double-left" value=">">																				
									</form>	
								</c:if>
								<c:if test="${curPage==pageCnt }">
									<!-- 
									<a class="btn btn-outline_btn-default" href="vpcInfo.sev?client_code=${client_code}&curPage=${pageCnt }&csInfoFlag=true&
													category=${category}&searchContext=${searchContext}">
										<i class="fa fa-angle-right"></i>
									</a>
									 -->
									<form action="vpcInfo.sev" method="get">
										<input type="hidden" name="client_code" value="${client_code}"/>
										<input type="hidden" name="curPage" value="${pageCnt}"/>
										<input type="hidden" name="csInfoFlag" value="true"/>											
										<input type="hidden" name="category" value="${category}"/>
										<input type="hidden" name="searchContext" value="${searchContext}"/>
										<input type="submit" class="btn btn-info btn-outline btn-default fa fa-angle-double-left" value=">">																				
									</form>
								</c:if>
							</li>
							<li class="lic">
								 <!-- 
								<a class="btn btn-outline btn-default" href="vpcInfo.sev?client_code=${client_code}&curPage=${pageCnt }&csInfoFlag=true&
													category=${category}&searchContext=${searchContext}">
									<i class="fa fa-angle-double-right "></i>
								</a>
								  -->								 
								<form action="vpcInfo.sev" method="get">
										<input type="hidden" name="client_code" value="${client_code}"/>
										<input type="hidden" name="curPage" value="${pageCnt}"/>
										<input type="hidden" name="csInfoFlag" value="true"/>											
										<input type="hidden" name="category" value="${category}"/>
										<input type="hidden" name="searchContext" value="${searchContext}"/>
										<input type="submit" class="btn btn-info btn-outline btn-default fa fa-angle-double-left" value=">>">																				
									</form>
							</li>
						</ul>
						<!-- ul -->
					</div>
					<!-- UL DIV -->
				</c:if>
				<!-- c:if -->
				<c:if test="${csInfoFlag == 'false'}">	
					<div class="table-responsive">
						<table id="kcs" name="kcs" class="table table-bordered table-hover table-striped">
							<thead>
								<tr>
<!-- 									<td class="col-md-2">No.</td>
									<td class="col-md-2">구분</td>
									<td class="col-md-2">서버 계정</td>
									<td class="col-md-2">고객명</td>
									<td class="col-md-2">KCS-NO</td>
									<td class="col-md-2">KCS IP</td>
									<td class="col-md-2">서버 IP</td>
									<td class="col-md-2">장비번호</td>
									<td class="col-md-6">사용도메인</td>
									<td class="col-md-6">접속도메인</td>
									<td class="col-md-3">최종공격일</td>
									<td class="col-md-4">비고</td>
									<td class="col-md-2">수정</td>
 -->									
									<td align=center class="col-md-1"  style="width: 40px;">No.</td>
									<td align=center class="col-md-2" style="width: 60px;">구분</td>
									<td align=center class="col-md-2" style="width: 134px;">고객명</td>
									<td align=center class="col-md-2" style="width: 80px;">장비</td>
									<td align=center class="col-md-2" style="width: 100px;">KCS IP</td>
									<td align=center class="col-md-2" style="width: 110px;" >서버IP</td>
									<td align=center class="col-md-2" style="width: 94px;">장비번호</td>
									<td align=center class="col-md-6" style="width: 200px;">접속도메인</td>
									<td align=center class="col-md-6" style="width: 200px;">연결도메인</td>
									<!-- <td align=center class="col-md-4" style="width: 180px;">방화벽 설정</td>-->
									<!-- <td class="col-md-3">최종공격일</td>-->
									<td align=center class="col-md-4" style="width: 80px;">비고</td>
									<td align=center class="col-md-2" style="width: 80px;">수정</td>											
								</tr>
							</thead>
							<tbody>
							
								<c:forEach items="${kcsList}" var="dto">																									
									<tr>
											<td align=center>${dto.kcs_num} ${dto.service_admin}</td>
											<td align=center>${dto.temp}</td>
<%//= request.getParameter("referer")%> 
<%
%>																			
											<td align=center><a href="/serviceDetail<%
													if (request.getParameter("referer") != "") 
													{  
													 String mkstring = "Solo" ;
													    out.print(mkstring); 
													} else {
														String mkstring = "";
														 out.print(mkstring); 
													}
											%>.sev?client_code=${dto.client_code}&service_code=<%= request.getParameter("service_code") %>">${dto.client_name}</a></td>
											<td align=center>${dto.kcs_code}</td>
											<td align=center><nobr style=" display:block; width:90px;  ">${dto.kcs_ip}</nobr></td>
											<td align=center><nobr style=" display:block; width:90px;  ">${dto.service_ip}</nobr></td>
											<td align=center>${dto.server_code}</td>
											<td> ${dto.kcs_connect_domain}</td>
											<td> ${dto.kcs_use_domain}</td>
											<!-- <td></td> -->
											<!-- <td>${dto.kcs_last_date}</td> -->
											<td>${dto.kcs_note}</td>
											<td align=center>
												<form action="ktcsUpdate.sev" method="get" >
													<input type="hidden" name="kcs_num" value="${dto.num}">
													<input type="hidden" name="service_line" value="${dto.service_line}">
													<input type="hidden" name="client_name" value="${dto.client_name}">
													<input type="hidden" name="kcs_code" value="${dto.kcs_code}">
													<input type="hidden" name="kcs_ip" value="${dto.kcs_ip}">
													<input type="hidden" name="service_ip" value="${dto.service_ip}">
													<input type="hidden" name="server_code" value="${dto.server_code}">
													<input type="hidden" name="kcs_last_date" value="${dto.kcs_last_date}">
													<input type="hidden" name="kcs_note" value="${dto.kcs_note}">
													<input type="hidden" name="category" value="${category}">
													<input type="hidden" name="searchContext" value="${searchContext}" >
													<input type="submit" value="수정" class="btn btn-info"  style="text-align:center;height:22px;margin: 0px;line-height:6px;width:65px;background-color:skyblue;">
												</form>																														
											</td>																																
									</tr>									
								</c:forEach>


								
								
							</tbody>
							<tfoot>
							</tfoot>
						</table>
					</div>
					<!-- table-responsive -->
					<div>
						<ul class="pagination ulc" style="margin:0px;">
								<li class="lic">
									<!-- 
									<a class="btn btn-outline btn-default" href="vpcInfo.sev?client_code=${client_code}&csInfoFlag=false&
													category=${category}&searchContext=${searchContext}">
										<i class="fa fa-angle-double-left "></i>
									</a>
									 -->
									<form action="vpcInfo.sev" method="get">
										<input type="hidden" name="client_code" value="${client_code}"/>
										<input type="hidden" name="csInfoFlag" value="false"/>											
										<input type="hidden" name="category" value="${category}"/>
										<input type="hidden" name="searchContext" value="${searchContext}"/>
										<input type="submit" class="btn btn-info btn-outline btn-default fa fa-angle-double-left" value="<<">											
									</form>
								</li>							
								<li class="lic">
									<c:if test="${kcs_curPage!=1 }">
										<!-- 
										<a class="btn btn-outline_btn-default" href="vpcInfo.sev?kcs_curPage=${curPage-1 }&client_code=${client_code}&csInfoFlag=false&
													category=${category}&searchContext=${searchContext}">
											<i class="fa fa-angle-left"></i>
										</a>
										 -->
										<form action="vpcInfo.sev" method="get">
											<input type="hidden" name="client_code" value="${client_code}"/>
											<input type="hidden" name="csInfoFlag" value="false"/>	
											<input type="hidden" name="kcs_curPage" value="${kcs_curPage-1}"/>										
											<input type="hidden" name="category" value="${category}"/>
											<input type="hidden" name="searchContext" value="${searchContext}"/>
											<input type="submit" class="btn btn-info btn-outline btn-default fa fa-angle-double-left" value="<">											
										</form>
									</c:if>
									<c:if test="${kcs_curPage==1 }">
										<!-- 
										<a class="btn btn-outline_btn-default" href="vpcInfo.sev?kcs_curPage=1&client_code=${client_code}&csInfoFlag=false&
													category=${category}&searchContext=${searchContext}">
											<i class="fa fa-angle-left"></i>
										</a>
										 -->
										<form action="vpcInfo.sev" method="get">
											<input type="hidden" name="client_code" value="${client_code}"/>
											<input type="hidden" name="csInfoFlag" value="false"/>	
											<input type="hidden" name="kcs_curPage" value="${1}"/>										
											<input type="hidden" name="category" value="${category}"/>
											<input type="hidden" name="searchContext" value="${searchContext}"/>
											<input type="submit" class="btn btn-info btn-outline btn-default fa fa-angle-double-left" value="<">											
										</form>
									</c:if>
								</li>
							<c:forEach var="i" begin="${kcs_firstPage }" end="${kcs_endPage }">
								<li class="lic">
									<!-- 
									<a class="btn btn-outline btn-defualt" href="vpcInfo.sev?client_code=${client_code}&kcs_curPage=${i}&csInfoFlag=false&
													category=${category}&searchContext=${searchContext}">${i}</a>
									 -->														
									<form action="vpcInfo.sev" method="get">
										<input type="hidden" name="client_code" value="${client_code}"/>
										<input type="hidden" name="csInfoFlag" value="false"/>	
										<input type="hidden" name="kcs_curPage" value="${i}"/>										
										<input type="hidden" name="category" value="${category}"/>
										<input type="hidden" name="searchContext" value="${searchContext}"/>
										<input type="submit" class="btn btn-info btn-outline btn-default fa fa-angle-double-left" value="${i}">											
									</form>	 														
								</li>
							</c:forEach>
								<li class="lic">
									<c:if test="${kcs_curPage!=kcs_pageCnt }">
										<!-- 
										<a class="btn btn-outline_btn-default" href="vpcInfo.sev?kcs_curPage=${kcs_curPage+1 }&client_code=${client_code}&csInfoFlag=false&
													category=${category}&searchContext=${searchContext}">
											<i class="fa fa-angle-right"></i>
										</a>
										 -->
										<form action="vpcInfo.sev" method="get">
											<input type="hidden" name="client_code" value="${client_code}"/>
											<input type="hidden" name="csInfoFlag" value="false"/>	
											<input type="hidden" name="kcs_curPage" value="${kcs_curPage+1}"/>										
											<input type="hidden" name="category" value="${category}"/>
											<input type="hidden" name="searchContext" value="${searchContext}"/>
											<input type="submit" class="btn btn-info btn-outline btn-default fa fa-angle-double-left" value=">">											
										</form>	 														
									</c:if>
									<c:if test="${kcs_curPage==kcs_pageCnt }">
										<!-- 
										<a class="btn btn-outline_btn-default" href="vpcInfo.sev?kcs_curPage=${kcs_pageCnt }&client_code=${client_code}&csInfoFlag=false&
													category=${category}&searchContext=${searchContext}">
											<i class="fa fa-angle-right"></i>
										</a>
										 -->
										 <form action="vpcInfo.sev" method="get">
											<input type="hidden" name="client_code" value="${client_code}"/>
											<input type="hidden" name="csInfoFlag" value="false"/>	
											<input type="hidden" name="kcs_curPage" value="${kcs_pageCnt}"/>										
											<input type="hidden" name="category" value="${category}"/>
											<input type="hidden" name="searchContext" value="${searchContext}"/>
											<input type="submit" class="btn btn-info btn-outline btn-default fa fa-angle-double-left" value=">">											
										</form>
									</c:if>
								</li>
								<li class="lic">
									<!-- 
									<a class="btn btn-outline btn-default" href="vpcInfo.sev?client_code=${client_code}&kcs_curPage=${kcs_pageCnt}&csInfoFlag=false&
													category=${category}&searchContext=${searchContext}">
										<i class="fa fa-angle-double-right "></i>
									</a>
									 -->
									<form action="vpcInfo.sev" method="get">
											<input type="hidden" name="client_code" value="${client_code}"/>
											<input type="hidden" name="csInfoFlag" value="false"/>	
											<input type="hidden" name="kcs_curPage" value="${kcs_pageCnt}"/>										
											<input type="hidden" name="category" value="${category}"/>
											<input type="hidden" name="searchContext" value="${searchContext}"/>
											<input type="submit" class="btn btn-info btn-outline btn-default fa fa-angle-double-left" value=">>">											
									</form>									 
								</li>
						</ul>
						<!-- ul -->
						
					</div>
					<!-- UL DIV -->
				</c:if>
				<!-- c:if -->
			</div>
			<!-- panel-body -->
		</div>
		<!-- panel panel-default -->
	</div>
	<!-- col-lg-12 -->
</div>
<!-- row -->
<!-- /#page-wrapper -->
