From 6ae5062c2266b0443e6dc1cfb5a7d70e2a905c40 Mon Sep 17 00:00:00 2001 From: Azfar Arsyad <45238748+Arpax17@users.noreply.github.com> Date: Wed, 22 Dec 2021 16:14:00 +0800 Subject: [PATCH] update --- app/Http/Controllers/LelongController.php | 6 + app/Http/Controllers/MarhunController.php | 34 ++++- ...21_12_14_041545_create_simulasis_table.php | 6 + ...2021_12_14_041557_create_lelongs_table.php | 9 ++ .../views/lelong/senarailelong.blade.php | 1 + .../views/marhun/kemaskinimarhun.blade.php | 127 ++++++++++++++++++ resources/views/marhun/marhun.blade.php | 95 ++++++++++++- .../views/marhun/semakanmarhun.blade.php | 118 ++++++++++++++++ routes/web.php | 19 ++- 9 files changed, 402 insertions(+), 13 deletions(-) create mode 100644 resources/views/marhun/kemaskinimarhun.blade.php create mode 100644 resources/views/marhun/semakanmarhun.blade.php diff --git a/app/Http/Controllers/LelongController.php b/app/Http/Controllers/LelongController.php index 195b8e7c..7eb974c3 100644 --- a/app/Http/Controllers/LelongController.php +++ b/app/Http/Controllers/LelongController.php @@ -326,6 +326,12 @@ class LelongController extends Controller return redirect()->route('lelong.senarailelong') ->with('success','Lelongan bermula'); } + + public function refresh() + { + return redirect()->route('lelong.senarailelong') + ->with('success','Kemaskini Berjaya'); + } } \ No newline at end of file diff --git a/app/Http/Controllers/MarhunController.php b/app/Http/Controllers/MarhunController.php index 4ddf9d19..ba3cbac6 100644 --- a/app/Http/Controllers/MarhunController.php +++ b/app/Http/Controllers/MarhunController.php @@ -39,19 +39,49 @@ class MarhunController extends Controller public function index() { $user = Auth::user(); - + $lelong = Lelong::join('cawangan_lelong','cawangan_lelong.lelong_id','=','lelong.id') + ->join('cawangan','cawangan.id','=','cawangan_lelong.caw_id') + ->where('cawangan.caw_code','=',$user->kodcaw)->get(); + dd($lelong->all()); $caw = Cawangan::where('caw_code','=',$user->kodcaw)->first(); $lelongbid = LelongBid::where('caw_id','=',$caw->id)->get(); return view('marhun.senaraimarhun',compact('lelongbid')); } + + public function kemaskini(Request $request) + { + dd($request->all()); + + + $marhun = LelongBidMarhun::where('lelongbid_id','=',$request->idmarhun)->first(); + $lelongbid = LelongBid::where('id','=',$marhun->lelong_bid)->first(); + $caw = CawanganLelong::where('id','=',$lelongbid->caw_id)-first(); + $lelong = Lelong::where('id','=',$caw->caw_id)->first(); + + $simkarat = SimKarat::where('simulasi_id','=',$simulasi->id)->get(); + $marhun->marhun = $request->marhun; + $marhun->karat = $request->karat; + $marhun->berat = $request->berat; + $marhun->harga = $request->harga; + $marhun->n_marhun = $request->n_marhun; + $marhun->hargaasas = $request->hargaasas; + $marhun->save(); + + return redirect()->route('marhun.senaraimarhun') + ->with('success','Kemaskini Marhun Berjaya'); + } + public function show($id) { $lelongbid = LelongBid::where('id','=',$id)->first(); $marhun = LelongBidMarhun::where('lelongbid_id','=',$id)->get(); - return view('marhun.marhun',compact('marhun','lelongbid')); + $karatall = JenisKarat::all(); + $emasall = JenisEmas::all(); + + return view('marhun.marhun',compact('marhun','lelongbid','karatall','emasall')); } } diff --git a/database/migrations/2021_12_14_041545_create_simulasis_table.php b/database/migrations/2021_12_14_041545_create_simulasis_table.php index f3de9a9f..1c000fb0 100644 --- a/database/migrations/2021_12_14_041545_create_simulasis_table.php +++ b/database/migrations/2021_12_14_041545_create_simulasis_table.php @@ -17,6 +17,7 @@ class CreateSimulasisTable extends Migration $table->bigIncrements('id'); $table->string('tarikh_lelong'); $table->time('masatamat_lelong')->nullable(); + $table->dateTime('masakemaskini_data')->nullable(); $table->string('kali')->nullable(); $table->string('harga_emas_asas'); $table->string('jbg'); @@ -47,6 +48,7 @@ class CreateSimulasisTable extends Migration Schema::create('simulasibid', function (Blueprint $table) { $table->bigIncrements('id'); + $table->unsignedBigInteger('simulasi_id')->unsigned(); $table->unsignedBigInteger('caw_id')->unsigned(); $table->string('kodcaw'); $table->string('norujukan'); @@ -78,6 +80,10 @@ class CreateSimulasisTable extends Migration $table->foreign('caw_id') ->references('id')->on('cawangan') ->onDelete('cascade'); + + $table->foreign('simulasi_id') + ->references('id')->on('simulasi') + ->onDelete('cascade'); }); Schema::create('simulasibidmarhun', function (Blueprint $table) { diff --git a/database/migrations/2021_12_14_041557_create_lelongs_table.php b/database/migrations/2021_12_14_041557_create_lelongs_table.php index 8a31b48c..65e50f3b 100644 --- a/database/migrations/2021_12_14_041557_create_lelongs_table.php +++ b/database/migrations/2021_12_14_041557_create_lelongs_table.php @@ -16,7 +16,9 @@ class CreateLelongsTable extends Migration Schema::create('lelong', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('tarikh_lelong'); + $table->time('masamula_lelong')->nullable(); $table->time('masatamat_lelong')->nullable(); + $table->dateTime('masakemaskini_data')->nullable(); $table->string('kali')->nullable(); $table->string('harga_emas_asas'); $table->string('jbg'); @@ -47,6 +49,7 @@ class CreateLelongsTable extends Migration Schema::create('lelongbid', function (Blueprint $table) { $table->bigIncrements('id'); + $table->unsignedBigInteger('lelong_id')->unsigned(); $table->unsignedBigInteger('caw_id')->unsigned(); $table->string('kodcaw'); $table->string('norujukan'); @@ -72,12 +75,17 @@ class CreateLelongsTable extends Migration $table->decimal('percent', $precision = 7, $scale = 2); $table->string('status_jual'); $table->string('status_payment'); + $table->integer('status_semak')->default(0); $table->string('mora_upah'); $table->timestamps(); $table->foreign('caw_id') ->references('id')->on('cawangan') ->onDelete('cascade'); + + $table->foreign('lelong_id') + ->references('id')->on('lelong') + ->onDelete('cascade'); }); Schema::create('lelongbidmarhun', function (Blueprint $table) { @@ -91,6 +99,7 @@ class CreateLelongsTable extends Migration $table->decimal('harga', $precision = 5, $scale = 2); $table->decimal('n_marhun', $precision = 9, $scale = 2); $table->decimal('hargaasas', $precision = 11, $scale = 2); + $table->integer('status_semak')->default(0); $table->timestamps(); $table->foreign('lelongbid_id') diff --git a/resources/views/lelong/senarailelong.blade.php b/resources/views/lelong/senarailelong.blade.php index 0209fc14..1bee7d00 100644 --- a/resources/views/lelong/senarailelong.blade.php +++ b/resources/views/lelong/senarailelong.blade.php @@ -35,6 +35,7 @@ {{ $lel->jbg }} {{ $lel->cajlelong }} + @if(!$lel->masatamat_lelong) diff --git a/resources/views/marhun/kemaskinimarhun.blade.php b/resources/views/marhun/kemaskinimarhun.blade.php new file mode 100644 index 00000000..ab9bd4c6 --- /dev/null +++ b/resources/views/marhun/kemaskinimarhun.blade.php @@ -0,0 +1,127 @@ +@extends('layouts.app') + +@section('content') +
+
+
+ + @if ($message = Session::get('success')) +
+

{{ $message }}

+
+ @endif +
+ + + + + {{-- --}} + + + + + + + + + + + + + + {{-- --}} + + + + + + + + + + +
No. RujukanMarhunNotaKaratBeratHargaNilai MarhunHarga Asas
{{ $lelongbid->norujukan }}{{ $marhun->marhun }}{{ $marhun->nota }}{{ $marhun->karat }}{{ $marhun->berat }}{{ $marhun->harga }}{{ $marhun->n_marhun }}{{ $marhun->hargaasas }}
+
+
+ +
+
+ +
+
+ + +@endsection diff --git a/resources/views/marhun/marhun.blade.php b/resources/views/marhun/marhun.blade.php index e75a8ab3..740a3438 100644 --- a/resources/views/marhun/marhun.blade.php +++ b/resources/views/marhun/marhun.blade.php @@ -18,12 +18,12 @@ No. Rujukan Marhun - Nota Karat Berat - Harga + Harga(RM) Nilai Marhun Harga Asas + Nota Action @@ -34,14 +34,14 @@ {{ $lelongbid->norujukan }} {{ $item->marhun }} - {{ $item->nota }} {{ $item->karat }} {{ $item->berat }} {{ $item->harga }} {{ $item->n_marhun }} {{ $item->hargaasas }} + {{ $item->nota }} - + @@ -53,6 +53,64 @@ + @endsection diff --git a/resources/views/marhun/semakanmarhun.blade.php b/resources/views/marhun/semakanmarhun.blade.php new file mode 100644 index 00000000..4ac8d693 --- /dev/null +++ b/resources/views/marhun/semakanmarhun.blade.php @@ -0,0 +1,118 @@ +@extends('layouts.app') + +@section('content') +
+
+
+ + @if ($message = Session::get('success')) +
+

{{ $message }}

+
+ @endif +
+ + + + + + + + + + + + + @foreach ($lelongbid as $bid) + + + + + + + @endforeach + + +
Nombor RujukanTarikh LelongAction
{{ $bid->norujukan }}{{ $bid->t_lelong }} + + {{-- --}} +
+
+
+ +
+
+ + +@endsection diff --git a/routes/web.php b/routes/web.php index ffe63c12..48a448db 100644 --- a/routes/web.php +++ b/routes/web.php @@ -64,20 +64,21 @@ Route::group(['middleware' => ['permission:sistem'],'prefix'=>'sistem'], functio Route::post('/export',['as'=>'sistem.export','uses'=>'DatabaseController@export']); }); -Route::group(['middleware' => ['permission:pendaftaranbatch','permission:lelongan'],'prefix'=>'lelong'], function () { +Route::group(['middleware' => ['permission:pendaftaranbatch'],'prefix'=>'lelong'], function () { Route::get('/create/{id}',['as'=>'lelong.create','uses'=>'LelongController@create']); Route::get('/senarailelong',['as'=>'lelong.senarailelong','uses'=>'LelongController@index']); Route::get('/showlelong/{id}',['as'=>'lelong.show','uses'=>'LelongController@show']); Route::get('/deletelelong/{id}',['as'=>'lelong.delete','uses'=>'LelongController@delete']); + Route::get('/refresh',['as'=>'lelong.refresh','uses'=>'LelongController@refresh']); - Route::get('/lelongstart/{id}',['as'=>'lelong.start','uses'=>'LelongController@start']); + // Route::get('/lelongstart/{id}',['as'=>'lelong.start','uses'=>'LelongController@start']); }); -Route::group(['middleware' => ['permission:pendaftaranbatch','permission:lelongan'],'prefix'=>'lelong'], function () { - Route::get('/create/{id}',['as'=>'lelong.create','uses'=>'LelongController@create']); - Route::get('/senarailelong',['as'=>'lelong.senarailelong','uses'=>'LelongController@index']); - Route::get('/showlelong/{id}',['as'=>'lelong.show','uses'=>'LelongController@show']); - Route::get('/deletelelong/{id}',['as'=>'lelong.delete','uses'=>'LelongController@delete']); +Route::group(['middleware' => ['permission:lelongan'],'prefix'=>'lelong'], function () { + // Route::get('/create/{id}',['as'=>'lelong.create','uses'=>'LelongController@create']); + // Route::get('/senarailelong',['as'=>'lelong.senarailelong','uses'=>'LelongController@index']); + // Route::get('/showlelong/{id}',['as'=>'lelong.show','uses'=>'LelongController@show']); + // Route::get('/deletelelong/{id}',['as'=>'lelong.delete','uses'=>'LelongController@delete']); Route::get('/lelongstart/{id}',['as'=>'lelong.start','uses'=>'LelongController@start']); }); @@ -86,4 +87,8 @@ Route::group(['middleware' => ['permission:semakanmarhun','permission:kemaskinim Route::get('/senaraimarhun',['as'=>'marhun.senaraimarhun','uses'=>'MarhunController@index']); Route::get('/marhun/{id}',['as'=>'marhun.show','uses'=>'MarhunController@show']); Route::get('/deletemarhun/{id}',['as'=>'marhun.delete','uses'=>'MarhunController@delete']); + + Route::post('/kemaskini',['as'=>'marhun.kemaskini','uses'=>'MarhunController@kemaskini']); + Route::get('/semakan',['as'=>'marhun.semakan','uses'=>'MarhunController@semakan']); + }); \ No newline at end of file