-
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 #57 from wanderlust-group-project-1/nirmal
feat: Admin->tips crud
- Loading branch information
Showing
8 changed files
with
372 additions
and
73 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,46 @@ | ||
<?php | ||
|
||
class Tips | ||
{ | ||
use Controller; | ||
|
||
public function index(string $a = '', string $b = '', string $c = ''): void | ||
{ | ||
|
||
$tips = new TipsModel(); | ||
$data['tips'] = $tips->findAll(); | ||
// show($data); | ||
$this->view('admin/tips', $data); | ||
} | ||
|
||
public function update(string $a = '', string $b = '', string $c = ''): void | ||
{ | ||
|
||
$tips = new TipsModel(); | ||
$tips->updateTip($_POST); | ||
|
||
redirect('admin/tips'); | ||
} | ||
|
||
public function add(string $a = '', string $b = '', string $c = ''): void | ||
{ | ||
|
||
$tips = new TipsModel(); | ||
$tips->addTip($_POST); | ||
// show($tips); | ||
|
||
redirect('admin/tips'); | ||
} | ||
|
||
public function delete(string $a = '', string $b = '', string $c = ''): void | ||
{ | ||
|
||
// show($a); | ||
// show($b); | ||
// show($c); | ||
$tips = new TipsModel(); | ||
$tips->delete($a, 'id'); | ||
|
||
redirect('admin/tips'); | ||
} | ||
} |
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
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.