<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<script src="IDC/js/getIP.js"></script>
<script type="text/javascript">
$(function()
{
	
});

//ip선택안됐을시
var checkIP=function(num)
{
	var result = true;
	var temp = $(".getIPc");
	if($(temp[num]).val()=="")
	{
		alert("IP를 선택해주세요");
		result = false;
	}
	
	return result;
}

</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> IP 변경</h4>
			</div>
			<div class="panel-body">
				<div class="row">
				</div>
				<!-- row -->
	   			<div>
					<table class="table table-bordered table-hover table-striped">
						<thead>
						</thead>
						<tbody>
							<tr>
								<td width="15%"><label>Main IP변경</label></td>
								<td>
									<div class="row">
										<div class="col-lg-3">
								  			<form action="IdcIPChange.sev" METHOD="get" onsubmit="return checkIP(0)">
										  		<div class="input-group">
									  				<span class="input-group-btn">
											  			<ul class="dropdown-menu getIPul" role="menu" id="getIPul">
											  			</ul>
										  			</span>
														<input type="text" class="form-control getIP" name="ip" maxlength="50" size="50" placeholder="${main_ip }">
														<input type="hidden" class="getIPc" id="main_ip" >
														<input type="hidden" name="service_code" value="${service_code }" >
														<input type="hidden" name="category" value="main">
														<input type="hidden" name="mkworker" value="${member.name }" >
													<span class="input-group-btn">
														<input type="submit" class="btn btn-info" value="수정">
													</span>
												</div>
								  			</form>
										</div>
									</div>
								</td>
							</tr>
							<c:forEach items="${sub }" var="temp" varStatus="i">
								<tr>
									<td><label>SUB IP${i.count }변경</label></td>
									<td>
										<div class="row">
											<div class="col-lg-3">
									  			<form action="IdcIPChange.sev" METHOD="post" onsubmit="return checkIP(${i.count})">
											  		<div class="input-group">
										  				<span class="input-group-btn">
												  			<ul class="dropdown-menu getIPul" role="menu" id="getIPul">
												  			</ul>
											  			</span>
															<input type="text" class="form-control getIP" name="ip" maxlength="50" size="50" placeholder="${temp.ip_address }">
															<input type="hidden" class="getIPc" id="sub_ip${i.count+1 }" >
															<input type="hidden" name="old_ip" value="${temp.ip_address }">
															<input type="hidden" name="service_code" value="${service_code }" >
															<input type="hidden" name="mkworker" value="${member.name }" >
															<input type="hidden" name="category" value="sub">
														<span class="input-group-btn">
															<input type="submit" class="btn btn-info" value="수정">
														</span>
													</div>
									  			</form>
											</div>
										</div>
									</td>
								</tr>
							</c:forEach>
						</tbody>
						<tfoot>
							<tr>
								<td colspan="2">
									<a class="btn btn-default out-line"  href="javascript:history.back(-1);">이전페이지로</a> <a class="btn btn-default out-line"  href="additionalService.sev?service_code=${service_code }">부가서비스정보</a>
								</td>
							</tr>
						</tfoot>
					</table>
				</div>
				<!-- table-responsive -->
			</div>
			<!-- panel-body -->
		</div>
		<!-- panel panel-default -->
	</div>
	<!-- col-lg-12 -->
</div>
<!-- row -->
<!-- /#page-wrapper -->
