/** *{tablename,unit_id,key,value of key} * this function call update function in units library and change value of a field **/ private function update($unit_id, $key, $value = '') { $res = wpl_units::update($unit_id, $key, $value); $res = (int) $res; $message = $res ? __('Operation was successful.', WPL_TEXTDOMAIN) : __('Error Occured.', WPL_TEXTDOMAIN); $data = NULL; $response = array('success' => $res, 'message' => $message, 'data' => $data); echo json_encode($response); exit; }