(feat)(in-progress): added modal for creation
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
require_once('Models/FacilityDataSet.php');
|
||||
require_once("Models/Paginator.php");
|
||||
// If page loads empty, set initial headers
|
||||
if(!isset($_GET['page']) || !(isset($_GET['dir'])) || !(isset($_GET['sort']))) {
|
||||
header("Location: ?sort=1&dir=asc&page=0");
|
||||
if(empty($_GET)) {
|
||||
header("Location: ?sort=1&dir=asc&category=1&term=&page=0");
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -36,9 +36,7 @@ $filterArray[$_GET['category'] ?? null] = $_GET['term'] ?? null;
|
||||
$sortArray[$_GET['sort'] ?? null] = $_GET['dir'] ?? null;
|
||||
|
||||
$facilityDataSet = new FacilityDataSet();
|
||||
if(isset($_POST['paginatorButton'])) {
|
||||
var_dump($_POST);
|
||||
}
|
||||
|
||||
if ((isset($_POST['filter']) && isset($_POST['filterCat']) && (isset($_POST['dir'])) && (isset($_POST['sort'])))) {
|
||||
$filter = filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_FULL_SPECIAL_CHARS) ?? '';
|
||||
$filterKey = filter_input(INPUT_POST, 'filterCat', FILTER_SANITIZE_FULL_SPECIAL_CHARS) ?? '';
|
||||
@@ -47,8 +45,8 @@ if ((isset($_POST['filter']) && isset($_POST['filterCat']) && (isset($_POST['dir
|
||||
$page = filter_input(INPUT_POST, 'paginationButton', FILTER_SANITIZE_NUMBER_INT) ?? 0; // Default page to 0 on new filter
|
||||
$filterArray[$filterKey] = $filter;
|
||||
$sortArray[$sortKey] = $direction;
|
||||
var_dump($filterArray);
|
||||
//redirect($filter, $filterArray, $direction, $sortArray, $page);
|
||||
var_dump($filterArray, $filterKey);
|
||||
redirect($filter, $filterArray, $direction, $sortArray, $page);
|
||||
}
|
||||
function redirect($filter, $filterArray, $direction, $sortArray, $page) : void {
|
||||
// Set the filter and generate the new URI
|
||||
@@ -72,8 +70,8 @@ function redirect($filter, $filterArray, $direction, $sortArray, $page) : void {
|
||||
exit;
|
||||
}
|
||||
|
||||
var_dump($filterArray);
|
||||
$view->pageData = $facilityDataSet->fetchAll($filterArray, $sortArray);
|
||||
var_dump($filterArray, $sortArray);
|
||||
$view->paginator = new Paginator($rowLimit, $view->pageData);
|
||||
|
||||
// Initialize paginator
|
||||
|
Reference in New Issue
Block a user