<commit_before><?php

require_once 'includes/db.php';

$results = $db->query('
	SELECT id, name, street_address, longitude, latitude, rate_total, rate_count
	FROM locations
	ORDER BY rate_total DESC
');

require_once 'includes/header.php';

?>
	<section>
		<button id="geo">Find my Location</button>
		<form id="geo-form">
			<label for="adr">Address</label>
			<input id="adr">
		</form>
	</section>
	
	<article>
	
		<h2>Locations</h2>
		
		<ol class="locations">
			<?php foreach ($results as $location) : ?>
			
			<?php
				if ($location['rate_count'] > 0) {
					$rating = round($location['rate_total'] / $location['rate_count']);
				} else {
					$rating = 0;
				}
			?>
				<li itemscope itemtype="http://schema.org/TouristAttraction" data-id="<?php echo $location['id']; ?>">
				
				<strong class="distance"></strong>
				
					<a href="single.php?id=<?php echo $location['id']; ?>" itemprop="name"><?php echo $location['name']; ?></a>
					
					<span itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">
						<meta itemprop="latitude" content="<?php echo $location['latitude']; ?>">
						<meta itemprop="longitude" content="<?php echo $location['longitude']; ?>">
					</span>
					
					<meter value="<?php echo $rating; ?>" min="0" max="5"><?php echo $rating; ?> out of 5</meter>
					<ol class="rater">
					<?php for ($i = 1; $i <= 5; $i++) : ?>
						<?php $class = ($i <= $rating) ? 'is-rated' : ''; ?>
						<li class="rater-level <?php echo $class; ?>">❤</li>
						<?php endfor; ?>
					</ol>
				</li>
				<?php endforeach; ?>
				</ol>
		
		<div id="map"></div>
		
	</article>

<?php require_once 'includes/footer.php'; ?><commit_msg>Added street address meta information to the locations list and added a submit button to the address search bar.<commit_after><?php

require_once 'includes/db.php';

$results = $db->query('
	SELECT id, name, street_address, longitude, latitude, rate_total, rate_count
	FROM locations
	ORDER BY rate_total DESC
');

require_once 'includes/header.php';

?>

<section>

	<h2>Locator</h2>
	<div id="map"></div>
	
</section>

<section>

	<h2 class="margin-h2">Splash Pads</h2>
	<div class="splash-pad-locations">
	
		<div>
			
			<form id="geo-form">
				<label for="adr">Address</label>
				<input id="adr" type="search" placeholder="Address or Postal Code">
				<button type="submit" id="search-button"></button>
			</form>
			
			<button id="geo-button"></button>
			
		</div>
	
		<div>

			<ol class="locations">
			
				<?php foreach ($results as $location) : ?>
				
				<?php
					if ($location['rate_count'] > 0) {
						$rating = round($location['rate_total'] / $location['rate_count']);
					} else {
						$rating = 0;
					}
				?>
				
				<li itemscope itemtype="http://schema.org/TouristAttraction" data-id="<?php echo $location['id']; ?>" class="single-location">
					
					<a href="single.php?id=<?php echo $location['id']; ?>" itemprop="name"><strong class="distance"></strong> <?php echo $location['name']; ?></a>
						
						<meta itemprop="address" content="<?php echo $location['street_address']; ?>">

					<span itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">
						<meta itemprop="latitude" content="<?php echo $location['latitude']; ?>">
						<meta itemprop="longitude" content="<?php echo $location['longitude']; ?>">
					</span>
						
					<ol class="rater">
					
						<?php for ($i = 1; $i <= 5; $i++) : ?>
						<?php $class = ($i <= $rating) ? 'is-rated' : ''; ?>
						
							<li class="rater-level <?php echo $class; ?>">❤</li>
							
						<?php endfor; ?>
						
					</ol>
				</li>
				
				<?php endforeach; ?>
				
				</ol>
				
			</div>
		</div>
	</section>

<?php require_once 'includes/footer.php'; ?>
{'fraction_non_alphanumeric': 0.20672179247799413, 'fraction_numerical': 0.00480128034142438, 'mean_word_length': 3.21822272215973, 'pattern_counts': {'":': 0, '<': 113, '<?xml version=': 0, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '552558', 'n_tokens_mistral': 1594, 'n_tokens_neox': 1253, 'n_words': 285}