-
Notifications
You must be signed in to change notification settings - Fork 0
/
LocalityNearPlacesPriorityProcess.php
119 lines (103 loc) · 3.3 KB
/
LocalityNearPlacesPriorityProcess.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
<?php
//calling function for all the cities
$cityArray = City::CityArr();
$smarty->assign("cityArray", $cityArray);
$smarty->assign('dirname',$dirName);
$orderby = 'ASC';
if(isset($_POST['asc_x'])) $orderby = 'ASC';
else if(isset($_POST['desc_x'])) $orderby = 'DESC';
$cityId = $_REQUEST['citydd'];
$smarty->assign('cityId',$cityId);
$suburbArr = array();
$suburbArr = Suburb::SuburbArr($cityId);
$smarty->assign('suburbArr',$suburbArr);
$locArr = array();
$locArr = Locality::getLocalityByCity($cityId);
//print_r($locArr);
$smarty->assign('localityArr',$locArr);
$NearPlaceTypesArr = NearPlaceTypes::getNearPlaceTypesEnabled();
//print_r($NearPlaceTypesArr);
$smarty->assign("nearPlaceTypesArray", $NearPlaceTypesArr);
$smarty->assign('status',$_REQUEST['status']);
$smarty->assign('placeType',$_REQUEST['placeType']);
//echo "<pre>";
//print_r($_REQUEST);die;
if(!empty($_REQUEST['placeType']))
{
$nearPlaceTypesId = $_REQUEST['placeType'];
$smarty->assign('nearPlaceTypesId',$nearPlaceTypesId);
//$suburbId = $_REQUEST['suburb'];
//$smarty->assign('suburbId',$suburbId);
// $projectArr = getProjectArr($suburbId,'suburb',$orderby);
}
//echo "<pre>";
//print_r($_REQUEST);die;
$NearPlacesArr = array();
if(isset($_REQUEST['submit'])) {
if($_REQUEST['locality'] == '')
$_REQUEST['localityId'] = '';
if(!empty($_REQUEST['localityId']) && !empty($cityId))
{
$localityId = $_REQUEST['localityId'];
$smarty->assign('localityId',$localityId);
// echo $nearPlaceTypesId;//die;
if(!empty($nearPlaceTypesId))
{
$NearPlacesArr = getNearPlacesArr($_REQUEST['status'], $cityId, $localityId,'locality',$orderby, $nearPlaceTypesId);
}
else
{
//print_r("here");
$NearPlacesArr = getNearPlacesArr($_REQUEST['status'], $cityId, $localityId,'locality',$orderby);
//print_r($NearPlacesArr);
}
}
else if(!empty($cityId))
{
if(!empty($nearPlaceTypesId))
{
$NearPlacesArr = getNearPlacesArrfromcity($_REQUEST['status'], $cityId, $orderby, $nearPlaceTypesId);
}
else
{
//print_r("here");
$NearPlacesArr = getNearPlacesArrfromcity($_REQUEST['status'], $cityId, $orderby);
//print_r($NearPlacesArr);
}
//print_r($NearPlacesArr);
}
}
else{
if(!empty($_REQUEST['localityId']) && !empty($cityId))
{
$localityId = $_REQUEST['localityId'];
$smarty->assign('localityId',$localityId);
/* if(!empty($nearPlaceTypesId))
{
$NearPlacesArr = getNearPlacesArr( $cityId, $localityId,'locality',$orderby, $nearPlaceTypesId);
//print_r("here");
}
else
{
//print_r("here");
$NearPlacesArr = getNearPlacesArr($cityId, $localityId,'locality',$orderby);
//print_r($NearPlacesArr);
}*/
}
}
/*else if(!empty($cityId))
{
if(!empty($nearPlaceTypesId))
{
$NearPlacesArr = getNearPlacesArrfromcity($cityId, $orderby, $nearPlaceTypesId);
}
else
{
//print_r("here");
$NearPlacesArr = getNearPlacesArrfromcity($cityId, $orderby);
//print_r($NearPlacesArr);
}
//print_r($NearPlacesArr);
}*/
$smarty->assign('nearPlacesArr',$NearPlacesArr);
?>