-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile_realtor.php
241 lines (206 loc) · 12.1 KB
/
profile_realtor.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
<?php require 'navbar.php'; ?>
<?php if($_SESSION['admin']!= 1) {
echo "<br><br>Unauthorized Access";
exit();
}
?>
<html lang="en">
<head>
<title>Realtor Profile</title>
<style>
.breadcrumb{
background: none;
text-align: left;
}
.navbar-brand, .nav{
font-family: 'Helvetica Neue', serif;
font-weight: lighter; }
body{padding-top:0%;}
.top-container{
margin-top: 80px;
/* background-color:#e5e5e5;*/
border-radius: 10px;
}
.transbox{
background:rgba(0, 0, 0, .07);
border-radius: 10px;
box-shadow: 1px 7px 36px -5px;
}
</style>
</head>
<body>
<?php
static $row;
$row = get_user_data();
?>
<div class="container text-center top-container">
<h1>Welcome <?php show_info("first_name")?> </h1>
</div>
<div class="container transbox">
<div class="input-group input-group-sm col-sm-offset-4 col-sm-4">
<b>First Name:</b> <?php show_info("first_name")?> <br>
<b>Last Name:</b> <?php show_info("last_name")?> <br>
<b>Phone number:</b> <?php show_info("phone_number")?> <br>
</div><br>
</div>
<div class="container top-container transbox">
<div class="container text-center">
<a href="new_listing.php"> Create A Listing</a>
</div><br>
<div class="container text-center">
<a href="realtor_database.php"> Edit Listings</a>
</div> <br>
<div class="container text-center">
<a href="contactUsers.php"> User Messages</a>
</div>
</div>
<br></div>
<div class="container text-center top-container">
<h>My Listings</h> <br>
<?php
error_reporting(E_ALL & ~E_NOTICE);
$connection = connect_to_mysql();
$result = get_realtor_listings($connection);
?>
</div>
<div class="container-full bottom-container" style="background-color:#e8e8e8">
<div class="container container-pad" id="property-listings">
<?php
if ($result != "") {
while ($row = mysqli_fetch_array($result)) {
?>
<div class="row">
<div class="col-sm-6">
<div class="brdr bgc-fff pad-10 box-shad btm-mrg-20 property-listing" style="overflow:hidden;">
<div class="media">
<a class="pull-left" href="home_details.php?details=<?php echo $row["id"] ?>" target="_parent">
<?php
$rand_num = rand(1, 1);
$img_name1 = $row["image" . $rand_num];
$img_path = 'assets/home_images/home' . $row["id"] . '/small/' . $img_name1;
?>
<img class="img-responsive" style="margin-top:9%;" src="<?php echo '' . $img_path . ''; ?>"/>
<span class="fnt-smaller fnt-lighter fnt-arial">Milestone Properties©</span>
</a>
<div class="clearfix visible-sm"></div>
<div class="media-body fnt-smaller">
<a href="#" target="_parent"></a>
<h3 class="media-heading">
<a href="#" target="_parent">$<?php echo '' . number_format($row["price"]) . '</a><small class="pull-right"><i>' . $row["address"] . ''; ?></i></small></h3>
<p><small class="pull-right"><?php echo '' . $row["city"] . ", " . $row["us_state"] . ", " . $row["zip_code"] . ''; ?></small></p>
<br>
<ul class="list-inline mrg-0 btm-mrg-10 clr-535353 pull-right">
<li><?php echo '' . $row["sq_ft"] . ''; ?> SqFt</li>
<li style="list-style: none">|</li>
<li><?php echo '' . $row["num_bedrooms"] . ''; ?> Beds</li>
<li style="list-style: none">|</li>
<li><?php echo '' . $row["num_bathrooms"] . ''; ?> Baths</li>
</ul>
<br><br>
<p class="hidden-xs"><?php echo '' . substr($row["description"], 0, 120) . ''; ?>...</p>
<div class="row">
<div class="col-md-4">
<form action="home_details.php" method="post">
<button name="bookmark" type="submit" value="<?php echo $row["id"] ?>" class="btn btn-default btn-xs">
<span class="glyphicon glyphicon-star" aria-hidden="true"></span> Bookmark
</button>
</form>
</div>
<div class="col-md-5">
<form action="contact_realtor.php" method="post">
<button name="idListing" type="submit" value="<?php echo $row["id"] ?>" class="btn btn-default btn-xs">
<span class="glyphicon glyphicon-envelope" aria-hidden="true"></span> Contact realtor
</button>
</form>
</div>
<div class="col-md-3">
<form action="home_details.php" method="get">
<button name="details" type="submit" value="<?php echo '' . $row[0] . ''; ?>" class="btn btn-success btn-xs"><i class="fa fa-search"></i>Details</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<?php if ($row = mysqli_fetch_array($result)) { ?>
<div class="brdr bgc-fff pad-10 box-shad btm-mrg-20 property-listing" style="overflow:hidden;">
<div class="media">
<a class="pull-left" href="home_details.php?details=<?php echo $row["id"] ?>" target="_parent">
<?php
$rand_num = rand(1, 1);
$img_name1 = $row["image" . $rand_num];
$img_path = 'assets/home_images/home' . $row["id"] . '/small/' . $img_name1;
?>
<img class="img-responsive" style="margin-top:9%;" src="<?php echo '' . $img_path . ''; ?>"/>
<span class="fnt-smaller fnt-lighter fnt-arial">Milestone Properties©</span>
</a>
<div class="clearfix visible-sm"></div>
<div class="media-body fnt-smaller">
<a href="#" target="_parent"></a>
<h3 class="media-heading">
<a href="#" target="_parent">$<?php echo '' . number_format($row["price"]) . '</a><small class="pull-right"><i>' . $row["address"] . ''; ?></i></small></h3>
<p><small class="pull-right"><?php echo '' . $row["city"] . ", " . $row["us_state"] . ", " . $row["zip_code"] . ''; ?></small></p>
<br>
<ul class="list-inline mrg-0 btm-mrg-10 clr-535353 pull-right">
<li><?php echo '' . $row["sq_ft"] . ''; ?> SqFt</li>
<li style="list-style: none">|</li>
<li><?php echo '' . $row["num_bedrooms"] . ''; ?> Beds</li>
<li style="list-style: none">|</li>
<li><?php echo '' . $row["num_bathrooms"] . ''; ?> Baths</li>
</ul>
<br><br>
<p class="hidden-xs"><?php echo '' . substr($row["description"], 0, 120) . ''; ?>...</p>
<div class="row">
<div class="col-md-4">
<form action="home_details.php" method="post">
<button name="bookmark" type="submit" value="<?php echo $row["id"] ?>" class="btn btn-default btn-xs">
<span class="glyphicon glyphicon-star" aria-hidden="true"></span> Bookmark
</button>
</form>
</div>
<div class="col-md-5">
<form action="contact_realtor.php" method="post">
<button name="idListing" type="submit" value="<?php echo $row["id"] ?>" class="btn btn-default btn-xs">
<span class="glyphicon glyphicon-envelope" aria-hidden="true"></span> Contact realtor
</button>
</form>
</div>
<div class="col-md-3">
<form action="home_details.php" method="get">
<button name="details" type="submit" value="<?php echo '' . $row[0] . ''; ?>" class="btn btn-success btn-xs"><i class="fa fa-search"></i>Details</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
}
}
mysqli_free_result($result);
} else {
echo "<h1></h1>";
}
?></div></div>
</body>
</html>
<?php
function get_user_data() {
$connection = connect_to_mysql();
$query = "SELECT * FROM users WHERE email = '";
$query .= $_SESSION["email"] . "'";
$result = mysqli_query($connection, $query);
$row = mysqli_fetch_array($result);
if($row != false) {
close_mysql_connection($connection);
return $row;
}
}
function show_info($fieldName) {
echo $GLOBALS['row'][$fieldName];
}
?>