<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2><?= print_lang($app_lang,'mod_items_token_view_title'); ?></h2>
        <ol class="breadcrumb">
            <li>
                <a class="url-elem" href="<?php echo url('/dashboard'); ?>"><?= print_lang($app_lang,'home'); ?></a>
            </li>
            <li>
                <a class="url-elem" href="<?php echo url('/tokens'); ?>"><?= print_lang($app_lang,'mod_items_token_view_title'); ?></a>
            </li>
            <li class="active">
                <strong><?= print_lang($app_lang,'mod_items_token_edit_title'); ?></strong>
            </li>
        </ol>
    </div>
    <div class="col-lg-2">
    </div>
</div>


<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox-title">
        <h5><?= print_lang($app_lang,'fields_with'); ?> <strong class="text-danger">*</strong> <?= print_lang($app_lang,'are_mandatory'); ?></h5>
    </div>
    <div class="ibox-content">
        <!-- spinner -->
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
        <!-- spinner -->
        <div class="row">
            <div class="col-sm-12 b-r">
                <form role="form" id="tokens-form" action="<?php echo url('/tokens/update').'/'.$editing_data['uid']; ?>">


                    <div class="row extra-mar-botm">

                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'mod_items_token_add_input_client'); ?> <strong class="text-danger">*</strong></label>
                                <select class="form-control chosen-select" name="client">
                                    <option disabled="" value="" selected="">-- <?= print_lang($app_lang,'mod_items_token_add_input_client'); ?> --</option>
                                    <?php foreach($clients as $row){ ?>
                                        <option <?php if($editing_data['client'] == $row['uid']){echo "selected='selected'";}?> value="<?= $row['uid']; ?>" data-address="<?= $row['address']; ?>" ><?= $row['name'].' ( Client)'; ?></option>
                                    <?php } ?>
                                    <?php foreach($suppliers as $row){ ?>
                                        <option <?php if($editing_data['client'] == $row['uid']){echo "selected='selected'";}?> value="<?= $row['uid']; ?>" data-address="<?= $row['address']; ?>"><?= $row['name'].' ( Supplier)'; ?></option>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>

                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'mod_items_token_add_input_item'); ?> <strong class="text-danger">*</strong></label>
                                <select class="form-control chosen-select" name="item">
                                    <option disabled="" value="" selected="">-- <?= print_lang($app_lang,'mod_items_token_add_input_item'); ?> --</option>
                                    <?php foreach($items as $row){ ?>
                                        <option <?php if($editing_data['item'] == $row['uid']){echo "selected='selected'";}?> value="<?= $row['uid']; ?>" data-token-rate="<?= $row['token_rate']; ?>"><?= $row['name'].' - '.$row['item_id']; ?></option>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>

                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'mod_items_token_add_input_sold'); ?></label>
                                <input type="text" class="form-control" name="sold_qty" value="<?= $editing_data['sold_qty']; ?>" placeholder="<?= print_lang($app_lang,'mod_items_token_add_input_sold'); ?>" readonly>
                            </div>
                        </div>

                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'mod_items_token_add_input_sold_value'); ?></label>
                                <input type="text" class="form-control" name="sold_amount" value="<?= $editing_data['sold_amount']; ?>" placeholder="<?= print_lang($app_lang,'mod_items_token_add_input_sold_value'); ?>" readonly>
                            </div>
                        </div>
                        
                    </div>

                    <div class="row extra-mar-botm">
                        
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'mod_items_token_add_input_currency'); ?> <strong class="text-danger">*</strong></label>
                                <select class="form-control chosen-select" name="currency">
                                    <option disabled="" value="" selected="">-- <?= print_lang($app_lang,'mod_items_token_add_input_currency'); ?> --</option>
                                    <?php foreach($currencies as $row){ ?>
                                        <option <?php if($editing_data['currency'] == $row['uid']){echo "selected='selected'";}?> value="<?= $row['uid']; ?>" data-usd-equalance="<?= $row['usd_equalance']; ?>"><?= $row['name']; ?> (<?= $row['symbol']; ?>)</option>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>

                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'mod_items_token_add_input_purchase'); ?> <strong class="text-danger">*</strong></label>
                                <input type="text" class="form-control" name="purchase_qty" value="<?= $editing_data['purchase_qty']; ?>" placeholder="<?= print_lang($app_lang,'mod_items_token_add_input_purchase'); ?>">
                            </div>
                        </div>

                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'mod_items_token_add_input_amount'); ?></label>
                                <input type="text" class="form-control" name="purchase_amount" value="<?= $editing_data['purchase_amount']; ?>" placeholder="<?= print_lang($app_lang,'mod_items_token_add_input_amount'); ?>" readonly>
                            </div>
                        </div>

                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'mod_items_token_add_input_account'); ?> <strong class="text-danger">*</strong></label>
                                <select class="form-control chosen-select" name="account">
                                    <option disabled="" value="" selected="">-- <?= print_lang($app_lang,'mod_items_token_add_input_account'); ?> --</option>
                                    <?php foreach($banks as $row){ ?>
                                        <option <?php if($editing_data['account'] == $row['uid']){echo "selected='selected'";}?> value="<?= $row['uid']; ?>" data-address="<?= $row['address']; ?>" ><?= $row['name'].' ( Bank)'; ?></option>
                                    <?php } ?>
                                    <?php foreach($cash as $row){ ?>
                                        <option <?php if($editing_data['account'] == $row['uid']){echo "selected='selected'";}?> value="<?= $row['uid']; ?>" data-address="<?= $row['address']; ?>"><?= $row['name'].' ( Cash)'; ?></option>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>

                    </div>

                    <div class="row extra-mar-botm">
                        <div class="col-md-12 text-right">
                            <a class="btn btn-w-m btn-outline btn-danger url-elem" href="<?php echo url('/tokens'); ?>"><?= print_lang($app_lang,'cancel'); ?></a>
                            <button class="btn btn-w-m btn-primary" type="submit"><?= print_lang($app_lang,'update'); ?></button>
                        </div>
                    </div>

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

</div>
