@extends('layout')


@section('content')

<style type="text/css">
	.datepicker { 
	    z-index: 9999 !important;
	}
</style>

<div class="page-header page-header-default">
	<div class="breadcrumb-line">
		<ul class="breadcrumb">
			<li><a href="index.html"><i class="icon-home2 position-left"></i> Keuangan</a></li>
			<li>Sumber Dana</li>
			<li class="active">Laporan Transaksi Sumber Dana</li>
		</ul>
	</div>
</div>

<div class="content">
	<div class="row">
		<div class="col-sm-6 col-md-6">
			
			<div class="panel panel-flat">
				<div class="panel-heading">
					<h5 class="panel-title">Transaksi Sumber Dana</h5>
					<div class="heading-elements">
						<ul class="icons-list">
				      		<!-- <li><a data-action="collapse"></a></li> -->
				      	</ul>
			       	</div>
			    </div>
			    	<form class="form-horizontal" autocomplete="off" id="form_laporan" method="post" action="#" target="_blank">
			    		<input type="hidden" name="_token" value="{{ csrf_token() }}">
			    <div class="panel-body">
			    		<!-- <div class="col-sm-12 col-md-12"> -->
			    			<div class="form-group">
				    			<label class="control-label col-sm-12 col-md-2">Lokasi</label>
				    			<div class="col-sm-12 col-md-10">
					    			<select name="lokasi" class="form-control select-search" required="">
					    				@if($lokasi_semua == 'show')
					    					<option value="0">Semua</option>
					    				@endif
					    				@foreach($lokasi_produksi AS $key => $value)
					    					<option value="{{ $value->id_lokasi }}">{{ $value->nama_lokasi }}</option>
					    				@endforeach
					    			</select>
					    		</div>
				    		</div>

				    		<div class="form-group">
				    			<label class="control-label col-sm-2">Kas/Bank</label>
				    			<div class="col-sm-10">
				    				<select class="form-control select-search" name="id_akun">
				    					@forelse($kas_bank AS $key=>$value)
				    						<option value="{{$key}}">{{$value}}</option>
				    					@empty
				    						<option value="">Tidak ada pilihan</option>
				    					@endforelse
				    				</select>
				    			</div>
				    		</div>
				    		
				    		<div class="form-group">
				    			<label class="control-label col-sm-12 col-md-2">Tanggal</label>
				    			<div class="col-sm-12 col-md-10">
				    				<div class="row">
				    					<div class="col-sm-12 col-md-6">
				    						<input class="form-control date_awal set_datepicker" type="text" name="tanggal_awal" value="{{ date('d/m/Y') }}" readonly="" required="">
				    						
				    					</div>
				    					<div class="col-sm-12 col-md-6">
				    						<input class="form-control date_akhir set_datepicker" type="text" name="tanggal_akhir" value="{{ date('d/m/Y') }}" readonly="" required="">

				    					</div>
				    				</div>
				    			</div>
				    		</div>
				    		
				    		<div class="form-group hide">
				    			<label class="control-label col-sm-12 col-md-2">&nbsp;</label>
				    			<div class="col-sm-12 col-md-10">
				    				<select name="jenis" class="form-control select-search">
				    					<option value="0">Transaksi</option>
				    					<option value="1" selected="">Detail</option>
				    				</select>
				    			</div>
				    		</div>

			    </div>
			    <div class="panel-footer">
			    	<div class="col-sm-12 col-md-12 text-right">
				    	<button type="button" id="btn_excel" class="btn btn-md btn-success"><i class="fa fa-file-excel-o position-left"></i> Excel</button>
				    	<button type="button" id="btn_print" class="btn btn-md btn-primary"><i class="icon-printer position-left"></i> Cetak</button>
				    </div>
			    </div>
			    	</form>
			</div>

		</div>		
		
	</div> <!--- end : .row -->

</div>

<script type="text/javascript">
	var BASE_URL = "{{ url('/') }}";
$(document).ready(function(){

	$(".set_datepicker").datepicker({
		format : "dd/mm/yyyy",
		autoclose : true,
		zOfIndex : 9999999,
	});

	$("#btn_excel").click(function(evt){
		$("#form_laporan").attr("action", BASE_URL+"/sumberdana/transaksi/cetak_laporan_transaksi_excel");
		$("#form_laporan").submit();
	})

	$("#btn_print").click(function(evt){
		$("#form_laporan").attr("action", BASE_URL+"/sumberdana/transaksi/cetak_laporan_transaksi");
		$("#form_laporan").submit();
	})

})

</script>


@endsection