<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2><?= print_lang($app_lang,'mod_metu_stock_sale_view_breadcrumb'); ?></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('/metu-sales'); ?>"><?= print_lang($app_lang,'mod_metu_stock_sale_view_breadcrumb'); ?></a>
            </li>
            <li class="active">
                <strong><?= print_lang($app_lang,'mod_metu_stock_sale_add_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="metu-sales-form" action="<?php echo url('/metu-sales/save'); ?>">
                    <input type="hidden" name="percentage_amount">
                    <input type="hidden" name="cost">
                    <div class="row extra-mar-botm">

                        <div class="col-md-4">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'mod_metu_stock_sale_add_input_date'); ?> <strong class="text-danger">*</strong></label>
                                <?php 
                                    $s_date = display_true_date( date('y-m-d') );
                                    $s_date = true_date_for_inputs($s_date);
                                ?>
                                <?php if($branch_calander == 'persian'){ ?>
                                    <input type="text" class="form-control persian-date" name="s_date" value="<?php echo $s_date; ?>" placeholder="<?= print_lang($app_lang,'date'); ?>" readonly="" style="background: #fff;">
                                <?php }else{ ?>
                                    <input type="date" class="form-control" name="s_date" value="<?php echo date("Y-m-d",strtotime($s_date)); ?>">
                                <?php } ?>
                            </div>
                        </div>

                        <div class="col-md-4">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'mod_metu_stock_sale_add_input_client'); ?> <strong class="text-danger">*</strong></label>
                                <select class="form-control chosen-select" name="client">
                                    <option value="" selected="">-- <?= print_lang($app_lang,'mod_metu_stock_sale_add_input_client'); ?> --</option>
                                    <?php foreach($clients as $row){ ?>
                                        <option value="<?= $row['uid']; ?>"><?= $row['name']; ?></option>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>

                        <div class="col-md-4">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'mod_metu_stock_sale_add_input_metu'); ?> <strong class="text-danger">*</strong></label>
                                <select class="form-control chosen-select" name="metu">
                                    <option disabled="" selected="">-- <?= print_lang($app_lang,'mod_metu_stock_sale_add_input_metu'); ?> --</option>
                                    <?php foreach($metu as $row){ ?>
                                        <option value="<?= $row['uid']; ?>"><?= $row['name']; ?></option>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>

                    </div>

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

                        <div class="col-md-4">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'mod_metu_stock_sale_add_input_value'); ?> <strong class="text-danger">*</strong></label>
                                <input type="number" class="form-control" name="value">
                            </div>
                        </div>

                        <div class="col-md-4">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'mod_metu_stock_sale_add_input_percentage'); ?> <strong class="text-danger">*</strong></label>
                                <input type="number" class="form-control" name="percentage">
                            </div>
                        </div>

                        <div class="col-md-4 pointer-none">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'mod_metu_stock_sale_add_input_sold_metu'); ?> <strong class="text-danger">*</strong></label>
                                <input type="number" class="form-control" name="total" readonly>
                            </div>
                        </div>
                        
                    </div>

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

                        <div class="col-md-12">
                            <div class="form-group">
                                <label><?= print_lang($app_lang,'mod_metu_stock_sale_add_input_details'); ?> </label>
                                <input type="text" class="form-control" name="details">
                            </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('/metu-sales'); ?>"><?= print_lang($app_lang,'cancel'); ?></a>
                            <button class="btn btn-w-m btn-primary" type="submit"><?= print_lang($app_lang,'mod_metu_stock_sale_add_input_save'); ?></button>
                        </div>
                    </div>

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

</div>
