-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
289 lines (243 loc) · 10.4 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
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/resp.css">
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script> -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="main-container">
<div class="inner-container">
<!--<div class="row" style="margin:0;">-->
<div class="img-div left-side">
<div class="logo1">
<p><span><img src="image/ak.png"></span>ARFEEN KHAN</p>
</div>
<div class="main-text">
<p class="main-heading">Help us know you better</p>
<p class="explanation">Sign up and fill a quick questionnaire to help us understand you
better, so we can provide best possible opportunities to you!</p>
</div>
<div class="start-button login_button" data-toggle="modal" data-target="#myModal" style="">LOGIN</div>
</div>
<div class="modal fade" id="myModal" role="dialog" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog abcd">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header" style="background:#fff; margin:0; padding:0;border-bottom:none;">
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<div class="login-sec">
<div class="login">
<p>LOGIN</p>
</div>
<div class="id-pass">
<input type="text" id="username" name="username" placeholder="Username" class="username" required="">
<input type="password" id="password1" name="password" placeholder="Password" class="username" required="">
<div class="agree" style="margin-bottom: 3%;"><span class="sub-button" id="submit" >SUBMIT</span></div>
<div class="error" id="ack"></div>
<!--<div class="error"></div>-->
<!--<label class="comment">-->
<!-- <input class="check" type="checkbox" checked="checked" name="remember">keep me signed in-->
<!--</label>-->
<!--<div class="forgot" data-toggle="modal" data-target="#myModal"> Forgot Password </div> -->
</div>
</div>
</div>
</div>
</div>
</div>
<div class="img-div right-side">
<div class="inner-section">
<p class="title">let's begin</p>
<form action="insertdb.php" method="post" name="registeruser">
<input type="hidden" id="emailf" value="0" />
<input type="hidden" id="passwordf" value="0" />
<div class="input-sections">
<input class="user name" id="name" type="text" name="name" placeholder="Name">
<input class="user phone" id="phone" type="text" name="phone" placeholder="Contact Number">
<input class="user" id="email" type="text" name="email" placeholder="Email ID">
<span id="error" style="display:none;color:red">Email already Registered Try Another!</span>
<input class="user message" id="password" type="password" name="password" placeholder="Password">
<input class="user message" id="confirm_password" type="password" name="cpassword" placeholder="Confirm Password">
<input class="user" id="dob" type="text" onfocus="(this.type='date')" name="dob" placeholder="Date of birth.">
</div>
<div class="radio-section">
<div class="first">
<p>Marital Status</p>
<div class="adjust">
<p><input class="red" type="radio" name="mstatus" id="married" value="Married" onclick="func(this.id)">
<label for="Married">Married</label>
</p>
<p><input type="radio" name="mstatus" value="Single" id="single" onclick="func(this.id)">
<label for="Single">Single</label>
</p>
</div>
</div>
<div class="second">
<p>Employment Status</p>
<div class="adjust">
<p><input type="radio" name="emp" value="In a job">
<label for="job">In a job</label>
</p>
<p><input type="radio" name="emp" value="Self Employed">
<label for="Employed">Self Employed</label>
</p>
</div>
</div>
</div>
<div class="input-sections">
<input class="user " id="children" type="text" name="children" placeholder="Number of child.." style="display:none;" >
</div>
<div class="start-button" onclick="check()">START</div>
</form>
</div>
</div>
<!--</div>-->
</div>
</div>
<script>
// $("#agree").click(function(){
// });
</script>
<script>
var a;
$('input[name=email]').change(function()
{
// alert('sfaf');
var email = document.getElementById('email').value;
// alert(email);
// var p = document.getElementById('password').value.length;
// var cp = document.getElementById('confirm_password').value.length;
// //alert(p);
// if(p=="" && cp==""){
// $('.message').css('border', '2px solid red');
// }
$.ajax({
url : "onchange.php",
data : {email: email},
type : "POST",
success : function(data) { // alert(data);
if(data==0){
document.getElementById("emailf").value = 1;
$("#email").css('border', '2px solid #81b746');
$("#error").css('display','none');
}
if(data==1){
$("#email").css('border', '2px solid red');
$("#error").css('display','block');
document.getElementById("emailf").value = 0;
}
},
error : function() {
}
});
});
$('#name').on('keyup',function(){
var name= document.getElementById('name').value.length;
// alert(name);
if(name>3){
$('.name').css('border', '2px solid #81b746');
}else{
$('.name').css('border', '2px solid red');
}
});
$('#phone').on('keyup',function(){
var name= document.getElementById('phone').value.length;
// alert(name);
if(name>9){
$('.phone').css('border', '2px solid #81b746');
}else{
$('.phone').css('border', '2px solid red');
}
});
$('#password, #confirm_password').on('keyup', function () {
if ($('#password').val() == "" || $('#confirm_password').val() == "") {
}else{
if ($('#password').val() == $('#confirm_password').val()) {
//$('.message').html('Matched confirm Password').css('color', 'green');
$('.message').css('border', '2px solid #81b746');
document.getElementById("passwordf").value = 1;
} else {
// $('.message').html('Not Matching Confirm Password').css('color', 'red');
$('.message').css('border', '2px solid red');
}
}
});
function check(){
var emailf= document.getElementById("emailf").value ;
var passwordf= document.getElementById("passwordf").value ;
var namef= document.getElementById("name").value ;
//alert(emailf);
if(emailf == 1 && namef != "" && passwordf == 1){
var x = document.getElementsByName('registeruser');
x[0].submit();
}
}
function func(e) {
//$(e).text('there');
var x = document.getElementById(e).value;
//alert(x);
if (x == 'Married') {
var y = document.getElementById('children');
y.style.display = 'block';
}if(x == 'Single'){
var z = document.getElementById('children');
z.style.display = 'none';
}
}
$("#submit").click(function()
{
//alert('sfaf');
$("#ack").css('display', 'none', 'important');
var email= document.getElementById('username').value;
var pass = document.getElementById('password1').value;
// alert(pass );
if(email=='' || pass=='')
{
$("#ack").css('display','inline','important');
$("#ack").css("color", "red");
$("#ack").html("Please enter your username and password!");
}
else
{
$.ajax({
url : "getlogin.php",
data : {email:email,pass:pass},
type : "POST",
beforeSend: function(){
$("#ack").css('display', 'inline', 'important');
$("#ack").html("Please Wait...");
},
success : function(data)
{
//console.log(data);
//alert(data);
if(data=='1'){
$("#ack").css('display', 'inline', 'important');
$("#ack").html("<font color='green'>loged In</font>");
window.location.href="http://www.coachtofortune.com/questionnaire/answer.php";
}
if(data=='0'){
$("#ack").css('display', 'inline', 'important');
$("#ack").html("<font color='red'>Wrong username or password!</font>");
}
},
error : function()
{
}
});
}
return false;
});
</script>
</body>
</html>