diff --git a/app/Http/Controllers/MarhunController.php b/app/Http/Controllers/MarhunController.php index a7b05cbf..acc4fcfe 100644 --- a/app/Http/Controllers/MarhunController.php +++ b/app/Http/Controllers/MarhunController.php @@ -32,6 +32,7 @@ use Illuminate\Support\Facades\Request as FacadesRequest; use App\Models\TempPengesahan; use DateTime; use App\Models\LogUser; +use Illuminate\Support\Facades\Storage; class MarhunController extends Controller { @@ -2598,14 +2599,77 @@ class MarhunController extends Controller public function pengurusanGambarMarhun() { - return view('pengurusangambar.index'); + $lelong_all = Lelong::select('id', 'tarikh_lelong', 'fasa')->get(); + foreach($lelong_all as $index => $lelong) + { + $date_convert = strtotime($lelong->tarikh_lelong); + $lelong_all[$index]['tarikh_lelong'] = date("d-m-Y", $date_convert); + } + + return view('pengurusangambar.operasi', compact('lelong_all')); } public function galeriMarhun() { $user = Auth::user(); - $kodcaw = Cawangan::select('id')->where('caw_code', $user->kodcaw)->first(); - return view('pengurusangambar.galerimarhun', compact('kodcaw')); + $cawangan = Cawangan::with('lelong')->where('caw_code', $user->kodcaw)->first(); + + $caw_id = $cawangan->id; + $lelong_all = $cawangan->lelong; + foreach($lelong_all as $index => $lelong) + { + $date_convert = strtotime($lelong->tarikh_lelong); + $lelong_all[$index]['tarikh_lelong'] = date("d-m-Y", $date_convert); + $lelong_all[$index]['new_id'] = str_pad($lelong->id, 3, "0", STR_PAD_LEFT); + } + + return view('pengurusangambar.cawangan', compact('caw_id', 'lelong_all')); + } + + public function listCawangan(Request $request) + { + $cawangan_all = CawanganLelong::join('cawangan', 'cawangan_lelong.caw_id', '=', 'cawangan.id') + ->where('lelong_id', $request->lelong_id) + ->select('cawangan_lelong.caw_id', 'cawangan.caw_name')->get(); + return response()->json($cawangan_all); + } + + public function listLelongBid(Request $request) + { + $lelong_bid_all = LelongBid::with('fileMarhunMain') + ->where('caw_id', $request->caw_id) + ->where('lelong_id', $request->lelong_id) + ->select(['id','norujukan', 'marhun', 'nilaimarhun', 'status_semak', 'berat', 'hargaasas']) + ->get(); + + foreach ($lelong_bid_all as $index => $lelong_bid) { + $lelong_bid_all[$index]['nilaimarhun'] = number_format($lelong_bid->nilaimarhun, 2, '.', ','); + $lelong_bid_all[$index]['hargaasas'] = number_format($lelong_bid->hargaasas, 2, '.', ','); + + if ($lelong_bid->fileMarhunMain != null) { + + $directory = "/{$lelong_bid->norujukan}/overall_photo/"; + $imageExtension = $lelong_bid->fileMarhunMain->file_type; + + $marhunImageFileName = "overall.{$imageExtension}"; + + if (Storage::disk('marhun')->exists("{$directory}${marhunImageFileName}")) { + $marhun_photo = Storage::disk('marhun')->get("{$directory}${marhunImageFileName}"); + + $lelong_bid_all[$index]['fileMarhunMain']['gambar'] = base64_encode($marhun_photo); + } else { + $lelong_bid_all[$index]['fileMarhunMain']['gambar'] = 0; + } + } + } + + $belum_semak = $lelong_bid_all->where('status_semak', 0)->count(); + + return response()->json([ + "jumlah_surat" => $lelong_bid_all->count(), + "belum_semak" => $belum_semak, + "lelong_bid" => $lelong_bid_all, + ]); } } diff --git a/public/css/style.css b/public/css/style.css index de155424..3f12650e 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -368,4 +368,20 @@ a.article:hover { .user-info { /* display: flex; */ +} + +.blink { + animation: blinker 0.6s linear infinite; + } + + @keyframes blinker { + 50% { + opacity: 0; + } + } + + .unchecked { + border: 2px solid red !important; + border-start-start-radius: 7px; + border-start-end-radius: 7px; } \ No newline at end of file diff --git a/resources/views/pengurusangambar/cawangan.blade.php b/resources/views/pengurusangambar/cawangan.blade.php new file mode 100644 index 00000000..b612b5a5 --- /dev/null +++ b/resources/views/pengurusangambar/cawangan.blade.php @@ -0,0 +1,265 @@ +@extends('layouts.app') + +@section('content') + + +