<%@ 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/getIP.js"></script>
<script type="text/javascript" src="IDC/js/serviceWrite.js"></script>
<script type="text/javascript" src="IDC/js/setToken.js"></script>
<!-- 여기가 본 페이지이다 -->
<div class="row">
	<div class="col-lg-10">
		<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="row">
					<!-- 윗줄 ㅇㅇ -->
				</div>
				<!-- row -->													
				<form name="frm" action="serviceWrite.sev" method="post" onsubmit="return validateTest();">
				<input type="hidden"  name="mkworker" value=${member.name }>			
		   			<input type="hidden" id="token" name="token">
		   			<div class="table-respon sive">
						<table class="table table-bordered table-hover table-striped">
							<thead>
							</thead>
							<tbody>
								<tr>
									<td style="min-width: 120px">서비스 상태</td>
									<td colspan="5">
										<select name="service_status">
											<option value="x">x</option>
											<option value="o">o</option>						
										</select> ( 기본값 X : 변경은 과금팀에서 전담 처리 하오니 절대 수정하지 마세요! )
									</td>
								</tr>								
								<tr>
									<td>고객 코드</td>
									<td colspan="5">
										<input type="text" name="client_code" id="client_code" maxlength="50" size="50" value="${client_code}" readonly>
									</td>
								</tr>
								<tr>
									<td>라인 종류</td>
									<td colspan="5">					
										<select name="service_line" id="service_line" onchange="clickDefence(this); clickTest();" client_code="${client_code}">
											<option value="normal">일반</option>
											<option value="defence">방어</option>
											<option value="solo">전용</option>
											<option value="test">테스트</option>
											<option value="event">이벤트</option>
											<option value="soloLine">전용라인</option>
											<option value="substitution">대체서버</option>
											<option value="vpn">VPN</option>				
											<option value="office">자사서버</option>
											<option value="onetime">일회성장비</option>																													
										</select>
									</td>
								</tr>
								<tr>
									<td>장비번호</td>
									<td colspan="5">
										<div class="input-group">
											<div class="input-group-btn">
												<ul id="firSel" class="dropdown-menu" role="menu">
												</ul>
											</div>
											<input type="text" class="form-control" id="firBtn">
											<input type="text" class="form-control" id="specramhdd" readonly="readonly">
										</div>						
										<input type="hidden" name="server_code" id="server_code" maxlength="50" size="50" placeholder="장비번호">			
									</td>
								</tr>
								<tr>
									<td>sw정보</td>
									<td colspan="5">
										<input type="text" name="service_sw" id="service_sw" maxlength="50" size="50" placeholder="반드시 C01PA01 형식으로 기입 요망 / 공백주의">
									</td>
								</tr>
								<tr>
									<td>os정보</td>
									<td colspan="5">
										<input type="text" name="service_os" id="service_os" maxlength="50" size="50" placeholder="OS 정보">
										<BR>
										예제)<BR>
										Win2008(64) ENT RAID 1/1<BR>
										Win2008R2 ENT RAID 1/1<BR>
										Centos 6.6(32) RAID 1/0<BR>
									</td>
								</tr>								
								<tr>
									<td>기본IP</td>
									<td colspan="5">
										<div class="row">
											<div class="col-lg-2">
										  		<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="service_ip" id="service_ip" maxlength="50" size="50" placeholder="기본IP">
													<input type="hidden" class="getIPt" id="t_ip0">
													<input type="hidden" class="getIPc" >
											  		<input type="hidden" class="client_code" value="${client_code}">
											  		<input type="hidden" class="client_name" value="">
												</div>
											</div>
										</div>
									</td>
								</tr>
								<tr>
									<td>CS장비</td>
									<td colspan="5">
										<div class="col-lg-2">
											<div class="input-group">
												<input type="text" class="form-control" name="cs_code" id="cs_code" maxlength="50" size="50" placeholder="CS장비명" readonly="readonly">
											</div>
										</div>
									</td>
								</tr>																								
								<tr>
									<td>CS추가</td>
									<td colspan="5">
										<select id="cs_count" onchange="clickCsCount(this); clickTest(); csInputDisplay();">
											<option value="0">기본</option>
											<option value="1">1개 추가</option>						
											<option value="2">2개 추가</option>
											<option value="3">3개 추가</option>
											<option value="4">4개 추가</option>
											<option value="5">5개 추가</option>
											<option value="6">6개 추가</option>
											<option value="7">7개 추가</option>
											<option value="8">8개 추가</option>																									
										</select>
										 <input type="hidden" name="cs_count" value="8" readonly="readonly">
										 <input type="hidden" name="amount_cs" value="0" readonly="readonly"/>
										예상금액 : <input type="text" id="amount_cs" value="0" readonly="readonly"/>
									</td>				
								</tr>								
								<tr>
									<td>추가 CS</td>																		
									<td colspan="5">
										<div class="row">
											<div class="col-lg-2">
										  		<div class="input-group">
										  			<input type="text" class="form-control CSInput" id="cs1" name="addCs_address" readonly="readonly"  style="display:none;"/>
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-lg-2">
										  		<div class="input-group">
										  			<input type="text" class="form-control CSInput" id="cs2" name="addCs_address" readonly="readonly"  style="display:none;"/>
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-lg-2">
										  		<div class="input-group">
										  			<input type="text" class="form-control CSInput" id="cs3" name="addCs_address" readonly="readonly"  style="display:none;"/>
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-lg-2">
										  		<div class="input-group">
										  			<input type="text" class="form-control CSInput" id="cs4" name="addCs_address" readonly="readonly"  style="display:none;"/>
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-lg-2">
										  		<div class="input-group">
										  			<input type="text" class="form-control CSInput" id="cs5" name="addCs_address" readonly="readonly"  style="display:none;"/>
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-lg-2">
										  		<div class="input-group">
										  			<input type="text" class="form-control CSInput" id="cs6" name="addCs_address" readonly="readonly"  style="display:none;"/>
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-lg-2">
										  		<div class="input-group">
										  			<input type="text" class="form-control CSInput" id="cs7" name="addCs_address" readonly="readonly"  style="display:none;"/>
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-lg-2">
										  		<div class="input-group">
										  			<input type="text" class="form-control CSInput" id="cs8" name="addCs_address" readonly="readonly"  style="display:none;"/>
												</div>
											</div>
										</div>
									</td>																		
								</tr>																
								<tr>
									<td>신청일</td>
									<td colspan="5">
										<input type="date" name="service_request_date" id="service_request_date" value="${curdate}">
									</td>
								</tr>
								<tr>
									<td>개통일</td>
									<td colspan="5">
										<input type="date" name="service_open_date" id="service_open_date" value="${curdate}">
									</td>
								</tr>
								<tr>
									<td>익월 결제일</td>
									<td colspan="5">
										<input type="date" name="service_payment_date" id="service_payment_date" value="${curdate}">					
									</td>
								</tr>								
								<tr>
									<td>상면비</td>
									<td colspan="3">					
										<select name="amount_rack" id="amount_rack" onChange="clickRack(this); clickTest();">
											<option value="100000">10만원</option>
											<option value="200000">20만원</option>
											<option value="300000">30만원</option>
											<option value="0">0원</option>
											<option value="etc">기타</option>																	
										</select>										
									</td>
									<td colspan="2">
										<div id="rackDisply" style="display:none;">직접 입력:<input type="text" name="rack_etc" id="rack_etc" onchange="clickTest();">
										</div>
									</td>
								</tr>
								<tr>
									<td>회선비</td>
									<td colspan="3">					
										<select name="amount_line" id="amount_line" onChange="clickLine(this); clickTest();">
											<option value="300000">30만원</option>
											<option value="500000">50만원</option>	
											<option value="0">0원</option>					
											<option value="etc">기타</option>																	
										</select>															
									</td>									
									<td colspan="2">
										<div id="lineDisply" style="display:none;">직접 입력:<input type="text" name="line_etc" id="line_etc" onchange="clickTest();">
										</div>
									</td>									
								</tr>
								<tr>
									<td>장비 임대 금액</td>
									<td colspan="5">										
										<input type="text" name="amount_cpu" id="amount_cpu" onchange="clickTest();" placeholder="장비 임대 금액"/>
										<input type="hidden" name="hidden_amount_cpu" id="hidden_amount_cpu" value="0"/>
									</td>
								</tr>
								<tr>
									<td>IP추가</td>
									<td colspan="5">
										<select name="ip_count" id="ip_count" onchange="clickIpCount(this); clickTest(); ipInputDisplay();">
											<option value="0">기본</option>
											<option value="1">1개 추가</option>						
											<option value="2">2개 추가</option>
											<option value="3">3개 추가</option>
											<option value="4">4개 추가</option>
											<option value="5">5개 추가</option>
											<option value="6">6개 추가</option>
											<option value="7">7개 추가</option>
											<option value="8">8개 추가</option>																									
										</select>
										<input type="text" name="amount_ip" id="amount_ip" value="0"/>
									</td>				
								</tr>
								
								<tr>
									<td>추가 아이피 주소</td>																		
									<td colspan="5">
										<div class="row">
											<div class="col-lg-2">
										  		<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" id="ip1" name="addIp_address" placeholder="1" style="display:none;"/>
													<input type="hidden" class="getIPt" id="t_ip1"><input type="hidden" class="getIPc" >
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-lg-2">
										  		<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" id="ip2" name="addIp_address" placeholder="2" style="display:none;"/>
													<input type="hidden" class="getIPt" id="t_ip2"><input type="hidden" class="getIPc" >
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-lg-2">
										  		<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" id="ip3" name="addIp_address" placeholder="3" style="display:none;"/>
													<input type="hidden" class="getIPt" id="t_ip3"><input type="hidden" class="getIPc" >
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-lg-2">
										  		<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" id="ip4" name="addIp_address" placeholder="4" style="display:none;"/>
													<input type="hidden" class="getIPt" id="t_ip4"><input type="hidden" class="getIPc" >
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-lg-2">
										  		<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" id="ip5" name="addIp_address" placeholder="5" style="display:none;"/>
													<input type="hidden" class="getIPt" id="t_ip5"><input type="hidden" class="getIPc" >
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-lg-2">
										  		<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" id="ip6" name="addIp_address" placeholder="6" style="display:none;"/>
													<input type="hidden" class="getIPt" id="t_ip6"><input type="hidden" class="getIPc" >
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-lg-2">
										  		<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" id="ip7" name="addIp_address" placeholder="7" style="display:none;"/>
													<input type="hidden" class="getIPt" id="t_ip7"><input type="hidden" class="getIPc" >
												</div>
											</div>
										</div>
										<div class="row">
											<div class="col-lg-2">
										  		<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" id="ip8" name="addIp_address" placeholder="8" style="display:none;"/>
													<input type="hidden" class="getIPt" id="t_ip8"><input type="hidden" class="getIPc" >
												</div>
											</div>
										</div>
									</td>																		
								</tr>																
								<tr>
									<td>방어 서비스</td>
									<td>
										<select name="service_defence" id="service_defence" onchange="clickServiceDefence(this); clickTest();">
											<option value="x">없음</option>
											<option value="normal">일반</option>
											<option value="ordinary">상시</option>
											<option value="cs-pre">CS-PRE</option>																																														
										</select>
									</td>
									<td colspan="4">
										원가 : <input type="text" name="amount_defence" id="amount_defence" value="0"/> 
										할인금액 : <input type="text" name="defence_discount" id="defence_discount" value="0">
									</td>
								</tr>
								
								<tr>
									<td>리셀러</td>
									<td colspan="5">										
										<input type="text" value="${client_reseller}" name="amount_reseller" id="amount_reseller" readonly="readonly"/>
									</td>
								</tr>
								
								<tr>				
									<td>장기 할인</td>
									<td colspan="3">
										<div id="normal_long" style="display:block;">
										<select name="amount_long" id="amount_long" onchange="clickTest();">
											<option value="0">없음</option>						
											<option value="12">1년</option>						
											<option value="24">2년</option>
											<option value="36">3년</option>
											<option value="48">4년</option>
											<option value="60">5년 이상</option>																														
										</select>					
										</div>
										<div id="solo_long" style="display:none;">
										<select name="solo_amount_long" id="solo_amount_long" onchange="clickTest();">
											<option value="0">없음</option>
											<option value="12">1년</option>						
											<option value="24">2년</option>
											<option value="36">3년</option>
											<option value="48">4년</option>
											<option value="60">5년 이상</option>																																														
										</select>
										</div>																											
									</td>									
									<td colspan="2">할인률<input type="text" id="last_long" name="last_long"/></td>
								</tr>
											
								<tr>
									<td>선입금 할인</td>
									<td colspan="3">
										<select name="amount_pre" id="amount_pre" onchange="clickTest();">
											<option value="0">없음</option>
											<option value="3">3개월</option>						
											<option value="6">6개월</option>
											<option value="12">12개월</option>																														
										</select>																		
									</td>
									<td colspan="2">할인률<input type="text" id="last_pre" name="last_pre"/></td>
								</tr>
								
								<tr>
									<td>직권 할인 금액</td>
									<td colspan="5">										
										<input type="text" name="amount_authority" id="amount_authority" value="0" onchange="clickTest(); validateDiscount();" placeholder="직권 할인 금액"/>
									</td>
								</tr>
								<!-- <tr>
									<td>계약 할인 금액</td>
									<td colspan="5">										
										<input type="text" name="amount_contact" id="amount_contact" value="0" onchange="clickTest(); validateDiscount();" placeholder="계약 할인 금액"/>
									</td>
								</tr> -->
								<input type="hidden" name="amount_contact" id="amount_contact" value="0" onchange="clickTest(); validateDiscount();" placeholder="계약 할인 금액"/>
								<tr>
									<td>부가 할인 금액</td>
									<td colspan="5">										
										<input type="text" name="amount_sub_discount" id="amount_sub_discount" value="0" onchange="clickTest(); validateDiscount();" placeholder="부가 할인 금액"/>
									</td>
								</tr>
								<tr>
									<td>총 할인 금액</td>
									<td colspan="5">										
										<input type="text" name="amount_total_discount" id="amount_total_discount" value="0" readonly="readonly"/>
									</td>
								</tr>
								<tr>
									<td>원가</td>
									<td colspan="3">
										<input type="text" name="amount_cost" id="amount_cost" maxlength="50" size="50" value="0"/>					
									</td>		
									<td>서버 금액</td>
									<td><input type="text" name="service_cost" id="service_cost"> </td>						
								</tr>
								<tr>
									<td>과금</td>
									<td colspan="5">
										<input type="text" name="service_amount" id="service_amount" maxlength="50" size="50" value="0"/>					
									</td>								
								</tr>
								<tr>
									<td>일할과금</td>
									<td colspan="5">
										<input type="text" name="service_deduction" id="service_deduction" maxlength="50" size="50" value="0" onChange="validateDeduction();"/> 
									</td>
								</tr>
								<tr>
									<td>메모</td>
									<td colspan="5">					
										<textarea name="service_note" rows="8" cols="100"></textarea>
									</td>
								</tr>
							</tbody>
							<tfoot>
								<tr>
									<td colspan="6" align="right">
										<input class="btn btn-outline btn-primary" type="submit" value="서비스 등록">
									</td>
								</tr>
							</tfoot>
						</table>
					</div>
					<!-- table-responsive -->
				</form>
			</div>
			<!-- panel-body -->
		</div>
		<!-- panel panel-default -->
	</div>
	<!-- col-lg-12 -->
</div>
<!-- row -->
<!-- /#page-wrapper -->
