-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlive.html
More file actions
125 lines (112 loc) · 3.73 KB
/
live.html
File metadata and controls
125 lines (112 loc) · 3.73 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Live Class Registration - CoreFit</title>
<style>
body {
font-family: Arial, sans-serif;
background: #0f172a;
color: white;
text-align: center;
padding: 20px;
}
h1 {
color: #facc15;
}
form {
background: #1e293b;
padding: 20px;
border-radius: 10px;
max-width: 400px;
margin: auto;
}
input, select, button {
width: 90%;
margin: 10px 0;
padding: 10px;
border-radius: 8px;
border: none;
font-size: 1em;
}
button {
background: #facc15;
color: black;
cursor: pointer;
}
#payment-section {
margin-top: 20px;
display: none;
}
#qr {
margin-top: 15px;
}
.amount {
font-size: 1.2em;
font-weight: bold;
color: #22c55e;
}
</style>
</head>
<body>
<a href="home.html" class="return-link">⬅ Back to Homepage</a>
<h1>🔥 Live Class Registration</h1>
<form id="liveForm">
<input type="text" id="name" placeholder="Full Name" required>
<input type="email" id="email" placeholder="Email" required>
<input type="tel" id="phone" placeholder="Phone Number" required>
<label for="plan">Select Plan:</label>
<select id="plan" required>
<option value="">--Choose a Plan--</option>
<option value="Basic:499">Basic - ₹499</option>
<option value="Standard:999">Standard - ₹999</option>
<option value="Premium:1499">Premium - ₹1499</option>
</select>
<input type="text" id="timing" name="timing" placeholder="Preferred Timing (e.g., 7AM - 8AM)" required>
<button type="submit">Register & Pay</button>
</form>
<div id="payment-section">
<p>You have selected the <span id="selectedPlan"></span> plan.</p>
<p class="amount">Please pay: ₹<span id="price"></span></p>
<div id="qr"></div>
</div>
<script src="https://cdn.jsdelivr.net/npm/qrcode/build/qrcode.min.js"></script>
<script>
const form = document.getElementById("liveForm");
const qrDiv = document.getElementById("qr");
const paymentSection = document.getElementById("payment-section");
const selectedPlan = document.getElementById("selectedPlan");
const priceEl = document.getElementById("price");
form.addEventListener("submit", async (e) => {
e.preventDefault();
const name = document.getElementById("name").value;
const email = document.getElementById("email").value;
const phone = document.getElementById("phone").value;
const planData = document.getElementById("plan").value;
if (!planData) {
alert("Please select a plan");
return;
}
const [plan, amount] = planData.split(":");
// Show selected plan and price
selectedPlan.textContent = plan;
priceEl.textContent = amount;
// Generate QR Code with UPI link (replace with your UPI ID)
const upiID = "9354543672@pthdfc";
const upiLink = `upi://pay?pa=${upiID}&pn=CoreFit&am=${amount}&cu=INR`;
qrDiv.innerHTML = "";
QRCode.toCanvas(document.createElement("canvas"), upiLink, (err, canvas) => {
if (!err) qrDiv.appendChild(canvas);
});
paymentSection.style.display = "block";
// Save registration details in backend
await fetch("http://localhost:5000/api/live-register", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ name, email, phone, plan, amount })
});
});
</script>
</body>
</html>