-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheBae.html
More file actions
136 lines (117 loc) · 4.41 KB
/
Copy patheBae.html
File metadata and controls
136 lines (117 loc) · 4.41 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
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE html>
<html>
<link rel="stylesheet" href="eBae.css">
<head>
<style media="screen">
<nav class="navbar navbar-expand-lg navbar-light fixed-top py-3" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="#page-top">eBae</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto my-2 my-lg-0">
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="login.html">Login</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#contact">Sign in</a>
</li>
</ul>
</div>
</div>
</nav>
</style>
</head>
<nav class="navbar navbar-expand-lg navbar-light fixed-top py-3" id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="#page-top">eBae</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto my-2 my-lg-0">
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="login.html">Login</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#contact">Sign in</a>
</li>
</ul>
</div>
</div>
</nav>
<body>
<table id = 'table1' align="center">
<thead id = 'Category'>
<h2 align="center">Event Selection</h2>
</thead>
<tr id = 'row'>
<td><h4>Event</h4></td>
<td><h4>Engage in Event</h4></td>
</tr>
</table>
<p id = 'numItems'></p>
</body>
<script>
console.log('hi');
</script>
<script src="https://www.gstatic.com/firebasejs/5.8.5/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "AIzaSyB53tt3mrTkPnBuP4NWQiy5ynKjXxlmxW0",
authDomain: "ebae-adb6d.firebaseapp.com",
databaseURL: "https://ebae-adb6d.firebaseio.com",
projectId: "ebae-adb6d",
storageBucket: "",
messagingSenderId: "860609061345"
};
firebase.initializeApp(config);
//create database
var database = firebase.database();
//console.log("hello");
//update users
function addNewUser(uid, username, tag, body) {
// A post entry.
var postData = {
club: username,
user: uid,
tagLine: tag,
info: body
};
// Get a key for a new Post.
var newPostKey = firebase.database().ref().child('posts').push().key;
// Write the new post's data simultaneously in the posts list and the user's post list.
var updates = {};
//updates['/posts/' + newPostKey] = postData;
updates['/user-posts/' + uid + '/' + newPostKey] = postData;
return firebase.database().ref().update(updates);
}
//update events
function addNewEvent(uid, eid, eventName, location, body) {
//uid -> user id
//eid -> event id
// A post entry.
var postDataE = {
event: eventName,
user: uid,
eventID: eid,
location: location,
info: body
};
// Get a key for a new Post.
var newPostKey = firebase.database().ref().child('posts').push().key;
// Write the new post's data simultaneously in the posts list and the user's post list.
var updates = {};
//updates['/posts/' + newPostKey] = postData;
updates['/user-posts/' + uid + '/events/' + eid + '/' + newPostKey] = postDataE;
return firebase.database().ref().update(updates);
}
//add a new club: Red Cross
//addNewUser(123, "Red Cross", "Advocates for Humanitarian Aid", "We encourage everyone to donate to us or volunteer with us to promote humanitarian aid in the world!");
//add a new event for Red Cross
//addNewEvent(123, 1, "Fundraiser for a Hurriacane", "Caltech", "Please donate to help people affected by devestating hurricanes. Check out our pre-order page for more ways you can help us and donate.")
</script>
<script src = 'eBae.js'></script>
</html>