<?php require $_SERVER["DOCUMENT_ROOT"] . '/vendor/autoload.php'; use SMS\App\Modules\Authorization\Controller\AuthorizationController as Authorization; try { if (isset($_POST["stafftype"]) && isset($_POST["authid"]) && isset($_POST["password"])) { $auth = new Authorization(); switch ($_POST["stafftype"]) { case 'administrator': $stafftype = 1; break; case 'class-teacher': $stafftype = 2; break; case 'subject-teacher': $stafftype = 3; break; default: $stafftype = ""; break; } $b = $auth->validateUser($stafftype, $_POST["authid"], $_POST["password"]); if ($b) { echo json_encode(array(true, "Valid Login Data")); exit; } else { echo json_encode(array(false, "Invalid Login Data")); exit; } } else { echo json_encode(array(false, "No Data Supplied For Processing"));
<?php require $_SERVER["DOCUMENT_ROOT"] . '/vendor/autoload.php'; use SMS\App\Modules\Authorization\Controller\AuthorizationController as Authorization; $auth = new Authorization(); $b = $auth->validateUser(1, "sam", "sam"); var_dump($b);