

<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'); ?>

<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">
<?php echo e(csrf_field()); ?> <?php echo e(method_field('POST')); ?>


    <center><h5>Laporan Penjualan Detail per Rumah</h5></center>
    <br><br>
    
    
    <div style="padding:5px 80px;">    
        <div class="row">

            <div class="form-group col-sm-8">
                <label>Project Perumahan</label>
                <select id="prj" name="prj" type="text" class="form-control" autofocus required>
                    <option value=""> --- Pilih Project --- </option>
                    <?php $__currentLoopData = $prj; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dt): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($dt->id); ?>"><?php echo e($dt->project_name.' ['.$dt->initial.']'); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>

        	<div class="form-group col-sm-4">
            	<label>CLUSTER/BLOCK/NOMOR</label>   
            	<input id="id_rmh" type="hidden" class="form-control" name="id_rmh" readonly="true" autofocus>	
            	<div class="input-group">
            		<input type="text" class="form-control" id="nomor" name="nomor" autofocus required readonly="true" placeholder="Clust/Block/No">
            		<span class="input-group-btn">
            			<button onclick="showRumah()" type="button" class="btn btn-info" style="width:10px;height:35px;border-radius:3">.. </button>
            		</span>
            	</div>
            </div>
        </div>
    
        <div class="form-group">
            <label>Nama Pembeli</label>
            <input type="text" id="cust" name="cust" class="form-control" autofocus readonly="true">
        </div>

        <div class="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="button" class="btn btn-success btn-sm" onclick="expor___tExcell()"><i class="fa fa-file-excel-o"></i> Export to Excell </button>
    		
        	<a href="<?php echo e(route('home')); ?>" class="btn btn-warning btn-sm"><i class="fa fa-home"></i> Home </a>
            <br>
        </div>
    	
    </div>
        
</form>

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


<?php echo $__env->make('transaksi.listrumah', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

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


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

<script type="text/javascript">

var table,  cus, tbl_report;

$(document).ready(function(){

})

tblrumah = $('#tbl-rumah').DataTable({
    "scrollY": '55vh',
    "scrollCollapse": true,
    "bSort": false,
    "destroy": true,
    "processing" : true,
    "paging" : false,
    "dom" : 'bti',
});

function showRumah(){
    var prj =$('#prj').val();
    
    if(prj=="") { alert('Harus pilih Perumahan dulu !'); return false; }
    
    $('#modal-rumah').modal('show');

    tblrumah.ajax.url("<?php echo e(DIR_APP); ?>rumah/"+prj+"/daftarrumahsold");
	tblrumah.ajax.reload();
}

function selectRumah(id){
	$('#id_rmh').val(id);
	$('#modal-rumah').modal('hide');
	
	$.ajax({
        url : "<?php echo e(DIR_APP); ?>report/"+id+"/infopembeli",
        type : "GET",
        dataType : "JSON",
        success : function(data){
            $('#nomor').val(data.cluster.concat('/', data.block. concat('/', data.nomor)));
			$('#cust').val(data.cus_name);
        },
        error : function(){
          alert("Tidak dapat menampilkan data!");
        }   
    });  
}


function viewReport(){
    $('#form-report').attr('action', "<?php echo e(DIR_APP); ?>report/viewreportdetail").submit();       //--> open new windows
    //location.reload();
}


function export_Excell(){
    alert('fitur belum siap'); 
    return false;
    //$('#form-report').attr('action', "<?php echo e(DIR_APP); ?>report/exportsale").submit();       //--> open new windows
    //location.reload();
}

function export_CSV(){
    alert('fitur belum siap'); return false;
    //$('#form-report').attr('action', "<?php echo e(DIR_APP); ?>report/exportcsv").submit();       //--> open new windows
    //location.reload();
}



</script>

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