diff --git a/app/controllers/Customer.php b/app/controllers/Customer.php
index 1a943960..58674cf2 100755
--- a/app/controllers/Customer.php
+++ b/app/controllers/Customer.php
@@ -9,8 +9,6 @@ public function update(string $a = '', string $b = '', string $c = ''):void {
$customer = new CustomerModel();
$customer->updateCustomer($_POST);
-
-
redirect('profile');
// $this->view('customer/profile');
}
diff --git a/app/controllers/Guide.php b/app/controllers/Guide.php
index a4e54b21..9b0fc692 100755
--- a/app/controllers/Guide.php
+++ b/app/controllers/Guide.php
@@ -11,5 +11,14 @@ public function find(string $a = '', string $b = '', string $c = ''):void {
$this->view('guide/find');
}
+ public function update(string $a = '', string $b = '', string $c = ''): void
+ {
+
+ $guide = new guideModel();
+ $guide->updateGuide($_POST);
+
+ redirect('dashboard');
+ // $this->view('customer/profile');
+ }
}
\ No newline at end of file
diff --git a/app/models/Guide.php b/app/models/Guide.php
index 5eb75d15..aac5f716 100755
--- a/app/models/Guide.php
+++ b/app/models/Guide.php
@@ -1,6 +1,7 @@
validateGuideSignup($data)) {
$user = new UserModel;
@@ -35,7 +37,8 @@ public function registerGuide(array $data) {
return false;
}
- public function validateGuideSignup(array $data) {
+ public function validateGuideSignup(array $data)
+ {
$this->errors = [];
if (empty($data['name'])) {
@@ -72,4 +75,19 @@ public function validateGuideSignup(array $data) {
return empty($this->errors);
}
+
+ public function updateGuide(array $data)
+ {
+
+ // $user = new UserModel;
+
+ $data['id'] = $_SESSION['USER']->id;
+
+ // alowed column
+ $data = array_filter($data, function ($key) {
+ return in_array($key, $this->allowedColumns);
+ }, ARRAY_FILTER_USE_KEY);
+
+ return $this->update($_SESSION['USER']->id, $data, 'id');
+ }
}
diff --git a/app/views/customer/profile.view.php b/app/views/customer/profile.view.php
index 844cb71d..40ad66dc 100755
--- a/app/views/customer/profile.view.php
+++ b/app/views/customer/profile.view.php
@@ -4,92 +4,92 @@
require_once('../app/views/components/navbar.php');
?>
-
+
-
+
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
Hello name ?>!
+
+
+
-
+
+
+
+
+
+
×
+
+
-
-
-
-
×
-
-
-
-
+
+
@@ -98,140 +98,140 @@
-
-
+
-
-
-
-
Total Booking
-
-
-
-
-
03
-
-
-
-
Equipment Booking
-
-
-
-
-
02
+
+
+
+
Total Booking
+
+
+
+
03
+
-
-
-
Guide Booking
-
-
-
-
-
01
+
+
+
Equipment Booking
+
+
-
>
-
-
+
+
02
+
-
+
+
+
Guide Booking
+
+
01
+
+
>
-
-
-
Recent Booking
-
-
-
-
-
-
-
Booking Type : Equipment Booking
-
-
-
Name : Glazers Camping
-
-
-
-
+
+
+
+
+
+
+
+
Recent Booking
+
+
+
+
+
Booking Type : Equipment Booking
+
+
+
Name : Glazers Camping
+
+
+
+
+
+
-
-
-
-
-
Booking History
-
-
-
-
-
- Name |
- Status |
- Type |
- Date |
- Time |
-
-
-
- Glazers Camping |
- Upcoming |
- Equipment |
- 02/12/2023 |
- 10.00 |
-
-
-
- Glazers Camping |
- Upcoming |
- Equipment |
- 02/12/2023 |
- 10.00 |
-
-
-
- Sarath |
- Done |
- Guide |
- 01/09/2023 |
- 10.00 |
-
-
-
-
-
+
+
+
+
+
+
+
Booking History
+
+
+
+
+
+ Name |
+ Status |
+ Type |
+ Date |
+ Time |
+
+
+
+ Glazers Camping |
+ Upcoming |
+ Equipment |
+ 02/12/2023 |
+ 10.00 |
+
+
+
+ Glazers Camping |
+ Upcoming |
+ Equipment |
+ 02/12/2023 |
+ 10.00 |
+
+
+
+ Sarath |
+ Done |
+ Guide |
+ 01/09/2023 |
+ 10.00 |
+
+
+
+
+
-
+
+
+
×
+
+
+
+
+
+
+
+
-
10
+
+
-
-
-
Tours per month
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Total Tours
+
+
-
03
+
10
+
-
-
-
Tours in last month
-
-
-
+
+
+
Tours per month
+
+
-
03
-
>
+
03
+
+
+
+
Tours in last month
+
+
+
+
+
03
+
+
>
-
-
-
-
-
-
-
Recent Booking
-
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
Recent Booking
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
Booking History
-
-
-
-
-
- Name |
- Status |
- Place |
- Date |
- Time |
-
-
-
- Kamal Silva |
- Upcoming |
- Nuwara Eliya |
- 02/12/2023 |
- 10.00 |
-
-
-
- Kumara Perera |
- Upcoming |
- Kandy |
- 02/12/2023 |
- 10.00 |
-
-
-
- Sarath |
- Done |
- Nuwara Eliya |
- 01/09/2023 |
- 10.00 |
-
-
-
-
+
Booking History
+
+
+
+
+
+ Name |
+ Status |
+ Place |
+ Date |
+ Time |
+
+
+
+ Kamal Silva |
+ Upcoming |
+ Nuwara Eliya |
+ 02/12/2023 |
+ 10.00 |
+
+
+
+ Kumara Perera |
+ Upcoming |
+ Kandy |
+ 02/12/2023 |
+ 10.00 |
+
+
+
+ Sarath |
+ Done |
+ Nuwara Eliya |
+ 01/09/2023 |
+ 10.00 |
+
+
+
+
@@ -236,6 +292,48 @@
-->
-