ok
Direktori : /proc/self/root/home2/selectio/www/thedentalpark.com/admin/apis/ |
Current File : //proc/self/root/home2/selectio/www/thedentalpark.com/admin/apis/booking_appointment.php |
<?php require_once '../config/config.php'; $id = $_POST['id'] ?? ''; $patient_name = $_POST['patient_name'] ?? ''; $patient_number1 = $_POST['patient_number1'] ?? ''; $patient_number2 = $_POST['patient_number2'] ?? ''; $address = $_POST['address'] ?? ''; $date = $_POST['date'] ?? ''; $time = $_POST['time'] ?? ''; $status = $_POST['status'] ?? ''; $reason = $_POST['reason'] ?? ''; $call_report = $_POST['call_report'] ?? ''; $doctor = $_POST['doctor'] ?? ''; if ($id) { $statement = $pdo->prepare("UPDATE tbl_appointment_booking SET patient_name=?,patient_number1=?,patient_number2=?,address=?,date=?,time=?,status=?,reason=?,call_report=?,doctor=? WHERE id=?"); $result = $statement->execute([$patient_name,$patient_number1, $patient_number2,$address,$date,$time,$status,$reason,$call_report,$doctor,$id]); if ($result) { echo json_encode(['status' => 200, 'message' => 'Appointment details updated successfully.']); } else { echo json_encode(['status' => 500, 'message' => 'Failed to update Appointment details.']); } } else { $statement = $pdo->prepare("INSERT INTO tbl_appointment_booking (patient_name, patient_number1,patient_number2,address,date,time,doctor) VALUES (?, ?, ?, ?, ?, ?,?)"); $result = $statement->execute([$patient_name,$patient_number1,$patient_number2,$address,$date,$time,$doctor]); if ($result) { echo json_encode(['status' => 200, 'message' => 'Appointment details added successfully.']); } else { echo json_encode(['status' => 500, 'message' => 'Failed to add Appointment details.']); } } ?>