-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvendors.html
101 lines (89 loc) · 2.9 KB
/
vendors.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
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
<!DOCTYPE html>
<html>
<head>
<title>Vendor List</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<style>
.body {
background-image: linear-gradient(120deg, #d4fc79 0%, #96e6a1 100%);
}
</style>
</head>
<body>
<!-- <div id="header"></div> -->
<h2 align=center>Registered Vendors</h2>
<div class="container mt-3">
<table class="table table-dark">
<thead>
<th>Sr. No.</th>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
<th>Address</th>
<th>Type</th>
</thead>
<tbody id="vendorList">
</tbody>
</table>
</div>
<!-- <div id="footer"></div> -->
<!-- <script>
$(function () {
$("#header").load("header.html");
$("#footer").load("footer.html");
});
</script> -->
</body>
<script type="module">
import {initializeApp} from "https://www.gstatic.com/firebasejs/9.18.0/firebase-app.js";
import {getFirestore, collection, onSnapshot} from "https://www.gstatic.com/firebasejs/9.18.0/firebase-firestore.js";
import {getDatabase, ref, child, get, onValue} from "https://www.gstatic.com/firebasejs/9.18.0/firebase-database.js";
var srno = 0;
const firebaseConfig = {
apiKey: "AIzaSyBBoWMteoxgPM8zaYpr2yyI4I1D0g63Ezg",
authDomain: "hacktheplan-55346.firebaseapp.com",
databaseURL: "https://hacktheplan-55346-default-rtdb.firebaseio.com",
projectId: "hacktheplan-55346",
storageBucket: "hacktheplan-55346.appspot.com",
messagingSenderId: "65660152625",
appId: "1:65660152625:web:4e6cfaf5330887de399e10",
measurementId: "G-HPTW77E8NX"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const db = getDatabase(app);
const vendorList = document.querySelector("#vendorList");
onValue(ref(db, 'vendor_db'), (snapshot) => {
vendorList.innerHTML = '';
snapshot.forEach((childSnapshot) => {
const vendor = childSnapshot.val();
const row = `
<tr>
<td>${++srno}</td>
<td>${vendor.vendor_name}</td>
<td>${vendor.vendor_email}</td>
<td>${vendor.vendor_phone}</td>
<td>${vendor.vendor_address}</td>
<td>${vendor.vendor_type}</td>
</tr>
`;
vendorList.innerHTML += row;
});
});
</script>
<!--Start of Tawk.to Script-->
<script type="text/javascript">
var Tawk_API = Tawk_API || {}, Tawk_LoadStart = new Date();
(function () {
var s1 = document.createElement("script"), s0 = document.getElementsByTagName("script")[0];
s1.async = true;
s1.src = 'https://embed.tawk.to/641f805d4247f20fefe7f8a6/1gsdgqs3v';
s1.charset = 'UTF-8';
s1.setAttribute('crossorigin', '*');
s0.parentNode.insertBefore(s1, s0);
})();
</script>
<!--End of Tawk.to Script-->
</html>