Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/employee' into staging
- Loading branch information
Showing
30 changed files
with
695 additions
and
284 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 |
---|---|---|
|
@@ -103,3 +103,4 @@ fabric.properties | |
/core/.env | ||
/.idea/inspectionProfiles/Project_Default.xml | ||
/node_modules/ | ||
/logs/ |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
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,57 @@ | ||
<?php | ||
|
||
namespace app\controllers\employee; | ||
|
||
use app\core\Controller; | ||
use app\core\Request; | ||
use app\models\ReportListModel; | ||
use app\stores\EmployeeStore; | ||
|
||
class EmployeeReportListController extends Controller | ||
{ | ||
const login = 'Location: /login'; | ||
|
||
private function validate(): void | ||
{ | ||
// checking whether the user is logged into the server | ||
if ($_SESSION['userType'] != 'staff') { | ||
header(self::login); | ||
} | ||
} | ||
|
||
public function load(Request $request): void | ||
{ | ||
$this->validate(); | ||
|
||
if ($request->isGet()) { | ||
if ($_SESSION['userType'] == 'staff') { | ||
$this -> render("employee/reports.php"); | ||
} else { | ||
header(self::login); | ||
} | ||
} else { | ||
header(self::login); | ||
} | ||
} | ||
|
||
public function getAllReports(): array | ||
{ | ||
$model = new ReportListModel(); | ||
// creating an array of all reports | ||
return $model->getAllReports(); | ||
} | ||
|
||
public function sortBySeen($list): array | ||
{ | ||
$seen = array(); | ||
$unseen = array(); | ||
foreach ($list as $report) { | ||
if ($report->is_employee_noticed) { | ||
$seen[] = $report; | ||
} else { | ||
$unseen[] = $report; | ||
} | ||
} | ||
return array_merge($seen, $unseen); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
Empty file.
Empty file.
Oops, something went wrong.