-
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 remote-tracking branch 'origin/dev' into adminstyles
- Loading branch information
Showing
152 changed files
with
16,374 additions
and
7,461 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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
class Customer { | ||
use Controller; | ||
|
||
|
||
public function uploadImage(string $a = '', string $b = '', string $c = ''):void { | ||
|
||
$request = JSONRequest::createFromFormData(); | ||
$response = new JSONResponse(); | ||
|
||
$customer = new CustomerModel; | ||
|
||
$data = [ | ||
'image' => $_FILES['image'], | ||
|
||
]; | ||
$id = UserMiddleware::getUser()['id']; | ||
|
||
$image = $customer->uploadImage($data, $id); | ||
|
||
|
||
if($image){ | ||
$response->statusCode(200)->data(['image' => $image['image']])->send(); | ||
}else{ | ||
$response->statusCode(400)->data(['error' => 'Image upload failed'])->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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
class GuideAvailability{ | ||
use Controller; | ||
public function index(string $a = '', string $b = '', string $c = ''): void { | ||
$this->view('guide/guideAvailability'); | ||
} | ||
|
||
public function update(string $a = '', string $b = '', string $c = ''): void { | ||
|
||
$request = new JSONRequest; | ||
$response = new JSONResponse; | ||
|
||
$id = UserMiddleware::getUser()['id']; | ||
|
||
// $request->getAll(); | ||
// show($request->getAll()); | ||
$data = $request->getAll(); | ||
$data['guide_id'] = $id; | ||
|
||
$GuideAvailabilityModel = new GuideAvailabilityModel; | ||
$sch = $GuideAvailabilityModel->getScheduleByGuideIdandDate(UserMiddleware::getUser()['id'], $data['date']); | ||
|
||
if($sch){ | ||
$GuideAvailabilityModel->updateSchedule($data); | ||
}else{ | ||
$GuideAvailabilityModel->createSchedule($data); | ||
} | ||
|
||
|
||
$response->success(true) | ||
->message('Schedule updated successfully') | ||
->statusCode(200) | ||
->send(); | ||
|
||
} | ||
|
||
public function getDays(string $a = '', string $b = '', string $c = ''): void { | ||
$request = new JSONRequest; | ||
$response = new JSONResponse; | ||
|
||
$data = $request->getAll(); | ||
|
||
$GuideAvailabilityModel = new GuideAvailabilityModel; | ||
$schedules = $GuideAvailabilityModel->getDaysByMonth(UserMiddleware::getUser()['id'], $data); | ||
|
||
$response->success(true) | ||
->data($schedules) | ||
->message('Schedule fetched 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?php | ||
|
||
class GuideBookings{ | ||
use Controller; | ||
public function index(string $a = '', string $b = '', string $c = ''): void { | ||
$this->view('guide/guidebooking'); | ||
} | ||
public function bookRequest(string $a = '', string $b = '', string $c = ''): void { | ||
$request = new JSONRequest; | ||
$response = new JSONResponse; | ||
|
||
$data = $request->getAll(); | ||
|
||
$GuideBookingsModel = new GuideBookingsModel; | ||
$booking = $GuideBookingsModel->createBooking($data); | ||
|
||
if ($booking) { | ||
$response->success(true) | ||
->message('Booking created successfully') | ||
->statusCode(200) | ||
->send(); | ||
exit(); | ||
} else { | ||
$response->success(false) | ||
->data(['errors' => $GuideBookingsModel->errors]) | ||
->message('Validation failed') | ||
->statusCode(422) | ||
->send(); | ||
} | ||
} | ||
public function getDays(string $a = '', string $b = '', string $c = ''): void { | ||
$request = new JSONRequest; | ||
$response = new JSONResponse; | ||
|
||
$data = $request->getAll(); | ||
|
||
$GuideBookingsModel = new GuideBookingsModel; | ||
$schedules = $GuideBookingsModel->getDaysByMonth(UserMiddleware::getUser()['id'], $data); | ||
|
||
$response->success(true) | ||
->data($schedules) | ||
->message('Schedule fetched successfully') | ||
->statusCode(200) | ||
->send(); | ||
} | ||
|
||
public function getBookingDetailsByDate($date): void { | ||
$response = new JSONResponse; | ||
|
||
// Call your method to retrieve booking details based on the date | ||
$GuideBookingsModel = new GuideBookingsModel(); | ||
$bookingDetails = $GuideBookingsModel->getBookingDetailsByDate(UserMiddleware::getUser()['id'],$date); | ||
|
||
$response->success(true) | ||
->data($bookingDetails) | ||
->message('Booking details fetched successfully') | ||
->statusCode(200) | ||
->send(); | ||
|
||
} | ||
|
||
public function deleteBooking($date): void { | ||
$response = new JSONResponse; | ||
|
||
$GuideBookingsModel = new GuideBookingsModel; | ||
|
||
$GuideBookingsModel->deleteBooking(UserMiddleware::getUser()['id'],$date); | ||
|
||
$response->success(true) | ||
->message('Booking deleted 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
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
Oops, something went wrong.