update function hapus marhun
This commit is contained in:
@@ -1347,6 +1347,8 @@ class MarhunController extends Controller
|
||||
if ($request->jenis_button == 'terima') {
|
||||
foreach ($pengesahan as $terimalel) {
|
||||
$lelongbidmarhuns = LelongBidMarhun::where('lelongbidmarhun.id', $terimalel['lelongbidmarhun_id'])->first();
|
||||
$semakCount = LelongBidMarhun::where('lelongbidmarhun.id', $terimalel['lelongbidmarhun_id'])->get();
|
||||
$bilmarhun = $semakCount->count();
|
||||
// dd($lelongbidmarhuns);
|
||||
|
||||
// foreach ($lelongbidmarhuns as $bidmarhuns) {
|
||||
@@ -1561,28 +1563,46 @@ class MarhunController extends Controller
|
||||
|
||||
$currentdate = Carbon::now();
|
||||
$currentdate = $currentdate->toDateTimeString();
|
||||
|
||||
$bilmarhun = LelongBidMarhun::join('lelongbid', 'lelongbidmarhun.lelongbid_id', '=', 'lelongbid.id')
|
||||
->where('lelongbid.id', $request->lelongbid_id)
|
||||
->get();
|
||||
$semakCount1 = $bilmarhun->count();
|
||||
|
||||
$marhun = LelongBidMarhun::join('lelongbid', 'lelongbidmarhun.lelongbid_id', '=', 'lelongbid.id')
|
||||
->where('lelongbidmarhun.id', '=', $request->lelongbidmarhun_id)
|
||||
->where('lelongbid.id', $request->lelongbid_id)
|
||||
->first();
|
||||
$bilmarhunpengesahan = Pengesahan::where('pengesahan.lelongbid_id', $request->lelongbid_id)
|
||||
->get();
|
||||
$semakCount2 = $bilmarhunpengesahan->count();
|
||||
// dd($semakCount1, $semakCount2, $semakCount2 >= $semakCount1-1);
|
||||
|
||||
$id = $request->lelongbid_id;
|
||||
$lelong_id = $marhun->lelong_id;
|
||||
if($semakCount2 >= $semakCount1-1){
|
||||
|
||||
return redirect()
|
||||
->route('marhun.show', compact('id', 'lelong_id'))
|
||||
->with('failed', 'Item Marhun Tidak Boleh Hapus Semua');
|
||||
}else{
|
||||
|
||||
$pengesahan = new Pengesahan();
|
||||
$pengesahan->lelong_id = $marhun->lelong_id;
|
||||
$pengesahan->lelongbid_id = $request->lelongbid_id;
|
||||
$pengesahan->lelongbidmarhun_id = $request->lelongbidmarhun_id;
|
||||
$pengesahan->norujukan = $marhun->norujukan;
|
||||
$pengesahan->diminta_oleh = $user->id;
|
||||
$pengesahan->diminta_pada = $currentdate;
|
||||
$pengesahan->status_ubah = 3;
|
||||
$pengesahan->save();
|
||||
$marhun = LelongBidMarhun::join('lelongbid', 'lelongbidmarhun.lelongbid_id', '=', 'lelongbid.id')
|
||||
->where('lelongbidmarhun.id', '=', $request->lelongbidmarhun_id)
|
||||
->where('lelongbid.id', $request->lelongbid_id)
|
||||
->first();
|
||||
|
||||
return redirect()
|
||||
->route('marhun.show', compact('id', 'lelong_id'))
|
||||
->with('success', 'Permohonan Pengesahan Padam Marhun Telah Berjaya Dihantar');
|
||||
$id = $request->lelongbid_id;
|
||||
$lelong_id = $marhun->lelong_id;
|
||||
|
||||
$pengesahan = new Pengesahan();
|
||||
$pengesahan->lelong_id = $marhun->lelong_id;
|
||||
$pengesahan->lelongbid_id = $request->lelongbid_id;
|
||||
$pengesahan->lelongbidmarhun_id = $request->lelongbidmarhun_id;
|
||||
$pengesahan->norujukan = $marhun->norujukan;
|
||||
$pengesahan->diminta_oleh = $user->id;
|
||||
$pengesahan->diminta_pada = $currentdate;
|
||||
$pengesahan->status_ubah = 3;
|
||||
$pengesahan->save();
|
||||
|
||||
return redirect()
|
||||
->route('marhun.show', compact('id', 'lelong_id'))
|
||||
->with('success', 'Permohonan Pengesahan Padam Marhun Telah Berjaya Dihantar');
|
||||
}
|
||||
}
|
||||
|
||||
public function senarailelong()
|
||||
|
||||
@@ -44,9 +44,13 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if ($message = Session::get('success'))
|
||||
<div class="alert mt-2 alert-success">
|
||||
<div class="alert alert-success">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@elseif ($message = Session::get('failed'))
|
||||
<div class="alert alert-danger">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<form id="deletePhoto" action="{{route('marhun.deletephotomarhun')}}" method="POST">
|
||||
@csrf
|
||||
@@ -59,6 +63,7 @@
|
||||
<input type="hidden" name="type" value="User">
|
||||
<input type="hidden" name="lelongbidmarhun_id" id="lelongbidmarhun_id" >
|
||||
<input type="hidden" name="lelongbid_id" id="lelongbid_id">
|
||||
<input type="hidden" name="lelong_id" value="{{ $lelongbid['lelong_id'] }}">
|
||||
</form>
|
||||
|
||||
<form id="formsemak" action="{{ route('marhun.semak', [ $lelongbid, $lelong_id ]) }}" method="GET">
|
||||
@@ -74,6 +79,7 @@
|
||||
<div class="card card-overall-marhun">
|
||||
<div class="card-header">Keseluruhan Marhun</div>
|
||||
<div class="card-body pl-0 pr-0" style="align-self: center; justify-content: center;">
|
||||
<h6 style="color:rgb(255, 38, 0);" align = 'center'><i>jika ingin hapus gambar sila klik pada gambar</i></h6>
|
||||
@if ($lelongbid['filemarhun_filename'] != null)
|
||||
<button type="button" data-toggle="modal" onclick="kesulurahanMarhunData(this)" data-lelongid="{{$lelongbid['lelong_id']}}" data-lelongbidid="{{$lelongbid['id']}}" data-lelongbid_status_semak="{{ $lelongbid['status_semak'] }}" data-fileid="{{ $lelongbid['filemarhun_id'] }}" data-target="#modaloverallphoto">
|
||||
<img src="{{ route('marhun.showphotomarhun', ['norujukan_sag' => $lelongbid['norujukan'], 'filemarhun_id' => $lelongbid['filemarhun_id']]) }}" width="100%">
|
||||
@@ -767,13 +773,13 @@
|
||||
})
|
||||
|
||||
$('a.confirmdel').confirm({
|
||||
title: 'Confirmation',
|
||||
title: 'Pengesahan',
|
||||
content: 'Anda pasti?',
|
||||
type: 'orange',
|
||||
type: 'red',
|
||||
typeAnimated: true,
|
||||
buttons: {
|
||||
Delete: {
|
||||
btnClass: 'btn-warning',
|
||||
Ya: {
|
||||
btnClass: 'btn-danger',
|
||||
action: function(e) {
|
||||
// location.href = this.$target.attr('href');
|
||||
let lelongbidmarhun = $(this)[0].$target[0].dataset.lelongbidmarhun;
|
||||
@@ -784,7 +790,7 @@
|
||||
|
||||
}
|
||||
},
|
||||
Batal: {
|
||||
Tidak: {
|
||||
btnClass: 'btn-default',
|
||||
action: function() {}
|
||||
}
|
||||
|
||||
@@ -24,9 +24,13 @@
|
||||
<input type="hidden" name="jenis_button" value="terima" id="jenis_button" />
|
||||
|
||||
@if ($message = Session::get('success'))
|
||||
<div class="alert alert-success">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
<div class="alert alert-success">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@elseif ($message = Session::get('failed'))
|
||||
<div class="alert alert-danger">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
@@ -16,9 +16,13 @@
|
||||
<div class="card-body">
|
||||
|
||||
@if ($message = Session::get('success'))
|
||||
<div class="alert alert-success">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
<div class="alert alert-success">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@elseif ($message = Session::get('failed'))
|
||||
<div class="alert alert-danger">
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<form id="exportform" action="" method="POST">
|
||||
<input type="hidden" name="type" value="User">
|
||||
|
||||
Reference in New Issue
Block a user