-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpictures.php
151 lines (131 loc) · 4.69 KB
/
pictures.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
<!------------------------------------------------------------------
WanderList(FLICKR PICTURES)
Travel Website
This website shows the picturs, videos and reviews of the destination searched
Developed by: Kajol Shah, Nina Guarino, Kattie Hilliard
Last Updated: December 1st, 2018
Languages & UI: PHP, SQL, CURL, PYTHON, BOOTSTRAP, HTML, CSS, JAVASCRIPT
APIs Used: Geolocation API, Flickr API, Youtube API, Yelp Fusion API
Developed at Rowan University(2018)
-------------------------------------------------------------------->
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Website Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
.fakeimg {
float: left;
padding: 10px;
margin: 10px;
background: #ffffff;
}
.fakeimg img {
opacity: 0.8;
cursor: pointer;
}
.fakeimg img:hover {
opacity: 1;
}
.footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 100px;
color: black;
text-align: center;
}
</style>
</head>
<body>
<div class="jumbotron text-center" style="margin-bottom:10px; background-color:#10e0e0; height:250px; overflow: auto;" class="clear_fix">
<h1>WanderList</h1>
<p>Your go to travel website!</p>
</div>
<nav class="navbar navbar-inverse" style="background-color:#368cb; overflow: auto;" class="clear_fix">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://elvis.rowan.edu/~shahk5/capstone/home.php">Home</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li><a href="http://elvis.rowan.edu/~shahk5/capstone/about">About Us</a></li>
</ul>
</div>
</div>
</nav>
<div class="container" style="width:1500px;">
<div class="row">
<div class="col-sm-4">
<form action="home.php" method="post">
<input type="text" style="width:300px; height:45px; padding:10px; margin:10px;" name="address"/>
<button type="submit" class="btn btn-warning btn-lg">Submit</button>
</form>
<ul class="nav nav-pills nav-stacked">
<li><a href="http://elvis.rowan.edu/~shahk5/capstone/pictures.php">Flickr Pictures <img width="35" height="35" src="flickr_logo.png"></img></a></li>
<li><a href="http://elvis.rowan.edu/~shahk5/capstone/videos.php">Youtube Videos <img width="35" height="35" src="youtube.jpg"></img></a></li>
<li><a href="http://elvis.rowan.edu/~shahk5/capstone/yelp.php">Yelp Reviews <img width="35" height="35" src="yelp.png"></img></a></li>
</ul>
<hr class="hidden-sm hidden-md hidden-lg">
</div>
<div class="col-sm-8">
<?php
$servername = "localhost";
$username = "shahk5";
$password = "warmmuffins";
$dbname = "shahk5";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
//SQL Query to get latitude & longitude from database
$sql = "SELECT search_id, latitude, longitude FROM geo order by search_id Desc limit 1;";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
#echo "Latitude: " . $row["latitude"]. " Longitude: " . $row["longitude"]. "<br>";
}
} else {
echo "0 results";
}
//SQL Query to get flickr images and description from database
$sql = "select filename, title
from flickr tt
INNER JOIN (select MAX(search_id) as MaxScore from flickr) tt2
ON tt.search_id = tt2.MaxScore";
$result = $conn->query($sql); ?>
<?php
//output images and description
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
?>
<div class="fakeimg">
<img src=<?php echo $row["filename"]; ?> style="width:800px; height:450px;" >
<div><font size="20"><?php echo $row["title"];?></font></div>
</div>
<?php
} ?><div class="row">
</div>
</div><?php
} else {
echo "0 results";
}
//close database connection
$conn->close();
?>
</body>
</html>