if (IS_AJAX === true) { $result = array('success' => $operations->result['success'], 'messages' => $operations->result['message']); if ($operations->result['success'] === true) { $result['hospId'] = $operations->result['hospId']; } echo json_encode($result); die; } else { if ($operations->result['success'] === true) { header('Location: /operations/?hospId=' . $hospId); die; } } } $operations->result['surgeonsList'] = $surgeons->getList(); $operations->result['files'] = $operations->getOperationFiles($urlData['id']); } } break; case 'delete': if (!empty($request_uri[3])) { $urlData['id'] = $request_uri[3]; if (is_numeric($urlData['id'])) { $operations->delete($urlData['id']); if (IS_AJAX === true) { $result = array('success' => $operations->result['success'], 'messages' => $operations->result['message'], 'hospId' => $operations->result['hospId']); echo json_encode($result); die; } else { header('Location: /operations/?hospId=' . $operations->result['hospId']); die;