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
+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'));
}
}