<style type="text/css">
    .chosen-container a.chosen-single{line-height: 24px !important;}
</style>
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2><?= print_lang($app_lang,'add_new_fixing_expenses'); ?></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('/fixing-expenses'); ?>"><?= print_lang($app_lang,'fixing_expenses'); ?></a>
            </li>
            <li class="active">
                <strong><?= print_lang($app_lang,'new_fixing_expenses'); ?></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="temp-fixing-expenses-form">

                    <div class="row " style="margin-bottom: 5px;">
                        <div class="col-md-3 fixed-fields-input">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'currency'); ?> <strong class="text-danger">*</strong></label>
                                <select class="form-control chosen-select" name="temp_currency" >
                                    <option disabled="" selected="">-- <?= print_lang($app_lang,'select_currency'); ?> --</option>
                                    <?php foreach($currencies as $row){ ?>
                                        <option value="<?= $row['uid']; ?>" data-usd-equalance="<?= $row['usd_equalance']; ?>"><?= $row['name']; ?> (<?= $row['symbol']; ?>)</option>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>
                        <div class="col-md-3 fixed-fields-input">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'rate'); ?> <strong class="text-danger">*</strong></label>
                                <input type="text" class="form-control" name="temp_rate"  placeholder="<?= print_lang($app_lang,'rate'); ?>">
                            </div>
                        </div>
                        <div class="col-md-3 fixed-fields-input">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'invoice'); ?> <strong class="text-danger">*</strong></label>
                                <input type="text" class="form-control" name="temp_invoice"  placeholder="<?= print_lang($app_lang,'invoice_#'); ?>">
                            </div>
                        </div>
                        <div class="col-md-3 fixed-fields-input">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'agent'); ?> <strong class="text-danger">*</strong></label>
                                <select class="form-control chosen-select" name="temp_agent">
                                    <option disabled="" selected="">-- <?= print_lang($app_lang,'select_agent'); ?> --</option>
                                    <?php foreach($accounts as $row){ ?>
                                        <?php if($row['type'] != 'transit'){ continue; } ?>
                                        <option value="<?= $row['uid']; ?>" data-agent-name="<?= $row['name']; ?>"><?= $row['name']; ?></option>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>
                    </div>                    

                    <div class="row" style="margin-bottom: 5px;">
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'car'); ?> <strong class="text-danger">*</strong></label>
                                <select class="form-control chosen-select" name="temp_car">
                                    <option disabled="" selected="">-- <?= print_lang($app_lang,'select_car'); ?> --</option>
                                    <?php foreach($cars as $row){ ?>
                                        <option value="<?= $row['uid']; ?>" data-car-name="<?= $row['car_name']; ?>"><?= $row['car_name']; ?></option>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'amount'); ?> <strong class="text-danger">*</strong></label>
                                <input type="text" class="form-control" name="temp_amount" placeholder="<?= print_lang($app_lang,'amount'); ?>">
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'details'); ?></label>
                                <input type="text" class="form-control" name="temp_details" placeholder="<?= print_lang($app_lang,'details'); ?>">
                            </div>
                        </div>
                    </div>

                    <div class="row extra-mar-botm">
                        <div class="col-md-12 text-right">
                            <button style="width: 100%;" class="btn btn-w-m btn-primary" type="submit"><?= print_lang($app_lang,'add_to_expenses'); ?></button>
                        </div>
                    </div>

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

        <form role="form" id="fixing-expenses-form" action="<?php echo url('/fixing-expenses/save'); ?>">
            <div class="row" style="margin-top: 10px;">
                <div class="col-md-12">
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                                <tr>
                                    <th class="text-center"><?= print_lang($app_lang,'car'); ?></th>
                                    <th class="text-center"><?= print_lang($app_lang,'amount'); ?></th>
                                    <th class="text-center"><?= print_lang($app_lang,'details'); ?></th>
                                    <th class="text-center"><?= print_lang($app_lang,'action'); ?></th>
                                </tr>
                            </thead>
                            <tbody id="fixing-expenses-table-body">
                                
                            </tbody>
                        </table>    
                    </div>
                </div>

                <div class="col-md-12"><hr></div>
                <div class="col-md-12 fixing-expenses-totals-col">
                    <div class="row">
                        <div class="col-md-12 purchase-total-cel fixing-expenses-total-amount-row">
                            <strong><?= print_lang($app_lang,'total_amount'); ?>: </strong>
                            <span class="cals-span"></span>
                            <input class="cals-input" type="hidden" name="total_amount">
                        </div>
                    </div>
                </div>
                <div class="col-md-12"><hr></div>

                <div class="col-md-12" style="margin-top: 20px;">
                    <input type="submit" style="width: 100%;" class="btn btn-primary" value="<?= print_lang($app_lang,'save_print'); ?>">
                </div>

            </div>
        </form>

    </div>

</div>