-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
144 lines (133 loc) · 3.87 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
<?php
include 'connect/connect.php';
if(!isset($_SESSION["email"])){
echo "";
} else{
echo "<meta http-equiv=\"refresh\" content=\"0; url=http://areal.x10host.com/home.php\">";
}
?>
<div class="w3-container w3-content" style="max-width:1400px;margin-top:80px">
<div class="w3-third w3-container" id="iconers">
<br>
<div class="w3-container w3-padding-0">
<center><h3>A place to hangout with your friends and get in touch with new ones.</h3></center>
</div>
<br><br>
<div class="w3-container w3-row-padding">
<center>
<i class="material-icons">swap_vert</i>
<h4> Stay up to date with your friends </h4>
<i>using our Infotainment</i>
</center>
</div>
<br><br>
<div class="w3-container w3-row-padding">
<center>
<i class="material-icons">flight_takeoff</i>
<h4> Share places and moments on the go </h4>
<i>using our Pic-N-Share</i>
</center>
</div>
<br><br>
<div class="w3-container w3-row-padding">
<center>
<i class="material-icons">explore</i>
<h4> Explore more surprises inside</h4>
<i>Join us</i>
</center>
</div>
</div>
<div class="w3-third">
<div class="w3-container">
</div>
</div>
<div class="w3-third">
<br><br><br>
<div class="w3-container w3-blue">
<h2>Login</h2>
</div>
<form id="submitForm" class="w3-container w3-card-4">
<div class="w3-group">
<label class="w3-label w3-text-blue">Email</label>
<input class="w3-input w3-border" type="text" id="email" name="email" required>
</div>
<div class="w3-group">
<label class="w3-label w3-text-blue">Password</label>
<input class="w3-input w3-border" type="password" name="password" id="password" required>
</div>
<br>
<div class="w3-row">
<div class="w3-third">
<button id="loginButton" name="loginButton" class="w3-btn-block w3-teal">Login</button>
</div>
<div class="w3-third">
<div class="w3-container">
</div>
</div>
<div class="w3-third">
<button id="registerButton" name="registerButton" class="w3-btn-block w3-light-green"> Register </button>
</div>
</div>
<br>
</form>
</div>
</div>
<br><br>
<footer class="w3-container w3-leftbar w3-border-teal w3-theme-d3 w3-padding-hor-16">
<p>AREAL - Created By Sravan Kumar and Suresh Padmanabhan</p>
</footer>
<script>
$("#registerButton").click(function(){
window.open("register.php","_self");
});
$("#loginButton").click(function(){
var email = $("#email").val();
var password = $("#password").val();
console.log(email);
$("form").unbind().submit(function(e){
e.preventDefault();
$.ajax({
url: "connect/getContent.php",
type: "POST",
cache: false,
dataType: 'json',
data: {
email: email,
password: password
},
success: function(data){
if(data["result"] == "matched!"){
$("form").trigger("reset");
console.log(data["email"]);
$.ajax({
url: "connect/getSession.php",
type: "POST",
cache: false,
data: {
email: data["email"]
},
success: function(){
window.open("home.php", "_self"); }
});
}
},
error: function(data){
console.log("Failed");
}
});
});
});
</script>
<script type="text/javascript">
function openNav() {
var x = document.getElementById("navDemo");
if (x.className.indexOf("w3-show") == -1) {
x.className += " w3-show";
} else {
x.className = x.className.replace(" w3-show", "");
}
}
</script>
</body>
</html>