Esempio n. 1
0
require_once './php/config.php';
require_once './php/admin_config.php';
require_once './php/db_connect.php';
require_once './php/commons.php';
require_once './php/db_functions.php';
require_once './php/modes.php';
require_once './php/admin_modes.php';
require_once './php/admin_db_functions.php';
$modes = new Modes();
$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;
Esempio n. 2
0
<?php

require './php/config.php';
require './php/db_connect.php';
require './php/commons.php';
require './php/db_functions.php';
require './php/modes.php';
require_once '../swiftmailer-master/lib/swift_required.php';
require_once '../PHPMailer/class.phpmailer.php';
require_once '../PHPExcel/PHPExcel.php';
$modes = new Modes();
$db = new DBFunctions();
$commons = new Commons();
// set to UTC
$db->setMYSQLTimeZone('+05:30') or die('timezone set error');
date_default_timezone_set('Asia/Calcutta') 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;
}
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;