-
Notifications
You must be signed in to change notification settings - Fork 0
/
showAllTimeVenues.php
executable file
·90 lines (80 loc) · 2.66 KB
/
showAllTimeVenues.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
<?php
include 'dbconfig.php';
//decide time
$timeline = array();
$query = "SELECT DISTINCT timeOfRecord from weeklystats ORDER BY timeOfRecord desc";
$result = mysql_query($query);
while($resultArray = mysql_fetch_array($result)){
array_push($timeline, $resultArray[0]);
}
//logic of timeline
$latestTime = $timeline[0];
$queryLatest = "SELECT name, usersCount FROM weeklystats WHERE timeOfRecord='$latestTime'";
$resultLatest = mysql_query($queryLatest);
//constructor - venues assoc array
$venues = array();
while($resultArray = mysql_fetch_array($resultLatest)){
$name = $resultArray[0];
$usersCount = $resultArray[1];
$venues['latest'][$name] = $usersCount;
}
// sorting venues by decreasing no of new people who went in
arsort($venues[latest]);
?>
<html lang="en">
<head>
<title>[bangalore] nights</title>
<meta charset="UTF-8">
<meta name="description" content="[bangalore] nights - discover popular nighlife based on foursquare checkin patterns." />
<meta name="keywords" content="foursquare bangalore checkins nighlife popular venues" />
<meta content="Priya Ranjan Singh" name="Author"/>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="wrapper">
<header>
[bangalore] nights
</header>
<nav>
<ul>
<li><a href="index.php">Last week's popular venues</a></li>
<li><a href="showAllTimeVenues.php">All time popular venues</a></li>
<li><a href="onboardedVenues.php">Onboarded Venues</a></li>
</ul>
</nav>
<content>
<div id="popularVenues">
<ul>
<?php
foreach($venues[latest] as $venuename=>$totalCheckins){
print '<li>'."\n";
print ' <div class="venue">'.$venuename.'</div>'."\n";
print ' <div class="checkinCount">'.$totalCheckins.'</div>'."\n";
print ' <div class="checkinsText"> people have been here</div>'."\n";
print '</li>'."\n";
}
?>
</ul>
</div>
</content>
</div>
<footer>
<div id="footText">
<p>[bangalore nights] 2011. the website uses 4sq data to present popularity.<br/>Made on #4sqhackathon, Sep 17, 18.</p>
<p>[bangalore] nights onboards venues supporting nighlife in Bangalore, India and shows its popularity
based on users been there before. It also would highlight (in future) venues growing popular faster
than others.</p>
</div>
</footer>
<!-- <script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2317725-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script> -->
</body>
</html>