-
Notifications
You must be signed in to change notification settings - Fork 0
/
sell-xxxx.php
736 lines (626 loc) · 26.8 KB
/
sell-xxxx.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
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
<?php
session_start();
ob_start();
include("includes/dbutil.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width intial-scale=1.0 maximum-scale=1.0 user-scalable=yes" />
<title>Tolet Bro</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.css"/>
<link rel="stylesheet" type="text/css" href="css/font-awesome.css"/>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<link rel="stylesheet" type="text/css" href="css/popup.css"/>
<link rel="stylesheet" type="text/css" href="css/magnific-popup.css"/>
<link rel="stylesheet" type="text/css" href="css/responsive.css"/>
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'>
<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/jquery.validate.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=places"></script>
<script>
// This example displays an address form, using the autocomplete feature
// of the Google Places API to help users fill in the information.
var placeSearch, autocomplete;
var componentForm = {
street_number: 'short_name',
route: 'long_name',
locality: 'long_name',
administrative_area_level_1: 'short_name',
country: 'long_name',
postal_code: 'short_name'
};
function fillInAddress(){
}
function initialize() {
// Create the autocomplete object, restricting the search
// to geographical location types.
autocomplete = new google.maps.places.Autocomplete(
/** @type {HTMLInputElement} */(document.getElementById('autocomplete')),
{ types: ['geocode'] });
// When the user selects an address from the dropdown,
// populate the address fields in the form.
google.maps.event.addListener(autocomplete, 'place_changed', function() {
var address = $('#autocomplete').val();
var geocoder = new google.maps.Geocoder();
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var latitude = results[0].geometry.location.lat();
var longitude = results[0].geometry.location.lng();
$("#lat").val(latitude);
$("#lng").val(longitude);
}
});
});
// populate the address fields in the form.
auto= document.getElementById('autocomplete');
google.maps.event.addDomListener(auto, 'keydown', function(e) {
if (e.keyCode == 13) {
e.preventDefault();
}
});
}
</script>
<script>
//Load the Facebook JS SDK
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
// Init the SDK upon load
window.fbAsyncInit = function() {
FB.init({
appId : '505593126281403', // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
// Specify the extended permissions needed to view user data
// The user will be asked to grant these permissions to the app (so only pick those that are needed)
var permissions = [
'email',
].join(',');
// Specify the user fields to query the OpenGraph for.
// Some values are dependent on the user granting certain permissions
var fields = [
'id',
'first_name',
'middle_name',
'last_name',
'gender',
'email',
'picture'
].join(',');
function showDetails() {
FB.api('/me', {fields: fields}, function(details) {
var user_details = JSON.stringify(details, null, '\t');
//alert(user_details);
user_details = JSON.parse(user_details);
$.ajax({
url: 'fb-authentication.php',
type: 'POST',
data: {
id: user_details.id,
first_name : user_details.first_name,
last_name : user_details.last_name,
email : user_details.email,
gender : user_details.gender,
mobile:user_details.mobile,
picture : user_details.picture.data.url
} ,
success: function (response) {
//your success code
//alert(response);
var data = JSON.parse(response);
if(data.status == "true" )
{
window.location = 'index.php';
}else{
alert("Failed to login");
}
},
error: function () {
//your error code
}
});
});
}
$('#fb-login').click(function(){
//initiate OAuth Login
FB.login(function(response) {
// if login was successful, execute the following code
if(response.authResponse) {
showDetails();
}
}, {scope: permissions});
});
};
</script>
<script>
$(document).ready(function(){
$("#sign-up").submit(function(e) {
e.preventDefault();
}).validate({
rules: {
emailid: {
required: true,
email: true,
remote:{
url: "check-email.php",
type:'POST',
data: {
email: function() {
return $( "#emailid" ).val();
}
}
}
},
mobileno: {
required: true,
remote:{
url: "check-email.php",
type:'POST',
data: {
mobile: function() {
return $( "#mobileno" ).val();
}
}
}
}
},
messages :{
emailid : {
remote : "User already registered with this Email ID"
},
mobileno: {
remote : "User already registered with this Mobile"
}
},
//perform an AJAX post to ajax.php
submitHandler: function() {
$("#form-content").hide();
$.ajax({
url : "mobile-verification.php",
type : "POST",
data : {mobile : $("#mobileno").val()},
success: function(data){
if(data == 1)
{
var one_password = '<div class="col-md-5 left-part">'+
'<a href="#">'+
'<img src="images/logo-w.png"/>'+
'</a>'+
'<div class="signup-div">'+
'<h1>Why sign up?</h1>'+
'<ul>'+
'<li>Save time filling forms</li>'+
'<li>Access your recent searches</li>'+
'<li>Track shortlisted, messaged properties</li>'+
'</ul>'+
'</div>'+
'</div>'+
'<div class="col-md-7">'+
'<div class="login-div">'+
'<div class="clearfix"></div>'+
'<div class="login-form">'+
'<span>Please Verify One time password sent to your mobile</span>'+
'<input type="text" class="required" placeholder="One Time Password" name="password" id="one-time-password"/>'+
'<span style="color:red" id="one-required"></span>'+
'<button type="button" id="verify">Verify</button>'+
'</div>'+
'<div class="clearfix"></div>'+
'</div>'+
'</div>'+
'<div class="clearfix"></div>';
$("#test-popup2").append(one_password);
}else{
alert("Error While sign up please try again");
}
}
});
}
});
$(document).on("click","#verify",function(){
var password = $("#one-time-password").val();
if(password != '')
{
$.ajax({
url : "verify-code.php",
type : "POST",
data : {code:password},
success : function(data){
if(parseInt(data) == 1)
{
var form = $("#sign-up").serialize();
$.ajax({
url : "userregister.php",
type : "POST",
data: form,
success:function(data)
{
window.location = 'index.php';
}
});
}else{
$("#one-required").text("");
$("#one-required").text("Pasword not matched");
}
}
});
}else{
$("#one-required").text("");
$("#one-required").text("This field is required");
}
});
});
</script>
<style>
.error{
color: red;
}
</style>
<?php
$is_user_login = 0;
########## Google Settings.. Client ID, Client Secret from https://cloud.google.com/console #############
$google_client_id = '394341835770-td97u9sunc8rgijgll23pa4brhhs9mk1.apps.googleusercontent.com';
$google_client_secret = 'ROGTcqICqifViYLujjZJFGi_';
$google_redirect_url = 'http://localhost/toletbro/index.php'; //path to your script
$google_developer_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
//include google api files
include_once 'src/Google_Client.php';
include_once 'src/contrib/Google_Oauth2Service.php';
$gClient = new Google_Client();
$gClient->setApplicationName('Login to toletbro.com');
$gClient->setClientId($google_client_id);
$gClient->setClientSecret($google_client_secret);
$gClient->setRedirectUri($google_redirect_url);
$gClient->setDeveloperKey($google_developer_key);
$google_oauthV2 = new Google_Oauth2Service($gClient);
//If user wish to log out, we just unset Session variable
if (isset($_REQUEST['reset']))
{
unset($_SESSION['token']);
$gClient->revokeToken();
header('Location: ' . filter_var($google_redirect_url, FILTER_SANITIZE_URL)); //redirect user back to page
}
//If code is empty, redirect user to google authentication page for code.
//Code is required to aquire Access Token from google
//Once we have access token, assign token to session variable
//and we can redirect user back to page and login.
if (isset($_GET['code']))
{
$gClient->authenticate($_GET['code']);
$_SESSION['token'] = $gClient->getAccessToken();
header('Location: ' . filter_var($google_redirect_url, FILTER_SANITIZE_URL));
return;
}
if (isset($_SESSION['token']))
{
$gClient->setAccessToken($_SESSION['token']);
}
if ($gClient->getAccessToken())
{
//For logged in user, get details from google using access token
$user = $google_oauthV2->userinfo->get();
$user_id = $user['id'];
$user_name = filter_var($user['name'], FILTER_SANITIZE_SPECIAL_CHARS);
$email = filter_var($user['email'], FILTER_SANITIZE_EMAIL);
$profile_url = filter_var($user['link'], FILTER_VALIDATE_URL);
$profile_image_url = filter_var($user['picture'], FILTER_VALIDATE_URL);
$personMarkup = "$email<div><img src='$profile_image_url?sz=50'></div>";
$_SESSION['token'] = $gClient->getAccessToken();
}
else
{
//For Guest user, get google login url
$authUrl = $gClient->createAuthUrl();
}
if(isset($authUrl)) //user is not logged in, show login button
{
++$is_user_login;
}
else // user logged in
{
/* connect to database using mysqli */
//unset($_SESSION['token']);
//$user_exist = $mysqli->query("SELECT COUNT(google_id) as usercount FROM user_profile WHERE google_id=$user_id ")->fetch_object()->usercount;
$user_count=get_row_count_by_condition("users","where user_email='".$email."'");
if($user_count>0)
{
$user_info=get_row_by_condition("users","where user_email='".$email."'");
$_SESSION['user_mobile'] = $user_info['user_mobile'];
$_SESSION['upid'] = $user_info['upid'];
$_SESSION['user_name'] = $user_info['user_name'];
$_SESSION['user_email'] = $user_info['user_email'];
//header("location:http://localhost/safe-wash/index.php");
}else{
//user is new
//echo 'Hi '.$user_name.', Thanks for Registering!';
$user_info1=array('google_id'=>$user_id,'user_name'=>$user_name,'user_email'=>$email);
$inserted=insertdata($user_info1,"users");
/*$mysqli->query("INSERT INTO user_profile (google_id, name, email)
VALUES ($user_id, '$user_name','$email')");*/
if($inserted>0){
if(!isset($_SESSION['user_email']))
{
$user_info=get_row_by_condition("users","where user_email='".$email."'");
$_SESSION['user_mobile'] = $user_info['user_mobile'];
$_SESSION['upid'] = $user_info['upid'];
$_SESSION['user_name'] = $user_info['user_name'];
$_SESSION['user_email'] = $user_info['user_email'];
}
}
}
}
?>
</head>
<body onLoad="initialize()">
<section class="white-div-wrapper">
<div class="container">
<div class="row">
<div class="col-md-12">
<div id="test-popup" class="white-popup mfp-with-anim mfp-hide">
<div class="col-md-5 left-part">
<a href="#">
<img src="images/logo-w.png"/>
</a>
<div class="signup-div">
<h1>Why sign up?</h1>
<ul>
<li>Save time filling forms</li>
<li>Access your recent searches</li>
<li>Track shortlisted, messaged properties</li>
</ul>
</div>
</div>
<div class="col-md-7">
<div class="login-div">
<div class="clearfix"></div>
<div class="login-form">
<form method="post" action="convention-checkuser.php">
<input type="email" placeholder="Email Id" name="user_email"/>
<input type="password" placeholder="Password" name="password"/>
<button type="submit">Login</button>
</form>
</div>
<span><img src="images/or.png" class="or-img"/></span>
<div class="clearfix"></div>
<a href="#"><img id="fb-login" src="images/fb-login.png"/></a>
<div class="clearfix"></div>
<?php
if($is_user_login){ ?>
<a class="login" href="<?= $authUrl; ?>"><img src="images/gplus-login.png"/></a>
<?php } ?>
<div class="clearfix"></div>
</div>
</div>
<div class="clearfix"></div>
</div>
<div id="test-popup2" class="white-popup mfp-with-anim mfp-hide">
<div id="form-content">
<div class="col-md-5 left-part">
<a href="#">
<img src="images/logo-w.png"/>
</a>
<div class="signup-div">
<h1>Why sign up?</h1>
<ul>
<li>Save time filling forms</li>
<li>Access your recent searches</li>
<li>Track shortlisted, messaged properties</li>
</ul>
</div>
</div>
<div class="col-md-7">
<div class="login-div">
<div class="clearfix"></div>
<div class="login-form">
<form method="post" id="sign-up" action="userregister.php">
<input type="text" class="required" placeholder="Name" name="username" id="username"/>
<input type="email" class="email" placeholder="Email Id" name="emailid" id="emailid"/>
<input type="number" placeholder="Mobile Number" class="mobile required" name="mobileno" id="mobileno"/>
<input type="password" placeholder="Password" name="password" id="password"/>
<input type="password" placeholder="Confirm Password" name="conformpassword" id="conformpassword"/>
<button type="submit">Sign Up</button>
</form>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
<div class="container-fluid top-header">
<div class="container">
<div class="row">
<div class="links">
<?php if(isset($_SESSION['upid']) || isset($_SESSION['cnv_upid'])){?>
<ul class="list-log-di">
<li><a href="my-account.php"><?php echo $_SESSION['user_name']; ?></a></li>
<li> <a href="logout.php" >Log out</a></li>
<div class="clear"></div>
</ul>
<?php } else { ?>
<ul id="inline-popups" >
<li><a href="#test-popup2" class="sing-buts click">Sign Up</a></li>
<li><a href="#test-popup" class="click2">Login</a></li>
<div class="clear"></div>
</ul>
<?php } ?>
<!-- <ul id="inline-popups" >
<li><a href="#test-popup2" class="sing-buts click">Sign Up</a></li>
<li><a href="#test-popup" class="click2">Login</a></li>
<div class="clearfix"></div>
</ul> -->
</div>
<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
</div>
<div class="container-fluid sell-banner">
<div>
<a href="index.php">
<img src="images/logo.png" class="logo1"/>
</a>
</div>
<div class="container">
<div class="row">
<div>
<h1 class="head6" style="color:#f2635d;">LOREM LPSUM DUMMY TEXT</h1>
<form class="form1" action="property-listview.php" method="get">
<label>
<img src="images/map-icon.png" class="map-icon"/>
<input type="text" id="autocomplete" placeholder="Search by locality or landmark or building" style="width:60% !important;"/>
<input type="hidden" name="lat" value="" id="lat"/>
<input type="hidden" name="lng" value="" id="lng"/>
<!-- <select class="rent-select" name="type">
<option>Rent</option>
<option>Sale</option>
</select> -->
<input type="hidden" name="type" value="Sale">
<button type="submit"><img src="images/search-icon.png"/>Search</button>
<div class="clearfix"></div>
</label>
<div class="clearfix"></div>
</form>
</div>
<div class="clearfix"></div>
</div>
</div>
</div>
<div class="container-fluid white-bg1">
<div class="container">
<div class="row">
<h2 class="head7">Find suitable house in your city</h2>
<div class="col-md-3 city-div">
<img src="images/chennai.png"/>
<span>Chennai</span>
</div>
<div class="col-md-3 city-div">
<img src="images/hyderabad.png"/>
<span>Hyderabad</span>
</div>
<div class="col-md-3 city-div">
<img src="images/bangalore.png"/>
<span>Bangalore</span>
</div>
<div class="col-md-3 city-div">
<img src="images/pune.png"/>
<span>Pune</span>
</div>
</div>
</div>
</div>
<div class="clearfix clear-60"></div>
<div>
<div class="main-wrapper">
<div class="banner-footer">
<div class="what-service">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
<a href="#"><span>Contact Us</span></a>
<div class="clear"></div>
</div>
</div>
</div>
<div class="footer-bt">
<div class="footer">
<img src="images/img1.png" class="img1"/>
<div class="cont-about">
<ul>
<li><a href="#"> About Us</a></li>
<li><a href="#">Privacy Policy</a></li>
<li><a href="#">News</a></li>
<li><a href="#">Terms</a></li>
<li><a href="#">FAQ</a></li>
</ul>
</div>
<div class="adress-maill">
<form class="address-mails" method="post" action="#">
<label>
<input type="text" name="name" placeholder="User Name">
</label>
<label>
<input type="text" name="email" placeholder="E-mail">
</label>
<div class="clear"></div>
<label>
<textarea name="message" placeholder="Message"></textarea>
</label>
<label>
<input type="submit" name="submit" value="Save" style="border:none !important;">
<input type="button" value="Clear" class="clear-but">
<div class="clear"></div>
</label>
<div class="clear"></div>
</form>
</div>
<div class="social-media">
<div class="cont-btm">
<img src="images/map1.png" style="width:18px;">
<span>12-6-23/6/4. opp kukatpally depot,<br>moosapet,hyderabad-72</span>
<div class="clear"></div>
</div>
<div class="cont-btm">
<img src="images/mail1.png" style="width:24px;">
<span style="margin-top:5px;">sisirreddy@yahoo.com</span>
<div class="clear"></div>
</div>
<div class="cont-btm">
<img src="images/call1.png" style="width:24px;">
<span>+91 8464892222<br>+91 40 23862386</span>
<div class="clear"></div>
</div>
<ul class="sol-ic">
<li><img src="images/fb.png"></li>
<li><img src="images/tw.png"></li>
<li><img src="images/you.png"></li>
<div class="clear"></div>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
<div class="footer-strip">
<p>2015 Toletbro.All Right Reserved.Terms and Conditions</p>
</div>
</div>
</section>
<script type="text/javascript">
$(function(){
var $elems = $('.animateblock');
var winheight = $(window).height();
var fullheight = $(document).height();
$(window).scroll(function(){
animate_elems();
});
function animate_elems() {
wintop = $(window).scrollTop(); // calculate distance from top of window
// loop through each item to check when it animates
$elems.each(function(){
$elm = $(this);
if($elm.hasClass('animated')) { return true; } // if already animated skip to the next item
topcoords = $elm.offset().top; // element's distance from top of page in pixels
if(wintop > (topcoords - (winheight*.75))) {
// animate when top of the window is 3/4 above the element
$elm.addClass('animated');
}
});
} // end animate_elems()
});
</script>
<script src='js/jquery.magnific-popup.min.js'></script>
<script src="js/index.js"></script>
</body>
</html>