<script>
    $(document).ready(function (e) {
        print_Custom('mycustomheader');
    });
</script>

<form method="post" action="productCatController.php?do=update">
    <table border="0" class="table-black">
        <tr>
            <td><div>
                    <label>{$smarty.const.MAIN_CATEGORY}</label>
                </div></td>
            <td><div>
                    <label for="parent"></label>
                    {foreach $allParents as $parent}
                    {if $productCatData->productCatParent  eq $parent->productCatId}{$parent->productCatName}{/if}
                    {/foreach} </div></td>
        </tr>
        <tr>
            <td><div>
                    <label>{$smarty.const.CATEGORY_NAME}</label>
                </div></td>
            <td><div> {$productCatData->productCatName} </div></td>
        </tr>
        <tr>
            <td><div>
                    <label> {$smarty.const.CATEGORY_COMMIT} </label>
                </div></td>
            <td><div> {$productCatData->productCatDescription} </div></td>
        </tr>
        <tr>
            <td><div>
                    <label> {$smarty.const.CATEGORY_UNITS_MEASURE} </label>
                </div></td>
            <td><div>
                    <div id="cat_addUnitsDiv">
                        <div class="table-responsive">
                            <table id="cat_unitsTable"  class="table table-black">
                                {assign var=j value=1}
                                {foreach $catUnitsData as $proUnit}
                                <tr>
                                    <td><div class="form-group">
                                            <label class="col-lg-4 control-label">{$smarty.const.UNIT_NAME}</label>
                                            <div class="col-lg-8">

                                                {foreach $unitsData as $unit}

                                                {if $proUnit->unitid eq $unit->unitId}{$unit->unitName}{/if}

                                                {/foreach}



                                            </div>
                                        </div></td>
                                    <td><div class="form-group">
                                            <label class="col-lg-4 control-label">{$smarty.const.NUMBER_UNITS}</label>
                                            <div class="col-lg-8">
                                                <input name="cat_productnumber{$j}" id="cat_productnumber{$j}"  readonly="readonly" type="text" class="form-control numberinput" value="{$proUnit->productnumber}"/>
                                            </div>
                                        </div></td>
                                    <!--                    <td><a id="cat_remove{$j}" onClick="cat_removeUnits({$j});" class="cat_removeUnits">X</a></td>
                                    -->                  </tr>
                                {capture assign=j}{$j+1}{/capture}
                                {/foreach}
                            </table>
                        </div>
                        <!--end cat_unitsTable-->
                    </div>
                    <!--            <input class="cat_addUnits btn btn-warning" onClick="cat_addUnits();" type="button"  value="إضافة وحدة قياس"/>
                    -->            <input name="cat_unitsItr" id="cat_unitsItr" type="hidden" value="{$countcatUnits}" />
                </div></td>
        </tr>

        <tr>
            <td colspan="2"><div>
                    <input type="button" onClick="print_Custom('mycustomheader');" class="noprint" value="{$smarty.const.CATEGORY_PRINT}" />
                </div></td>
        </tr>
    </table>
</form>
