Skip to content

Commit

Permalink
Merge pull request #50 from wanderlust-group-project-1/Gayandee
Browse files Browse the repository at this point in the history
Gayandee
  • Loading branch information
nsavinda authored Oct 31, 2023
2 parents 22dbb07 + e3a02b3 commit eafc146
Show file tree
Hide file tree
Showing 3 changed files with 245 additions and 182 deletions.
15 changes: 15 additions & 0 deletions app/controllers/RentalService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

class Rentalservice {
use Controller;


public function update(string $a = '', string $b = '', string $c = ''):void {

$rentalservice = new rentalserviceModel();
$rentalservice->updateRentalservice($_POST);

redirect('dashboard');
// $this->view('customer/profile');
}
}
13 changes: 13 additions & 0 deletions app/models/RentalService.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,18 @@ public function validateRentalService(array $data){
return empty($this->errors);
}

public function updateRentalservice(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');
}
}
Loading

0 comments on commit eafc146

Please sign in to comment.