

<head>
  
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
  
</head>

<?php $__env->startSection('breadcrumb'); ?>
   ##parent-placeholder-6e5ce570b4af9c70279294e1a958333ab1037c86##
   <li>report penjualan detail</li>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('content'); ?>
<br>

<div class="container-fluid">
    <div class="col-sm-12 col-md-12 col-xs-12">
        <div class="box">
    
    <div class="box-body">
    
        <div class="form-group">
            <br>

    		<div class="col-md-3">
    			<input id="awal" type="date" class="form-control" name="awal" autofocus required>
    		</div>
    		<div class="col-md-3">
    			<input id="akhir" type="date" class="form-control" name="akhir" autofocus required>
    		</div>
    
    			<div class="col-md-6 col-sm-6"> 
        				
    				<button type="button" class="btn btn-success" onclick="exportExcell()"><i class="fa fa-file-excel-o"></i> Export to Excell </button>
    				<button type="button" class="btn btn-primary" onclick="reportSaleDetail()"><i class="fa fa-table"></i> Report Detail </button>
    				<button type="button" class="btn btn-success" onclick="window.history.back()"><i class="fa fa-undo"></i> Close </button>
    
    		        <div class="text-right" style="font-size:3vh; margin-top:20px">
        				<input type="checkbox" checked value="1" id="report-cash"> Cash
        				&nbsp;&nbsp;&nbsp;&nbsp;
        				<input type="checkbox" value="0" id="report-credit"> Credit
        				&nbsp;&nbsp;&nbsp;&nbsp;
        				<input type="checkbox" value="0" id="report-sort"> Sort by Product (export XLS)
    				</div>
    				<br>
    			</div>
    			
    	</div>

    </div>
    
        </div>
    </div>
</div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>

<script type="text/javascript">

var table, tgl1, tgl2, cus, tbl_report;

$(document).ready(function(){

})

function reportSale(){
	
	$("#tbl-sale tbody tr").remove(); 
	
	tgl1=$('#awal').val();
	tgl2=$('#akhir').val();

	tbl_report = $('#tbl-sale').DataTable({
		"processing" : true,
		"scrollY": '58vh',
		"scrollCollapse": true,
		"paging": false,		
		"bSort": false,
		"destroy": true,
		"dom" : 'btif',	 
		"ajax" : {
			"url" : "/wawan/report/"+tgl1+"/"+tgl2+"/getdata",
			"type": "GET"
		}
	}); 

 };
 
function reportSaleDetail(){
 
    if($('#report-cash').is(':checked')) { cash=1; }else{ cash=0; }
    if($('#report-credit').is(':checked')) { credit=1; }else{ credit=0; }
    if($('#report-sort').is(':checked')) { bsort=1; }else{ bsort=0; }

	tgl1=$('#awal').val();
	tgl2=$('#akhir').val();

	_url="/wawan/report/detail/"+tgl1+"/"+tgl2+"/"+cash+"/"+credit+"/"+bsort;
	window.open(_url);		//open new tab

 };
  

function exportExcell(){
	
	tgl1=$('#awal').val();
	tgl2=$('#akhir').val();
    
    if($('#report-cash').is(':checked')) { cash=1; }else{ cash=0; }
    if($('#report-credit').is(':checked')) { credit=1; }else{ credit=0; }
    if($('#report-sort').is(':checked')) { bsort=1; }else{ bsort=0; }
    
	_url="/wawan/report/excell/"+tgl1+"/"+tgl2+"/"+cash+"/"+credit+"/"+bsort+'"';
	window.open(_url,'_blank');		//open new tab
}

</script>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/myprojeq/public_html/wawan/resources/views/report/index_saledetail.blade.php ENDPATH**/ ?>