integrated EVERYTHING!
This commit is contained in:
@@ -1,18 +1,24 @@
|
||||
<?php
|
||||
include( $_SERVER['DOCUMENT_ROOT'] . '/logic/userLogic.php' );
|
||||
|
||||
$param = "";
|
||||
$data = "";
|
||||
$method = "";
|
||||
|
||||
isset($_GET["method"]) ? $method = $_GET["method"] : false;
|
||||
isset($_GET["param"]) ? $param = $_GET["param"] : false;
|
||||
|
||||
$logic = new UserLogic();
|
||||
$result = $logic->handleUserRequests($method, $param);
|
||||
$method =
|
||||
$result = true;
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$json = file_get_contents('php://input');
|
||||
$data = json_decode($json, true);
|
||||
$result = $logic->handleUserRequests($method, $data);
|
||||
}
|
||||
|
||||
|
||||
if ($result == null) {
|
||||
response("GET", 400, null);
|
||||
response('POST', 400, $result);
|
||||
} else {
|
||||
response("GET", 200, $result);
|
||||
response('POST', 200, $result);
|
||||
}
|
||||
|
||||
function response($method, $status, $data)
|
||||
|
||||
Reference in New Issue
Block a user