-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #245 from wanderlust-group-project-1/db_merge
fix:urls cases
- Loading branch information
Showing
4 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
class GuideProfile { | ||
use Controller; | ||
|
||
public function index(string $a = '', string $b = '', string $c = ''): void { | ||
$user = $_SESSION['USER']; | ||
echo "a"; | ||
|
||
if ($user->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(); | ||
} | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
class GuideprofileModel { | ||
class GuideProfileModel { | ||
use Model; | ||
|
||
protected string $table = 'guide_profile'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters