From 074ca8a80e2c52e6e3edd571b8591d448269977f Mon Sep 17 00:00:00 2001 From: Amirah22 <94591077+Amirah22@users.noreply.github.com> Date: Sun, 17 Jul 2022 12:13:43 +0800 Subject: [PATCH] kemaskini notis update --- app/Http/Controllers/LelongController.php | 6 +- app/Http/Controllers/NotisController.php | 61 ++++++++++-- app/Models/Cawangan.php | 1 + ...2021_12_14_041557_create_lelongs_table.php | 2 + resources/views/includes/sidebar.blade.php | 18 +++- .../views/jananotis/kemaskininotis.blade.php | 8 +- .../jananotis/kemaskininotisbycaw.blade.php | 94 +++++++++++++++++++ resources/views/pdf/jananotis.blade.php | 2 +- resources/views/pdf/listnotis.blade.php | 22 ++--- routes/web.php | 3 + 10 files changed, 186 insertions(+), 31 deletions(-) create mode 100644 resources/views/jananotis/kemaskininotisbycaw.blade.php diff --git a/app/Http/Controllers/LelongController.php b/app/Http/Controllers/LelongController.php index b0b83381..0fe76145 100644 --- a/app/Http/Controllers/LelongController.php +++ b/app/Http/Controllers/LelongController.php @@ -446,9 +446,9 @@ class LelongController extends Controller foreach($lelongbid as $bid) { - $gadai = Gadai::where('norujukan', $bid['norujukan'])->first(); - $gadai->taglel = 0; - $gadai->update(); + // $gadai = Gadai::where('norujukan', $bid['norujukan'])->first(); + // $gadai->taglel = 0; + // $gadai->update(); //insert loguser $loguser = new LogUser; diff --git a/app/Http/Controllers/NotisController.php b/app/Http/Controllers/NotisController.php index c0be590b..94fedd2d 100644 --- a/app/Http/Controllers/NotisController.php +++ b/app/Http/Controllers/NotisController.php @@ -172,22 +172,67 @@ class NotisController extends Controller return view('jananotis.kemaskininotis',compact('tetapan')); } + public function storeall(Request $request) { - public function store(Request $request) - { - - - //create tetapan - $tetapan = Tetapan::find(1); - $tetapan->para2 = $request->para2; - $tetapan->update(); + // dd($request->all()); + $tetapan = Tetapan::find(1); + + $tetapan->para2 = $request->para2; + $tetapan->update(); + $cawangan = Cawangan::all(); + + foreach($cawangan as $updatecaw){ + + $update = Cawangan::where('id', $updatecaw['id']) + ->update(['para2'=>$request->para2]); + // $update->para2 = $request->para2; + // $update->update(); + + } + return redirect()->route('jananotis.kemaskininotis') ->with('success','Kemaskini Berjaya'); } + + public function store(Request $request) + { + + // dd($request->all()); + $tetapan = Tetapan::find(1); + + $tetapan->para2 = $request->para2; + $tetapan->update(); + + $cawangan = Cawangan::all(); + + foreach($cawangan as $updatecaw){ + + $update = Cawangan::where('id', $updatecaw['id']) + ->where('caw_code', $request->kodcaw) + ->update(['para2'=>$request->para2]); + // $update->para2 = $request->para2; + // $update->update(); + + } + + return redirect()->route('jananotis.kemaskininotisbycaw') + ->with('success','Kemaskini Berjaya'); + + + } + + Public function kemaskininotisbycaw (Request $request){ + + $caw = Cawangan::all(); + + return view('jananotis.kemaskininotisbycaw',compact('caw')); + + + } } \ No newline at end of file diff --git a/app/Models/Cawangan.php b/app/Models/Cawangan.php index aa45d064..c1492b33 100644 --- a/app/Models/Cawangan.php +++ b/app/Models/Cawangan.php @@ -27,5 +27,6 @@ class Cawangan extends Model 'nofaks', 'lokasi', 'pkb_jmc', + 'para2', ]; } 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 ab91f002..7b37c59d 100644 --- a/database/migrations/2021_12_14_041557_create_lelongs_table.php +++ b/database/migrations/2021_12_14_041557_create_lelongs_table.php @@ -173,6 +173,8 @@ class CreateLelongsTable extends Migration $table->string('kali')->nullable(); $table->integer('cajlelong')->nullable(); $table->timestamps(); + $table->string('para2')->nullable(); + // $table->foreign('norujukan') // ->references('norujukan')->on('gadai') diff --git a/resources/views/includes/sidebar.blade.php b/resources/views/includes/sidebar.blade.php index 777b7d4b..c3e9539a 100644 --- a/resources/views/includes/sidebar.blade.php +++ b/resources/views/includes/sidebar.blade.php @@ -256,9 +256,21 @@ {{-- end laporan --}} {{-- Kemaskini Notis --}} -
  • - Kemaskini Notis Lelong -
  • + +
  • + + + + +
  • {{-- end Kemaskini Notis --}} diff --git a/resources/views/jananotis/kemaskininotis.blade.php b/resources/views/jananotis/kemaskininotis.blade.php index 989744ce..d68f88a9 100644 --- a/resources/views/jananotis/kemaskininotis.blade.php +++ b/resources/views/jananotis/kemaskininotis.blade.php @@ -16,18 +16,18 @@

    {{ $message }}

    @endif -
    + @csrf
    -
    -
    + +
    diff --git a/resources/views/jananotis/kemaskininotisbycaw.blade.php b/resources/views/jananotis/kemaskininotisbycaw.blade.php new file mode 100644 index 00000000..a4b8cdca --- /dev/null +++ b/resources/views/jananotis/kemaskininotisbycaw.blade.php @@ -0,0 +1,94 @@ +@extends('layouts.app') + +@section('content') + + + + + +
    +
    +
    +

    Kemaskini Notis Lelong by Cawangan

    + + @if ($message = Session::get('failed')) +
    +

    {{ $message }}

    +
    + @endif + + @csrf + + +
    + {{-- + + + @foreach ($caw as $caws) + + @endforeach + + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + +
    +
    + + + + + + +@endsection \ No newline at end of file diff --git a/resources/views/pdf/jananotis.blade.php b/resources/views/pdf/jananotis.blade.php index 00be30e4..bba1ecf0 100644 --- a/resources/views/pdf/jananotis.blade.php +++ b/resources/views/pdf/jananotis.blade.php @@ -131,7 +131,7 @@
    - + {{-- --}} diff --git a/resources/views/pdf/listnotis.blade.php b/resources/views/pdf/listnotis.blade.php index c7c1f211..bfbd3c44 100644 --- a/resources/views/pdf/listnotis.blade.php +++ b/resources/views/pdf/listnotis.blade.php @@ -76,19 +76,17 @@ tr:nth-child(even) {
    {{--
    PKB LOGO
    --}} - -
    -

    {{$caw['caw_name']}}
    - {{$caw['alamat1']}}
    - {{$caw['alamat2']}}
    - No Tel: {{$caw['notel']}}
    - No Faks: {{$caw['nofaks']}} -

    -
    -
    -
    + +
    +
    {{$caw['caw_name']}}
    + {{$caw['alamat1']}}
    + {{$caw['alamat2']}}
    + No Tel: {{$caw['notel']}}
    + No Faks: {{$caw['nofaks']}} +
    +
    + -
    diff --git a/routes/web.php b/routes/web.php index d026112b..d1922185 100644 --- a/routes/web.php +++ b/routes/web.php @@ -324,7 +324,10 @@ Route::group(['middleware' => ['permission:jananotis'],'prefix'=>'jananotis'], f Route::get('/send-email',['as'=>'jananotis.email','uses'=>'MailController@sendEmail']); Route::get('/kemaskininotis',['as'=>'jananotis.kemaskininotis','uses'=>'NotisController@kemaskininotis']); + Route::post('/storeall',['as'=>'jananotis.storeall','uses'=>'NotisController@storeall']); + Route::post('/store',['as'=>'jananotis.store','uses'=>'NotisController@store']); + Route::get('/kemaskininotisbycaw',['as'=>'jananotis.kemaskininotisbycaw','uses'=>'NotisController@kemaskininotisbycaw']); });