Files
Hamza-AyedandClaude Opus 5 92dc6b3641 chore: استيراد أولي من سيرو (ecfe7568) — بلا أي تعديل
نسخة كاملة من مستودع سيرو عند ecfe7568 لتكون أساس تطبيق «انطلق».
نُسخ المتعقَّب في git فقط (12,509 ملفاً / 302 م.ب) بـ git archive، لا
`cp -r` — فاستُثنيت تلقائياً مخلفات البناء (build · node_modules ·
.dart_tool · .gradle · Pods ≈ 10.7 غ.ب) وكل ما يستثنيه .gitignore.

هذا الكوميت **بلا أي تعديل عمداً** حتى يكون كل ما يليه فرقاً مقروءاً
مقابل سيرو الأصلي. سيرو نفسه لم يُمسّ.

⚠️ لا يبني بعد: `.env` و`lib/env/env.g.dart` غير متعقَّبين في سيرو (وهذا
صحيح — أسرار لكل مستأجر). كل تطبيق فلاتر هنا يحتاج .env خاصاً بانطلق ثم
توليد env.g.dart عبر build_runner. لا تُنسخ أسرار سيرو.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 05:10:29 +03:00

41 lines
1.1 KiB
PHP

<?php
require_once __DIR__ . '/../../connect.php';
// Fetch the input data
$id = filterRequest("id"); // Trip ID to identify the trip
$status = "cancelled"; // New status
// Check if the trip ID is provided
if (empty($id)) {
jsonError("Trip ID is missing.");
exit;
}
// Update the status of the trip to "cancelled"
$sql = "
UPDATE `mishwaritrips`
SET `status` = :status
WHERE `id` = :id AND `status` != 'cancelled'
";
$stmt = $con->prepare($sql);
$stmt->bindParam(':status', $status, PDO::PARAM_STR);
$stmt->bindParam(':id', $id, PDO::PARAM_INT); // Bind the ID parameter
// Execute the update
if ($stmt->execute()) {
// Check if the update was successful
if ($stmt->rowCount() > 0) {
// Trip status updated successfully
jsonSuccess(null, "Trip cancelled successfully.");
} else {
// No rows updated, meaning the trip might not have been found or was already cancelled
jsonError("No trip found to cancel.");
}
} else {
// Print failure if the update query failed
$errorInfo = $stmt->errorInfo();
error_log('SQL Error: ' . implode(", ", $errorInfo));
jsonError("Failed to cancel the trip.");
}
?>