<?php /* Smarty version Smarty-3.1.11, created on 2025-07-24 16:53:15
         compiled from "..\views\default\buyBillview\linkExcelProducts.html" */ ?>
<?php /*%%SmartyHeaderCode:673568823acbef4f50-34285993%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '2c79ea7cab8e66a4b773548c0b5720fddbba53aa' => 
    array (
      0 => '..\\views\\default\\buyBillview\\linkExcelProducts.html',
      1 => 1672089199,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '673568823acbef4f50-34285993',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'Programsettingdata' => 0,
    'billdate' => 0,
    'productsArr' => 0,
    'pro' => 0,
    'existingExcelInfo_pro' => 0,
    'i' => 0,
    'existingExcelInfo_cat' => 0,
    'existingExcelInfo_size' => 0,
    'existingExcelInfo_color' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_68823acc23f037_16277400',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_68823acc23f037_16277400')) {function content_68823acc23f037_16277400($_smarty_tpl) {?><style>
    .newoption {
        background-color:#CCCCCC !important;
        font-weight:bold !important;
    }
    .nodata{
        background-color: #428bca;
        color: white;
        border-radius: 13px;
        margin: 14px;
        font-size: 15px;
        text-align: right;
        padding: 5px;
    }
</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">
                <h3 class="panel-title">ربط المنتجات من الاكسل</h3>
            </div>

            <div class="panel-body">
                <form action="buyBillController.php?do=doLinkExcelProducts" method="post" id="myProductForm" name="myProductForm" enctype="multipart/form-data">
                    <div class="table-responsive" id="tableWrap">
                        <input type="hidden" name="searchvalue" id="searchvalue" value="<?php echo $_smarty_tpl->tpl_vars['Programsettingdata']->value->searchvalue;?>
"/>
                        <input type="hidden" name="billdateExcel" id="billdateExcel" value="<?php echo $_smarty_tpl->tpl_vars['billdate']->value;?>
"/>


                        <table class="table table-black dataTableClassNoPaging">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th>التصنيف</th>
                                    <th>المنتج</th>
                                    <th>المقاس</th>
                                    <th>اللون</th>
                                    <th>التصنيف فى البرنامج</th>
                                    <th>المنتج فى البرنامج</th>
                                    <th>المقاس فى البرنامج</th>
                                    <th>اللون فى البرنامج</th>
                                    <th>سعر الشراء</th>
                                    <th>سعر جملة</th>
                                    <th>سعر نصف جملة</th>
                                    <th>سعر قطاعى</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable(1, null, 0);?>
                                <?php  $_smarty_tpl->tpl_vars['pro'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['pro']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['productsArr']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['pro']->key => $_smarty_tpl->tpl_vars['pro']->value){
$_smarty_tpl->tpl_vars['pro']->_loop = true;
?>
                                <tr <?php if (isset($_smarty_tpl->tpl_vars['existingExcelInfo_pro']->value[$_smarty_tpl->tpl_vars['pro']->value->productid])&&$_smarty_tpl->tpl_vars['existingExcelInfo_pro']->value[$_smarty_tpl->tpl_vars['pro']->value->productid]->productId>0){?> <?php }else{ ?> class="danger"<?php }?>>
                                    <td><?php echo $_smarty_tpl->tpl_vars['i']->value;?>
</td>
                                    <td>
                                        <?php echo $_smarty_tpl->tpl_vars['pro']->value->catname;?>

                                        <input type="hidden" name="catid<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="catid<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->catid;?>
"/>
                                        <input type="hidden" name="catname<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="catname<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->catname;?>
"/>
                                    </td>
                                    <td>
                                        <?php echo $_smarty_tpl->tpl_vars['pro']->value->productname;?>

                                        <input type="hidden" name="productid<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="productid<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->productid;?>
"/>
                                        <input type="hidden" name="productname<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="productname<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->productname;?>
"/>
                                        <input type="hidden" name="productparcode<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="productparcode<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->parcode;?>
"/>
                                        <input type="hidden" name="quantity<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="quantity<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->quantity;?>
"/>
                                        <input type="hidden" name="price<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="price<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->price;?>
"/>
                                    </td>
                                    <td>
                                        <?php echo $_smarty_tpl->tpl_vars['pro']->value->colorname;?>

                                        <input type="hidden" name="sizeid<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="sizeid<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->sizeid;?>
"/>
                                        <input type="hidden" name="sizename<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="sizename<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->sizename;?>
"/>
                                    </td>
                                    <td>
                                        <?php echo $_smarty_tpl->tpl_vars['pro']->value->sizename;?>

                                        <input type="hidden" name="colorid<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="colorid<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->colorid;?>
"/>
                                        <input type="hidden" name="colorname<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="colorname<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->colorname;?>
"/>
                                    </td>
                                    <td>
                                        <?php if (isset($_smarty_tpl->tpl_vars['existingExcelInfo_cat']->value[$_smarty_tpl->tpl_vars['pro']->value->catid])&&$_smarty_tpl->tpl_vars['existingExcelInfo_cat']->value[$_smarty_tpl->tpl_vars['pro']->value->catid]->catExcelid>0){?>
                                        <?php echo $_smarty_tpl->tpl_vars['existingExcelInfo_cat']->value[$_smarty_tpl->tpl_vars['pro']->value->catid]->productCatName;?>

                                        <input type="hidden" name="catprog<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="catprog<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['existingExcelInfo_cat']->value[$_smarty_tpl->tpl_vars['pro']->value->catid]->productCatId;?>
"/>
                                        <input type="hidden" name="catIsLinked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="catIsLinked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="1"/>
                                        <?php }else{ ?>
                                        <input type="hidden" name="catprog<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="catprog<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" class="catprog"/>
                                        <input type="hidden" name="catIsLinked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="catIsLinked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="0"/>
                                        <input type="hidden" name="catNameFromUser<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="catNameFromUser<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" class="form-control" value=""/>
                                        <?php }?>
                                    </td>
                                    <td>
                                        <?php if (isset($_smarty_tpl->tpl_vars['existingExcelInfo_pro']->value[$_smarty_tpl->tpl_vars['pro']->value->productid])&&$_smarty_tpl->tpl_vars['existingExcelInfo_pro']->value[$_smarty_tpl->tpl_vars['pro']->value->productid]->productId>0){?>
                                        <?php echo $_smarty_tpl->tpl_vars['existingExcelInfo_pro']->value[$_smarty_tpl->tpl_vars['pro']->value->productid]->productName;?>

                                        <input type="hidden" name="productprog<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="productprog<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['existingExcelInfo_pro']->value[$_smarty_tpl->tpl_vars['pro']->value->productid]->productId;?>
"/>
                                        <input type="hidden" name="productIsLinked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="productIsLinked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="1"/>
                                        <?php }else{ ?>
                                        <input type="hidden" name="productprog<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="productprog<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" class="productprog"/>
                                        <input type="hidden" name="productIsLinked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="productIsLinked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="0"/>
                                        <input type="hidden" name="productNameFromUser<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="productNameFromUser<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" class="form-control" value=""/>
                                        <?php }?>

                                    </td>
                                    <td>
                                        <?php if (isset($_smarty_tpl->tpl_vars['existingExcelInfo_size']->value[$_smarty_tpl->tpl_vars['pro']->value->sizeid])&&$_smarty_tpl->tpl_vars['existingExcelInfo_size']->value[$_smarty_tpl->tpl_vars['pro']->value->sizeid]->id>0){?>
                                        <?php echo $_smarty_tpl->tpl_vars['existingExcelInfo_size']->value[$_smarty_tpl->tpl_vars['pro']->value->sizeid]->name;?>

                                        <input type="hidden" name="sizeprog<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="sizeprog<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['existingExcelInfo_pro']->value[$_smarty_tpl->tpl_vars['pro']->value->sizeid]->id;?>
"/>
                                        <input type="hidden" name="sizeIsLinked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="sizeIsLinked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="1"/>
                                        <?php }else{ ?>


                                        <input type="hidden" name="sizeprog<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="sizeprog<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" class="<?php if ($_smarty_tpl->tpl_vars['pro']->value->sizeid>0){?>sizeprog<?php }?>"/>
                                        <input type="hidden" name="sizeIsLinked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="sizeIsLinked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="0"/>


                                        <?php }?>
                                        <input type="hidden" name="sizename<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="sizename<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->sizename;?>
"/>
                                        <input type="hidden" name="sizeidExcel<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="sizeidExcel<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->sizeid;?>
"/>
                                    </td>
                                    <td>
                                        <?php if (isset($_smarty_tpl->tpl_vars['existingExcelInfo_color']->value[$_smarty_tpl->tpl_vars['pro']->value->colorid])&&$_smarty_tpl->tpl_vars['existingExcelInfo_color']->value[$_smarty_tpl->tpl_vars['pro']->value->colorid]->id>0){?>
                                        <?php echo $_smarty_tpl->tpl_vars['existingExcelInfo_color']->value[$_smarty_tpl->tpl_vars['pro']->value->colorid]->name;?>

                                        <input type="hidden" name="colorprog<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="colorprog<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['existingExcelInfo_color']->value[$_smarty_tpl->tpl_vars['pro']->value->colorid]->id;?>
"/>
                                        <input type="hidden" name="colorIsLinked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="colorIsLinked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="1"/>
                                        <?php }else{ ?>
                                        <input type="hidden" name="colorprog<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="colorprog<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" data-itr="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" class="<?php if ($_smarty_tpl->tpl_vars['pro']->value->colorid>0){?>colorprog<?php }?>"/>
                                        <input type="hidden" name="colorIsLinked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="colorIsLinked<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="0"/>
                                        <?php }?>
                                        <input type="hidden" name="colorname<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="colorname<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->colorname;?>
"/>
                                        <input type="hidden" name="coloridExcel<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="coloridExcel<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->colorid;?>
"/>
                                    </td>
                                    <td><input type="text" readonly name="price_RO<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="price_RO<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" class="form-control" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->price;?>
"/></td>
                                    <td><input type="text" name="sellAllPrice<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="sellAllPrice<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" class="form-control positivefloat" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->price;?>
"/></td>
                                    <td><input type="text" name="sellHalfPrice<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="sellHalfPrice<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" class="form-control positivefloat" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->price;?>
"/></td>
                                    <td><input type="text" name="sellUnitPrice<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" id="sellUnitPrice<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
" class="form-control positivefloat" value="<?php echo $_smarty_tpl->tpl_vars['pro']->value->price;?>
"/></td>
                                </tr>
                                <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable($_smarty_tpl->tpl_vars['i']->value+1, null, 0);?>
                                <?php } ?>

                            </tbody>
                        </table>
                        <input type="hidden" name="itr" id="itr" value="<?php echo $_smarty_tpl->tpl_vars['i']->value;?>
"/>

                        <div class="form-group">
                            <div class="col-lg-offset-2 col-lg-4">
                                <button type="button" id="savebtn"  class="btn btn-primary pull-left">التالى </button>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                        <hr/>
                        <div class="nodata">
                            <hr>
                            <ul>
                                <li>عند اختيار تصنيف جديد فسوف تتم اضافته . واذا كان الاسم موجود فى البرنامج فعلا فسوف يتم الربط مع الموجود</li>
                                <li>عند اختيار منتج جديد فسوف تتم اضافته . واذا كان الاسم موجود فى البرنامج فعلا فسوف يتم الربط مع الموجود</li>
                                <li>عند اختيار مقاس جديد فسوف تتم اضافته . واذا كان الاسم موجود فى البرنامج فعلا فسوف يتم الربط مع الموجود</li>
                                <li>عند اختيار منتج جديد فسوف تتم اضافته . واذا كان الاسم موجود فى البرنامج فعلا فسوف يتم الربط مع الموجود</li>
                                <li>يتم نقل الفاتورة بالقطعة</li>
                            </ul>
                            <hr>
                        </div>
                    </div>
                    <div class="clearfix"></div>
                    <br/>
                </form>

            </div> <!-- end of panel-body-->

        </div>  <!-- end of panel panel-default-->

    </div> <!-- end of container-->

</div>  <!-- end of row-->



<?php }} ?>