From 7da398e12cda55835a5e47cd7e9c539dd196dac8 Mon Sep 17 00:00:00 2001 From: nsavinda Date: Sat, 27 Apr 2024 16:45:48 +0530 Subject: [PATCH] fix:urls cases --- app/controllers/GuideProfile.php | 37 ++++++++++++++++++++++++ app/controllers/Guideprofile.php | 4 +-- app/models/GuideProfile.php | 2 +- app/views/guide/layout/guide-sidebar.php | 4 +-- 4 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 app/controllers/GuideProfile.php diff --git a/app/controllers/GuideProfile.php b/app/controllers/GuideProfile.php new file mode 100644 index 0000000..50e065f --- /dev/null +++ b/app/controllers/GuideProfile.php @@ -0,0 +1,37 @@ +role == 'guide') { + $guideProfileModel = new GuideProfileModel(); + $guideProfile = $guideProfileModel->getGuideProfileByUserId($user->id); // Assuming you have a method to fetch guide profile by user ID + $this->view('guide/guideprofile', ['user' => $user, 'guideProfile' => $guideProfile]); + } + } + + public function update(string $a = '', string $b = '', string $c = ''): void { + $request = new JSONRequest; + $response = new JSONResponse; + + $data = $request->getAll(); + $data['guide_id'] = UserMiddleware::getUser()['id']; + + $guideProfileModel = new GuideProfileModel; + $data = $guideProfileModel->updateGuideProfile($data); + + $response + ->data($data) + ->success(true) + ->message('Profile updated successfully') + ->statusCode(200) + ->send(); + } + +} + +?> \ No newline at end of file diff --git a/app/controllers/Guideprofile.php b/app/controllers/Guideprofile.php index 92215a5..f8c50cc 100644 --- a/app/controllers/Guideprofile.php +++ b/app/controllers/Guideprofile.php @@ -7,7 +7,7 @@ public function index(string $a = '', string $b = '', string $c = ''): void { $user = $_SESSION['USER']; if ($user->role == 'guide') { - $guideProfileModel = new GuideprofileModel(); + $guideProfileModel = new GuideProfileModel(); $guideProfile = $guideProfileModel->getGuideProfileByUserId($user->id); // Assuming you have a method to fetch guide profile by user ID $this->view('guide/guideprofile', ['user' => $user, 'guideProfile' => $guideProfile]); } @@ -20,7 +20,7 @@ public function update(string $a = '', string $b = '', string $c = ''): void { $data = $request->getAll(); $data['guide_id'] = UserMiddleware::getUser()['id']; - $guideProfileModel = new GuideprofileModel; + $guideProfileModel = new GuideProfileModel; $data = $guideProfileModel->updateGuideProfile($data); $response diff --git a/app/models/GuideProfile.php b/app/models/GuideProfile.php index 27a8873..e6e2ecf 100644 --- a/app/models/GuideProfile.php +++ b/app/models/GuideProfile.php @@ -1,6 +1,6 @@