Repository navigation
Expand file tree
/
Copy pathhome.php
More file actions
140 lines (132 loc) · 4.23 KB
/
Copy pathhome.php
File metadata and controls
140 lines (132 loc) · 4.23 KB
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
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<title>PropertyVillage</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href='./css/default1.css' rel='stylesheet' />
<body>
<header>
<a href="index.php" class="logohref"><div id="logo">Property<span>Village</span></div></a>
<a href="login.php"><button class="button login">Account</button></a>
</header>
<div id="menus"><div id="holder"><div id="item" class="search">
<form action="search.php" method="get">
<input type="text" name="term"><input type="submit">
</form>
</div>
<div id="item" class="add">
<a href="#">Add a Property</a>
</div>
</div>
</div>
<div id="content" class="house">
<?php
include('conn.inc');
include('dollar.php');
$nameHolder = "";
$query = "select * from listing inner join attributes where listing.property_id = '" . $_GET['home'] . "' and attributes.property_id = '" . $_GET['home'] . "';";
$result = mysqli_query($con, $query);
while($row = mysqli_fetch_array($result))
{
if(strcmp($row['pet_friendly'], "1") == "0"){
$pet = "Yes";
}else{
$pet = "No";
}
if(strcmp($row['popcorn_ceiling'], "1") == "0"){
$pop = "Yes";
}else{
$pop = "No";
}
if(strcmp($row['smoker_friendly'], "1") == "0"){
$smoke = "Yes";
}else{
$smoke = "No";
}
$money = floatval($row['cost']);
$money = dollar_func($money);
$nameHolder = $nameHolder . $row["address"];
echo '<div id="housing_details"><div id="housing_information">
<div id="housing_photo" style="background: url(img/' . $_GET['home'] . '.png) no-repeat center, #001; background-size: 100%;">
</div>
<div class="details"><h3 style="
font-size: 1.4em;
">' . $row['address'] . ', ' . $row['city'] . ', ' . $row['state'] . ', ' . $row['zipcode'] . '</h3>
<h3 style="
font-size: 1.4em;
">' . $money . '</h3>
<p style="
font-size: 1.4em;
">' . html_entity_decode($row['description']) . '</p>
<div>
<div class="housing_information_items">
<span class="header">Property Type</span>
<span class="content">' . $row['property_type'] . '</span>
</div>
<div class="housing_information_items">
<span class="header">Style</span>
<span class="content">' . $row['story'] . ' Story, ' . $row['style'] . '</span>
</div>
<div class="housing_information_items">
<span class="header">Pet Friendly</span>
<span class="content">' . $pet . '</span>
</div>
<div class="housing_information_items">
<span class="header">Popcorn Ceiling</span>
<span class="content">' . $pop . '</span>
</div>
<div class="housing_information_items">
<span class="header">Smoker Friendly</span>
<span class="content">' . $smoke . '</span>
</div>
<div class="housing_information_items">
<span class="header">Condition</span>
<span class="content">' . $row['condition'] . '</span>
</div>
<div class="housing_information_items">
<span class="header">Built</span>
<span class="content">' . $row['built'] . '</span>
</div>
</div>
<div id="housing_controls">
<button class="button favorite" data-value="' . $_GET['home'] . '">Favorite</button>
<button class="button share" data-value=""><a href="home.php?property_id="' . $_GET['share'] . '">Share</a></button>
<button class="button report" data-value="' . $_GET['home'] . '">Report</button>
<i class="far fa-times-circle" onclick="$(\'#ajax_delivery\').removeClass(\'active\');" style="cursor: pointer"></i>
</div>
</div>
<div>
</div>';
}
$GLOBALS["name"] = $nameHolder;
?>
</div>
</div>
</div>
<div id="subsection">
</div>
<div id="footer">
<div id="sitemap">
</div>
<div id="bottom_menu">
</div>
<script>
$(function() {
$(window).on("scroll", function() {
if($(window).scrollTop() > 50) {
$("header").addClass("active");
} else {
//remove the background property so it comes transparent again (defined in your css)
$("header").removeClass("active");
}
});
});
</script>
</body>
</head>
</html>