<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2><?= print_lang($app_lang,'add_new_showroom_sale'); ?></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('/buy-cars'); ?>"><?= print_lang($app_lang,'showroom_sales'); ?></a>
            </li>
            <li class="active">
                <strong><?= print_lang($app_lang,'new_showroom_sale'); ?></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="buy-cars-sales-form" action="<?php echo url('/buy-cars/sale/save'); ?>">

                    <div class="row extra-mar-botm">
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'currency'); ?> <strong class="text-danger">*</strong></label>
                                <select class="form-control chosen-select" name="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">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'client'); ?> <strong class="text-danger">*</strong></label>
                                <select class="form-control chosen-select" name="client">
                                    <option disabled="" selected="">-- <?= print_lang($app_lang,'select_client'); ?> --</option>
                                    <?php foreach($accounts as $row){ ?>
                                        <?php if($row['type'] == 'client'){ ?>
                                            <option value="<?= $row['uid']; ?>"><?= $row['name']; ?></option>
                                        <?php } ?>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'invoice'); ?> <strong class="text-danger">*</strong></label>
                                <input type="text" class="form-control" name="invoice" placeholder="<?= print_lang($app_lang,'invoice'); ?>">
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'real_cost'); ?></label>
                                <input type="text" class="form-control pointer-none" name="real_cost" value="<?= $car_details['real_cost']; ?>" data-real-cost="<?= $car_details['real_cost']; ?>" data-currency="<?= $car_details['currency']; ?>" data-currency-usd-equalance="<?= $car_details['currency_usd_equalance']; ?>" placeholder="<?= print_lang($app_lang,'real_cost'); ?>" readonly>
                                <input type="hidden" name="car_uid" value="<?= $car_details['uid']; ?>">
                            </div>
                        </div>
                    </div>

                    <div class="row extra-mar-botm">
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'sale_price'); ?> <strong class="text-danger">*</strong></label>
                                <input type="text" class="form-control in-calculations" name="sale_price" placeholder="<?= print_lang($app_lang,'sale_price'); ?>">
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'profit'); ?></label>
                                <input type="text" class="form-control pointer-none" name="profit" placeholder="<?= print_lang($app_lang,'profit'); ?>" readonly>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'total'); ?></label>
                                <input type="text" class="form-control pointer-none" name="total" placeholder="<?= print_lang($app_lang,'total'); ?>" readonly>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'discount'); ?></label>
                                <input type="text" class="form-control in-calculations" name="discount" placeholder="<?= print_lang($app_lang,'discount'); ?>">
                            </div>
                        </div>
                    </div>

                    <div class="row extra-mar-botm">
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'gross_total'); ?></label>
                                <input type="text" class="form-control pointer-none" name="gross_total" placeholder="<?= print_lang($app_lang,'gross_total'); ?>" readonly>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'cash_paid_account'); ?></label>
                                <select class="form-control chosen-select" name="cash_paid_account">
                                    <option disabled="" selected="">-- <?= print_lang($app_lang,'select_account'); ?> --</option>
                                    <?php foreach($accounts as $row){ ?>
                                        <?php if($row['type'] == 'cashbook' OR $row['type'] == 'bank'){ ?>
                                            <option value="<?= $row['uid']; ?>"><?= $row['name']; ?></option>
                                        <?php } ?>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'cash_paid'); ?></label>
                                <input type="text" class="form-control in-calculations" name="cash_paid" placeholder="<?= print_lang($app_lang,'cash_paid'); ?>">
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'pending_amount'); ?></label>
                                <input type="text" class="form-control pointer-none" name="pending_amount" placeholder="<?= print_lang($app_lang,'pending_amount'); ?>" readonly>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-12">
                            <h4><?= print_lang($app_lang,'car_sales_buyer_info'); ?></h4>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'car_sales_buyer_name'); ?></label>
                                <input type="text" class="form-control" name="name" placeholder="<?= print_lang($app_lang,'car_sales_buyer_name'); ?>">
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'car_sales_buyer_f_name'); ?></label>
                                <input type="text" class="form-control" name="father_name" placeholder="<?= print_lang($app_lang,'car_sales_buyer_f_name'); ?>">
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'car_sales_buyer_tazkira'); ?></label>
                                <input type="text" class="form-control" name="tazkira" placeholder="<?= print_lang($app_lang,'car_sales_buyer_tazkira'); ?>">
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'car_sales_buyer_mobile'); ?></label>
                                <input type="text" class="form-control" name="mobile" placeholder="<?= print_lang($app_lang,'car_sales_buyer_mobile'); ?>">
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-md-4">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'car_sales_buyer_address'); ?></label>
                                <input type="text" class="form-control" name="address" placeholder="<?= print_lang($app_lang,'car_sales_buyer_address'); ?>">
                            </div>
                        </div>

                        <div class="col-md-4">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'car_sales_buyer_image'); ?></label>
                                <input type="file" class="form-control" name="buyer_image">
                            </div>
                        </div>
                        <div class="col-md-4">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'car_sales_buyer_document'); ?></label>
                                <input type="file" class="form-control" name="document">
                            </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('/buy-cars/sale/view'); ?>"><?= print_lang($app_lang,'cancel'); ?></a>
                            <button class="btn btn-w-m btn-primary" type="submit"><?= print_lang($app_lang,'save'); ?></button>
                        </div>
                    </div>

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

</div>
