migration lelonngbid
This commit is contained in:
@@ -674,7 +674,7 @@ class LelongController extends Controller
|
||||
}
|
||||
|
||||
public function deletemarhun(Request $request){
|
||||
dd($request->checkboxdata);
|
||||
// dd($request->checkboxdata);
|
||||
$data = $request->checkboxdata;
|
||||
foreach($data as $index=>$norujukan)
|
||||
{
|
||||
|
||||
@@ -706,6 +706,43 @@ class SimulasiController extends Controller
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function senaraimarhunlel($lelongid, $cawid)
|
||||
{
|
||||
$marhuns = LelongBid::join('cawangan', 'lelongbid.caw_id', '=', 'cawangan.id')
|
||||
->where('lelong_id','=',$lelongid)
|
||||
->where('caw_id','=',$cawid)
|
||||
->select(
|
||||
'lelongbid.t_lelong',
|
||||
'lelongbid.kodcaw',
|
||||
'cawangan.caw_name',
|
||||
'lelongbid.norujukan',
|
||||
'lelongbid.pinjaman',
|
||||
'lelongbid.berat',
|
||||
'lelongbid.nilaimarhun',
|
||||
'lelongbid.hargaasas',
|
||||
'lelongbid.upahsimpan',
|
||||
'lelongbid.cajlelong',
|
||||
'lelongbid.baki',
|
||||
'lelongbid.status_jual',
|
||||
)
|
||||
->get();
|
||||
|
||||
return view('lelong.senaraimarhunsim',compact('marhuns','lelongid','cawid'));
|
||||
}
|
||||
|
||||
public function deletemarhunlel(Request $request){
|
||||
dd($request->checkboxdata);
|
||||
|
||||
$data = $request->checkboxdata;
|
||||
foreach($data as $index=>$norujukan)
|
||||
{
|
||||
$marhun = LelongBid::where('norujukan','=',$norujukan)->first();
|
||||
$marhun->delete();
|
||||
}
|
||||
|
||||
return redirect()->route('lelong.senaraimarhunlel',['lelongid'=>$request->lelongid,'cawid'=>$request->cawid])
|
||||
->with('success','Delete Berjaya');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ class CreateLelongsTable extends Migration
|
||||
$table->string('status_jual');
|
||||
$table->string('status_payment');
|
||||
$table->integer('status_semak')->default(0);
|
||||
$table->datetime('diserahkan_pada')->nullable();
|
||||
$table->string('mora_upah');
|
||||
$table->timestamps();
|
||||
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row ">
|
||||
<div class="col-md-11 mx-auto card p-4">
|
||||
|
||||
@if ($message = Session::get('success'))
|
||||
<div class="alert alert-success">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<form id="deletesag" action="{{route('lelong.deletemarhunlel')}}" method="POST">
|
||||
@csrf
|
||||
<input type="hidden" name="lelongid" value="{{$lelongid}}">
|
||||
<input type="hidden" name="cawid" value="{{$cawid}}">
|
||||
<table class="table table-striped table-xl" id="marhun" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th>No.</th>
|
||||
<th>Tarikh Lelong</th>
|
||||
<th>Kod Cawangan</th>
|
||||
<th>Nama Cawangan</th>
|
||||
<th>Norujukan</th>
|
||||
<th>Pinjaman (RM)</th>
|
||||
<th>Berat (gm)</th>
|
||||
<th>Nilai Marhun (RM)</th>
|
||||
<th>Harga Asas (RM)</th>
|
||||
<th>Upah Simpan (RM)</th>
|
||||
<th>Caj Lelong (%)</th>
|
||||
<th>Rugi Lelong (RM)</th>
|
||||
<th>Baki Lelong (RM)</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($marhuns as $index=> $marhun)
|
||||
<tr>
|
||||
<td>{{$index+1}}</td>
|
||||
<td>{{ $marhun->t_lelong }}</td>
|
||||
<td class="text-center">{{ $marhun->kodcaw }}</td>
|
||||
<td>{{ $marhun->caw_name }}</td>
|
||||
<td>{{ $marhun->norujukan}}</td>
|
||||
<td>{{ $marhun->pinjaman }}</td>
|
||||
<td>{{ $marhun->berat }}</td>
|
||||
<td>{{ $marhun->nilaimarhun }}</td>
|
||||
<td>{{ $marhun->hargaasas }}</td>
|
||||
<td>{{ $marhun->upahsimpan }}</td>
|
||||
<td>{{ $marhun->cajlelong }}</td>
|
||||
<?php
|
||||
$rugi = '';
|
||||
$baki = '';
|
||||
if(strpos($marhun->baki, '-') !== false)
|
||||
{
|
||||
$rugi = $marhun->baki;
|
||||
}
|
||||
else {
|
||||
$baki = $marhun->baki;
|
||||
}
|
||||
?>
|
||||
<td>{{$rugi}}</td>
|
||||
<td>{{$baki}}</td>
|
||||
|
||||
<td class="text-center">
|
||||
<input type="checkbox" aria-label="Checkbox for following text input" onclick="btnDelete(this)" name="checkboxdata[]" value="{{ $marhun->norujukan }}">
|
||||
</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()">Delete</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": 25,
|
||||
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
|
||||
@@ -73,7 +73,7 @@
|
||||
@foreach ($arraycaw as $index=>$caw)
|
||||
<tr>
|
||||
<td>{{$index+1}}</td>
|
||||
<td>{{ $caw['cawangan'] }}</td>
|
||||
<td><a href=" {{ route('lelong.senaraimarhunlel',['lelongid'=>$lelong_id,'cawid'=>$caw['id_cawangan']]) }} " target="blank" style="color:#3490dc">{{ $caw['cawangan'] }}</a></td>
|
||||
<td>{{ $caw['t_lelong'] }}</td>
|
||||
<td>{{ $caw['bil_marhun'] }}</td>
|
||||
<td>{{ number_format($caw['berat'], 2, '.', ',') }}</td>
|
||||
|
||||
@@ -59,6 +59,8 @@ Route::group(['middleware' => ['permission:analisa'],'prefix'=>'analisa'], funct
|
||||
Route::get('/senaraisimulasi',['as'=>'analisa.senaraisimulasi','uses'=>'SimulasiController@senaraisimulasi']);
|
||||
Route::get('/showsimulasi/{id}',['as'=>'analisa.show','uses'=>'SimulasiController@show']);
|
||||
Route::get('/deletesimulasi/{id}',['as'=>'analisa.delete','uses'=>'SimulasiController@delete']);
|
||||
Route::get('/senaraimarhunlel/{lelongid}/{cawid}',['as'=>'analisa.senaraimarhunlel','uses'=>'SimulasiController@senaraimarhunlel']);
|
||||
Route::get('/deletemarhunlel',['as'=>'analisa.deletemarhunlel','uses'=>'SimulasiController@senaraimarhunlel']);
|
||||
|
||||
Route::post('/filter',['as'=>'analisa.filter','uses'=>'SimulasiController@filter']);
|
||||
Route::post('/export',['as'=>'analisa.export','uses'=>'SimulasiController@export']);
|
||||
|
||||
Reference in New Issue
Block a user