<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<?php 
//print_r($account);die();
?>
<div class="box">
    <div class="box-header">
        <h2 class="blue"><i class="fa-fw fa fa-plus"></i><?= lang('Add New Transfer') ?></h2>
    </div>
    <div class="box-content">
        <div class="row">
            <div class="col-lg-12">
			<?php 
                $attrib = array('data-toggle' => 'validator', 'role' => 'form');
                echo admin_form_open_multipart("transaction/save_transfer", $attrib)
                ?>

                <div class="col-md-5">
					 
				<div class="form-group">
                 <?= lang('from_account', 'from_account'); ?>
                 <?php
					if($account != '')
					{
                        $acc[''] = "";
                        foreach ($account as $account) 
			{
                            $acc[$account->Account_No] = $account->Account_No;
                        }
                        echo form_dropdown('from_account', $acc,(isset($_POST['from_account']) ? $_POST['from_account'] : ""),'class="form-control"  required="required"
                        placeholder="' . lang("select") . " " . lang("Account") . '" style="width:100%" '); ?>
                       
			<?php  } 
				   else
				   {
						 echo form_dropdown('from_account','No account',(isset($_POST['from_account']) ? $_POST['from_account'] : ($transaction ? $transaction->account_id : '')), 'class="form-control select" id="category" placeholder="' . lang("select") . " " . lang("Account") . '" style="width:100%"')
             ?>
		<?php	   }	?>
					 </div>
					<div class="form-group">
                 <?= lang('to_account', 'to_account'); ?>
                 <?php
					if($accounting != '')
					{
                        $accs[''] = "";
                        foreach ($accounting as $accounts) 
			{
                            $accs[$accounts->Account_No] = $accounts->Account_No;
                        }
                        echo form_dropdown('to_account', $accs,(isset($_POST['to_account']) ? $_POST['to_account'] : ""),'class="form-control"  required="required" 
                        placeholder="' . lang("select") . " " . lang("Account") . '" style="width:100%"'); ?>
                       
			<?php  } 
				   else
				   {
						 echo form_dropdown('to_account','No account',(isset($_POST['to_account']) ? $_POST['to_account'] : ($transaction ? $transaction->account_id : '')), 'class="form-control select" id="category" placeholder="' . lang("select") . " " . lang("Account") . '" style="width:100%"')
             ?>
		<?php	   }	?>
					 </div>
					
					<div class="form-group">
                        <?= lang('Amount', 'Amount'); ?>
                        <?= form_input('Amount', (isset($_POST['Amount']) ? $_POST['Amount'] : ""), 'class="form-control tip" id="Amount"required="required"
                        placeholder="' . lang("Enter") . " " . lang("Amount to Transfer") . '" style="width:100%"'); ?>
                    </div>
					
					
					<div class="form-group">
                        <?php echo form_submit('Add_transaction', $this->lang->line("Add_transaction"), 'class="btn btn-primary"'); ?>
                    </div>
				</div>
				
                
            <?= form_close(); ?>

            </div>

        </div>
    </div>
</div>

