<%@ 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/setToken.js"></script>
<script>
//부가서비스류 삭제
function deleteHandle(content_db, content_code, service_code, client_code)
{
	location.replace("deleteServiceItem.sev?content_db="+content_db+"&content_code="+content_code+
							"&service_code="+service_code+"&client_code="+client_code+"&reason="+encodeURI($("#reason").val())+"&token="+$("#token").val());
}

//전체서비스 삭제
function deleteService(client_code,service_code, service_line)
{
	var url = "deleteServiceAll.sev?client_code="+client_code+"&service_code="+service_code+"&service_line=" + service_line+
								"&reason="+encodeURI($("#reason").val())+"&token="+$("#token").val();
	//alert(url);
	window.location = url;
}

</script>
<script type="text/javascript">
$(function()
{
	//삭제 버튼 클릭시
	$(".deleteDivBtn").click(function()
	{
		$("#deleteBtn").attr("onClick",$(this).attr("myVal"));		
	});
});
</script>
<!-- 여기가 본 페이지이다 -->
<div class="row">
	<div class="col-lg-8">
		<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 -->
	   			<div class="table-responsive">
	   				<input type="hidden" id="token">
					<table class="table table-bordered table-hover table-striped">
						<thead>
							<tr>
								<td>
									서비스 코드
								</td>
								<td colspan="2">
									${service_code}									
								</td>
							</tr>
							<tr>	
								<td>
									고객 코드
								</td>
								<td colspan="2">
									${client_code}
								</td>
							</tr>
						</thead>
						<tbody>
							<tr>
								<td>${dto.content} </td>
								<td>${dto.content_request_date} ${dto.content_code} ${dto.sub_content}</td>
								<td><input type="button" class="deleteDivBtn" action="NEW" data-toggle="modal"
										 data-target="#divModal" value="해지"
										  myVal="deleteService('${client_code}','${service_code}', '${dto.sub_content}')"></td>									
							</tr>		
							<c:forEach items="${list}" var="list">
								<tr>
									<td>${list.content}</td>
									<td> ${list.content_request_date} ${list.content_code} ${list.content_db} ${list.sub_code} ${list.sub_content} / ${list.adddb_code }</td>
									<td><input type="button" class="deleteDivBtn " action="NEW" data-toggle="modal"
											 data-target="#divModal" value="해지" 
											 myVal="deleteHandle('${list.content_db}', '${list.content_code}','${service_code}','${client_code}')"></td>									
								</tr>
							</c:forEach>	
						</tbody>
						<tfoot>
						</tfoot>
					</table>
				</div>
				<a class="btn btn-outline btn-default " href="serviceDetailSolo.sev?client_code=${client_code}&service_code=${service_code}">서비스 리스트</a>
				<!-- table-responsive -->
			</div>
			<!-- panel-body -->
		</div>
		<!-- panel panel-default -->
	</div>
	<!-- col-lg-12 -->
</div>
<!-- row -->
<!-- /#page-wrapper -->


<div id="divModal" class="modal fade" data-keyboard="true" >
    <div class="modal-dialog">
        <div class="modal-content" style="width:500px; position:relative; left:-30%; auto;">
            <div class="modal-header">
                <h4 class="modal-title">해지 사유</h4>
            </div>
            <div class="modal-body">
            	<div class="row">
	            	<div class="col-lg-12">
	           			<input type="text"  id="reason" class="form-control">
	            	</div>
	            </div>
            </div>
            <div class="modal-footer">
            	<button type="button" id="deleteBtn" class="btn btn-default">해지</button>
            	 <button type="button" class="btn btn-default" data-dismiss="modal">닫기</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->



