<%@ 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" src="IDC/js/addKCS2.js"></script>
<script type="text/javascript" src="IDC/js/setToken.js"></script>
<script type="text/javascript">
$(function()
{
	//kcs 장비명 입력마다 있는지 없는지 가져와 판단한다.
	$("#kcs_code").bind("input",function()
	{
		var data = $(this).val();
		$.get("IdcGetKcsCode.jso","&sc="+data,function(json)
		{
			var d = json.a;
			if(data.toUpperCase()==d.toUpperCase())
				$("#checkKCS").val("사용중");
			else
				$("#checkKCS").val("사용가능");
		});
	});
	
	//입력값 체크
	$("#kcsSub").click(function()
	{
		var check = true;
		
		if($("#checkKCS").val()=="사용중")
		{
			check=false;
			alert("CS장비번호를 이미 사용중입니다.")			
		}
		if(check)
			$("#kcsF").submit();
	});
});
</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> KT-CS 추가</h4>
			</div>
			<div class="panel-body">
   				<form id="kcsF" action="addKCSHandle.sev?client_code=${kcs_list.client_code}" method="post">
		   			<input type="hidden" id="token" name="token">
		   			<div class="table-responsive">
	   					<input type="hidden" name="service_code" id="service_code" value="${kcs_list.service_code}" >
						<table class="table table-bordered table-hover table-striped">
							<thead>
							</thead>
							<tbody>
									<tr>
										<td>서비스 구분</td>
										<td colspan="3">
											<input type="text" name="service_line" id="service_line" readonly="readonly">					
										</td>				
									</tr>
									<tr>
										<td>서버계정</td>
										<td colspan="3">
											<input type="text" name="service_admin" id="service_admin">					
										</td>				
									</tr>
									<tr>
										<td>고객명</td>
										<td colspan="3">
											<input type="text" name="client_name" id="client_name" readonly="readonly" >
										</td>
									</tr>
									<tr>
										<td>서버IP</td>
										<td colspan="3">
											<input type="text" name="service_ip" id="service_ip" readonly="readonly">
										</td>
									</tr>
									
									<tr>
										<td>장비번호</td>
										<td colspan="3">
											<div class="col-lg-4">
												<div class="input-group">
													<span class="input-group-btn">
														<ul class="dropdown-menu" role="menu" id="server">
															
														</ul>
													</span>
													<input type="text" class="btn btn-default" name="server_code" id="server_code" placeholder="클릭하세요" value="" / >
												</div>
											</div>
										</td>
									</tr>
									<tr>
										<td>KCS-CS장비</td>
										<td colspan="3">
											<input type="text" id="kcs_code" name="kcs_code" value="">
											사용여부 : 
											<input type="text" id="checkKCS" value="사용가능" readonly="readonly">
										</td>
									</tr>
									<tr>
										<td>KCS IP</td>
										<td colspan="3">
											<div class="row">
												<div class="col-lg-4">
											  		<div class="input-group">
											  			<input type="text" class="form-control" name="kcs_ip" id="kcs_ip"/>
													</div>
												</div>
											</div>
										</td>
									</tr>
									<tr>
										<td>연결 도메인</td>
										<td colspan="3">
											<input type="text" name="kcs_use_domain" id="kcs_use_domain">
										</td>
									</tr>
									<tr>
										<td>접속 도메인</td>
										<td colspan="3">
											<input type="text" name="kcs_connect_domain" id="kcs_connect_domain">
										</td>
									</tr>
									
									<tr>
										<td>최종 공격일</td>
										<td colspan="3">
											<input type="date" name="kcs_last_date" id="kcs_last_date" maxlength="50" size="50">
										</td>
									</tr>
												
									<tr>
										<td>비고</td>
										<td colspan="3">					
											<textarea name="kcs_note" id="kcs_note" rows="8" cols="100"></textarea>
										</td>
									</tr>
							</tbody>
							<tfoot>
								<tr>
									<td colspan="4" align="right">
										<button class="btn btn-outline btn-primary" type="button" id="kcsSub" value="KCS등록">KCS등록</button>
										<a class="btn btn-outline btn-default" href="serviceDetail.sev?client_code=${kcs_list.client_code}">취소</a>
									</td>
								</tr>
							</tfoot>
						</table>
					</div>
					<!-- table-responsive -->
				</form>
			</div>
			<!-- panel-body -->
		</div>
		<!-- panel panel-default -->
	</div>
	<!-- col-lg-12 -->
</div>
<!-- row -->
<!-- /#page-wrapper -->
