<?php /* Smarty version Smarty-3.1.11, created on 2025-02-19 23:46:13
         compiled from "../views/default/productview/show.html" */ ?>
<?php /*%%SmartyHeaderCode:82687627267abfda6635834-72228280%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '3a00d5c4ed0deff88c9badca22a3282db9213bbe' => 
    array (
      0 => '../views/default/productview/show.html',
      1 => 1740000156,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '82687627267abfda6635834-72228280',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_67abfda6908666_73899911',
  'variables' => 
  array (
    'youtubes' => 0,
    'outputString' => 0,
    'Programsettingdata' => 0,
    'catDataReport' => 0,
    'data' => 0,
    'usergroupname' => 0,
    'message' => 0,
    'productsData' => 0,
    'userGroupData' => 0,
    'showQuantity' => 0,
    'productCatId' => 0,
    'i' => 0,
    'editCat' => 0,
    'alldata' => 0,
    'proData' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_67abfda6908666_73899911')) {function content_67abfda6908666_73899911($_smarty_tpl) {?><style>
    td.details-control {
        background: url('../views/default/images/details_open.png') no-repeat center center;
        cursor: pointer;
    }

    tr.details td.details-control {
        background: url('../views/default/images/details_close.png') no-repeat center center;
    }


    .mStyle {
        width: 90px;
        text-align: center;
    }

    a:link,
    a:visited,
    a:hover,
    a:active {
        text-align: center !important;
    }

    .product-image-overlay {
        /*        position: fixed;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                background: rgba(0, 0, 0, 0.9);
                z-index: 9999;
                display: none;*/

        position: fixed;
        top: 15%;
        left: 40%;
        /* text-align: center; */
        width: 30%;
        height: 50%;
        background: rgba(4, 0, 0, 0.38);
        z-index: 9999;
        border-radius: 45px;
        display: none;
    }

    .product-image-overlay .product-image-overlay-close {
        display: block;
        position: absolute;
        top: 20px;
        left: 20px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 1px solid #eee;
        line-height: 35px;
        font-size: 20px;
        color: #eee;
        text-align: center;
        cursor: pointer;
    }

    .product-image-overlay img {
        width: auto;
        max-width: 80%;
        position: absolute;
        top: 50%;
        left: 50%;
        -webkit-transform: translate(-50%, -50%);
        -moz-transform: translate(-50%, -50%);
        -o-transform: translate(-50%, -50%);
        transform: translate(-50%, -50%);
    }

    @media print {
        .no-print {
            display: none
        }
    }
</style>

<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">المنتجات</a></li>
            <li><a href="#">المنتجات </a></li>
            <li class="active">عرض المنتجات</li>
        </ol>
        <div class="panel panel-default panel-m">
            <div class="panel-heading hidden-print" style="padding:5px 15px 15px">
                <h3 class="panel-title hidden-print" style="display: inline-block;"> عرض </h3>
                <a href="<?php echo $_smarty_tpl->tpl_vars['youtubes']->value[198]->url;?>
" target="_blank" class="hidden-print"><img
                        src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube"
                        style="width: 2%;"></a>
                <a href="productController.php" class="hidden-print"><input type="button" id="submit"
                        style="margin-left: 12px" class="btn btn-primary pull-left " value="إضافة جديد" /></a>
            </div>
            <div class="panel-body">


                <!---------- start outputString alert ----------->
                <div id="outputString" class="alert alert-block alert-success fade in" style="display:none">
                    <button type="button" class="close pull-left" data-dismiss="alert"
                        aria-hidden="true">&times;</button>
                    <p id="outputStringValue"><?php echo $_smarty_tpl->tpl_vars['outputString']->value;?>
</p>
                    <div class="clearfix"></div>
                </div>
                <!---------  end outputString alert ------------>
                <input type="hidden" id="changeBuyPriceChangeSellInProductCtrl"
                    value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->changeBuyPriceChangeSellInProductCtrl;?>
" />
                <form class="form-inline hidden-print" action="productController.php?do=show" method="post">
                    <div class="form-group">
                        <div class="col-md-2">
                            <label class="sr-only">تصنيف المنتج</label>
                        </div>
                        <select class="select2 wdt300 productCat" data-level="0" name="productCatId0"
                            id="productCatId0">
                            <option value="-1">اختر تصنيف</option>
                            <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['catDataReport']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['data']->key => $_smarty_tpl->tpl_vars['data']->value){
$_smarty_tpl->tpl_vars['data']->_loop = true;
?>
                            <option value="<?php echo $_smarty_tpl->tpl_vars['data']->value->productCatId;?>
"><?php echo $_smarty_tpl->tpl_vars['data']->value->productCatName;?>
</option>
                            <?php } ?>
                        </select>
                        <input type="hidden" id="level" name="level" value="0">
                    </div>

                    <div class="form-group">
                        <div id="manyParents">

                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-4">
                            <label class="sr-only">
                                <input type="checkbox" id="editCat" name="editCat" value="1">
                                تعديل التصنيف
                            </label>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-4">
                            <label class="sr-only">
                                <input type="checkbox" id="showQuantity" name="showQuantity" value="1">
                                عرض الكمية
                            </label>
                        </div>
                    </div>
                    <br />
                    <div class="form-group">
                        <div class="col-md-2">
                            <label class="sr-only">المنتج</label>
                        </div>
                        <input type="hidden" name="searchvalue" id="searchvalue"
                            value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->searchvalue;?>
" />
                        <input type="hidden" id="product" name="product" class="select2product">
                    </div>
                    <div class="form-group">
                        <div class="col-md-2">
                            <label class="sr-only">الباركود</label>
                        </div>
                        <input type="text" name="parcode" id="parcode" class="form-control"
                            onkeypress="getproductbyParcode(event, this.value);">
                    </div>
                    <input type="hidden" name="usergroupname" id="usergroupname" value="<?php echo $_smarty_tpl->tpl_vars['usergroupname']->value;?>
" />
                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
                <br />
            </div>
            <div class="panel panel-default panel-m">
                <!-- Default panel contents -->
                <div class="panel-heading"><?php echo $_smarty_tpl->tpl_vars['message']->value;?>
</div>
                <div class="panel-body">
                    <hr />
                    
                    <form id="form1" name="form1" method="post" action="productController.php?do=executeOperation"
                        onsubmit="if (Spry.Widget.Form.validate(this)) {
                                return countChoosenProducts('productController');
                            } else {
                                return false;
                            }
                          " enctype="multipart/form-data">
                        
                        <div class="table-responsive" id="tableWrap">
                            <?php if (!empty($_smarty_tpl->tpl_vars['productsData']->value)){?>



                            <!-- ================================================   -->
                            <!-- Nav tabs -->
                            <ul class="nav nav-tabs hidden-print">
                                <li class="active"><a href="#tab1" data-toggle="tab">المنتجات</a></li>
                                <li><a href="#tab2" data-toggle="tab"> المنتجات الموقوفة</a></li>
                            </ul>
                            <!-- =================================================   -->
                            <!-- Tab panes -->
                            <div class="tab-content tab-product">
                                <!-- start tab1 -->
                                <div class="tab-pane active" id="tab1" style="">

                                    <!--                                    
                                                                        tr class="danger" style="display:none !important;"
                                                                        
                                                                        <tr style="background-color:#eed3d7!important" class="alert-danger">
                                                                        

                                                                        <tr>
                                                                        -->

                                    <a href="javascript:;" id="toggleAll" data-status="closed"
                                        class="btn btn-default bg-black hidden-print"> فتح / إغلاق الكل</a>
                                    <table class="display table-black" id="productsTable">
                                        <!--tfoot>
                                            <tr>
                                                     <th class="hidden-print">
                                                <label>
                                                  <input type="checkbox" name="checkAll" id="checkAll"/>

                                                </label>
                                              </th>

                                             <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->parcode;?>
<?php $_tmp1=ob_get_clean();?><?php if ($_tmp1==0){?>   <th>الباركود</th><?php }?>
                                              <th>اسم المنتج</th>
                                              <th>اسم التصنيف</th>
                                             <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->priceing;?>
<?php $_tmp2=ob_get_clean();?><?php if ($_tmp2==0){?>
                                              <th>سعر الجملة</th>
                                              <th>سعر النصف جملة</th>
                                              <th>سعر التجزئة</th><?php }?>
                                              <th class="hidden-print">حذف/إلغاء الحذف</th>
                                              <th class="hidden-print">التعديل</th>
                                            </tr>
                                    </tfoot-->
                                        <thead>
                                            <tr>
                                                <th class="hidden-print"></th>
                                                <th class="hidden-print">
                                                    <label>
                                                        <input type="checkbox" name="checkAll" id="checkAll" />
                                                    </label>
                                                </th>
                                                <th>الصورة </th>
                                                <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->parcode;?>
<?php $_tmp3=ob_get_clean();?><?php if ($_tmp3==0){?> <th>الباركود</th><?php }?>
                                                <th style="">اسم المــنتج</th>
                                                <th style="    "> اسم التصنيف </th>
                                                <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->priceing;?>
<?php $_tmp4=ob_get_clean();?><?php if ($_tmp4==0){?>
                                                <th <?php if ($_smarty_tpl->tpl_vars['userGroupData']->value->hideproductcatid==1){?> class="hidden" <?php }?>>سعر
                                                    الشراء</th>
                                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceall==1){?>
                                                <th>سعر الجملة</th>
                                                <?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpricehalf==1){?>
                                                <th>سعر النصف جملة</th>
                                                <?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceunit==1){?>
                                                <th>سعر التجزئة</th>
                                                <?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice4==1){?>
                                                <th>سعر4</th>
                                                <?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice5==1){?>
                                                <th>سعر5</th>
                                                <?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice6==1){?>
                                                <th>سعر6</th>
                                                <?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice7==1){?>
                                                <th>سعر7</th>
                                                <?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice8==1){?>
                                                <th>سعر8</th>
                                                <?php }?>
                                                <th>الترتيب</th>
                                                <?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['showQuantity']->value==1){?> <th>الكمية فى المخازن </th><?php }?>
                                                <th class="hidden-print">
                                                    حذف <br>
                                                    الغاء الحذف
                                                </th>
                                                <th class="hidden-print">التعديل</th>
                                                <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->allowfinsldelete;?>
<?php $_tmp5=ob_get_clean();?><?php if ($_tmp5==0){?>
                                                <th class="hidden-print">حذف </th>
                                                <?php }?>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <!--                                <input name="productCatId" type="text" value="<?php echo $_smarty_tpl->tpl_vars['productCatId']->value;?>
" />-->
                                            <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable(1, null, 0);?>

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

                                            <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->conditions;?>
<?php $_tmp6=ob_get_clean();?><?php if ($_tmp6==0){?>

                                            <tr
                                                data-pro="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
<?php if ($_smarty_tpl->tpl_vars['data']->value->productDataSOC!=''){?>_SOC<?php }?><?php if ($_smarty_tpl->tpl_vars['data']->value->productDataSAC!='[]'){?>_SAC<?php }?><?php if ($_smarty_tpl->tpl_vars['data']->value->productDataING!='[]'){?>_ING<?php }?>">
                                                <td class="hidden-print"></td>
                                                <td class="hidden-print">
                                                    <label>
                                                        <input type="checkbox" name="choosedItem[]" id="checked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"
                                                            class="choosenItem" value="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
" />
                                                        <input type="hidden" name="optic_<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                            id="optic_<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
" value="<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
" />
                                                    </label>
                                                </td>
                                                <td>

                                                    <img src="../views/default/images/product_image/<?php echo $_smarty_tpl->tpl_vars['data']->value->logo;?>
"
                                                        class="moImg" alt="" width="50" height="30" />
                                                </td>
                                                <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->parcode;?>
<?php $_tmp7=ob_get_clean();?><?php if ($_tmp7==0){?> <td> <?php echo $_smarty_tpl->tpl_vars['data']->value->parcode;?>
 </td>
                                                <?php }?>
                                                <td>
                                                    <?php if ($_smarty_tpl->tpl_vars['data']->value->productDataSOC!=''){?>
                                                    <input type='hidden' name='sizecolordetails<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
_SOC'
                                                        id='sizecolordetails<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
_SOC'
                                                        value='<?php echo $_smarty_tpl->tpl_vars['data']->value->productDataSOC;?>
' />
                                                    <?php }?>
                                                    <?php if ($_smarty_tpl->tpl_vars['data']->value->productDataSAC!="[]"){?>
                                                    <input type='hidden' name='sizecolordetails<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
_SAC'
                                                        id='sizecolordetails<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
_SAC'
                                                        value='<?php echo $_smarty_tpl->tpl_vars['data']->value->productDataSAC;?>
' />
                                                    <?php }?>
                                                    <?php if ($_smarty_tpl->tpl_vars['data']->value->productDataING!="[]"){?>
                                                    <input type='hidden' name='sizecolordetails<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
_ING'
                                                        id='sizecolordetails<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
_ING'
                                                        value='<?php echo $_smarty_tpl->tpl_vars['data']->value->productDataING;?>
' />
                                                    <?php }?>
                                                    <label class="hidden hidden-print"> <?php echo $_smarty_tpl->tpl_vars['data']->value->productName;?>
 </label>

                                                    <!--<input type="text" name="productName" data-isOptic="<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
" data-type="name" class="m_product mStyle" style="" data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
" id="productName" value='<?php echo $_smarty_tpl->tpl_vars['data']->value->productName;?>
' />-->
                                                    <textarea name="productName" data-isOptic="<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"
                                                        data-type="name" class="m_product" style=""
                                                        data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
" id="productName"
                                                        rows="1"><?php echo $_smarty_tpl->tpl_vars['data']->value->productName;?>
</textarea>
                                                </td>
                                                <td>
                                                    <label class="hidden hidden-print"> <?php echo $_smarty_tpl->tpl_vars['data']->value->productCatName;?>
 </label>
                                                    <?php if ($_smarty_tpl->tpl_vars['editCat']->value==1){?>
                                                    <select name="productCatId" data-isOptic="<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"
                                                        data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
" data-placeholder=""
                                                        class="select2 wdt100 m_productCat" tabindex="1">
                                                        <!--                                                        <option value="-1">اختر المنتج الرئيسي</option>-->
                                                        <?php  $_smarty_tpl->tpl_vars['proData'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['proData']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['alldata']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['proData']->key => $_smarty_tpl->tpl_vars['proData']->value){
$_smarty_tpl->tpl_vars['proData']->_loop = true;
?>
                                                        <option value="<?php echo $_smarty_tpl->tpl_vars['proData']->value->productCatId;?>
" <?php if ($_smarty_tpl->tpl_vars['proData']->value->productCatId==$_smarty_tpl->tpl_vars['data']->value->productCatId){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['proData']->value->productCatName;?>

                                                        </option>
                                                        <?php } ?>
                                                    </select>
                                                    <?php }else{ ?>
                                                    <?php echo $_smarty_tpl->tpl_vars['data']->value->productCatName;?>

                                                    <?php }?>

                                                </td>
                                                <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->priceing;?>
<?php $_tmp8=ob_get_clean();?><?php if ($_tmp8==0){?>
                                                <td <?php if ($_smarty_tpl->tpl_vars['userGroupData']->value->hideproductcatid==1){?> class="hidden" <?php }?>>
                                                    <input type="text" name="buyprice" data-isOptic="<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"
                                                        data-type="buyprice" class="m_product mStyle"
                                                        data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
" id="productName"
                                                        value='<?php echo $_smarty_tpl->tpl_vars['data']->value->productBuyPrice;?>
' />
                                                    <label class="hidden hidden-print"> <?php echo $_smarty_tpl->tpl_vars['data']->value->productBuyPrice;?>

                                                    </label>

                                                </td>
                                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceall==1){?>
                                                <td>
                                                    <input type="text" name="allprice" data-isOptic="<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"
                                                        data-type="allprice" class="m_product mStyle"
                                                        data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
" id="allpriceNew_<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        value='<?php echo $_smarty_tpl->tpl_vars['data']->value->productSellAllPrice;?>
'
                                                        data-editOther="<?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->editAllPrice==1){?>1<?php }else{ ?>0<?php }?>" />
                                                    <label class="hidden hidden-print"> <?php echo $_smarty_tpl->tpl_vars['data']->value->productSellAllPrice;?>

                                                    </label>
                                                </td>
                                                <?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpricehalf==1){?>
                                                <td>
                                                    <input type="text" name="halfprice" data-isOptic="<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"
                                                        data-type="halfprice" class="m_product mStyle"
                                                        data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        id="halfpriceNew_<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        value='<?php echo $_smarty_tpl->tpl_vars['data']->value->productSellHalfPrice;?>
' />
                                                    <label class="hidden hidden-print"> <?php echo $_smarty_tpl->tpl_vars['data']->value->productSellHalfPrice;?>

                                                    </label>
                                                </td>
                                                <?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showpriceunit==1){?>
                                                <td>
                                                    <input type="text" name="unitPrice" data-isOptic="<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"
                                                        data-type="unitPrice" class="m_product mStyle"
                                                        data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        id="unitPriceNew_<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        value='<?php echo $_smarty_tpl->tpl_vars['data']->value->productSellUnitPrice;?>
' />
                                                    <label class="hidden hidden-print"> <?php echo $_smarty_tpl->tpl_vars['data']->value->productSellUnitPrice;?>

                                                    </label>
                                                </td>
                                                <?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice4==1){?>
                                                <td>
                                                    <input type="text" name="price4" data-isOptic="<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"
                                                        data-type="price4" class="m_product mStyle"
                                                        data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
" id="price4New_<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        value='<?php echo $_smarty_tpl->tpl_vars['data']->value->price4;?>
' />
                                                    <label class="hidden hidden-print"> <?php echo $_smarty_tpl->tpl_vars['data']->value->price4;?>
</label>
                                                </td>
                                                <?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice5==1){?>
                                                <td>
                                                    <input type="text" name="price5" data-isOptic="<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"
                                                        data-type="price5" class="m_product mStyle"
                                                        data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
" id="price5New_<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        value='<?php echo $_smarty_tpl->tpl_vars['data']->value->price5;?>
' />
                                                    <label class="hidden hidden-print"> <?php echo $_smarty_tpl->tpl_vars['data']->value->price5;?>
</label>
                                                </td>
                                                <?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice6==1){?>
                                                <td>
                                                    <input type="text" name="price6" data-isOptic="<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"
                                                        data-type="price6" class="m_product mStyle"
                                                        data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
" id="price6New_<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        value='<?php echo $_smarty_tpl->tpl_vars['data']->value->price6;?>
' />
                                                    <label class="hidden hidden-print"> <?php echo $_smarty_tpl->tpl_vars['data']->value->price6;?>
</label>
                                                </td>
                                                <?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice7==1){?>
                                                <td>
                                                    <input type="text" name="price7" data-isOptic="<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"
                                                        data-type="price7" class="m_product mStyle"
                                                        data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
" id="price7New_<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        value='<?php echo $_smarty_tpl->tpl_vars['data']->value->price7;?>
' />
                                                    <label class="hidden hidden-print"> <?php echo $_smarty_tpl->tpl_vars['data']->value->price7;?>
</label>
                                                </td>
                                                <?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->showprice8==1){?>
                                                <td>
                                                    <input type="text" name="price8" data-isOptic="<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"
                                                        data-type="price8" class="m_product mStyle"
                                                        data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
" id="price8New_<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        value='<?php echo $_smarty_tpl->tpl_vars['data']->value->price8;?>
' />
                                                    <label class="hidden hidden-print"> <?php echo $_smarty_tpl->tpl_vars['data']->value->price8;?>
</label>
                                                </td>
                                                <?php }?>
                                                <td>
                                                    <input type="text" class="sortbypro mStyle"
                                                        data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
" value='<?php echo $_smarty_tpl->tpl_vars['data']->value->sortby;?>
' />
                                                </td>
                                                <?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['showQuantity']->value==1){?> <td><?php echo $_smarty_tpl->tpl_vars['data']->value->currentQuantity;?>
</td><?php }?>
                                                <td class="hidden-print ">
                                                    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->conditions;?>
<?php $_tmp9=ob_get_clean();?><?php if ($_tmp9==0){?>
                                                    <a href="productController.php?do=tempdelete&id=<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
&optic=<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"
                                                        type="button" class="btn btn-default btn-lg removeicon"> </a>
                                                    <?php }else{?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->conditions;?>
<?php $_tmp10=ob_get_clean();?><?php if ($_tmp10==1){?>
                                                    <a href="productController.php?do=returndelete&id=<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
&optic=<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"
                                                        type="button" class="btn btn-default btn-lg correcticon"> </a>
                                                    <?php }}?>
                                                </td>
                                                <?php if ($_smarty_tpl->tpl_vars['data']->value->isOptic==2){?>
                                                <td class="hidden-print">
                                                    <center><a
                                                            href="productController.php?do=editoptid&id=<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                            type="button" class="btn btn-default btn-lg editicon"></a>
                                                    </center>
                                                </td>
                                                <?php }else{ ?>
                                                <td class="hidden-print"><a
                                                        href="productController.php?do=edit&id=<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        type="button" class="btn btn-default btn-lg editicon"></a></td>
                                                <?php }?>


                                                <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->allowfinsldelete;?>
<?php $_tmp11=ob_get_clean();?><?php if ($_tmp11==0){?>
                                                <td class="hidden-print"><a href="#" name="dd" type="button"
                                                        class="btn btn-default btn-lg deleteicon conformdel1"
                                                        data-position="productController.php?do=deleteFinaly&id=<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
&optic=<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"></a>
                                                </td>
                                                <?php }?>
                                            </tr>

                                            <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable($_smarty_tpl->tpl_vars['i']->value+1, null, 0);?>
                                            <?php }?>

                                            <?php } ?>


                                        </tbody>

                                    </table>



                                </div>
                                <!-- start tab2 -->
                                <div class="tab-pane no-print" id="tab2" style="">

                                    <table class="display table-black dataTableClassNoPaging">
                                        <!--tfoot>
                                            <tr>
                                                     <th class="hidden-print">
                                                <label>
                                                  <input type="checkbox" name="checkAll" id="checkAll"/>

                                                </label>
                                              </th>

                                             <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->parcode;?>
<?php $_tmp12=ob_get_clean();?><?php if ($_tmp12==0){?>   <th>الباركود</th><?php }?>
                                              <th>اسم المنتج</th>
                                              <th>اسم التصنيف</th>
                                             <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->priceing;?>
<?php $_tmp13=ob_get_clean();?><?php if ($_tmp13==0){?>
                                              <th>سعر الجملة</th>
                                              <th>سعر النصف جملة</th>
                                              <th>سعر التجزئة</th><?php }?>
                                              <th class="hidden-print">حذف/إلغاء الحذف</th>
                                              <th class="hidden-print">التعديل</th>
                                            </tr>
                                    </tfoot-->
                                        <thead>
                                            <tr>
                                                <th class="hidden-print">
                                                    <label>
                                                        <input type="checkbox" name="checkAll" id="checkAll" />
                                                    </label>
                                                </th>
                                                <th>الصورة </th>
                                                <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->parcode;?>
<?php $_tmp14=ob_get_clean();?><?php if ($_tmp14==0){?> <th>الباركود</th><?php }?>
                                                <th style="">اسم المنتج</th>
                                                <th style="    width: 142px;"> اسم التصنيف </th>
                                                <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->priceing;?>
<?php $_tmp15=ob_get_clean();?><?php if ($_tmp15==0){?>
                                                <th <?php if ($_smarty_tpl->tpl_vars['userGroupData']->value->hideproductcatid==1){?> class="hidden" <?php }?>>سعر
                                                    الشراء</th>
                                                <th>سعر الجملة</th>
                                                <th>سعر النصف جملة</th>
                                                <th>سعر التجزئة</th><?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['showQuantity']->value==1){?><th>الكمية فى المخازن </th><?php }?>
                                                <th class="hidden-print">
                                                    حذف <br>
                                                    الغاء الحذف
                                                </th>
                                                <th class="hidden-print">التعديل</th>
                                                <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->allowfinsldelete;?>
<?php $_tmp16=ob_get_clean();?><?php if ($_tmp16==0){?>
                                                <th class="hidden-print">حذف </th>
                                                <?php }?>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <!--                                <input name="productCatId" type="text" value="<?php echo $_smarty_tpl->tpl_vars['productCatId']->value;?>
" />-->
                                            <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable(1, null, 0);?>

                                            <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['productsData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['data']->key => $_smarty_tpl->tpl_vars['data']->value){
$_smarty_tpl->tpl_vars['data']->_loop = true;
?>
                                            <?php if ($_smarty_tpl->tpl_vars['data']->value->conditions==1){?>
                                            <tr data-pro="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
<?php if ($_smarty_tpl->tpl_vars['data']->value->productDataSOC!=''){?>_SOC<?php }?><?php if ($_smarty_tpl->tpl_vars['data']->value->productDataSAC!='[]'){?>_SAC<?php }?><?php if ($_smarty_tpl->tpl_vars['data']->value->productDataING!='[]'){?>_ING<?php }?>"
                                                style="background-color:#eed3d7!important" class="alert-danger">
                                                <td class="hidden-print">
                                                    <label>
                                                        <input type="checkbox" name="choosedItem[]" id="checked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"
                                                            class="choosenItem" value="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
" />
                                                    </label>
                                                </td>
                                                <td>

                                                    <img src="../views/default/images/product_image/<?php echo $_smarty_tpl->tpl_vars['data']->value->logo;?>
"
                                                        class="moImg" alt="" width="50" height="30" />
                                                </td>
                                                <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->parcode;?>
<?php $_tmp17=ob_get_clean();?><?php if ($_tmp17==0){?> <td> <?php echo $_smarty_tpl->tpl_vars['data']->value->parcode;?>
 </td>
                                                <?php }?>
                                                <td>
                                                    <label class="hidden hidden-print"> <?php echo $_smarty_tpl->tpl_vars['data']->value->productName;?>
 </label>

                                                    <!--<input type="text" name="productName" data-type="name" class="m_product mStyle" style="" data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
" id="productName" value='<?php echo $_smarty_tpl->tpl_vars['data']->value->productName;?>
' />-->
                                                    <textarea name="productName" data-isOptic="<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"
                                                        data-type="name" class="m_product" style=""
                                                        data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
" id="productName"
                                                        rows="1"><?php echo $_smarty_tpl->tpl_vars['data']->value->productName;?>
</textarea>

                                                </td>
                                                <td>
                                                    <label class="hidden hidden-print"> <?php echo $_smarty_tpl->tpl_vars['data']->value->productCatName;?>
 </label>
                                                    <?php if ($_smarty_tpl->tpl_vars['editCat']->value==1){?>
                                                    <select name="productCatId" data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        data-placeholder="" class="select2 wdt100 m_productCat"
                                                        tabindex="1">
                                                        <option value="-1">اختر المنتج الرئيسي</option>
                                                        <?php  $_smarty_tpl->tpl_vars['proData'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['proData']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['alldata']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['proData']->key => $_smarty_tpl->tpl_vars['proData']->value){
$_smarty_tpl->tpl_vars['proData']->_loop = true;
?>
                                                        <option value="<?php echo $_smarty_tpl->tpl_vars['proData']->value->productCatId;?>
" <?php if ($_smarty_tpl->tpl_vars['proData']->value->productCatId==$_smarty_tpl->tpl_vars['data']->value->productCatId){?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['proData']->value->productCatName;?>

                                                        </option>
                                                        <?php } ?>
                                                    </select>
                                                    <?php }else{ ?>
                                                    <?php echo $_smarty_tpl->tpl_vars['data']->value->productCatName;?>

                                                    <?php }?>
                                                </td>
                                                <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->priceing;?>
<?php $_tmp18=ob_get_clean();?><?php if ($_tmp18==0){?>
                                                <td <?php if ($_smarty_tpl->tpl_vars['userGroupData']->value->hideproductcatid==1){?> class="hidden" <?php }?>>
                                                    <input type="text" name="buyprice" data-type="buyprice"
                                                        class="m_product mStyle" data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        id="productName" value='<?php echo $_smarty_tpl->tpl_vars['data']->value->productBuyPrice;?>
' />
                                                    <label class="hidden hidden-print"> <?php echo $_smarty_tpl->tpl_vars['data']->value->productBuyPrice;?>

                                                    </label>

                                                </td>
                                                <td>
                                                    <input type="text" name="allprice" data-type="allprice"
                                                        class="m_product mStyle" data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        id="allpriceNew_<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        value='<?php echo $_smarty_tpl->tpl_vars['data']->value->productSellAllPrice;?>
'
                                                        data-editOther="<?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->editAllPrice==1){?>1<?php }else{ ?>0<?php }?>" />
                                                    <label class="hidden hidden-print"> <?php echo $_smarty_tpl->tpl_vars['data']->value->productSellAllPrice;?>

                                                    </label>
                                                </td>
                                                <td>
                                                    <input type="text" name="halfprice" data-type="halfprice"
                                                        class="m_product mStyle" data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        id="halfpriceNew_<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        value='<?php echo $_smarty_tpl->tpl_vars['data']->value->productSellHalfPrice;?>
' />
                                                    <label class="hidden hidden-print"> <?php echo $_smarty_tpl->tpl_vars['data']->value->productSellHalfPrice;?>

                                                    </label>

                                                </td>
                                                <td>
                                                    <input type="text" name="unitPrice" data-type="unitPrice"
                                                        class="m_product mStyle" data-id="<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        id="unitPriceNew_<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        value='<?php echo $_smarty_tpl->tpl_vars['data']->value->productSellUnitPrice;?>
' />
                                                    <label class="hidden hidden-print"> <?php echo $_smarty_tpl->tpl_vars['data']->value->productSellUnitPrice;?>

                                                    </label>

                                                </td><?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['showQuantity']->value==1){?><td><?php echo $_smarty_tpl->tpl_vars['data']->value->currentQuantity;?>
</td><?php }?>
                                                <td class="hidden-print ">
                                                    <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->conditions;?>
<?php $_tmp19=ob_get_clean();?><?php if ($_tmp19==0){?>
                                                    <a href="productController.php?do=tempdelete&id=<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
&optic=<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"
                                                        type="button" class="btn btn-default btn-lg removeicon"> </a>
                                                    <?php }else{?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['data']->value->conditions;?>
<?php $_tmp20=ob_get_clean();?><?php if ($_tmp20==1){?>
                                                    <a href="productController.php?do=returndelete&id=<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
&optic=<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"
                                                        type="button" class="btn btn-default btn-lg correcticon"> </a>
                                                    <?php }}?>
                                                </td>
                                                <?php if ($_smarty_tpl->tpl_vars['data']->value->isOptic==2){?>
                                                <td class="hidden-print">
                                                    <center><a
                                                            href="productController.php?do=editoptid&id=<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                            type="button" class="btn btn-default btn-lg editicon"></a>
                                                    </center>
                                                </td>
                                                <?php }else{ ?>
                                                <td class="hidden-print"><a
                                                        href="productController.php?do=edit&id=<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
"
                                                        type="button" class="btn btn-default btn-lg editicon"></a></td>
                                                <?php }?>


                                                <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->allowfinsldelete;?>
<?php $_tmp21=ob_get_clean();?><?php if ($_tmp21==0){?>
                                                <td class="hidden-print"><a href="#" name="dd" type="button"
                                                        class="btn btn-default btn-lg deleteicon conformdel1"
                                                        data-position="productController.php?do=deleteFinaly&id=<?php echo $_smarty_tpl->tpl_vars['data']->value->productId;?>
&optic=<?php echo $_smarty_tpl->tpl_vars['data']->value->isOptic;?>
"></a>
                                                </td>
                                                <?php }?>
                                            </tr>

                                            <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable($_smarty_tpl->tpl_vars['i']->value+1, null, 0);?>
                                            <?php }?>


                                            <?php } ?>


                                        </tbody>

                                    </table>



                                </div>
                            </div>




                            <?php }?>

                            <div class="clearfix"></div>
                        </div>
                        <hr class="hidden-print" />
                        <div class="hidden-print">
                            <div class="col-lg-12">
                                <div class="well well-sm">
                                    <div class="form-group">
                                        <div class="col-lg-4">
                                            <label for="operation"></label>
                                            <span id="spryselect1">
                                                <select name="operation" id="operation" data-placeholder="اختر العملية"
                                                    class="select2 wdt100">
                                                    <option></option>
                                                    <option value="1">حذف مؤقت</option>

                                                    <option value="2">إلغاء الحذف</option>
                                                    <option value="3">حذف نهائى</option>
                                                </select>
                                                <span class="selectRequiredMsg">اختر العملية</span></span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-lg-4">
                                            <input name="" class="hidden-print btn btn-primary" type="submit"
                                                value="تنفيذ" />
                                        </div>
                                    </div>

                                    <!-----------  start noElementsError alert ------------->
                                    <div class="clearfix"></div>
                                    <div id="noElementsError" class="alert alert-danger fade in" style="display:none;">
                                        <button type="button" class="close pull-left" data-dismiss="alert"
                                            aria-hidden="true">×</button>
                                        <p>يجب اختيار العناصر أولاً</p>
                                        <div class="clearfix"></div>
                                    </div>
                                    <!----------  end noElementsError alert -------------->

                                    <div class="clearfix"></div>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                        </div>


                        <!-- Modal -->
                        <div class="hidden-print">
                            <div class="modal fade " id="myModal1" tabindex="-1" role="dialog"
                                aria-labelledby="myModalLabel" aria-hidden="true">
                                <div class="modal-dialog">
                                    <div class="modal-content">
                                        <div class="modal-header">
                                            <button type="button" class="close pull-left" data-dismiss="modal"
                                                aria-hidden="true">&times;</button>
                                            <h4 class="modal-title">تأكيد حذف مجموعة</h4>
                                        </div>
                                        <div class="modal-body"> هل تريد حذف هذا المنتج ؟ </div>
                                        <div class="modal-footer">
                                            <button type="button" class="btn btn-default"
                                                data-dismiss="modal">لا</button>
                                            <button type="button" class="btn btn-primary savemodel1">نعم</button>
                                        </div>
                                    </div>
                                    <!-- /.modal-content -->
                                </div>
                                <!-- /.modal-dialog -->
                            </div>
                        </div>
                        <!-- /.modal -->

                        <div class="hidden-print">
                            <div class="col-lg-12">
                                <div class="form-group">
                                    <div class="col-lg-4">
                                        <button type="button" onclick="print_Custom('mycustomheader');"
                                            class="btn btn-success pull-right">طباعة</button>

                                    </div>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                    </form>
                    <script type="text/javascript">
                        var x = document.getElementById("tableWrap").innerHTML;
                        $(document).ready(function (e) {

                            document.getElementById("data").value = x;
                        });</script>
                    <form name="jazx" id="excel" action="http://localhost/newstorex/untitled.php" method="post">
                        <input type="hidden" name="data" id="data" />
                        <br />
                        <!--input type="submit" name="button" id="button" class="btn btn-success pull-right" value="ملف اكسل" /-->
                    </form>
                </div>
            </div>
        </div>
    </div>

    <!-- Modal -->
    <div class="hidden-print modal fade" id="sucessmodel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
        aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close pull-left" data-dismiss="modal"
                        aria-hidden="true">&times;</button>
                    <span style="font-weight:bold">تعديل المنتج</span>
                </div>
                <div class="modal-body"> لقد تم تعديل المنتج <br />
                    <span id="columupdated"></span> &nbsp; <span id="columupdatedvalue"></span>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">غلق</button>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->
    <script>
        var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1");
        $('body').on('click', '.moImg', function () {

            $('body').append('<div class="product-image-overlay"><span class="product-image-overlay-close">x</span><img src="" /></div>');
            var productImage = $('img');
            var productOverlay = $('.product-image-overlay');
            var productOverlayImage = $('.product-image-overlay img');
            productImage.click(function () {
                var productImageSource = $(this).attr('src');
                productOverlayImage.attr('src', productImageSource);
                productOverlay.fadeIn(100);
                $('body').css('overflow', 'hidden');
                $('.product-image-overlay-close').click(function () {
                    productOverlay.fadeOut(100);
                    $('body').css('overflow', 'auto');
                });
            });
        });
    </script>
    <script>

        $('.nav-tabs li').on('click', function () {
            $(".tab-product .tab-pane").toggleClass("no-print");
            // if ($(".tab-product .tap-pane" ).hasClass('no-print') ) {
            //     alert(444);
            //     console.log("the tab is already active");
            //     $("this").removeClass('no-print');

            // }
            // else {
            //     $(".tab-product .tap-pane").addClass('no-print');
            // }
        });

    </script>

    
    <script>
        $('body').on('change', '.sortbypro', function () {
            var sortbys = Number($(this).val());
            var myid = Number($(this).attr('data-id'));
            $.post('productControllerAjax.php?do=changesortby', { myid: myid, sortbys: sortbys });
        });
        $(function () {

            $(".select2product").select2({
                placeholder: "المنتج",
                minimumInputLength: document.getElementById("searchvalue").value,
                multiple: false,
                quietMillis: 100,
                containerCssClass: "wdt300",
                ajax: {
                    url: "sellbillAjaxController.php?do=getProducts2",
                    dataType: 'json',
                    data: function (term, page) {
                        //alert("sellbillAjaxController.php?do=getProducts&term="+term+"&page_limit=10&storeid="+document.getElementById("storeid").value);
                        return {
                            term: term, //search term
                            page_limit: 10, // page size,
                        };
                    },
                    results: function (data) {

                        return { results: data };
                    }
                },
                formatResult: function (data) {
                    return data.text;
                    //            if (Number(data.id) == -2) {
                    //                return  '<span class="newoption">' + data.text + '</span >';
                    //            } else {
                    //                return  '<span>' + data.text + '</span >';
                    //            }
                },
                initSelection: function (element, callback) {
                    var item = element.val().split(':');
                    var data = { id: item[0], text: item[1], productquantity: item[2], price: item[3] };
                    callback(data);
                }

            });
        });
        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>
    <?php }} ?>