<%@ 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>
var tableToExcel = (function(){
	var uri = 'data:application/vnd.ms-excel;base64,'
	    , template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta http-equiv="content-type" content="text/plain; charset=UTF-8"/></head><body><table>{table}</table></body></html>'
	    , base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
	    , format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) }
	  return function(table, name, filename) {
	    if (!table.nodeType) table = document.getElementById(table)
	    var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML}
	    //window.location.href = uri + base64(format(template, ctx))
            document.getElementById("dlink").href = uri + base64(format(template, ctx));
            document.getElementById("dlink").download = filename;
            document.getElementById("dlink").click();
	  }
})();

function validateTest(){
		
}

</script>
<script type="text/javascript">
</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> 입금 리스트</h4>
				
			</div>
			<div class="panel-body">
				<div class="row">
					<!-- 윗줄 ㅇㅇ -->
					<form action="IdcDepositListExcel.dep" method="post">
						<div class="col-lg-8 col-md-7 col-sm-8 col-xs-12">
							<a class="btn btn-outline btn-default" type="button" href="IdcDepositList.dep">고객리스트</a>
							<div class="input-group">								
								<input class="form-control" type="text" name="searchContent" placeholder="고객명" value="${searchContent }">
								<div class="input-group-btn">
									<input type="submit" class="btn btn-info btn-outline" value="검색">
									<a class="btn btn-outline btn-default"  onclick="tableToExcel('table','name','prime_incomelist.xls')">엑셀 출력</a>
								</div>
							</div>
						</div>
					</form>
				</div>
				<!-- row -->
				<input type="hidden" id="token">
				<a id="dlink"  style="display:none;"></a>
	   			<div class="table-responsive" id="table">
					<table class="table table-bordered table-hover table-striped">
						<thead>
							<tr>
								<td>No</td>
								<td>고객코드</td>
								<td>고객명</td>
								<td>입금일</td>
								<td>입금액</td>
								<td>입금은행</td>
								<td>입금자</td>
								<td>비고</td>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${IdcDepositList }" varStatus="i" var="temp">
								<tr>
									<td>${temp.num }</td>
									<td>${temp.client_code }</td>
									<td>${temp.client_name }</td>
									<td>${temp.deposit_date }</td>
									<td>${temp.deposit_amount2 }</td>
									<td>${temp.deposit_bank }</td>
									<td>${temp.deposit_name }</td>
									<td>${temp.deposit_note }</td>
								</tr>
							</c:forEach>
						</tbody>
						<tfoot>
						</tfoot>
					</table>
				</div>				
			</div>
			<!-- panel-body -->
		</div>
		<!-- panel panel-default -->
	</div>
	<!-- col-lg-12 -->
</div>
<!-- row -->
<!-- /#page-wrapper -->
