<commit_before><?php require_once('Dao.php'); ?>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
	<section>
		<!-- Filter form will just submit to itself. This is okay on a GET request -->
		<form method="GET">
			<p>
				<label>Filter by email:
				<input type="text" name="email" required>
				</label>
				<input type="submit" name="filterButton" value="Filter">
			</p>
		</form>
	</section>
	<section>
		<!-- Add form will submit to a separate handler. POST/Redirect/GET pattern. -->
		<form action="test-handler.php" method="POST">
			<p>
				<label>Add email:
				<input type="text" name="email" required>
				</label>
				<input type="submit" name="addButton" value="Add Email">
			</p>
		</form>
	</section>
	<section>
	<h1>Search Results</h1>
	<?php
	// filter results if email parameter is present in URL, otherwise, display
	// all results.
	if(isset($_GET['email']))
	{
		$email = htmlspecialchars($_GET['email']);
		try {
			$dao = new Dao();
			$results = $dao->getRow($email);
			printResultTable($results);
		} catch (PDOException $e) {
			echo $e->getMessage(); // only print this during development. Don't print in production.
			echo "<p>Failed to filter data. Please come back later.</p>";
		}
	} else {
		try {
			$dao = new Dao();
			$results = $dao->getAllRows();
			printResultTable($results);
		} catch (PDOException $e) {
			echo $e->getMessage(); // only print this during development. Don't print in production.
			echo "<p>Failed to retrieve data. Please come back later.</p>";
		}
	}

	function printResultTable($rows) {
		if(!empty($rows)) { ?>
			<table>
			<?php foreach($rows as $row) {?>
				<tr><td><?= $row['email'] ?></td></tr>
			<?php }?>
			</table>
	<?php } else { ?>
		<p>No results.</p>
	<?php }
	}
	?>
	</section>
</body>
</html>
<commit_msg>Minor formatting fixes.<commit_after><?php require_once('Dao.php'); ?>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
	<section>
		<!-- Filter form will just submit to itself. This is okay on a GET request -->
		<form method="GET">
			<p>
				<label>Filter by email:
				<input type="text" name="email" required>
				</label>
				<input type="submit" name="filterButton" value="Filter">
			</p>
		</form>
	</section>
	<section>
		<!-- Add form will submit to a separate handler. POST/Redirect/GET pattern. -->
		<form action="test-handler.php" method="POST">
			<p>
				<label>Add email:
				<input type="text" name="email" required>
				</label>
				<input type="submit" name="addButton" value="Add Email">
			</p>
		</form>
	</section>
	<section>
		<h1>Search Results</h1>
		<?php
		// filter results if email parameter is present in URL, otherwise, display
		// all results.
		if(isset($_GET['email']))
		{
			$email = htmlspecialchars($_GET['email']);
			try {
				$dao = new Dao();
				$results = $dao->getRow($email);
				printResultTable($results);
			} catch (PDOException $e) {
				echo $e->getMessage(); // only print this during development. Don't print in production.
				echo "<p>Failed to filter data. Please come back later.</p>";
			}
		} else {
			try {
				$dao = new Dao();
				$results = $dao->getAllRows();
				printResultTable($results);
			} catch (PDOException $e) {
				echo $e->getMessage(); // only print this during development. Don't print in production.
				echo "<p>Failed to retrieve data. Please come back later.</p>";
			}
		}
	
		function printResultTable($rows) {
			if(!empty($rows)) { ?>
				<table>
				<?php foreach($rows as $row) {?>
					<tr><td><?= $row['email'] ?></td></tr>
				<?php }?>
				</table>
			<?php } else { ?>
				<p>No results.</p>
			<?php }
		}
		?>
	</section>
</body>
</html>

{'fraction_non_alphanumeric': 0.19027892847279756, 'fraction_numerical': 0.0011046672190002762, 'mean_word_length': 3.216530849825378, 'pattern_counts': {'":': 0, '<': 107, '<?xml version=': 0, '>': 115, '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': '5796084', 'n_tokens_mistral': 1425, 'n_tokens_neox': 1232, 'n_words': 348}