Example #1
0
function updateNotification(&$pDB)
{
    // collect parameters
    $sMessage = trim(getParameter('message'));
    $sIsActive = trim(getParameter('isActive'));
    $response = array('action' => 'updateNotification', 'message' => 'Cập nhật thông báo thành công');
    $pOverall_setting = new paloSantoOverall_setting($pDB);
    $result = $pOverall_setting->updateNotification($sMessage, $sIsActive);
    // 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);
}