-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
54 lines (48 loc) · 1.78 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Pre Order - Uranus</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<div class="flex flex-col items-center justify-center h-screen gap-4 bg-gray-100">
<div class="w-24 h-24 border-t-4 border-blue-500 rounded-full animate-spin"></div>
Sahifa yuklanmoqda, kuting...
</div>
<script>
// Set the hidden inputs with the full name and phone number from the URL
let full_name = new URLSearchParams(window.location.search).get('full_name');
let phone = new URLSearchParams(window.location.search).get('phone');
if (!full_name || !phone) {
alert("Forma ma'lumotlarini qayta tekshiring!");
}
function sendRequest() {
fetch("https://mercuryedu.uz/api/pre-order", {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
full_name: full_name,
phone: phone,
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
window.location.href = data.message; // Redirect to payment gateway URL
}
})
.catch(error => console.error('Error:', error));
}
// Send the request every 3 seconds
if (full_name && phone) {
sendRequest();
const intervalId = setInterval(sendRequest, 3000);
}
</script>
</body>
</html>