kemaskini notis update

This commit is contained in:
Amirah22
2022-07-17 12:13:43 +08:00
parent d1c7d1a6c7
commit 074ca8a80e
10 changed files with 186 additions and 31 deletions
+3 -3
View File
@@ -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;
+53 -8
View File
@@ -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'));
}
}
+1
View File
@@ -27,5 +27,6 @@ class Cawangan extends Model
'nofaks',
'lokasi',
'pkb_jmc',
'para2',
];
}
@@ -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')
+15 -3
View File
@@ -256,9 +256,21 @@
{{-- end laporan --}}
{{-- Kemaskini Notis --}}
<li class="{{ (request()->is('jananotis/*')) ? 'active' : '' }}">
<a href="{{url('jananotis/kemaskininotis')}}">Kemaskini Notis Lelong</a>
</li>
<li class="{{ (request()->is('report/')) ? 'active' : '' }}">
<a href="#kemaskiniSubmenu" data-toggle="collapse" aria-expanded="false" style="">Kemaskini Notis Lelong</a>
<ul class="list-unstyled collapse {{ (request()->is('jananotis/*')) ? 'show' : '' }}" id="kemaskiniSubmenu" >
<li class="{{ (request()->is('jananotis/kemaskininotis/*') || request()->is('jananotis/kemaskininotis') ) ? 'active' : '' }}">
<a href="{{url('jananotis/kemaskininotis')}}">Semua Cawangan</a>
</li>
</ul>
<ul class="list-unstyled collapse {{ (request()->is('jananotis/*')) ? 'show' : '' }}" id="kemaskiniSubmenu" >
<li class="{{ (request()->is('jananotis/kemaskininotisbycaw/*') || request()->is('jananotis/kemaskininotisbycaw') ) ? 'active' : '' }}">
<a href="{{url('jananotis/kemaskininotisbycaw')}}">By Cawangan</a>
</li>
</ul>
</li>
{{-- end Kemaskini Notis --}}
@@ -16,18 +16,18 @@
<p>{{ $message }}</p>
</div>
@endif
<form action="{{route('jananotis.store')}}" method="POST" enctype="multipart/form-data">
<form action="{{route('jananotis.storeall')}}" method="POST" enctype="multipart/form-data">
@csrf
<div class="form-group row">
<label for="jbg" class="col-sm-2 col-form-label">Format Notis</label>
<div class="col-sm-4" id="para2">
<textarea name="para2" rows="10" cols="100" id="article-ckeditor" required>
{{$tetapan->para2}}
</textarea>
</div>
</div>
</div>
<div class="form-group row">
<div class="col-sm-10">
<button type="submit" class="btn btn-primary">Simpan</button>
@@ -0,0 +1,94 @@
@extends('layouts.app')
@section('content')
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.10/css/select2.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.10/js/select2.min.js"></script>
<script src="https://cdn.ckeditor.com/4.16.2/standard/ckeditor.js"></script>
<div class="container-fluid">
<div class="row ">
<div class="col-md-12 mx-auto card">
<h3 class="pt-3">Kemaskini Notis Lelong by Cawangan</h3>
@if ($message = Session::get('failed'))
<div class="alert alert-danger">
<p>{{ $message }}</p>
</div>
@endif
<form action="{{route('jananotis.store')}}" method="POST" enctype="multipart/form-data">
@csrf
<label for="caw" class="col-sm-1 col-form-label">Cawangan</label>
<div class="col-sm-4">
{{-- <select class="custom-select" name="caw" id="caw"> --}}
<select onchange="getSelectValue();" id="kodcaw" name="kodcaw">
<option value="">Sila Pilih Cawangan</option>
@foreach ($caw as $caws)
<option value="{{$caws->caw_code}}">{{$caws->caw_name}}</option>
@endforeach
</select>
</div>
<br>
<div class="form-group row">
<div class="col-sm-4" id="list">
<textarea onchange="getSelectValue();" name="para2" rows="10" cols="100" id="article-ckeditor" id="list" required>
</textarea>
</div>
<br>
<div class="form-group row">
<div class="col-sm-10">
<button type="submit" class="btn btn-primary">Simpan</button>
</div>
</div>
</form>
</div>
</div>
</div>
<script>
function getSelectValue()
{
var selectedValue = document.getElementById("list").value;
console.log(selectedValue);
}
function myFunction()
{
document.getElementById("list").value = getElementById();
}
$('#caw').select2({
width: '100%',
placeholder: "Pilih Cawangan",
allowClear: true
});
$(document).ready(function () {
$("input[name=fasa]").change(function(){
if($("#fasa1").is(':checked')){
$("#jbg").val('').prop("readonly", false);
}
if($("#fasa2").is(':checked')){
$("#jbg").val('12').prop("readonly", true);
}
});
});
</script>
@endsection
+1 -1
View File
@@ -131,7 +131,7 @@
<div class="container">
<table id="header">
<tr>
<th rowspan="4"style="width:100px"><br><img src="{{ asset('img/icon_pkb.png') }}" style="width:70px"></img></th>
{{-- <th rowspan="4"style="width:100px"><br><img src="{{ asset('img/icon_pkb.png') }}" style="width:70px"></img></th> --}}
<th colspan="1">{{$caw['caw_name']}}</th>
</tr>
<tr>
+10 -12
View File
@@ -76,19 +76,17 @@ tr:nth-child(even) {
<div class="row">
{{-- <div class="first-prgph"><img src="http://lelong.test/img/icon_pkb.png" alt="PKB LOGO" width="100" height="100"><br></div> --}}
<div class="first-prgph1">
<p> {{$caw['caw_name']}}<br>
{{$caw['alamat1']}}<br>
{{$caw['alamat2']}}<br>
No Tel: {{$caw['notel']}}<br>
No Faks: {{$caw['nofaks']}}
</p>
</div>
<br>
</div>
<div class="first-prgph1">
<h5> {{$caw['caw_name']}}<br>
{{$caw['alamat1']}}<br>
{{$caw['alamat2']}}<br>
No Tel: {{$caw['notel']}}<br>
No Faks: {{$caw['nofaks']}}
</h5>
</div>
</div>
</table> </div>
<table cellspacing="0" cellpadding="5" style="float:right;" border="0" width="100%" height="80" align="left" id="sim">
<thead>
<tr>
+3
View File
@@ -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']);
});