-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.php
351 lines (296 loc) · 11.2 KB
/
index.php
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
<?php
if(isset($_SESSION['id']))
{
header("Location: home");
}
if(isset($_COOKIE['A']) && isset($_COOKIE['B']))
{
include('php/db.php');
include('php/class.php');
$q->cookie_login($_COOKIE['A'],$_COOKIE['B']);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="Sandeep Acharya">
<link rel="icon" href="img/favicon.ico">
<title>timeBranch | Make new Friends | Make it large | Make in INDIA</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/cover.css" rel="stylesheet">
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<script src="../../assets/js/ie-emulation-modes-warning.js"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
#btn-env:hover {
color: #10ad9d;
}
#btn-env {
color: #0bb320;
}
</style>
</head>
<body onload="load();">
<div class="modal fade" id="notice" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h3 class="modal-title" id="myModalLabel" style="color: rgb(172, 19, 19);">IMPORTANT THINGS NEED TO KNOW</h3>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<h4 class="alert alert-danger">
You can not change your primary email after signing up. So please provide a working email id of you.
</h4>
<h4 class="alert alert-info">
It is our request to you to provide <b>your name </b>correctly and check it before submitting.<br>
Remember you never can change your name after this signing up process as it is your identity.
</h4>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-warning" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="site-wrapper">
<div class="site-wrapper-inner">
<div class="cover-container">
<div class="masthead clearfix">
<div class="inner">
<h3 class="masthead-brand"><a href="index" style="color: #ffffff;">timeBranch</a></h3>
<nav>
<ul class="nav masthead-nav">
<li onclick="signup();" id="btnsign"><a>Sign Up</a></li>
<li onclick="login();" id="btnlog"><a>Log In</a></li>
<li onclick="about();" id="btnabout"><a>About Us</a></li>
</ul>
</nav>
</div>
</div>
<div class="inner cover bar" id="signup" style="font-size: larger;">
<div id="success"></div>
<img src="img/loader.gif" id="loader" height="25%" style="position: fixed;margin: 0 auto;z-index: 400;">
<form class="form-horizontal" method="post" action="php/signup.php" id="sign_up_form">
<br>
<h1 class="cover-heading">Create Account
</h1>
<div class="form-group">
<div class="col-sm-12">
<input type="email" onblur="check_email();" autocomplete="off" class="form-control" value="<?php if(isset($_POST['signupEmail'])) echo $_POST['signupEmail']; ?>" id="signupEmail" name="signupEmail" placeholder=" Type your working Email..." required>
<span id="email-info"></span>
</div>
</div>
<div class="form-group">
<div class="col-sm-4">
<input type="text" class="form-control" autocomplete="off" id="firstname" value="<?php if(isset($_POST['firstname'])) echo $_POST['firstname']; ?>" name="firstname" placeholder=" First Name" required>
</div>
<div class="col-sm-4">
<input type="text" class="form-control" autocomplete="off" id="middlename" value="<?php if(isset($_POST['middlename'])) echo $_POST['middlename']; ?>" name="middlename" placeholder=" Middle Name">
</div>
<div class="col-sm-4">
<input type="text" class="form-control" autocomplete="off" id="lastname" value="<?php if(isset($_POST['lastname'])) echo $_POST['lastname']; ?>" name="lastname" placeholder=" Last Name">
</div>
</div>
<div class="form-group">
<label for="inputSex" class="col-sm-2 control-label">I am</label>
<div class="col-sm-4">
<label class="radio-inline">
<input type="radio" name="sex" id="sex1" value="male" required> <b>Boy</b>
</label>
<label class="radio-inline">
<input type="radio" name="sex" id="sex2" value="female" checked="checked" required> <b>Girl</b>
</label>
</div>
</div>
<div class="form-group">
<div class="col-sm-6">
<input type="password" class="form-control" id="password1" name="password" placeholder="Password" required>
</div>
<div class="col-sm-6">
<input type="password" class="form-control" id="password2" placeholder="Confirm Password" required>
</div>
<span id="password-info"></span>
</div>
<button type="submit" class="btn btn-primary" value="Sign Up" id="signUpBtn" data-toggle="tooltip" data-placement="left" title="Click here to sign up"><span class="glyphicon glyphicon-plus"></span> Sign Up </button>
</form>
<br>
<span data-toggle="modal" data-target="#notice" type="button" style="cursor: pointer;" id="btn-env">Read Rules </span>
</div>
<div class="inner cover bar" id="login" style="font-size: larger">
<br>
<h1 class="cover-heading">Sign In</h1>
<form class="form-horizontal" method="post" id="login_form">
<div class="form-group">
<div class="col-sm-12">
<input type="email" class="form-control" autocomplete="off" id="loginEmail" name="loginEmail" placeholder="Email that you have used in the sign up process.." required>
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<input type="password" class="form-control" id="loginPassword" name="loginPassword" placeholder="Password" required>
</div>
<span id="pass_err"></span>
</div>
<div class="form-group">
<div class="col-sm-12">
<div class="checkbox">
<label>
<input type="checkbox" name="special_key"> Keep me logged in
</label>
</div>
</div>
</div>
<button type="submit" id="loginBtn" class="btn btn-primary" value="Log in">Log in <span class="glyphicon glyphicon-user"></span></button>
<br>
</form>
<br>
</div>
<div class="inner cover bar" id="about" style="font-size: larger">
<br>
<h1 class="cover-heading">About timeBranch</h1>
<h3>Tired of using FB?</h3>
<p class="text-primary">timeBranch is a new social networking system for INDIA. Switch to new timeBranch and Explore is awesome new features. Be a part of Revolution.
<h2>Make In India | Make it Large.</h2>
<h4>This site is not for everyone, this is for each of one.</h4>
<br>
</p>
</div>
<div class="mastfoot">
<div class="inner">
<p>Made with lots of <img src="img/love.png" width="9%"> in INDIA, Make In India by <a href="https://twitter.com/sandeepemon" target="_blank">@sandeepemon</a>.</p>
</div>
</div>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script>
var loader = $('#loader');
loader.hide();
var signupdiv = $('#signup');
var logindiv = $('#login');
var aboutdiv = $('#about');
function signup() {
logindiv.hide();
aboutdiv.hide();
signupdiv.slideToggle("slow");
$('#btnsign').addClass("active");
$('#btnabout').removeClass('active');
$('#btnlog').removeClass("active");
}
function login() {
signupdiv.hide();
aboutdiv.hide();
logindiv.slideToggle("slow");
$('#btnlog').addClass("active");
$('#btnabout').removeClass('active');
$('#btnsign').removeClass("active");
}
function about() {
logindiv.hide();
signupdiv.hide();
aboutdiv.slideToggle("slow");
$('#btnsign').removeClass("active");
$('#btnlog').removeClass("active");
$('#btnabout').addClass('active');
}
function load() {
logindiv.hide();
aboutdiv.hide();
$('#btnsign').addClass("active");
}
function check_email() {
$('#email-info').html('Loading...');
var email = $('#signupEmail').val();
email = $.trim(email);
if (email == '') {
$('#email-info').html('<span class="bg-info" style="color:black; padding:3px;">Please provide your email id</span>');
return false;
} else {
$.post('php/email_check.php', {
'signupEmail': email
}, function(data) {
$('#email-info').html(data);
});
return true;
}
}
$('#signUpBtn').click(function() {
check_email();
var p = $('#password1').val();
var cp = $('#password2').val();
if (p == '' || cp == '') {
$('#password-info').html('Please provide a password');
} else {
if (p == cp && check_email()) {
//sing up
loader.show();
var d = $('#sign_up_form').serialize();
$.ajax({
url: "php/signup.php",
method: "POST",
data: d,
success: function(data) {
$('#sign_up_form').hide();
$('#success').show();
$('#success').html('<h1 style="color:#78ffee;">' + data + '</h1>');
},
error: function() {
alert('There is some problem we are facing.');
},
complete: function() {
loader.hide();
}
});
} else {
$('#password-info').html('<b>Password did not matched. Please try again.</b>');
}
}
return false;
});
$('#loginBtn').click(function() {
var logdata = $('#login_form').serialize();
$.ajax({
url: 'php/login.php',
method: "post",
data: logdata,
success: function(data) {
$('#pass_err').html(data);
},
error: function() {
alert('There is some problem we are facing.');
},
complete: function() {}
});
return false;
});
$(function() {
$('[data-toggle="tooltip"]').tooltip();
});
$(function() {
$('[data-toggle="popover"]').popover();
});
</script>
</body>
</html>