Repository navigation
Expand file tree
/
Copy pathcheckOut.html
More file actions
102 lines (82 loc) · 3.35 KB
/
Copy pathcheckOut.html
File metadata and controls
102 lines (82 loc) · 3.35 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by TEMPLATED
http://templated.co
Released for free under the Creative Commons Attribution License
Name : PlainLeaf
Description: A two-column, fixed-width design with dark color scheme.
Version : 1.0
Released : 20130902
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="https://www.gstatic.com/firebasejs/5.0.4/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.0.4/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.0.4/firebase-database.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.0.4/firebase-firestore.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.0.4/firebase-messaging.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.0.4/firebase-functions.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "AIzaSyCZnmgHZG4SgzgdhR8mvXPyMiYwgNJfG_Q",
authDomain: "lostfound-b80fc.firebaseapp.com",
databaseURL: "https://lostfound-b80fc.firebaseio.com",
projectId: "lostfound-b80fc",
storageBucket: "lostfound-b80fc.appspot.com",
messagingSenderId: "919579258670"
};
firebase.initializeApp(config);
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Interapt Lost and Found App 😄</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900" rel="stylesheet" />
<link href="default.css" rel="stylesheet" type="text/css" media="all" />
<link href="fonts.css" rel="stylesheet" type="text/css" media="all" />
<!--[if IE 6]><link href="default_ie6.css" rel="stylesheet" type="text/css" /><![endif]-->
</head>
<body>
<div id="header" class="container">
<div id="logo">
<h1>Lost and Founds</h1>
</div>
<div id="menu">
<ul>
<li><a href="index.html" accesskey="1" title="">Homepage</a></li>
<li class="active" ><a href="#" accesskey="2" title="">Check Out Item</a></li>
<li><a href="checkIn.html" accesskey="4" title="">Check In Item</a></li>
<li><a href="addItemCss.html" accesskey="5" title="">Create New Item</a></li>
</ul>
</div>
<!--Content for the page goes here-->
<p height=100> </p>
<h2>Check Out Item </h2>
<select id = "position">
<script>
//Get the resources that have been stored
let resourceRef = firebase.database().ref("resources");
//use the once function to get all data from the Firebase
resourceRef.once('value', function(snapshot) {
//Loop through each unique "child" of the data
snapshot.forEach(function(childSnapshot) {
var childKey = childSnapshot.key;
var childData = childSnapshot.val();
//display name of resource only if qty > 0
if( childData.qty > 0) {
//document.write(childData.name + "<br>");
document.getElementById("position").innerHTML += "<option>" + childData.name + "</option>";
}
});
});
</script></select>
<!--End page content-->
</div>
<div id="copyright" class="container">
<p>© Untitled. All rights reserved. | Photos by <a href="http://fotogrph.com/">Fotogrph</a> | Design by <a href="http://templated.co" rel="nofollow">TEMPLATED</a>.</p>
</div>
</body>
<script src= "firebaseExample.js"></script>
</html>