<?php 

function pm_edit_bank_account_cb() {
	if(!isset($_GET['id'])) return_method();
	$post = new post;
	$meta = $post->get_post_meta($_GET['id']);
	?>
	<div class="row">
		<div class="col-md-12">
			<div class="panel-body instruction">
	        	<form method="post" id="bank_account_form" action="contents/plugins/payment_module/ajax.php">
	        		<input type="hidden" name="id" value="<?php echo $meta['id'] ?>">
	        		<?php 
	        		input(['label' => 'Account Name', 'id' => 'account_name', 'required' => 'required', 'value' => $meta['account_name']]);
	        		input(['label' => 'Account Number', 'id' => 'account_number', 'required' => 'required', 'class' => 'form-control numbers-only', 'value' => $meta['account_number']]);
	        		input(['label' => 'Bank Name', 'id' => 'bank_name', 'required' => 'required', 'value' => $meta['bank_name']]);
	        		select(['label' => 'Account Type', 'id' => 'account_type', 'required' => 'required'], ['Current Account' => 'Current Account', 'Savings Account' => 'Savings Account'], $meta['account_type']);
	        		input(['label' => 'Account Identity', 'id' => 'account_id', 'hint' => 'This will be used to reference the account on the system. Leave empty to use the bank name as the reference.', 'value' => $meta['account_id']]);
	        		textarea(['label' => 'Use Instructions', 'id' => 'instructions', 'value' => $meta['instructions']]);
	        		submit_btn('edit_bank', 'Save');
	        		 ?>
	        	</form>
			</div>
		</div>
	</div>
	<?php
	global $post_meta;
	add_page_javascript('app/assets/js/page-scripts/submit.js');
	add_page_javascript('app/assets/js/page-scripts/koweb.js');
	add_page_javascript('app/assets/js/page-scripts/js-functions.js');
}