| @@ 8-22 (lines=15) @@ | ||
| 5 | parent::__construct(); |
|
| 6 | } |
|
| 7 | ||
| 8 | public function index(int $page = 1) { |
|
| 9 | if($page === 0) redirect('user/favourites/1'); |
|
| 10 | ||
| 11 | $this->header_data['title'] = "Favourites"; |
|
| 12 | $this->header_data['page'] = "favourites"; |
|
| 13 | ||
| 14 | $favouriteData = $this->Tracker->favourites->get($page); |
|
| 15 | $this->body_data['favouriteData'] = $favouriteData['rows']; |
|
| 16 | $this->body_data['currentPage'] = $page; |
|
| 17 | $this->body_data['totalPages'] = $favouriteData['totalPages']; |
|
| 18 | ||
| 19 | if($page > $this->body_data['totalPages'] && $page <= 1) redirect('user/favourites/1'); |
|
| 20 | ||
| 21 | $this->_render_page('User/Favourites'); |
|
| 22 | } |
|
| 23 | } |
|
| 24 | ||
| @@ 8-22 (lines=15) @@ | ||
| 5 | parent::__construct(); |
|
| 6 | } |
|
| 7 | ||
| 8 | public function index(int $page = 1) { |
|
| 9 | if($page === 0) redirect('user/history/1'); |
|
| 10 | ||
| 11 | $this->header_data['title'] = "History"; |
|
| 12 | $this->header_data['page'] = "history"; |
|
| 13 | ||
| 14 | $historyData = $this->History->userGetHistory($page); |
|
| 15 | $this->body_data['historyData'] = $historyData['rows']; |
|
| 16 | $this->body_data['currentPage'] = (int) $page; |
|
| 17 | $this->body_data['totalPages'] = $historyData['totalPages']; |
|
| 18 | ||
| 19 | if($page > $this->body_data['totalPages'] && $page <= 1) redirect('user/history/1'); |
|
| 20 | ||
| 21 | $this->_render_page('User/History'); |
|
| 22 | } |
|
| 23 | ||
| 24 | public function export(string $type) : void { |
|
| 25 | $historyData = $this->History->userGetHistoryAll(); |
|