<div id="confirm_msg_div" class="row wrapper border-bottom white-bg page-heading confirm-leave">
    <div class="col-lg-10">
        <h2><?= print_lang($app_lang,'mod_production_raw_add_view'); ?></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('/production-raw'); ?>"><?= print_lang($app_lang,'mod_production_raw_add_view'); ?></a>
            </li>
            <li class="active">
                <strong><?= print_lang($app_lang,'mod_production_raw_add_breadcrumb'); ?></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 class="text-<?php if($app_direction == 'rtl'){echo 'left';}else{echo 'right';} ?>">
            <input style="width: 100px; border: none; background: #e0e0e0; padding: 9px 5px; text-align: center; border-radius: 2px; color: black;" type="text" class="pointer-none" value="<?= print_lang($app_lang,'add_entry_sr_num').' '.get_serial_id('production'); ?>" readonly="">
        </div>
    </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 -->

        <form id="production-raw-form" action="<?= url('production-raw/save'); ?>">
            <input type="hidden" class="production-total-produced-qty" name="total_produced_qty">
            <div class="row">
                <div class="col-md-2">
                    <div class="form-group">
                        <label><?= print_lang($app_lang,'mod_production_raw_add_input_currency'); ?> <strong class="text-danger">*</strong></label>
                        <select class="form-control chosen-select cv-required raw-production-currency" name="currency">
                            <option disabled="" value="" selected="">-- <?= print_lang($app_lang,'mod_production_raw_add_input_currency'); ?> --</option>
                            <?php foreach($currencies as $row){ ?>
                                <option data-usd-equalance="<?= $row['usd_equalance']; ?>" value="<?= $row['uid']; ?>"><?= $row['name']; ?></option>
                            <?php } ?>
                        </select>
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="form-group">
                        <label><?= print_lang($app_lang,'mod_production_raw_add_input_item'); ?> <strong class="text-danger">*</strong></label>
                        <select class="form-control chosen-select cv-required raw-production-item" name="item">
                            <option disabled="" value="" selected="">-- <?= print_lang($app_lang,'mod_production_raw_add_input_item'); ?> --</option>
                            <?php foreach($items as $row){ if(!in_array($row['uid'], $items_relation)){continue;} ?>
                                <option data-unit-name="<?= $row['purchase_unit_name']; ?>" data-currency="<?= $row['currency']; ?>" data-currency-equalance="<?= $row['currency_usd_equalance']; ?>" data-cost="<?= $row['_avg_cost']; ?>" value="<?= $row['uid']; ?>"><?= $row['name']; ?> (<?= $row['item_id']; ?>) (<?= $row['purchase_unit_name']; ?>)</option>
                            <?php } ?>
                        </select>
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="form-group">
                        <label><?= print_lang($app_lang,'mod_production_raw_add_input_warehouse'); ?> <strong class="text-danger">*</strong></label>
                        <select class="form-control chosen-select cv-required raw-production-warehouse" name="warehouse">
                            <option disabled="" selected="">-- <?= print_lang($app_lang,'mod_production_raw_add_input_warehouse'); ?> --</option>
                            <?php foreach($warehouses as $row){ if($row['type'] == 'sales'){continue;} ?>
                                <option value="<?= $row['uid']; ?>"><?= $row['name']; ?></option>
                            <?php } ?>
                        </select>
                    </div>
                </div>
                <div class="col-md-2">
                    <div class="form-group">
                        <label><?= print_lang($app_lang,'mod_production_raw_add_input_qty'); ?> <strong class="text-danger">*</strong></label>
                        <input type="text" class="form-control cv-required raw-production-qty" name="qty" value="1" placeholder="<?= print_lang($app_lang,'mod_production_raw_add_input_qty'); ?>">
                    </div>
                </div>

                <div class="col-md-2 pointer-none">
                    <div class="form-group">
                        <label><?= print_lang($app_lang,'mod_production_raw_add_input_cost'); ?> <strong class="text-danger">*</strong></label>
                        <input type="text" class="form-control cv-required raw-production-cost" name="cost" value="1" placeholder="<?= print_lang($app_lang,'mod_production_raw_add_input_cost'); ?>">
                    </div>
                </div>
            </div>

            <div class="production-raw-relational-items-data">
                
            </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('/production-raw'); ?>"><?= 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>