<?php
echo message_box('success');
echo message_box('error');
$created = can_action('125', 'created');
$edited = can_action('125', 'edited');
?>


<?php if (!empty($created) || !empty($edited)) { ?>
	<div class="0">
		<form role="form" data-parsley-validate="" novalidate="" enctype="multipart/form-data" id="saved_account"
			action="<?php echo base_url(); ?>admin/account/saved_account" method="post" class="">
			<div class="grid grid-cols-1 md:grid-cols-2 gap-3 mb-3">
			<?= form_input_group('account_name', lang('account_name'), !empty($account_info) ? $account_info->account_name : '', 'text', true, array(), '', '', ''); ?>
			<?= form_textarea_group('description', lang('description'), !empty($account_info) ? $account_info->description : '', 3, false, array(), ''); ?>
			<?= form_input_group('balance', lang('initial_balance'), !empty($account_info) ? $account_info->balance : '', 'number', true, array('step' => '0.01', 'data-parsley-type' => 'number'), '', '', ''); ?>
			<?= form_input_group('account_number', lang('account_number'), !empty($account_info) ? $account_info->account_number : '', 'text', false, array('data-parsley-type' => 'number'), '', '', ''); ?>
			<?= form_input_group('contact_person', lang('contact_person'), !empty($account_info) ? $account_info->contact_person : '', 'text', false, array(), '', '', ''); ?>
			<?= form_input_group('contact_phone', lang('phone'), !empty($account_info) ? $account_info->contact_phone : '', 'text', false, array(), '', '', ''); ?>
			<?= form_textarea_group('bank_details', lang('bank_details'), !empty($account_info) ? $account_info->bank_details : '', 3, false, array(), ''); ?>
			<?php
			if (!empty($account_info)) {
				$account_id = $account_info->account_id;
				$permissionL = $account_info->permission;
			} else {
				$account_id = null;
				$permissionL = null;
			}
			?>





			<?= form_permission_modern($permission_user, $permissionL, lang('assined_to')); ?>
			</div>

			<div class="flex items-center justify-end gap-2 border-t border-slate-200 pt-4 dark:border-slate-700">
				<button type="button" class="inline-flex items-center rounded-lg border border-slate-200 bg-white px-4 py-2 text-sm font-semibold text-slate-700 hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700" data-dismiss="modal"><?= lang('close') ?></button>
				<button type="submit" class="inline-flex items-center rounded-lg bg-slate-900 px-4 py-2 text-sm font-semibold text-white hover:bg-slate-800 dark:bg-slate-100 dark:text-slate-900 dark:hover:bg-white"><?= lang('save') ?></button>
			</div>
			<?php echo form_close(); ?>
	</div>
<?php } ?>
