Exemple #1
0
$db = new DBFunctions();
$admin_modes = new AdminModes();
$admin_db = new AdminDBFunctions();
$commons = new Commons();
// set to UTC
$db->setMYSQLTimeZone('+08:00');
date_default_timezone_set('Australia/Perth') or die('timezone error');
// no echo / print_r / var_dump
$response = array();
$response[KEY_STATUS] = R_STATUS_FAILED;
if (SETTING_ERROR) {
    $response[KEY_ERROR_CODE] = E_UNKNOWN;
    $response[KEY_ERROR_MESSAGE] = EM_UNKNOWN;
}
foreach ($_REQUEST as $key => $value) {
    $_REQUEST[$key] = $commons->clean($value);
}
if (!isset($_REQUEST[KEY_MODE])) {
    $response[KEY_STATUS] = R_STATUS_FAILED;
    if (SETTING_ERROR) {
        $response[KEY_ERROR_CODE] = E_INSUFFICIENT_PARAMS;
        $response[KEY_ERROR_MESSAGE] = EM_INSUFFICIENT_PARAMS;
    }
    echo json_encode($response);
    exit;
}
switch ($_REQUEST[KEY_MODE]) {
    case M_INIT:
        if (!isset($_REQUEST[P_PLATFORM_CODE])) {
            break;
        }