35 lines
786 B
PHP
35 lines
786 B
PHP
<?php
|
|
session_start();
|
|
include "functions.php";
|
|
require_once "include_login.php";
|
|
include "config.php";
|
|
include "include/module.php";
|
|
|
|
|
|
$className = null;
|
|
$methodData = Ajax::getMethodData();
|
|
|
|
$methodName = array_get($methodData, "methodName");
|
|
$type = array_get($methodData, "type");
|
|
|
|
if (isset($methodName) && isset($type)) {
|
|
$data = explode("/", $methodName);
|
|
|
|
$className = ucfirst(camelCaseEncode($data[0]));
|
|
$newMethodName = $data[1];
|
|
|
|
$var = $type === "GET" ? $_GET : $_POST;
|
|
|
|
$methodValue = $var[$methodName];
|
|
unset($var[$methodName]);
|
|
$var = array_merge(array($newMethodName => $methodValue), $var);
|
|
|
|
if ($type == "GET") {
|
|
$_GET = $var;
|
|
} else {
|
|
$_POST = $var;
|
|
}
|
|
}
|
|
|
|
(new Ajax("\Api\\" . $className))->checkAjaxRequests();
|