<script src="<?php echo THEME_PATH; ?>plugins/jquery-validation/js/jquery.validate.min.js"></script>

<style>
    .table thead tr >th{
        background-color: #4c0870;
        color:#fff;
    }
    .table thead tr th[class*='sorting_'] {
        color: #FFFFFF;
    }
    .bg-master-lighter {
        border:none;
        background-color:#fff;
        border-top:1px solid #ddd; 

    }
    .btn-default{
        border: none;
        background-color: #eee;
    }
    .btn-default:hover{
        background-color:#4c0870!important;
        color:#fff;
        border: none;
    }


</style>



<div class="container-fluid container-fixed-lg bg-white">
    <div class="panel panel-transparent">
        <div class="panel-heading">
            <div class="panel-title"> <?php print CommonLanguage::getMessage('uom_conversion'); ?></div>

            <div class="clearfix"></div>
        </div>
        <div class="panel-body">
            <div class="row col-xs-12 form-group">
                <div class="col-xs-4">
                    <label class="labelText"><?php print CommonLanguage::getMessage('product'); ?></label>
                    <input class="item full-width" id="item" name="item" type="hidden"/>
                </div>
                <br>
            
            </div>
    <table class="table table-bordered table-hover demo-table-search" id="tableWithSearch" >
                    <thead>
                        <tr>
                            <th class="text-center" style="width:15%" ><?php print CommonLanguage::getMessage('product'); ?></th>
                            <th class="text-center" style="width:15%" ><?php print CommonLanguage::getMessage('From'); ?></th>
                            <th class="text-center" style="width:20%" ><?php print CommonLanguage::getMessage('To'); ?></th>
                            <th class="text-center" style="width:15%" ><?php print CommonLanguage::getMessage('value'); ?></th>
                            <th class="text-center" style="width:15%" ><?php print CommonLanguage::getMessage('barcode'); ?></th>
                            <th class="text-center" style="width:15%" ><?php print CommonLanguage::getMessage('additional_barcodes'); ?></th>
                        </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>


        </div>
    </div>
    </div>
    <script>
        var title = <?php echo json_encode(CommonLanguage::getMessage('uom_conversion')); ?>,
                Failed_Submit = <?php echo json_encode(CommonLanguage::getMessage('Failed_Submit')); ?>,
                Required_Fields = <?php echo json_encode(CommonLanguage::getMessage('Required_Fields')); ?>,
                Submitted_Successfully = <?php echo json_encode(CommonLanguage::getMessage('Submitted_Successfully')); ?>;
        $(function () {
            RebuildDataTable(title, [0, 1, 2, 3, 4], 'InventoryAjax/uomConversionRequest', {id: $("#item").val()})

            build_select2($(".item,.product_multi"), "xhr/ProductSearch")

            $("#item").on("change", function () {
                RebuildDataTable(title, [0, 1, 2, 3, 4], 'InventoryAjax/uomConversionRequest', {id: $("#item").val()})

            })






        })
    </script>