227 lines
9.5 KiB
PHP
227 lines
9.5 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('content')
|
|
|
|
<div class="container-fluid">
|
|
<div class="row ">
|
|
<div class="col mx-auto p-4">
|
|
<div class="card">
|
|
<div class="card-header header-style">
|
|
<a href="javascript:window.history.go(-1);" class="header-style-icon">
|
|
<i class="fas fa-arrow-left"></i>
|
|
</a>
|
|
@foreach ($arrayinfo as $laporan)
|
|
<div class="header-style-title">
|
|
Senarai SAG(Pindah Batch Lelong) : @foreach($laporan['details'] as $details)
|
|
<b>{{ $details['caw_name']}}</b>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
@if ($message = Session::get('success'))
|
|
<div class="alert alert-success">
|
|
<p>{{ $message }}</p>
|
|
</div>
|
|
@endif
|
|
<span class="pt-3" style="margin-left:1%;"><b>Batch Lelong : {{ $laporan['laporan']['lelong_id']}}</b></span><br>
|
|
<span class="pt-3" style="margin-left:1%;"><b>Tarikh Lelong : @php
|
|
$myDateTime = DateTime::createFromFormat('Y-m-d', $laporan['laporan']['tarikh_lelong'] );
|
|
$datez = $myDateTime->format('d-m-Y');
|
|
echo($datez);
|
|
@endphp</b></span>
|
|
|
|
@endforeach
|
|
|
|
<form id="deletesag" action="{{route('lelong.pindahlelongbysag')}}" method="POST">
|
|
@csrf
|
|
<input type="hidden" name="lelongid" value="{{$lelongid}}">
|
|
<input type="hidden" name="cawid" value="{{$cawid}}">
|
|
<div><span class="pt-3" style="margin-left:1%;>" Pindah Ke-</div>
|
|
<select class="js-states browser-default select2" name="lelongidbaru" required id="lelongidbaru">
|
|
<option value="option_select" disabled selected>SILA PILIH BATCH LELONG UNTUK PINDAH BATCH</option>
|
|
@foreach($datapindah as $data)
|
|
<option value="{{ $data['id'] }}">Batch Lelong:{{ $data['id']}} / Tarikh: {{ $data['tarikh_lelong']}} / Kali Ke-: {{ $data['kali']}}</option>
|
|
@endforeach
|
|
</select></span>
|
|
<button type="submit" class="btn btn-success">Pindah Lelong</button>
|
|
<table class="table text-right table-bordered" id="marhun" style="width:100%">
|
|
<thead class="bg-primary text-white">
|
|
<tr>
|
|
<th><input type="checkbox" aria-label="Checkbox for following text input" id="checkall"></th>
|
|
<th>Pilih</th>
|
|
{{-- <th>No</th> --}}
|
|
<th>No Rujukan</th>
|
|
<th>Tempoh</th>
|
|
<th>Berat (gm)</th>
|
|
<th>Nilai Marhun (RM)</th>
|
|
<th>Pembiayaan (RM)</th>
|
|
<th>Keuntungan (RM)</th>
|
|
<th>Caj Lelong (%)</th>
|
|
<th>Harga Asas (RM)</th>
|
|
<th>Rugi Lelong (RM)</th>
|
|
<th>Baki Lelong (RM)</th>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($marhuns as $index=> $marhun)
|
|
<tr>
|
|
<td class="text-center">
|
|
<input type="checkbox" aria-label="Checkbox for following text input" onclick="btnDelete(this)" name="checkboxdata[]" value="{{ $marhun['norujukan'] }}" class="checkbox">
|
|
</td>
|
|
<td>{{$loop->iteration}}</td>
|
|
<td style="white-space: nowrap;">{{ $marhun['norujukan']}}</td>
|
|
<td>{{ $marhun['jbg']}}</td>
|
|
<td>{{ $marhun['berat'] }}</td>
|
|
<td>{{ number_format($marhun['nilaimarhun'], 2, '.', ',') }}</td>
|
|
<td>{{ number_format($marhun['hargaasas'], 2, '.', ',') }}</td>
|
|
<td>{{ number_format($marhun['pinjaman'] , 2, '.', ',') }}</td>
|
|
<td>{{ number_format($marhun['bakiupah'], 2, '.', ',') }}</td>
|
|
|
|
{{-- <td>{{ $marhun['keuntungan'] }}</td> --}}
|
|
<td>{{ number_format($marhun['cajlelong'], 2, '.', ',') }}</td>
|
|
<?php
|
|
$rugi = 0;
|
|
$baki = 0;
|
|
if(strpos($marhun['baki'], '-') !== false)
|
|
{
|
|
$rugi = $marhun['baki'];
|
|
}
|
|
else {
|
|
$baki = $marhun['baki'];
|
|
}
|
|
?>
|
|
<td>{{number_format($rugi, 2, '.', ',')}}</td>
|
|
<td>{{number_format($baki, 2, '.', ',')}}</td>
|
|
|
|
|
|
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
|
|
</table>
|
|
<div class="text-right pt-4">
|
|
<!-- <a href="{{ route('lelong.show',$lelongid) }}" class="btn btn-primary">Kembali</a>
|
|
<button type="button" class="btn btn-danger" id="btndelete" onclick="confirm()">Padam</button> -->
|
|
</div>
|
|
{{-- <a href="{{url('lelong/senarailelong')}}" class="btn btn-primary">Kembali</a> --}}
|
|
|
|
</form>
|
|
</div>
|
|
|
|
</div>
|
|
<script type='text/javascript'>
|
|
$(document).ready(function(){
|
|
// Check or Uncheck All checkboxes
|
|
$("#checkall").change(function(){
|
|
var checked = $(this).is(':checked');
|
|
if(checked){
|
|
$(".checkbox").each(function(){
|
|
$(this).prop("checked",true);
|
|
});
|
|
}else{
|
|
$(".checkbox").each(function(){
|
|
$(this).prop("checked",false);
|
|
});
|
|
}
|
|
});
|
|
|
|
// Changing state of CheckAll checkbox
|
|
$(".checkbox").click(function(){
|
|
|
|
if($(".checkbox").length == $(".checkbox:checked").length) {
|
|
$("#checkall").prop("checked", true);
|
|
} else {
|
|
$("#checkall").prop("checked", false);
|
|
}
|
|
|
|
});
|
|
});
|
|
</script>
|
|
<script>
|
|
$("#btndelete").prop("disabled", true);
|
|
function btnDelete(e) {
|
|
var count = 0;
|
|
tablemarhun.rows().nodes().to$().find('input[type="checkbox"]').each(function(){
|
|
if($(this).prop('checked') === true)
|
|
{
|
|
count = count + 1;
|
|
}
|
|
// $(this).prop('checked', e.checked);
|
|
})
|
|
if(count != 0)
|
|
{
|
|
$("#btndelete").prop("disabled", false);
|
|
}
|
|
else
|
|
{
|
|
$("#btndelete").prop("disabled", true);
|
|
}
|
|
// let checkbox = $('#checkboxdata').val();
|
|
// console.log(checkbox)
|
|
// $("#btndelete").prop("disabled", checkboxdata.length === 0);
|
|
}
|
|
function confirm() {
|
|
$.confirm({
|
|
title: 'Confirmation',
|
|
content: 'Anda pasti?',
|
|
type: 'red',
|
|
typeAnimated: true,
|
|
buttons: {
|
|
Delete: {
|
|
btnClass: 'btn-danger',
|
|
action: function () {
|
|
$("#deletesag").submit();
|
|
}
|
|
},
|
|
Batal: {
|
|
btnClass: 'btn-default',
|
|
action: function () {}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
var tablemarhun = $('#marhun').DataTable( {
|
|
"columnDefs": [
|
|
{
|
|
"targets": 13,
|
|
"orderable": false
|
|
},
|
|
// {
|
|
// "targets": 4,
|
|
// "orderable": false
|
|
// }
|
|
],
|
|
// order: [[1, 'asc']],
|
|
// "ordering": false,
|
|
"info": false,
|
|
"lengthChange": false,
|
|
"pageLength": 999999,
|
|
dom: 'Bfrtip',
|
|
// buttons: [
|
|
// // 'copy', 'excel', 'pdf'
|
|
// // { text: 'copy', className: 'btn btn-primary' },
|
|
// {
|
|
// className: 'btn btn-outline-success pl-4 pr-4 btn-sm adduser',
|
|
// text: '<i class="fas fa-plus" id="test"></i>',
|
|
// titleAttr: 'Tambah Pengguna',
|
|
// action: function ( e, dt, node, config ) {
|
|
// alert( 'Button activated' );
|
|
// }
|
|
// },
|
|
// {
|
|
// className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
|
|
// titleAttr: 'Export to CSV',
|
|
// text: '<i class="fas fa-download"></i>',
|
|
// action: function ( e, dt, node, config ) {
|
|
// $("#exportform").submit();
|
|
// }
|
|
// }
|
|
// ]
|
|
});
|
|
|
|
</script>
|
|
@endsection
|