gpt-4.1-mini-2025-04-14· OpenAI
WildChat-4.8M (AI2)
صفحة تتبع الطلبات
- User
صفحة تتبع الطلبات
- Assistant
صفحة تتبع الطلبات
بالطبع! فيما يلي مثال بسيط لصفحة تتبع الطلبات باستخدام HTML وCSS مع بعض JavaScript البسيط لتوضيح كيفية إدخال رقم الطلب وعرض حالة الطلب:
<!DOCTYPE html>
<html lang="ar">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>صفحة تتبع الطلبات</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f6f8;
padding: 20px;
text-align: center;
direction: rtl;
}
h1 {
color: #333;
}
label {
font-size: 1.1em;
}
input[type="text"] {
padding: 10px;
font-size: 1em;
width: 250px;
margin: 10px 0;
border: 1px solid #ccc;
border-radius: 4px;
text-align: center;
}
button {
padding: 10px 20px;
font-size: 1em;
color: white;
background-color: #007bff;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
#result {
margin-top: 20px;
font-size: 1.2em;
color: #555;
min-height: 40px;
}
.status {
font-weight: bold;
color: green;
}
.not-found {
color: red;
}
</style>
</head>
<body>
<h1>تتبع الطلبات</h1>
<label for="orderNumber">أدخل رقم الطلب:</label><br />
<input type="text" id="orderNumber" placeholder="مثلاً 12345" />
<br />
<button onclick="trackOrder()">تتبع</button>
<div id="result"></div>
<script>
// مثال بيانات الطلبات (في الواقع يتم جلبها من الخادم)
const orders = {
"12345": "جاري تجهيز الطلب",
"98765": "تم الشحن والتوصيل قريباً",
"55555": "تم التوصيل بنجاح",
"11111": "تم إلغاء الطلب"
};
function trackOrder() {
const orderNum = document.getElementById("orderNumber").value.trim();
const resultDiv = document.getElementById("result");
if (orderNum === "") {
resultDiv.innerHTML = "<span class='not-found'>يرجى إدخال رقم الطلب.</span>";
return;
}
if (orders.hasOwnProperty(orderNum)) {
const status = orders[orderNum];
resultDiv.innerHTML = `حالة الطلب رقم <strong>${orderNum}</strong>: <span class="status">${status}</span>`;
} else {
resultDiv.innerHTML = `<span class='not-found'>عذراً، رقم الطلب غير موجود.</span>`;
}
}
</script>
</body>
</html>
orders.يمكنك تطوير هذا النموذج ليتصل بقاعدة بيانات أو API حقيقي لجلب حالة الطلب الحقيقية. إذا أردت مساعدة في ذلك، أخبرني!
Not yet included in a published release.