0, 'message' => 'ID and action are required.'])); } $qm = new QuotationManager($pdo2, $company_id); try { $qm->updateStatus($id, $action, $logging); $answer['success'] = 1; $answer['message'] = 'Status updated.'; } catch (PDOException $e) { $answer['message'] = 'Database error, please try again.'; http_response_code(500); } catch (Exception $e) { $answer['message'] = $e->getMessage(); http_response_code(400); } exit(json_encode($answer));