-
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.
- Loading branch information
1 parent
8336063
commit 897be65
Showing
17 changed files
with
408 additions
and
215 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 |
---|---|---|
|
@@ -2,6 +2,12 @@ | |
|
||
echo "This is the index page"; | ||
|
||
Class Admin{ | ||
use Controller; | ||
|
||
// public function getRentalCount | ||
|
||
} | ||
|
||
?> | ||
|
||
?> |
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 |
---|---|---|
@@ -1,15 +1,39 @@ | ||
<?php | ||
|
||
class Charts { | ||
class Charts | ||
{ | ||
use Controller; | ||
|
||
public function index(string $a = '', string $b = '', string $c = ''):void { | ||
// public function index(string $a = '', string $b = '', string $c = ''):void { | ||
// $this->view('admin/chart'); | ||
// } | ||
|
||
public function item(string $a = '', string $b = '', string $c = ''): void | ||
{ | ||
$this->view('admin/chart'); | ||
} | ||
|
||
public function item(string $a = '', string $b = '', string $c = ''):void { | ||
$this->view('admin/chart'); | ||
}} | ||
public function index(string $a = '', string $b = '', string $c = ''): void | ||
{ | ||
|
||
$stats = new AdminStatsModel; | ||
$data['rentalServices'] = $stats->getRentalServiceCount(); | ||
|
||
$stats = new AdminStatsModel; | ||
$data['customers'] = $stats->getCustomerCount(); | ||
|
||
$stats = new AdminStatsModel; | ||
$data['guides'] = $stats->getGuideCount(); | ||
|
||
?> | ||
$stats = new AdminStatsModel; | ||
$data['tips'] = $stats->getTipsCount(); | ||
|
||
$stats = new AdminStatsModel; | ||
$data['rentComplaints'] = $stats->getRentComplainsCount(); | ||
|
||
$stats = new AdminStatsModel; | ||
$data['orders'] = $stats->getOrdersCount(); | ||
|
||
$this->view('admin/chart', $data); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,12 +1,30 @@ | ||
<?php | ||
|
||
class Dashboard { | ||
class Dashboard | ||
{ | ||
use Controller; | ||
|
||
public function index(string $a = '', string $b = '', string $c = ''):void { | ||
$this->view('admin/dashboard'); | ||
} | ||
} | ||
public function index(string $a = '', string $b = '', string $c = ''): void | ||
{ | ||
|
||
$stats = new AdminStatsModel; | ||
$data['rentalServices'] = $stats->getRentalServiceCount(); | ||
|
||
$stats = new AdminStatsModel; | ||
$data['customers'] = $stats->getCustomerCount(); | ||
|
||
$stats = new AdminStatsModel; | ||
$data['guides'] = $stats->getGuideCount(); | ||
|
||
$stats = new AdminStatsModel; | ||
$data['tips'] = $stats->getTipsCount(); | ||
|
||
?> | ||
$stats = new AdminStatsModel; | ||
$data['rentComplaints'] = $stats->getRentComplainsCount(); | ||
|
||
$stats = new AdminStatsModel; | ||
$data['orders'] = $stats->getOrdersCount(); | ||
|
||
$this->view('admin/dashboard', $data); | ||
} | ||
} |
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,79 @@ | ||
<?php | ||
|
||
|
||
class AdminStatsModel | ||
{ | ||
use Model; | ||
|
||
public function getRentalServiceCount() | ||
{ | ||
|
||
$q = new QueryBuilder(); | ||
|
||
$q->setTable('rental_services'); | ||
$q->count()->where("status", "accepted"); | ||
|
||
|
||
return $this->query($q->getQuery(), $q->getData()); | ||
} | ||
|
||
public function getCustomerCount() | ||
{ | ||
|
||
$q = new QueryBuilder(); | ||
|
||
$q->setTable('customers'); | ||
$q->count(); | ||
|
||
|
||
return $this->query($q->getQuery(), $q->getData()); | ||
} | ||
|
||
public function getGuideCount() | ||
{ | ||
|
||
$q = new QueryBuilder(); | ||
|
||
$q->setTable('guides'); | ||
$q->count(); | ||
|
||
|
||
return $this->query($q->getQuery(), $q->getData()); | ||
} | ||
|
||
public function getTipsCount() | ||
{ | ||
|
||
$q = new QueryBuilder(); | ||
|
||
$q->setTable('tips'); | ||
$q->count(); | ||
|
||
|
||
return $this->query($q->getQuery(), $q->getData()); | ||
} | ||
|
||
public function getRentComplainsCount() | ||
{ | ||
|
||
$q = new QueryBuilder(); | ||
|
||
$q->setTable('rent_return_complaints'); | ||
$q->count(); | ||
|
||
|
||
return $this->query($q->getQuery(), $q->getData()); | ||
} | ||
|
||
public function getOrdersCount() | ||
{ | ||
|
||
$q = new QueryBuilder(); | ||
|
||
$q->setTable('rent'); | ||
$q->count(); | ||
|
||
|
||
return $this->query($q->getQuery(), $q->getData()); | ||
} | ||
} |
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.