-
Notifications
You must be signed in to change notification settings - Fork 3
/
script.js
36 lines (30 loc) · 1.33 KB
/
script.js
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
function generateTicket() {
const name = document.getElementById('name').value;
const branch = document.getElementById('branch').value;
const regNumber = document.getElementById('regNumber').value;
const college = document.getElementById('college').value;
const ticketContent = `
<div class="border border-gray-300 p-4 mb-4 bg-white p-4 rounded shadow-md">
<div class='flex items-center justify-between my-4'>
<img src='./images/gdsc.webp' class='w-1/12'>
<h2 class='text-2xl font-semibold'>Google Developer Student Clubs | GITAM </h2>
</div>
<div class='flex justify-between items-center'>
<div>
<h3 class="text-xl font-bold mb-2">Ticket Information</h3>
<p class="mb-2"><strong>Name:</strong> ${name}</p>
<p class="mb-2"><strong>Branch:</strong> ${branch}</p>
<p class="mb-2"><strong>Registration Number:</strong> ${regNumber}</p>
<p class="mb-2"><strong>College:</strong> ${college}</p>
</div>
<div id="qrcode"></div>
</div>
</div>
`;
document.getElementById('ticketContainer').innerHTML = ticketContent;
const qrcode = new QRCode(document.getElementById('qrcode'), {
text: `Name: ${name}\nBranch: ${branch}\nRegistration Number: ${regNumber}\nCollege: ${college}`,
width: 128,
height: 128
});
}