<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<?php 
//print_r($product);die();
//foreach($product as $rows):
?>

<div class="box">
    <div class="box-header">
        <h2 class="blue"><i class="fa-fw fa fa-plus"></i><?= lang('edit_account') ?></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/edit/" . $product->id, $attrib)
                ?>

                <div class="col-md-5">
					 <!--<div class="form-group">
                                    <?= lang("date", "date"); ?>
                                    <?php echo form_input('date', (isset($_POST['date']) ? $_POST['date'] :$this->sma->hrld($product->date) ), 'class="form-control input-tip datetime" id="date" required="required"'); ?>
                     </div>
					<div class="form-group">
					<div class="not-active">
                        <?= lang("Account_No", "Account_No") ?>
						<?= form_input('Account_No', (isset($_POST['Account_No']) ? $_POST['Account_No'] : $product->Account_No), 'class="form-control tip" id="Account_No" required="required"'); ?>
                    </div>
                    </div>-->
					 <div class="form-group">
                         <?= lang("account_category", "account_category") ?> <b>*</b>
                      <?php
						
                        $ty[''] = "";
                        foreach ($account_category as $tes) {
                            $ty[$tes->id] = $tes->name ;
                        }
                        echo form_dropdown('account_category', $ty, (isset($_POST['account_category']) ? $_POST['account_category'] :($product ? $product->account_category : '')), 'class="form-control select"  placeholder="' . lang("select") . " " . lang("type") . '" style="width:100%" required="required"')
                        ?>
						
					</div>
					 <div class="form-group">
                        <?= lang("type", "type") ?> <b>*</b>
                      <?php
						
                        $typ[''] = "";
                        foreach ($type as $types) {
                            $typ[$types->id] = $types->name ;
                        }
                        echo form_dropdown('type', $typ, (isset($_POST['type']) ? $_POST['type'] :($product ? $product->type : '')), 'class="form-control select"  placeholder="' . lang("select") . " " . lang("type") . '" style="width:100%" required="required"')
                        ?>
						
					</div>
					<div class="form-group">
                        <?= lang("Name", "Name") ?>
                        <?= form_input('Name', (isset($_POST['Name']) ? $_POST['Name'] :$product->Name), 'class="form-control tip" id="Name" required="required"') ?>
                    </div>
					<div class="form-group">
                        <?= lang("Account_Belong_to", "Account_Belong_to") ?>
						<?php
                        $opty = array(''  =>'Select Type','1' => lang('income'), '2' => lang('expense'), '3' => lang('income/expense'),'0' => lang('none'));
                        echo form_dropdown('belongs_to', $opty, (isset($_POST['belongs_to']) ? $_POST['belongs_to'] :$product->belongs_to), 'class="form-control" id="belongs_to"  required="required"');
                        ?>
						
                    </div>
					
					<div class="form-group">
                        <?php echo form_submit('edit_account', $this->lang->line("edit_account"), 'class="btn btn-primary"'); ?>
                    </div>
				</div>
				
              
            <?= form_close(); ?>

            </div>

        </div>
    </div>
</div>
<?php //endforeach;
?>
<style>
.not-active {
  
   pointer-events: none;
   cursor: default;
   background-color: #f8f8f8;
    color:#bfa1a1;
}
input:read-only {
    background-color: yellow;
}
</style>