Exemple #1
0
function updateRate(&$pDB, $pACL)
{
    // get user info
    $idUser = $pACL->getIdUser($_SESSION['elastix_user']);
    //$user_name = $pACL->getUsers($idUser);
    // collect parameters
    $data = array('sabre' => trim(getParameter('sabre')), 'bsp' => trim(getParameter('bsp')), 'lion_air' => trim(getParameter('lion_air')), 'air_asia' => trim(getParameter('air_asia')), 'lao_airlines' => trim(getParameter('lao_airlines')), 'transviet' => trim(getParameter('transviet')), 'note' => trim(getParameter('note')), 'elastix_user_id' => $idUser);
    $pOverall_setting = new paloSantoOverall_setting($pDB);
    $result = $pOverall_setting->updateRate($data);
    // return json
    if (!$result) {
        $response['action'] = 'error';
        $response['message'] = 'Lỗi: ' . $pOverall_setting->errMsg;
    } else {
        $response['action'] = 'updateRate';
        $response['message'] = 'success';
    }
    $json = new Services_JSON();
    Header('Content-Type: application/json');
    return $json->encode($response);
}