add function pindah id lelong by sag
This commit is contained in:
@@ -0,0 +1,196 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row ">
|
||||
<div class="col-md-11 mx-auto card p-4">
|
||||
<div class="nav nav-tabs" id="nav-tab" role="tablist">
|
||||
<button type="button" class="btn btn-light" ><a href="javascript:window.history.go(-1);"><h3><i class="fas fa-arrow-alt-circle-left"></i></h3></a></button>
|
||||
</div>
|
||||
<span class="pt-3" style="margin-left:1%; font-size:20px"><b>Senarai Lelong(Pindah ID Lelong)</b></span>
|
||||
@foreach ($arrayinfo as $laporan)
|
||||
|
||||
<span class="pt-3" style="margin-left:1%;"><b>ID Lelong : {{ $laporan['laporan']['lelong_id']}}</b></span>
|
||||
<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>
|
||||
@foreach($laporan['details'] as $details)
|
||||
<span class="pt-3" style="margin-left:1%;"><b>Nama Cawangan : {{ $details['caw_name']}}</b></span>
|
||||
<span class="pt-3" style="margin-left:1%;"><b>Kod Cawangan : {{ $details['caw_code']}}</b></span>
|
||||
@endforeach
|
||||
|
||||
@endforeach
|
||||
|
||||
@if ($message = Session::get('success'))
|
||||
<div class="alert alert-success">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<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> Pindah Ke-</div>
|
||||
<select class="js-states browser-default select2" name="lelongidbaru" required id="lelongidbaru">
|
||||
<option value="option_select" disabled selected>SILA PILIH ID LELONG</option>
|
||||
@foreach($datapindah as $data)
|
||||
<option value="{{ $data['id'] }}">ID Lelong:{{ $data['id']}} / Tarikh: {{ $data['tarikh_lelong']}} / Kali Ke-: {{ $data['kali']}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<button type="submit" class="btn btn-success">Pindah Lelong</button>
|
||||
<table class="table table-striped table-xl" id="marhun" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th>Pilih</th>
|
||||
<th>No.</th>
|
||||
<th>No rujukan</th>
|
||||
<th>Tempoh</th>
|
||||
<th>Berat (gm)</th>
|
||||
<th>Nilai Marhun (RM)</th>
|
||||
<th>Harga Asas (RM)</th>
|
||||
<th>Pembiayaan (RM)</th>
|
||||
<th>Keuntungan (RM)</th>
|
||||
<th>Caj Lelong (%)</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'] }}">
|
||||
</td>
|
||||
<td>{{$loop->iteration}}</td>
|
||||
<td>{{ $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>
|
||||
</div>
|
||||
<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
|
||||
@@ -43,7 +43,7 @@
|
||||
<tr>
|
||||
<td><input type="radio" aria-label="Checkbox for following text input" name="caw[]" id="caw" value = "{{ $caw['kodcaw'] }}" class="custom_name"></td>
|
||||
<td>{{$index+1}}</td>
|
||||
<td><a href=" {{ route('lelong.senaraimarhunsimulasi',['lelongid'=>$lelong_id,'cawid'=>$caw['id_cawangan']]) }} " target="blank" style="color:#3490dc">{{ $caw['cawangan'] }}</a></td>
|
||||
<td><a href=" {{ route('lelong.listsagpindah',['lelongid'=>$lelong_id,'cawid'=>$caw['id_cawangan']]) }} " target="blank" style="color:#3490dc">{{ $caw['cawangan'] }}</a></td>
|
||||
<td align = 'center'>{{ $caw['bil_marhun'] }}</td>
|
||||
<td align = 'right'>{{ number_format($caw['berat'], 2, '.', ',') }}</td>
|
||||
<td align = 'right'>{{ number_format($caw['n_marhun'], 2, '.', ',') }}</td>
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
<th>Nama</th>
|
||||
<th>Nama Pengguna</th>
|
||||
<th>Emel</th>
|
||||
<th>Cawangan</th>
|
||||
<th>Taraf</th>
|
||||
<th>Status</th>
|
||||
<th class="text-center">Action</th>
|
||||
@@ -42,6 +43,7 @@
|
||||
<td>{{ $user->name }}</td>
|
||||
<td>{{ $user->username }}</td>
|
||||
<td>{{ $user->email }}</td>
|
||||
<td>{{ $user->kodcaw }}</td>
|
||||
|
||||
<td>
|
||||
@foreach ($user->roles as $taraf)
|
||||
|
||||
Reference in New Issue
Block a user