feat: استيراد كود سيرو إلى تريبز (سيرو @ecfe7568) — بلا تعديل
قرار المالك 2026-07-27: باك إند سيرو PHP هو المعتمد، وتطبيقاته المجرّبة ميدانياً تحل محل إعادة البناء المؤرشفة. سيرو نفسه لم يُمسّ. الخريطة: backend · payment_server · loction_server · ride_server · passenger_server · docker · dashboard · stress_test → الجذر siro_rider → apps/rider siro_driver → apps/driver siro_admin → dashboards/admin siro_service → dashboards/service android_bot → apps/android_bot socialBot → apps/socialBot نُسخ المتعقَّب في git سيرو فقط عبر `git archive` (3,198 ملفاً / ~169 م.ب) لا `cp -r` — فاستُثنيت مخلفات البناء تلقائياً. بلا أي تعديل محتوى عمداً: كل ما يلي يصير فرقاً مقروءاً مقابل المصدر. لم يُستورد وسببه: siromove.com (الموقع التسويقي يبقى marketing/ في تريبز، سيرو فيه 8 ملفات) · docs و planning (تريبز له docs/ الخاص) · deploy.sh (ليس نشراً على سيرفر بل `git add . && git push origin --all` — فخّ في مستودع آخر) · transit_dashboard (بانتظار قرار مصير backend-transit و dashboards/transit-web). ⚠️ لا يبني بعد — ثلاثة نواقص متوقعة ومقصودة: 1. `.env` و `lib/env/env.g.dart` غير متعقَّبين في سيرو (أسرار لكل مستأجر): كل تطبيق فلاتر يحتاج .env خاصاً ثم توليد env.g.dart بـ build_runner. 2. إعدادات Firebase (9 ملفات google-services.json و GoogleService-Info.plist) يستبعدها .gitignore تريبز — ولكل مستأجر مشروع Firebase خاص أصلاً. 3. apps/driver في سيرو يشير إلى `../../Intaleq/packages/get` خارج المستودع → يجب ضمّ الحزم داخله أسوة بـ apps/rider. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
9909d9b4c1
commit
4d8414c96b
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
||||
// الاتصال بقاعدة البيانات والدوال المشتركة
|
||||
require_once __DIR__ . '/../../connect.php';
|
||||
|
||||
// تضمين autoload من Composer (مجلد vendor في الجذر)
|
||||
require_once __DIR__ . '/../../../vendor/autoload.php';
|
||||
|
||||
// استقبال البيانات من الطلب
|
||||
$passengerName = filterRequest("name");
|
||||
$passengerEmail = filterRequest("email");
|
||||
$passengerPhone = filterRequest("phone");
|
||||
$fee = floatval(filterRequest("fee"));
|
||||
$startLocation = filterRequest("startLocation");
|
||||
$endLocation = filterRequest("endLocation");
|
||||
$startNameLocation = filterRequest("startNameLocation");
|
||||
$endNameLocation = filterRequest("endNameLocation");
|
||||
$timeOfTrip = filterRequest("timeOfTrip");
|
||||
$duration = intval(filterRequest("duration"));
|
||||
$duration = floor($duration / 60); // تحويل للـ minutes
|
||||
|
||||
// حساب الخصم
|
||||
$discount = 0;
|
||||
if ($startNameLocation && $endNameLocation) {
|
||||
$discount = $fee * 0.12;
|
||||
$beforDiscount = $fee;
|
||||
$fee -= $discount;
|
||||
}
|
||||
|
||||
// بناء الإيميل
|
||||
$bodyEmail = "
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
body { font-family: 'Arial', sans-serif; background-color: #f8f9fa; color: #333; line-height: 1.6; }
|
||||
table { border-collapse: collapse; width: 100%; background-color: white; margin: 20px 0; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
|
||||
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; }
|
||||
th { background-color: #007bff; color: white; }
|
||||
tr:nth-child(even) { background-color: #f2f2f2; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<img src='https://siromove.com/assets/logo.png' alt='Siro Logo' style='width: 150px; margin: 20px auto; display: block;'>
|
||||
<p>Hi $passengerName,</p>
|
||||
<p>Thank you for booking your ride with <strong>Tripz</strong>. Here are the details of your recent trip:</p>
|
||||
<table>
|
||||
<tr><th>Detail</th><th>Value</th></tr>
|
||||
<tr><td>Passenger</td><td>$passengerName</td></tr>
|
||||
<tr><td>Email</td><td>$passengerEmail</td></tr>
|
||||
<tr><td>Phone</td><td>$passengerPhone</td></tr>
|
||||
<tr><td>Fee</td><td>$$fee</td></tr>
|
||||
<tr><td>Start Location</td><td>$startLocation ($startNameLocation)</td></tr>
|
||||
<tr><td>End Location</td><td>$endLocation ($endNameLocation)</td></tr>
|
||||
<tr><td>Time of Trip</td><td>$timeOfTrip</td></tr>
|
||||
<tr><td>Duration</td><td>$duration minutes</td></tr>
|
||||
</table>";
|
||||
|
||||
if ($discount > 0) {
|
||||
$bodyEmail .= "<p>You have received a 12% discount on your trip from $startNameLocation to $endNameLocation. The original fee was $$beforDiscount. Your discounted fee is $$fee.</p>";
|
||||
}
|
||||
|
||||
$bodyEmail .= "<p>Thank you for using <strong>Tripz</strong>. We hope you have a great day!</p><p>Best regards,<br>Tripz Team</p></body></html>";
|
||||
|
||||
// إعداد البريد
|
||||
$mail = new PHPMailer(true);
|
||||
|
||||
try {
|
||||
$mail->isSMTP();
|
||||
$mail->Host = 'smtp.hostinger.com';
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->Username = getenv('MAIL_USERNAME') ?: 'noreply@siromove.com';
|
||||
$mail->Password = getenv('MAIL_PASSWORD') ?: '';
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||
$mail->Port = 587;
|
||||
|
||||
$mail->setFrom(getenv('MAIL_FROM_ADDRESS') ?: 'noreply@siromove.com', getenv('MAIL_FROM_NAME') ?: 'Siro');
|
||||
$mail->addAddress($passengerEmail, $passengerName);
|
||||
$mail->isHTML(true);
|
||||
$mail->Subject = 'Your Tripz Trip Details';
|
||||
$mail->Body = $bodyEmail;
|
||||
|
||||
$mail->send();
|
||||
echo json_encode(["status" => "success", "message" => "Email sent successfully"]);
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(["status" => "error", "message" => $mail->ErrorInfo]);
|
||||
}
|
||||
Reference in New Issue
Block a user