318 lines
14 KiB
PHP
318 lines
14 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="{{ route('marhun.senarailelongmarhun') }}" class="header-style-icon">
|
|
<i class="fas fa-arrow-left"></i>
|
|
</a>
|
|
<div class="header-style-title">
|
|
Semakan Marhun
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
|
|
@if ($message = Session::get('success'))
|
|
<div class="alert alert-success">
|
|
<p>{{ $message }}</p>
|
|
</div>
|
|
@endif
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-6 col-sm-4">
|
|
<p><u><b>Bilangan SAG : </b></u>
|
|
<p>
|
|
<p><b>Keseluruhan : {{ sizeof($lelongbid) }}</b> </p>
|
|
{{-- <p><b>Belum Disemak : {{ sizeof($sag) }}</b></p> --}}
|
|
{{-- <p><b>Dalam Proses : {{ sizeof($dalamproses) }}</b></p> --}}
|
|
<p><b>Sudah Disemak : {{ sizeof($sdhdisemak) }}</b></p>
|
|
{{-- <p><b>Sudah Disahkan Oleh PC : {{ sizeof($sdhdisahkan) }}</b></p> --}}
|
|
</div>
|
|
<div class="col-6 col-sm-4">
|
|
<p><b><u> Pengesahan Oleh PC :</u></b></p>
|
|
{{-- <p><b>Sudah Disemak : {{ sizeof($sdhdisemaktangguhlel) }}</b></p> --}}
|
|
<p><b>Dalam Proses : {{ sizeof($dalamproses) }}</b></p>
|
|
<p><b>Sudah Disahkan : {{ sizeof($sdhdisahkan) }}</b></p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<form id="exportform" action="" method="POST">
|
|
<input type="hidden" name="type" value="User">
|
|
<table class="table table-striped table-bordered table-xl text-center" id="senaraimarhun" style="width:100%">
|
|
<thead class="bg-primary text-white">
|
|
<tr>
|
|
<th>Bil</th>
|
|
<th>No Rujukan</th>
|
|
<th>Tarikh Lelong</th>
|
|
<th>Status Semak</th>
|
|
{{-- <th>Pengesahan</th> --}}
|
|
<th class="text-center">Semakan Marhun</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($lelongbid as $bid)
|
|
<tr>
|
|
<td>{{ $loop->iteration }}</td>
|
|
<td>{{ $bid->norujukan }}</td>
|
|
<td>{{ $bid->t_lelong }}</td>
|
|
<td>
|
|
@if($bid->status_semak == 0)
|
|
{{-- <button class="btn btn-danger btn-sm hovernone-danger" disabled>BELUM DISEMAK</button> --}}
|
|
{{-- @if(isset($bid['pengesahan']['disahkan_oleh'])) --}}
|
|
@if(!empty($bid['pengesahan'] !== null))
|
|
<button class="btn btn-warning btn-sm hovernone-warning" disabled>DALAM PROSES</button>
|
|
@else
|
|
<button class="btn btn-danger btn-sm hovernone-danger" disabled>BELUM DISEMAK</button>
|
|
@endif
|
|
@elseif(($bid['pengesahan'] !== null) && ($bid->status_semak == 1))
|
|
@if($bid['pengesahan']['disahkan_oleh'] !== null)
|
|
<button class="btn btn-success btn-sm hovernone-success" disabled>SUDAH DISAHKAN</button>
|
|
@else
|
|
<button class="btn btn-warning btn-sm hovernone-warning" disabled>DALAM PROSES</button>
|
|
@endif
|
|
@elseif(($bid->status_semak == 1) && ($bid['pengesahan'] === null))
|
|
<button class="btn btn-outline-success btn-sm" disabled>SUDAH DISEMAK</button>
|
|
@endif
|
|
</td>
|
|
{{-- <td>
|
|
@if($bid['statustangguhlel'] != null)
|
|
<button class="btn btn-secondary btn-sm hovernone-secondary" disabled>TANGGUH LELONG PC</button>
|
|
@endif
|
|
</td> --}}
|
|
<td class="text-center">
|
|
@if($bid['statusterimamarhun'] == 1)
|
|
<!-- <button type="button" class="btn btn-primary" onclick="kemaskini(this)" data-lelong="{{$bid->lelong_id}}" data-all="{{$bid}}" data-surat="{{$bid->id}}" data-marhun="{{ json_encode($bid->marhun) }}" data-toggle="modal" data-target="#noRujukanModal"><i class="far fa-edit"></i></button> -->
|
|
<a type="button" class="btn btn-secondary" data-toggle="tooltip" data-placement="top" title="Lihat Butiran" href="{{ route('marhun.show', [$bid->id, $bid->lelong_id]) }}"><i class="far fa-edit"></i></a>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</form>
|
|
{{-- <div class="row justify-content-end">
|
|
<a href="{{ route('marhun.senarailelongmarhun') }}" class="btn m-3 btn-primary">Kembali</a>
|
|
</div> --}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal fade" id="noRujukanModal" data-backdrop="static" data-keyboard="false" tabindex="-1" aria-labelledby="noRujukanModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-xl modal-dialog-centered">
|
|
<div class="modal-content">
|
|
<form id="formsemak" action="" method="GET">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="titleHeader" value="titleHeader"></h5>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="row justify-content-center">
|
|
<div class="col-6">
|
|
<form id="form1">
|
|
<div class="row justify-content-center">
|
|
<img id="blah" style="max-width: 400px; max-height: 400px;" src="#" alt="gambar marhun" />
|
|
</div>
|
|
<div class="row justify-content-center">
|
|
<input type='file' accept="image/*;capture=camera" id="imgInp" />
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<br>
|
|
<table class="table table-striped text-center table-xl" id="tablemarhun" style="width:100%">
|
|
<thead class="bg-primary text-white">
|
|
<tr>
|
|
<th>Barang</th>
|
|
<th>Marhun</th>
|
|
<th>Karat</th>
|
|
<th>Berat</th>
|
|
<th>Harga(RM)</th>
|
|
<th>Nilai Marhun</th>
|
|
<th>Harga Asas</th>
|
|
<th>Nota</th>
|
|
<th>Kemaskini Marhun</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
</table>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
|
|
<button type="button" disabled id="semakButton" onclick="confirm()" class="btn btn-success">Semak Marhun <i class="far fa-check-circle"></i></button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
$("#imgInp").change(function() {
|
|
readURL(this);
|
|
});
|
|
|
|
function readURL(input) {
|
|
if (input.files && input.files[0]) {
|
|
var reader = new FileReader();
|
|
|
|
reader.onload = function(e) {
|
|
$('#blah').attr('src', e.target.result);
|
|
}
|
|
|
|
reader.readAsDataURL(input.files[0]);
|
|
}
|
|
}
|
|
|
|
$(function() {
|
|
$('[data-toggle="tooltip"]').tooltip()
|
|
})
|
|
let all = [];
|
|
let surat = '0'
|
|
let lelongId = '0'
|
|
let marhun = '0'
|
|
|
|
function kemaskini(e) {
|
|
|
|
tablemarhun.clear().draw();
|
|
all = $(e).data('all');
|
|
document.getElementById("titleHeader").innerHTML = all.norujukan;
|
|
surat = $(e).data('surat');
|
|
lelongId = $(e).data('lelong');
|
|
marhun = $(e).data('marhun');
|
|
let statusSemak = $(e).data('all').status_semak;
|
|
console.log(statusSemak);
|
|
if (statusSemak == 1) {
|
|
$("#semakButton").prop('disabled', true);
|
|
} else if (statusSemak == 0) {
|
|
$("#semakButton").prop('disabled', false);
|
|
}
|
|
marhun.forEach((item, index) => {
|
|
var urlroute = '{{ route("marhun.show", [":id", ":id2"]) }}';
|
|
urlroute = urlroute.replace(':id', surat);
|
|
urlroute = urlroute.replace(':id2', lelongId);
|
|
tablemarhun.row.add([
|
|
index + 1,
|
|
item.marhun,
|
|
item.karat,
|
|
item.berat,
|
|
item.harga,
|
|
item.n_marhun,
|
|
item.hargaasas,
|
|
item.nota,
|
|
'<a href="' + urlroute + '" title="Kemaskini Marhun"><i class="far fa-edit"></i></a> ',
|
|
]).draw();
|
|
});
|
|
|
|
}
|
|
var tablemarhun = $('#tablemarhun').DataTable({
|
|
"orderFixed": [0, 'asc'],
|
|
})
|
|
|
|
function confirm() {
|
|
$.confirm({
|
|
title: 'Perhatian!',
|
|
content: 'Anda pasti telah membuat semakan untuk kesemua marhun?',
|
|
type: 'green',
|
|
typeAnimated: true,
|
|
buttons: {
|
|
Batal: {
|
|
btnClass: 'btn-default',
|
|
action: function() {}
|
|
},
|
|
Sahkan: {
|
|
btnClass: 'btn-success',
|
|
action: function() {
|
|
var urlroute = '{{ route("marhun.semak", [":id", ":id2"]) }}';
|
|
urlroute = urlroute.replace(':id', surat);
|
|
urlroute = urlroute.replace(':id2', lelongId);
|
|
console.log(urlroute);
|
|
$('#formsemak').attr('action', urlroute);
|
|
$("#formsemak").submit();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
//Enable tooltips everywhere
|
|
$(function() {
|
|
$('[data-toggle="tooltip"]').tooltip()
|
|
})
|
|
|
|
$('a.confirmdel').confirm({
|
|
title: 'Confirmation',
|
|
content: 'Anda pasti?',
|
|
type: 'orange',
|
|
typeAnimated: true,
|
|
buttons: {
|
|
Delete: {
|
|
btnClass: 'btn-warning',
|
|
action: function() {
|
|
location.href = this.$target.attr('href');
|
|
}
|
|
},
|
|
Batal: {
|
|
btnClass: 'btn-default',
|
|
action: function() {}
|
|
}
|
|
}
|
|
});
|
|
|
|
var tablesenaraimarhun = $('#senaraimarhun').DataTable({
|
|
"columnDefs": [{
|
|
"targets": 0,
|
|
"orderable": false
|
|
},
|
|
{
|
|
"targets": 5,
|
|
"orderable": false
|
|
}
|
|
],
|
|
order: [
|
|
[0, '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 addsim',
|
|
// text: '<i class="fas fa-plus" id="test"></i>',
|
|
// titleAttr: 'Tambah Marhun',
|
|
// 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();
|
|
}
|
|
}
|
|
]
|
|
});
|
|
|
|
// $('.addsim').tooltip();
|
|
$('.export').tooltip();
|
|
// $( '.dt-buttons').addClass('btn-group');
|
|
// $( '.addsim').removeClass('dt-button');
|
|
$('.export').removeClass('dt-button');
|
|
|
|
|
|
function selectall(cb) {
|
|
tablesenaraimarhun.rows().nodes().to$().find('input[type="checkbox"]').each(function() {
|
|
$(this).prop('checked', cb.checked);
|
|
})
|
|
}
|
|
</script>
|
|
|
|
@endsection |