Пример #1
0
function refreshRate()
{
    global $arrConf;
    //conexion resource
    $pDB = new paloDB($arrConf['cadena_dsn']);
    $pACL = new paloACL($arrConf['elastix_dsn']['acl']);
    include_once "/var/www/html/modules/overall_setting/libs/paloSantoOverall_setting.class.php";
    $pOverall_setting = new paloSantoOverall_setting($pDB);
    $result = $pOverall_setting->getRate();
    // return json
    if (!$result) {
        $response['action'] = 'error';
        $response['message'] = 'Lỗi: ' . $pOverall_setting->errMsg;
        $json = new Services_JSON();
        Header('Content-Type: application/json');
        return $json->encode($response);
    } else {
        $user = $pACL->getUsers($result[0]['elastix_user_id']);
        //var_dump($pACL->getUsers($result[0]['elastix_user_id']));
        $result[0]['username'] = $user[0][1] . ' (' . $user[0][2] . ')';
        $result[0]['created'] = date('h:i d/m/Y', strtotime($result[0]['created']));
        $json = new Services_JSON();
        Header('Content-Type: application/json');
        return $json->encode($result[0]);
    }
}
Пример #2
0
function refreshRate($pDB, $pACL)
{
    $pOverall_setting = new paloSantoOverall_setting($pDB);
    $result = $pOverall_setting->getRate();
    // return json
    if (!$result) {
        $response['action'] = 'error';
        $response['message'] = 'Lỗi: ' . $pOverall_setting->errMsg;
        $json = new Services_JSON();
        Header('Content-Type: application/json');
        return $json->encode($response);
    } else {
        $user = $pACL->getUsers($result[0]['elastix_user_id']);
        //var_dump($pACL->getUsers($result[0]['elastix_user_id']));
        $result[0]['username'] = $user[0][1] . ' (' . $user[0][2] . ')';
        $result[0]['created'] = date('h:i d/m/Y', strtotime($result[0]['created']));
        $json = new Services_JSON();
        Header('Content-Type: application/json');
        return $json->encode($result[0]);
    }
}
Пример #3
0
function refreshNotification($pDB)
{
    $response = array('action' => 'refreshNotification', 'message' => 'Làm tươi dữ liệu thành công');
    $pOverall_setting = new paloSantoOverall_setting($pDB);
    $result = $pOverall_setting->getNotification();
    // return json
    if (!$result) {
        $response['action'] = 'error';
        $response['message'] = 'Lỗi: ' . $pOverall_setting->errMsg;
    }
    $json = new Services_JSON();
    Header('Content-Type: application/json');
    return $json->encode($result[0]);
}