{literal}
<script type="text/javascript" charset="utf-8">
    $("[id^='parcode']").live('keypress', function () {
        if (event.which == '10' || event.which == '13') {
            event.preventDefault();
        }
    });
    function getproductbyParcode(e, value)
    {
        //\s means "one space", and \s+ means "one or more spaces".
        value = value.replace(/\s+/g, '');//\s is the regex for "whitespace", and g is the "global" flag, meaning match ALL \s (whitespaces).
        var code = (e.keyCode ? e.keyCode : e.which);
        //to stop the submit of the form
        if (e.which == 13 && value != "")
        {
            var billnameid = 3;
            value = value.replace("ه", "i");//this replacement is for parcode reader
            value = value.replace("÷", "i");//this replacement is for parcode reader
            value = value.replace("/", "i");//this replacement is for parcode reader
            value = value.replace("I", "i");//this replacement is for parcode reader
            //alert(value.charAt(0));
            $.ajax({
                url: 'sellbillAjaxController.php?do=getproductNamebyOnlyParcode&parcode=' + value + '&billnameid=' + billnameid + '',
                success: function (data) {
                    var response = $.parseJSON(data);
                    $("#product").select2('data', {id: response.id, text: response.text});
                }
            });
            // }
        }
    }
</script>
{/literal}

<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">المخازن </a></li>
            <li class="active">تسكين المخازن </li>
        </ol>
        <div class="panel panel-default panel-m">
            <div class="panel-heading">
                <h3 class="panel-title">تسكين المخازن</h3>
                <a href="{$youtubes[58]->url}" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>

            </div>
            <div class="panel-body">
                <form class="form-horizontal" role="form" action="storeHousingController.php?do=add" method="post" >
                    
                    {if $searchinonestore neq 0}
                    <div class="form-group">
                        <label for="storesData" class="col-lg-2 control-label">المخزن</label>
                        <div class="col-lg-4">
                           <input type="hidden" name="storeId" id="storeId"  value="{$storeid}"  >
                          {$storedef->storeName}
                        </div>
                    </div>

                    {else}
                    <div class="form-group">
                        <label for="storesData" class="col-lg-2 control-label">المخزن</label>
                        <div class="col-lg-4">
                            <select class="select2 wdt100" name="storeId" id="storeId">
                                <option value="-1">اختر مخزن</option>
                                {foreach $storesData as $store}
                                <option value="{$store->storeId}">{$store->storeName}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                    {/if}




                    <!-- ================================================= -->
                    <div class="form-group">
                        <label for="catId" class="col-lg-2 control-label">التصنيف الرئيسى</label>
                        <div class="col-lg-4">
                            <select class="select2 wdt100 productCat" data-level="0"  name="productCatId0" id="productCatId0" >
                                <option value="-1">اختر تصنيف</option>
                                {foreach $catData as $data}
                                <option value="{$data->productCatId}">{$data->productCatName}</option>
                                {/foreach}
                            </select>
                        </div>
                        <input type="hidden" id="level" name="level" value="0">
                    </div>

                    <div id="manyParents">

                    </div>

                    <!-- ================================================= -->

                    <div class="form-group">
                        <label for="parent" class="col-lg-2 control-label">المنتج</label>
                        <div class="col-lg-4">
                            <input type="hidden" id="product" name="product" data-placeholder="اختر" class="select2product wdt100" />
                        </div>
                    </div>

                    <!-- ================================================= -->

                    <div class="form-group">
                        <label for="parent" class="col-lg-2 control-label">الباركود</label>
                        <div class="col-lg-4">
                            <input type="text" name="parcode" id="parcode" class="form-control" onkeypress="getproductbyParcode(event, this.value);" placeholder="need to press enter">
                        </div>
                        <div class="col-lg-1"><button type="button"  class="btn btn-primary pull-left" id="searchStoreHousing">بحث</button></div>
                    </div>

                    <!-- ================================================= -->
                    <div id="productsDiv">

                    </div>
                    <input name="storenegative" type="hidden" value="{$storenegative}" id="storenegative" />
                   <!--  <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-4">
                            <button type="submit"  class="btn btn-primary pull-left">حفظ</button>
                        </div>
                    </div> -->
                </form>
                <input type="hidden" name="searchvalue" id="searchvalue" value="{$programsettingsdata->searchvalue}"/>
            </div>
        </div>
    </div>
</div>