<commit_before><?php

$pageRequiresLogin = true;
require_once "setup.php";

$pageTitle = 'Open New Account';
require_once 'inc/header.php';

?>

<h1>Open New Account</h1>

<form id="openAccount" method="post">
	Account Name: <input type="text" name="name"> <br />
	Account Type: <select name="accountType">
						<option value="current">Current Account</option>
						<option value="personal">Personal Account</option>
						<option value="savings">Savings Account</option>
						<option value="loan">Loan Account</option>
						<option value="joint">Joint Account</option>
					</select> <br />
	<input type="submit" value="Submit" / >
</form>


<?php
require_once 'inc/footer.php';
<commit_msg>setting account properties<commit_after><?php

$pageRequiresLogin = true;
require_once "setup.php";

$pageTitle = 'Open New Account';
require_once 'inc/header.php';

if(isset($_POST['name']) && $_POST['name'] != '' && isset($_POST['accountType']) && $_POST['accountType'] != '') {
	$account= new Bankaccount();
	$account->setBalance(0); //lol
	$account->setName($_POST['name']);
	$account->setType($_POST['accountType']);
	$account->setIdUser($user);

	$em->persist($account);
	$em->flush();

	header("Location: accountOverview.php");
	die();

} else{
	$err="Account Name or Type not set";
}


?>

<h1>Open New Account</h1>
<?php 
	if(isset($err)){
		echo "<p>$err</p>";
		//echo "<p>" . $err . "</p>";
	}
?>


<form id="openAccount" method="post">
	Account Name: <input type="text" name="name"> <br />
	Account Type: <select name="accountType">
						<option value="current">Current Account</option>
						<option value="personal">Personal Account</option>
						<option value="savings">Savings Account</option>
						<option value="loan">Loan Account</option>
						<option value="joint">Joint Account</option>
					</select> <br />
	<button class="btn btn-lg btn-primary btn-block" type="submit">Submit</button>
</form>


<?php
require_once 'inc/footer.php';

{'fraction_non_alphanumeric': 0.20122574055158324, 'fraction_numerical': 0.002553626149131767, 'mean_word_length': 4.954407294832826, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 57, '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': '634686', 'n_tokens_mistral': 716, 'n_tokens_neox': 640, 'n_words': 139}