-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresults.php
125 lines (95 loc) · 4.21 KB
/
results.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
<html dir="ltr" lang="en-US">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<!-- Stylesheets -->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,300' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="src/css/grid.css" type="text/css" />
<link rel="stylesheet" href="src/css/style.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<!-- External JavaScripts -->
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#city_selector').on('change',function() {
$('#filter div').show().not("#data-" + this.value).hide();
});
});
</script>
<title>VF Project - Results</title>
</head>
<body class="full">
<section class="header">
<div class="container-fluid wrap">
<div class="row center">
<div class="col-half right">
<img src="src/img/vodka.png" height="99px" width="141px">
</div>
<div class="col-half left">
<img src="src/img/red.png" height="90px" width="123px">
</div>
</div>
<h3 class="fancy center">Enter to Win a</h3>
<h2 class="center">Odio Dignissimos Ducimus Qui Vaid</h2>
</div>
</section>
<section class="results center">
<h2 class="fancy">Results</h2>
</section>
<section class="results center">
<div class="container-fluid wrap">
<div id="filter" class="row">
<?php
// Require config.php
require(dirname(__FILE__)."/config.php");
// Get city data from table for sorting without showing duplicate cities
$drop = "SELECT DISTINCT city FROM `demo` ORDER BY city ASC";
$res = $conn->query($drop);
// Echo query to <select> tag
echo "<select name='city_selector' id='city_selector'>";
while ($row = $res->fetch_assoc()) {
$city = str_replace(" ", "-",$row['city']);
echo "<option value='$city'>" . $row["city"] . "</option>";
}
echo "</select>";
// Get all data from table to show on results page
$sql = "SELECT * FROM `demo`";
$result = $conn->query($sql);
// If multiple entries, show them all
if ($result->num_rows > 0) {
// Output data of each row
while ($row = $result->fetch_assoc()) {
$city = str_replace(" ", "-",$row['city']);
echo "<div class='col-fourth card' id='data-$city'><img src='/JT-VividProject/images/" . $row["image"] . "'><p>" . $row["name"] . " from " . $row["city"] . "</p></div>";
}
} else {
// If no results, show on page
echo "0 results";
}
// Close connection to database
$conn->close();
?>
</div>
</div>
</section>
<section class="footer">
<div class="container-fluid wrap">
<h4 class="fancy center">Don't forget to LIKE our Facebook page to stay updated on contents details & other exciting MB special offers!</h4>
<div class="row center">
<div class="col-whole">
<img src="src/img/facebook.png">
</div>
<div class="col-whole">
<p>Must be at least 21 years of age, have fewer than 6 points on your valid Ohio drivers license, be fully insured ($250 deductible collision, $500,000 liability). Driver responsible for all maintenance over the year, $.25 per mile over 10,000. Driver responsible for all reconditioning expense and damage upon vehicle return. Driver must disclose any accidents in said vehicle to Vero Accumasas Delenti at the time of accident, repairs must be performed at Quod Maxi. ONE individual MUST be named on each raffle ticket as the winner/driver. The car cannot be won by a business, or be driven by multiple people. Courtesy of Vero eos Delenti."</p>
</div>
</div>
<div class="row">
<div class="col-half left">
<a href="disclaimer">Disclaimer</a> | <a href="site-map">Site Map</a>
</div>
<div class="col-half right">
At Vero eos accumasas delenti
</div>
</div>
</section>
</div>
</body>