forked from QuikBux/quikbux.github.io
/
config.html
139 lines (116 loc) · 4.65 KB
/
config.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
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
137
138
139
<!DOCTYPE HTML>
<html>
<head>
<title>QuikBux</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!--[if lte IE 8]><script src="assets/js/html5shiv.js"></script><![endif]-->
<link rel="stylesheet" href="assets/css/main.css" />
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.scrolly.min.js"></script>
<!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
<!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
<link rel="icon" href="icons/favicon.ico" />
<noscript>
<link rel="stylesheet" href="assets/css/noscript.css" />
</noscript>
<script src="https://cdn.firebase.com/js/client/2.3.1/firebase.js"></script>
<script src="assets/js/FireAuth.js"></script>
<script src="assets/js/account.js"></script>
</head>
<body class="is-loading">
<!-- Wrapper -->
<div id="wrapper">
<!-- Main -->
<section id="main">
<h2 style="text-transform: uppercase;">Continue Sign Up Below</h2>
<p style="color: red; text-transform: uppercase;" id="error"></p>
<form>
<div class="field">
<input type="file" id="file" name="file" required/>
</div>
<div class="field">
<input type="text" id="skills" name="skills" placeholder="Skills" />
</div>
<div class="field">
<input type="text" id="city" placeholder="City" name="City" />
</div>
<div class="field">
<div class="select-wrapper">
<select style="text-transform: uppercase;" name="department" id="department">
<option value="">worker</option>
<option value="sales">client</option>
</select>
</div>
</div>
<div class="field">
<textarea required name="status" id="status" placeholder="Please tell us about yourself" rows="1"></textarea>
</div>
<button style="text-transform: uppercase;" id="done" class="button">Done</button>
</form>
<hr />
<!--Social Network Buttons-->
<footer></footer>
</section>
<!-- Footer with Copyright -->
<footer id="footer">
<ul class="copyright">
<li>© QuikBux 2015, All Rights Reserved</li>
</ul>
</footer>
</div>
<!-- Scripts -->
<!--[if lte IE 8]><script src="assets/js/respond.min.js"></script><![endif]-->
<script>
var ref = new Firebase('https://makehacks.firebaseio.com/');
var usersRef = ref.child('users');
$("#done").click(success);
var pic = "";
//converts file to base64 encoded string
var input = document.getElementById('file');
input.onchange = function() {
console.log("aeuae")
pic = $("#file")[0].files[0]
var reader = new FileReader();
reader.onload = function(readerEvt) {
var binaryString = readerEvt.target.result;
var encodedData = btoa(binaryString)
pic = 'data:image/gif;base64,' + encodedData;
};
reader.readAsBinaryString(pic);
};
function success(e) {
e.preventDefault();
var info = {
type: $("#department option:selected").text(),
city: $("#city").val(),
description: $("#status").val(),
pic: pic,
skills: $("#skills").val()
}
//verify whether the user has completed the form
if (info.description != "") {
$.each(['pic', 'type', 'description', 'city', 'skills'], function(i, value) {
console.log(value + " " + user);
usersRef.child(user).child(value).set(info[value]);
});
usersRef.child(user).child('temp').set(true);
setTimeout(function() {
window.location.href = "home.html"
}, 500);
} else {
$("#error").html("Please enter a description.");
}
}
function error() {
$("#error").html("Please enter a valid city");
}
if ('addEventListener' in window) {
window.addEventListener('load', function() {
document.body.className = document.body.className.replace(/\bis-loading\b/, '');
});
document.body.className += (navigator.userAgent.match(/(MSIE|rv:11\.0)/) ? ' is-ie' : '');
}
</script>
</body>
</html>