<commit_before><?php

$pageRequiresLogin = true;
$pageTitle = 'Account Overview';

require_once "inc/setup.php";

if(!userHasPermission("view_account")) {
    redirectUnauthorized();
}


require_once 'inc/header.php';

/** @var Bankaccount[] $bankAccounts */
$bankAccounts = $em->getRepository("Bankaccount")->findBy(array("idUser" => $user->getIdUser()));

?>

<h1>Account Overview</h1>

<p>Here is a list of accounts that you own. If there is an issue with your account you should <a href="reportAnIssue.php">report an issue</a></p>

<?php

if($bankAccounts) {

	?>
<h2>Bank Accounts</h2>

	<table class="table">
		<thead>
		<tr>
			<th>Account ID</th>
			<th>Account Name</th>
			<th>Account Type</th>
			<th>Account Balance</th>
			<th></th>
		</tr>
		</thead>
		<tbody>
		<?php
		foreach ($bankAccounts as $bank) {
			?>
			<tr>
				<td><?=$bank->getIdBankaccount()?></td>
				<td><?=$bank->getName()?></td>
				<td><?=$bank->getIdAccounttype()->getName()?></td>
				<td>£<?=$bank->getBalance()?></td>
				<td><a href="bankOverview.php?id=<?=$bank->getIdBankaccount();?>">View Transaction</a></td>
			</tr>
		<?php } ?>
		</tbody>
	</table>

<?php

}else{ ?>
	<strong>You have no bank accounts</strong>
	<?php
}
?>

<h2>Open an account</h2>

<p>If you wish to open a web account you can <a href="openNewAccount.php">open an account</a>.</p>


<commit_msg>change view transactions to plural<commit_after><?php

$pageRequiresLogin = true;
$pageTitle = 'Account Overview';

require_once "inc/setup.php";

if(!userHasPermission("view_account")) {
    redirectUnauthorized();
}


require_once 'inc/header.php';

/** @var Bankaccount[] $bankAccounts */
$bankAccounts = $em->getRepository("Bankaccount")->findBy(array("idUser" => $user->getIdUser()));

?>

<h1>Account Overview</h1>

<p>Here is a list of accounts that you own. If there is an issue with your account you should <a href="reportAnIssue.php">report an issue</a></p>

<?php

if($bankAccounts) {

	?>
<h2>Bank Accounts</h2>

	<table class="table">
		<thead>
		<tr>
			<th>Account ID</th>
			<th>Account Name</th>
			<th>Account Type</th>
			<th>Account Balance</th>
			<th></th>
		</tr>
		</thead>
		<tbody>
		<?php
		foreach ($bankAccounts as $bank) {
			?>
			<tr>
				<td><?=$bank->getIdBankaccount()?></td>
				<td><?=$bank->getName()?></td>
				<td><?=$bank->getIdAccounttype()->getName()?></td>
				<td>£<?=$bank->getBalance()?></td>
				<td><a href="bankOverview.php?id=<?=$bank->getIdBankaccount();?>">View Transactions</a></td>
			</tr>
		<?php } ?>
		</tbody>
	</table>

<?php

}else{ ?>
	<strong>You have no bank accounts</strong>
	<?php
}
?>

<h2>Open an account</h2>

<p>If you wish to open a web account you can <a href="openNewAccount.php">open an account</a>.</p>



{'fraction_non_alphanumeric': 0.21808898614150254, 'fraction_numerical': 0.00437636761487965, 'mean_word_length': 4.285163776493256, 'pattern_counts': {'":': 0, '<': 121, '<?xml version=': 0, '>': 141, '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': '637013', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1032, 'n_words': 214}