-
Notifications
You must be signed in to change notification settings - Fork 0
/
property.php
80 lines (51 loc) · 1.97 KB
/
property.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
<?php
session_start();
if(!$_SESSION){
// header('Location: login.php');
exit;
}
if($_SESSION){
$sTitle = 'Property';
// GET USERTYPE FROM SESSION
$sPropertyId = $_GET['id'];
$_SESSION['sPropertyId'] = $sPropertyId;
$sUserType = $_SESSION['sUserType'];
$sUserId = $_SESSION['sUserId'];
require_once(__DIR__.'/functions.php');
require_once(__DIR__.'/components/header.php');
$jLoggedUser = $jData->$sUserType->$sUserId;
$jAgents = $jData->agents;
foreach ($jAgents as $sAgentId => $jAgent) {
$jAgentProperties = $jAgent->properties;
foreach ($jAgentProperties as $sAgentPropertyId => $jAgentProperty) {
if($sAgentPropertyId == $sPropertyId){
$_SESSION['sAgentId'] = $sAgentId;
// GET VERIFICATION STATUS FOR PROPERTY AND STORE IN SESSION
$sPropertyVerification = $jAgentProperty->verification;
if($sPropertyVerification == 1){
if($sUserType == 'agents'){
$sScriptPath = 'js/update-property.js';
require_once(__DIR__.'/api/api-update-property.php');
require_once(__DIR__.'/components/property-agents.php');
require_once(__DIR__.'/components/footer.php');
}
if($sUserType == 'users'){
$jLoggedUserFavorites = $jLoggedUser->favorites;
require_once(__DIR__.'/components/property-users.php');
require_once(__DIR__.'/components/footer.php');
echo '<script>';
require_once(__DIR__.'/js/like.js');
echo'</script>';
echo '<script>';
require_once(__DIR__.'/js/enquiry.js');
echo'</script>';
}
}
else{
header('Location: index.php');
exit;
}
}
}
}
}?>