@extends('layouts.app')

<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>

@section('breadcrumb')
   @parent
   <li>report sisa piutang</li>
@endsection


@section('content')

<div class="container-fluid">
    <div class="card">
        <div class="card-block">

<!--form method="post" id="form-report"-->


<form class="form-horizontal" data-toggle="validator" method="post" id="form-report">
{{ csrf_field() }} {{ method_field('POST') }}

    <center><h4>Laporan Sisa Piutang</h4></center>
    <br>

     <div class="row" style="margin-left:50px;">

        <!--div class="col-sm-1"></div-->
        <div class="form-group col-sm-6 col-md-6" style="margin-left:5px;margin-right:5px;">
            <label>Gudang</label>
            <select type="text" id="gudang" name="gudang" autofoucs class="form-control">
                <option value="">Pilih Gudang</option>
                @foreach($gdg as $list)
                    <option value="{{ $list->id }}">{{ $list->kode.' - '.$list->nama }}</option>
                @endforeach
            </select>
        </div>  

        <div class="col-md-12 text-center">	
        	<br>
    		<button type="submit" class="btn btn-primary btn-sm" onclick="viewReport()"><i class="fa fa-table"></i> View Report </button>
    		<button type="submit" class="btn btn-success btn-sm" onclick="exportExcell()"><i class="fa fa-file-excel-o"></i> Export to Excell </button>
    		<!--button type="submit" class="btn btn-success btn-sm" onclick="exportCSV()"><i class="fa fa-file-excel-o"></i> Export to CSV </button-->    	
    		<a href="{{ route('home') }}" class="btn btn-warning btn-sm"><i class="fa fa-home"></i> Home </a>
            <br>
    	</div>
        
</form>

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

@endsection

@section('script')

<script type="text/javascript">

var table, tbl_report;

$(document).ready(function(){

})

function viewReport(){
    $('#form-report').attr('action', "{{ DIR_APP }}report/viewreportpiutang").submit();       //--> open new windows
    //location.reload();
}


function exportExcell(){
    $('#form-report').attr('action', "{{ DIR_APP }}report/exportpiutang").submit();       //--> open new windows
    //location.reload();
}



</script>

@endsection