<?php /* Smarty version Smarty-3.1.11, created on 2024-07-20 15:22:54
         compiled from "..\views\default\productview\editAjax.html" */ ?>
<?php /*%%SmartyHeaderCode:9768669bac1e3b1339-87073843%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '7999fab28438ff2990544d5051d5ea2d1f696e57' => 
    array (
      0 => '..\\views\\default\\productview\\editAjax.html',
      1 => 1706479755,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '9768669bac1e3b1339-87073843',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'productsData' => 0,
    'alldata' => 0,
    'k' => 0,
    'v' => 0,
    'Programsettingdata' => 0,
    'clientsData' => 0,
    'client' => 0,
    'productUnitsData' => 0,
    'j' => 0,
    'unitsData' => 0,
    'unit' => 0,
    'proUnit' => 0,
    'countProductUnits' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_669bac1e63b075_99992559',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_669bac1e63b075_99992559')) {function content_669bac1e63b075_99992559($_smarty_tpl) {?><script>

    //alert(666);
    //alert($("#parcode1").val());

    checkbarcodewithid($("#parcode1").val(), 1);</script>



<form action="" class="form-horizontal myform" method="post" id="productEditForm"
    onsubmit="submitEditForm(event, this);">
    <input name="productId" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->productId;?>
" id="productId" />
    <div class="form-group">
        <label class="col-lg-2 control-label">تصنيف المنتج</label>
        <div class="col-lg-6"> <span id="spryselect1">
                <select name="productCatId" name="productCatId" class="select2_custom wdt100">
                    <option value="-1">اختر المنتج الرئيسي</option>

                    <?php  $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['v']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['alldata']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value){
$_smarty_tpl->tpl_vars['v']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['v']->key;
?>

                    <option value="<?php echo $_smarty_tpl->tpl_vars['k']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['productsData']->value->productCatId==$_smarty_tpl->tpl_vars['k']->value){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['v']->value;?>
</option>

                    <?php } ?>

                </select>
                <span class="selectInvalidMsg">اختر تصنيف</span><span class="selectRequiredMsg">اختر تصنيف</span></span>
        </div>
    </div>

    <!--==============================-->
    <div id="productsTable">
        <div class="form-group">
            <label class="col-lg-2 control-label">الإسم</label>
            <div class="col-lg-6"> <span id="sprytextfield7">
                    <input name="productName1" type="text" id="productName1" class="form-control" size="9"
                        value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->productName;?>
"
                        onchange="checkProductNameForEdit(this.value, $('#productId').val(), $('#productCatId').val());" />
                    <span class="textfieldRequiredMsg">*</span></span> </div>
        </div>

        <div
            class="form-group <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->isCaf!=1&&$_smarty_tpl->tpl_vars['Programsettingdata']->value->isRestaurent!=1){?> hidden <?php }?>">
            <label class="col-lg-2 control-label">فى المنيو </label>
            <div class="col-lg-4">
                <div class="radio-inline">
                    <label>
                        <input value="0" class="radioR" name="inMenu1" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['productsData']->value->inMenu;?>
<?php $_tmp1=ob_get_clean();?><?php if ($_tmp1==0){?>
                        checked="checked" <?php }?> type="radio" />

                        نعم </label>
                </div>
                <div class="radio-inline">
                    <label>
                        <input value="1" class="noradioR" name="inMenu1" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['productsData']->value->inMenu;?>
<?php $_tmp2=ob_get_clean();?><?php if ($_tmp2==1){?>
                        checked="checked" <?php }?> type="radio" />
                        لا </label>
                </div>

            </div>
        </div>

        <div class="form-group check_tr_production <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->production;?>
<?php $_tmp3=ob_get_clean();?><?php if ($_tmp3==1){?> hidden <?php }?>">
            <label class="col-lg-2 control-label">تصنيع </label>
            <div class="col-lg-4">
                <div class="radio-inline">
                    <label>
                        <input value="1" class="radioR" name="manufacture" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['productsData']->value->type;?>
<?php $_tmp4=ob_get_clean();?><?php if ($_tmp4==1){?>
                        checked="checked" <?php }?> type="radio" />

                        نعم </label>
                </div>
                <div class="radio-inline">
                    <label>
                        <input value="0" class="noradioR" name="manufacture" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['productsData']->value->type;?>
<?php $_tmp5=ob_get_clean();?><?php if ($_tmp5==0){?>
                        checked="checked" <?php }?> type="radio" />
                        لا </label>
                </div>

            </div>
        </div>

        <div class="form-group  <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->service;?>
<?php $_tmp6=ob_get_clean();?><?php if ($_tmp6==1){?> hidden <?php }?>">
            <label class="col-lg-2 control-label">خدمة </label>
            <div class="col-lg-4">
                <div class="radio-inline">
                    <label>
                        <input value="1" class="radioR isserviceedit" name="isservice1" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['productsData']->value->isService;?>
<?php $_tmp7=ob_get_clean();?><?php if ($_tmp7==1){?> checked="checked" <?php }?> type="radio" />

                        نعم </label>
                </div>
                <div class="radio-inline">
                    <label>
                        <input value="0" class="noradioR isserviceedit" name="isservice1" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['productsData']->value->isService;?>
<?php $_tmp8=ob_get_clean();?><?php if ($_tmp8==0){?> checked="checked" <?php }?> type="radio" />
                        لا </label>
                </div>

            </div>
        </div>
        <!--==============================-->
        <div class="form-group <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->parcode;?>
<?php $_tmp9=ob_get_clean();?><?php if ($_tmp9==1){?> hidden <?php }?>">
            <label class="col-lg-2 control-label">الباركود</label>
            <div class="col-lg-6">
                <input name="parcode1" type="text" id="parcode1" size="9" required class="form-control"
                    value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->parcode;?>
" onkeyup="checkbarcodewithid(this.value, 1);" />
            </div>
        </div>
        <!--==============================-->
        <div class="form-group" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->expiredate;?>
<?php $_tmp10=ob_get_clean();?><?php if ($_tmp10==1){?> hidden <?php }?> >
            <label class="col-lg-2 control-label"> مدة الصلاحية</label>
            <div class="col-lg-6"><span id="sprytextfield8">
                    <input name="expireDate1" type="text" id="expireDate1" style="width: 92%;"
                        class="form-control wd50 aw_m aw_mt aw_pp numberclic enteraction numberinput"
                        value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->expireDate;?>
" />
                    <span
                        style="float: left;margin-top: -27px; color: white;font-size: 15px;font-weight: bold;">يوم</span>
                    <span class="textfieldRequiredMsg"> ادخل رقم</span></span></div>
        </div>
        <!--==============================-->
        <div class="form-group">
            <label class="col-lg-2 control-label">سعر الشراء</label>
            <div class="col-lg-6"> <span id="sprytextfield1">
                    <?php if ($_smarty_tpl->tpl_vars['productsData']->value->isService==1){?>
                    <input name="productBuyPrice1" type="text" id="productBuyPrice1"
                        class="form-control wd50 aw_m aw_mt aw_pp numberclic enteraction numberinput" value=""
                        disabled />
                    <?php }else{ ?>
                    <input name="productBuyPrice1" type="text" id="productBuyPrice1"
                        class="form-control wd50 aw_m aw_mt aw_pp numberclic buy_price enteraction numberinput"
                        data-id="1" value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->productBuyPrice;?>
" />
                    <?php }?>
                    <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">أدخل
                        رقم</span></span> </div>
        </div>
        <div class="form-group">
            <label class="col-lg-2 control-label">سعر الشراء الفعلى</label>
            <div class="col-lg-6"> <span id="sprytextfield1">
                    <?php if ($_smarty_tpl->tpl_vars['productsData']->value->isService==1){?>
                    <input style="width: 50%;float: left;" name="productbuypricereal1"
                        value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->productbuypricereal;?>
" type="text" id="buypricereal1"
                        data-type="pricereal" disabled
                        class="form-control prices  aw_m aw_mt aw_pp numberclic enteraction  numberinput positivefloat buy_pricereal1"
                        data-id="1" width="10" /></span>
                <input style="  width: 50%;" name="buypricereal_precentage1"
                    value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->buypricereal_precentage;?>
" type="text" id="productBuyPrice1"
                    data-type="pricereal" disabled
                    class="form-control precentages  aw_m aw_mt aw_pp numberclic enteraction  numberinput positivefloat buypricereal_precentage1"
                    data-id="1" width="10" />

                <!--<input name="productbuypricereal1"  type="text" id="productBuyPrice1" class="form-control wd50 aw_m aw_mt aw_pp numberclic enteraction numberinput"  value="" disabled />-->
                <?php }else{ ?>
                <!--<input name="productbuypricereal1"  type="text" id="productBuyPrice1" class="form-control wd50 aw_m aw_mt aw_pp numberclic enteraction numberinput"  value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->productbuypricereal;?>
" />-->
                <input style="width: 50%;float: left;" name="productbuypricereal1"
                    value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->productbuypricereal;?>
" type="text" id="buypricereal1" data-type="pricereal"
                    class="form-control prices  aw_m aw_mt aw_pp numberclic enteraction  numberinput positivefloat buy_pricereal1"
                    data-id="1" width="10" /></span>
                <input style="  width: 50%;" name="buypricereal_precentage1"
                    value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->buypricereal_precentage;?>
" type="text" id="productBuyPrice1"
                    data-type="pricereal"
                    class="form-control precentages  aw_m aw_mt aw_pp numberclic enteraction  numberinput positivefloat buypricereal_precentage1"
                    data-id="1" width="10" />

                <?php }?>
                <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">أدخل
                    رقم</span></span>
            </div>
        </div>
        <!--==============================-->
        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceall==1){?>
        <div class="form-group">
            <label class="col-lg-2 control-label">سعر الجملة</label>
            <div class="col-lg-6"> <span id="sprytextfield2">
                    <!--<input name="productSellAllPrice1"   type="text" id="productSellAllPrice1" onkeyup="populateSellPrice(1);" class="form-control wd50 aw_m aw_mt aw_pp numberclic enteraction numberinput" value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->productSellAllPrice;?>
"  />-->
                    <input style="width: 50%;float: left;" name="productSellAllPrice1" type="text"
                        id="productSellAllPrice" data-type="buytotal"
                        class="form-control prices aw_m aw_mt aw_pp numberclic positivefloat buy_total1 enteraction numberinput"
                        value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->productSellAllPrice;?>
" data-id="1" width="10" />
                    <input style="  width: 50%;" name="buytotal_precentage1" type="text"
                        value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->buytotal_precentage;?>
" id="productBuyPrice1" data-type="buytotal"
                        class="form-control  aw_m aw_mt aw_pp numberclic enteraction precentages numberinput positivefloat buytotal_precentage1"
                        data-id="1" width="10" />

                    <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">أدخل
                        رقم</span></span> </div>
        </div>
        <?php }?>
        <!--==============================-->
        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpricehalf==1){?>
        <div class="form-group">
            <label class="col-lg-2 control-label">سعر نصف جملة</label>
            <div class="col-lg-6"> <span id="sprytextfield3">
                    <!--<input name="productSellHalfPrice1"   type="text" id="productSellHalfPrice1"  class="form-control wd50 aw_m aw_mt aw_pp numberclic enteraction numberinput"  value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->productSellHalfPrice;?>
" />-->
                    <input style="width: 50%;float: left;" name="productSellHalfPrice1" type="text" data-type="buyhalf"
                        id="productSellHalfPrice" value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->productSellHalfPrice;?>
"
                        class="form-control  aw_m aw_mt aw_pp numberclic prices enteraction numberinput positivefloat buy_hafe1"
                        data-id="1" width="10" />
                    <input style="  width: 50%;" name="buyhalf_precentage1" type="text" id="productBuyPrice1"
                        value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->buyhalf_precentage;?>
" data-type="buyhalf"
                        class="form-control  aw_m aw_mt aw_pp numberclic enteraction  precentages numberinput positivefloat buyhafe_precentage1"
                        data-id="1" width="10" />
                    <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">أدخل
                        رقم</span></span> </div>
        </div>
        <?php }?>
        <!--==============================-->
        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceunit==1){?>
        <div class="form-group">
            <label class="col-lg-2 control-label">سعر التجزئة</label>
            <div class="col-lg-6"> <span id="sprytextfield4">
                    <!--<input name="productSellUnitPrice1"  type="text" id="productSellUnitPrice1"  class="form-control wd50 aw_m aw_mt aw_pp numberclic enteraction numberinput"   value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->productSellUnitPrice;?>
"/>-->
                    <input style="width: 50%;float: left;" name="productSellUnitPrice1" type="text" data-type="buypart"
                        id="productSellUnitPrice"
                        class="form-control  aw_m aw_mt aw_pp numberclic prices enteraction numberinput positivefloat buy_part1"
                        value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->productSellUnitPrice;?>
" data-id="1" width="20" />
                    <input style="  width: 50%;" name="buypart_precentage1" type="text" id="productBuyPrice1"
                        data-type="buypart" value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->buypart_precentage;?>
"
                        class="form-control  aw_m aw_mt aw_pp numberclic enteraction precentages numberinput positivefloat buypart_precentage1"
                        data-id="1" width="10" />

                    <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">أدخل
                        رقم</span></span> </div>
        </div>
        <?php }?>
        <!--==============================-->
        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice4==1){?>
        <div class="form-group">
            <label class="col-lg-2 control-label">سعر4</label>
            <div class="col-lg-6"> <span id="sprytextfield5">
                    <input style="width: 50%;float: left;" name="price4_1" type="text" data-type="price4" id="price4"
                        class="form-control  aw_m aw_mt aw_pp numberclic prices enteraction numberinput positivefloat price4_1"
                        value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->price4;?>
" data-id="1" width="20" />
                    <input style="  width: 50%;" name="price4_precentage1" type="text" id="price4_1" data-type="price4"
                        value="<?php echo (($_smarty_tpl->tpl_vars['productsData']->value->price4/$_smarty_tpl->tpl_vars['productsData']->value->productBuyPrice)-1)*100;?>
"
                        class="form-control  aw_m aw_mt aw_pp numberclic enteraction precentages numberinput positivefloat price4_precentage1"
                        data-id="1" width="10" />

                    <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">أدخل
                        رقم</span></span> </div>
        </div>
        <?php }?>
        <!--==============================-->
        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice5==1){?>
        <div class="form-group">
            <label class="col-lg-2 control-label">سعر5</label>
            <div class="col-lg-6"> <span id="sprytextfield6">
                    <input style="width: 50%;float: left;" name="price5_1" type="text" data-type="price5" id="price5"
                        class="form-control  aw_m aw_mt aw_pp numberclic prices enteraction numberinput positivefloat price5_1"
                        value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->price5;?>
" data-id="1" width="20" />
                    <input style="  width: 50%;" name="price5_precentage1" type="text" id="price5_1" data-type="price5"
                        value="<?php echo (($_smarty_tpl->tpl_vars['productsData']->value->price5/$_smarty_tpl->tpl_vars['productsData']->value->productBuyPrice)-1)*100;?>
"
                        class="form-control  aw_m aw_mt aw_pp numberclic enteraction precentages numberinput positivefloat price5_precentage1"
                        data-id="1" width="10" />

                    <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">أدخل
                        رقم</span></span> </div>
        </div>
        <?php }?>
        <!--==============================-->
        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice6==1){?>
        <div class="form-group">
            <label class="col-lg-2 control-label">سعر6</label>
            <div class="col-lg-6"> <span id="sprytextfield7">
                    <input style="width: 50%;float: left;" name="price6_1" type="text" data-type="price6" id="price6"
                        class="form-control  aw_m aw_mt aw_pp numberclic prices enteraction numberinput positivefloat price6_1"
                        value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->price6;?>
" data-id="1" width="20" />
                    <input style="  width: 50%;" name="price6_precentage1" type="text" id="price6_1" data-type="price6"
                        value="<?php echo (($_smarty_tpl->tpl_vars['productsData']->value->price6/$_smarty_tpl->tpl_vars['productsData']->value->productBuyPrice)-1)*100;?>
"
                        class="form-control  aw_m aw_mt aw_pp numberclic enteraction precentages numberinput positivefloat price6_precentage1"
                        data-id="1" width="10" />

                    <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">أدخل
                        رقم</span></span> </div>
        </div>
        <?php }?>
        <!--==============================-->
        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice7==1){?>
        <div class="form-group">
            <label class="col-lg-2 control-label">سعر7</label>
            <div class="col-lg-6"> <span id="sprytextfield8">
                    <input style="width: 50%;float: left;" name="price7_1" type="text" data-type="price7" id="price7"
                        class="form-control  aw_m aw_mt aw_pp numberclic prices enteraction numberinput positivefloat price7_1"
                        value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->price7;?>
" data-id="1" width="20" />
                    <input style="  width: 50%;" name="price7_precentage1" type="text" id="price7_1" data-type="price7"
                        value="<?php echo (($_smarty_tpl->tpl_vars['productsData']->value->price7/$_smarty_tpl->tpl_vars['productsData']->value->productBuyPrice)-1)*100;?>
"
                        class="form-control  aw_m aw_mt aw_pp numberclic enteraction precentages numberinput positivefloat price7_precentage1"
                        data-id="1" width="10" />

                    <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">أدخل
                        رقم</span></span> </div>
        </div>
        <?php }?>
        <!--==============================-->
        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice8==1){?>
        <div class="form-group">
            <label class="col-lg-2 control-label">سعر8</label>
            <div class="col-lg-6"> <span id="sprytextfield9">
                    <input style="width: 50%;float: left;" name="price8_1" type="text" data-type="price8" id="price8"
                        class="form-control  aw_m aw_mt aw_pp numberclic prices enteraction numberinput positivefloat price8_1"
                        value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->price8;?>
" data-id="1" width="20" />
                    <input style="  width: 50%;" name="price8_precentage1" type="text" id="price8_1" data-type="price8"
                        value="<?php echo (($_smarty_tpl->tpl_vars['productsData']->value->price8/$_smarty_tpl->tpl_vars['productsData']->value->productBuyPrice)-1)*100;?>
"
                        class="form-control  aw_m aw_mt aw_pp numberclic enteraction precentages numberinput positivefloat price8_precentage1"
                        data-id="1" width="10" />

                    <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">أدخل
                        رقم</span></span> </div>
        </div>
        <?php }?>
        <!--==============================-->

        <div class="form-group">
            <label class="col-lg-2 control-label">الكمية</label>
            <div class="col-lg-6"> <span id="sprytextfield5">
                    <?php if ($_smarty_tpl->tpl_vars['productsData']->value->isService==1){?>
                    <input name="productquantity1" readonly="readonly" type="text" id="productquantity1"
                        class="form-control wd50 aw_m aw_mt aw_pp numberclic enteraction numberinput" value=""
                        disabled />
                    <?php }else{ ?>
                    <input name="productquantity1" readonly="readonly" type="text" id="productquantity1"
                        class="form-control wd50 aw_m aw_mt aw_pp numberclic enteraction numberinput"
                        value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->sumProductQuantity;?>
" />
                    <?php }?>
                    <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">أدخل
                        رقم</span></span> </div>
        </div>
        <!--==============================-->

        <div class="form-group <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->date;?>
<?php $_tmp11=ob_get_clean();?><?php if ($_tmp11==1){?> hidden <?php }?>">
            <label class="col-lg-2 control-label">التاريخ</label>
            <div class="col-lg-6">
                <input name="productDate1" class="form-control awdatepicker" autocomplete="off"
                    data-date-format="yyyy-mm-dd" type="text" id="productDate1" size="9" class="form-control"
                    value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->productDate;?>
" />
            </div>
        </div>
        <!--==============================-->

        <div class="form-group">
            <label class="col-lg-2 control-label">الحد الأدنى للمنتج</label>
            <div class="col-lg-6"> <span id="sprytextfield6">
                    <input name="limitamount1" type="text" id="limitamount1"
                        class="form-control wd50 aw_m aw_mt aw_pp numberclic enteraction numberinput"
                        value="<?php echo $_smarty_tpl->tpl_vars['productsData']->value->limitamount;?>
" />
                    <span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">أدخل
                        رقم</span></span> </div>
        </div>
        <!--==============================-->
        <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->addclienttoproduct==1){?>
        <div class="form-group">
            <label class="col-lg-2 control-label">العميل</label>
            <div class="col-lg-6">
                <select name="clientid1" class="form-control">
                    <option value="0" <?php if ($_smarty_tpl->tpl_vars['productsData']->value->clientid==0){?>selected<?php }?>>كل العملاء</option>
                    <?php  $_smarty_tpl->tpl_vars['client'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['client']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['clientsData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['client']->key => $_smarty_tpl->tpl_vars['client']->value){
$_smarty_tpl->tpl_vars['client']->_loop = true;
?>
                    <option value="<?php echo $_smarty_tpl->tpl_vars['client']->value->clientid;?>
" <?php if ($_smarty_tpl->tpl_vars['productsData']->value->clientid==$_smarty_tpl->tpl_vars['client']->value->clientid){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['client']->value->clientname;?>
</option>
                    <?php } ?>
                </select>
            </div>
        </div>
        <?php }?>
        <!--==============================-->
        <div class="form-group <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->description;?>
<?php $_tmp12=ob_get_clean();?><?php if ($_tmp12==1){?> hidden <?php }?>">
            <label class="col-lg-2 control-label">الوصف</label>
            <div class="col-lg-6">
                <textarea name="productDescription1" id="productDescription1" cols="5" rows="5"
                    class="form-control"><?php echo $_smarty_tpl->tpl_vars['productsData']->value->productDescription;?>
</textarea>
            </div>
        </div>
        <!--==============================-->

        <div class="form-group">
            <label class="col-lg-2 control-label">إخفاء</label>
            <div class="col-lg-6">
                <div class="radio-inline">
                    <label>
                        <input name="conditions" type="radio" value="1" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['productsData']->value->conditions;?>
<?php $_tmp13=ob_get_clean();?><?php if ($_tmp13==1){?> checked="checked" <?php }?> />
                        نعم </label>
                </div>
                <div class="radio-inline">
                    <label>
                        <input name="conditions" type="radio" <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['productsData']->value->conditions;?>
<?php $_tmp14=ob_get_clean();?><?php if ($_tmp14==0){?> checked="checked" <?php }?> value="0" />
                        لا </label>
                </div>
            </div>
        </div>
        <!--==============================-->

        <!--------------------------------  adding units   ----------------------------->

        <div id="addUnitsDiv1">
            <table id="unitsTable1" class="table-black">
                <?php $_smarty_tpl->tpl_vars['j'] = new Smarty_variable(1, null, 0);?>
                <?php  $_smarty_tpl->tpl_vars['proUnit'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['proUnit']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['productUnitsData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['proUnit']->key => $_smarty_tpl->tpl_vars['proUnit']->value){
$_smarty_tpl->tpl_vars['proUnit']->_loop = true;
?>
                <tr>
                    <td>
                        <div>
                            <label class="control-label">وحدة القياس</label>
                            <select name="productunit1<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
" id="productunit1<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
" data-placeholder="اختر"
                                class="select2_custom wdt100 chosenproduct">
                                <option value="-1">اختر وحدة القياس</option>
                                <?php  $_smarty_tpl->tpl_vars['unit'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['unit']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['unitsData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['unit']->key => $_smarty_tpl->tpl_vars['unit']->value){
$_smarty_tpl->tpl_vars['unit']->_loop = true;
?>
                                <option value="<?php echo $_smarty_tpl->tpl_vars['unit']->value->unitId;?>
" <?php if ($_smarty_tpl->tpl_vars['proUnit']->value->unitid==$_smarty_tpl->tpl_vars['unit']->value->unitId){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['unit']->value->unitName;?>
</option>
                                <?php } ?>
                            </select>
                        </div>
                    </td>
                    <td>
                        <div>
                            <label class="control-label">عدد الوحدات</label>
                            <input name="productnumber1<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
" readonly="readonly" id="productnumber1<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
"
                                class="form-control" type="text" value="<?php echo $_smarty_tpl->tpl_vars['proUnit']->value->productnumber;?>
" />
                            <input name="productunitid<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
" id="productunitid<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
" type="hidden"
                                value="<?php echo $_smarty_tpl->tpl_vars['proUnit']->value->productunitid;?>
" />
                        </div>
                    </td>
                    <td>
                        <div>
                            <label class="control-label">الباركود </label>
                            <input name="proUnitParcode1<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
" id="proUnitParcode1<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
" class="form-control positiveNo"
                                type="text" value="<?php echo $_smarty_tpl->tpl_vars['proUnit']->value->proUnitParcode;?>
" data-unit-itr="<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
"
                                data-unitid-itr="<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
"
                                onblur="checkUnitbarcodewithid(this.value, $(this).data('unitid-itr'), $(this).data('unit-itr'));" />
                        </div>
                    </td>
                    <td>
                        <div>
                            <label class="control-label">سعر الشراء </label>
                            <input name="proUnitBuyPrice1<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
" id="proUnitBuyPrice1<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
"
                                class="form-control positivefloat" type="text" value="<?php echo $_smarty_tpl->tpl_vars['proUnit']->value->proUnitBuyPrice;?>
" />
                        </div>
                    </td>
                    <td>
                        <div>
                            <label class="control-label">سعر الجملة </label>
                            <input name="proUnitSellAllPrice1<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
" id="proUnitSellAllPrice1<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
"
                                class="form-control positivefloat" type="text"
                                value="<?php echo $_smarty_tpl->tpl_vars['proUnit']->value->proUnitSellAllPrice;?>
" />
                        </div>
                    </td>
                    <td>
                        <div>
                            <label class="control-label">سعر نص جملة </label>
                            <input name="proUnitSellHalfPrice1<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
" id="proUnitSellHalfPrice1<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
"
                                class="form-control positivefloat" type="text"
                                value="<?php echo $_smarty_tpl->tpl_vars['proUnit']->value->proUnitSellHalfPrice;?>
" />
                        </div>
                    </td>
                    <td>
                        <div>
                            <label class="control-label">سعر قطاعى </label>
                            <input name="proUnitSellUnitPrice1<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
" id="proUnitSellUnitPrice1<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
"
                                class="form-control positivefloat" type="text"
                                value="<?php echo $_smarty_tpl->tpl_vars['proUnit']->value->proUnitSellUnitPrice;?>
" />
                        </div>
                    </td>
                    <td><a id="remove1<?php echo $_smarty_tpl->tpl_vars['j']->value;?>
" onclick="removeUnits(1, <?php echo $_smarty_tpl->tpl_vars['j']->value;?>
);" class="removeUnits">X</a></td>
                </tr>
                <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'j', null); ob_start(); ?><?php echo $_smarty_tpl->tpl_vars['j']->value+1;?>
<?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
if (!empty($_capture_buffer)) {
 if (isset($_capture_assign)) $_smarty_tpl->assign($_capture_assign, ob_get_contents());
 if (isset( $_capture_append)) $_smarty_tpl->append( $_capture_append, ob_get_contents());
 Smarty::$_smarty_vars['capture'][$_capture_buffer]=ob_get_clean();
} else $_smarty_tpl->capture_error();?>
                <?php } ?>
            </table>
            <!--end unitsTable-->
        </div>
        <input class="addUnits btn btn-success" onclick="addUnits(1);" type="button" value="إضافة وحدة قياس" />
        <input name="unitsItr1" id="unitsItr1" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['countProductUnits']->value;?>
" />

        <!-------------------------------- end adding units   -------------------------->
        </td>
    </div>
    <!--end productsTable -->

    <input name="productItr" id="productItr" type="hidden" value="1" />
    <div class="form-group">
        <div class="col-lg-offset-2 col-lg-6" id="myxdiv">
            <button type="submit" id="submit" class="btn btn-primary pull-left">حفظ</button>
        </div>
    </div>
</form>
<div id="productUnitsDiv" style="display:none;">
    <option value="-1">اختر وحدة القياس</option>
    <?php  $_smarty_tpl->tpl_vars['unit'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['unit']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['unitsData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['unit']->key => $_smarty_tpl->tpl_vars['unit']->value){
$_smarty_tpl->tpl_vars['unit']->_loop = true;
?>
    <option value="<?php echo $_smarty_tpl->tpl_vars['unit']->value->unitId;?>
"><?php echo $_smarty_tpl->tpl_vars['unit']->value->unitName;?>
</option>
    <?php } ?>
</div>
<div id="result"></div>

<script type="text/javascript">
    /*
     var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "real");
     var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "real");
     var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "real");
     var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "real");
     var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "integer");
     var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6", "integer");
     var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7");
     var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8","integer");
     var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {invalidValue:"-1"});*/
</script>
<?php }} ?>