<?php /* Smarty version Smarty-3.1.11, created on 2025-02-20 15:34:47
         compiled from "../views/default/productlimitreportview/show.html" */ ?>
<?php /*%%SmartyHeaderCode:42172885867b72f77c89f91-13915734%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'c8e996e07ab36fd03469950b7d7e2624bd7d60ce' => 
    array (
      0 => '../views/default/productlimitreportview/show.html',
      1 => 1740000148,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '42172885867b72f77c89f91-13915734',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'youtubes' => 0,
    'searchinonestore' => 0,
    'storeid' => 0,
    'storedef' => 0,
    'storeData' => 0,
    'store' => 0,
    'catDataReport' => 0,
    'data' => 0,
    'storedetailData' => 0,
    'message' => 0,
    'searchtype' => 0,
    'x' => 0,
    'storedetail' => 0,
    'hidecat' => 0,
    'total' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_67b72f77d18b47_09736988',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_67b72f77d18b47_09736988')) {function content_67b72f77d18b47_09736988($_smarty_tpl) {?><style>
    .myresult
    {
        -webkit-print-color-adjust: exact;
    }
</style>




<div class="row">
    <div class="container">


        <ol class="breadcrumb">
            <li><a href="#">التقارير</a></li>
            <li class="active">تقرير المنتجات بالمخزن اقل من الحد الأدنى</li>

        </ol>




        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">
                تقرير المنتجات بالمخزن اقل من الحد الأدنى
                <a href="<?php echo $_smarty_tpl->tpl_vars['youtubes']->value[64]->url;?>
" target="_blank" class="hidden-print"><img src="../views/default/assets/img/youtube.png" class="pull-left" alt="Youtube" style="width: 2%;"></a>

            </div>
            <div class="panel-body">





                <form class="form-inline hidden-print" action="productlimitreportController.php?do=show" method="post">









                    <?php if ($_smarty_tpl->tpl_vars['searchinonestore']->value!=0){?>
                    <div class="form-group">
                        <label class="sr-only">المخزن</label>
                        <input type="hidden" name="storeId" id="storeId"  value="<?php echo $_smarty_tpl->tpl_vars['storeid']->value;?>
"  >
                        <?php echo $_smarty_tpl->tpl_vars['storedef']->value->storeName;?>

                    </div>
                    <?php }else{ ?>
                    <div class="form-group">
                        <label class="sr-only">المخزن</label>
                        <select class="select2 wdt300"  name="storeId" id="storeId">
                            <option value="-1">اختر مخزن</option>
                            <?php  $_smarty_tpl->tpl_vars['store'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['store']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storeData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['store']->key => $_smarty_tpl->tpl_vars['store']->value){
$_smarty_tpl->tpl_vars['store']->_loop = true;
?>
                            <option value="<?php echo $_smarty_tpl->tpl_vars['store']->value->storeId;?>
"><?php echo $_smarty_tpl->tpl_vars['store']->value->storeName;?>
</option>
                            <?php } ?>
                        </select>
                    </div>
                    <?php }?>




                    <div class="form-group">
                        <label class="sr-only">الترتيب</label>
                        <select class="select2 wdt300"  name="order" id="order" >
                            <option value="asc">تصاعدى</option>
                            <option value="desc">تنازلى</option>
                        </select>
                    </div>

                    <div style="clear: both"></div>
                    <br />

                    <div class="form-group col-lg-3">
                        <label class="sr-only">تصنيف المنتج</label>
                        <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 id="manyParents">

                    </div>
                    <div class="form-group col-lg-3">
                        <div><label class="sr-only">نوع البحث</label></div>
                        <div class="radio-inline">
                            <label>
                                <input value="0" name="searchtype"  type="radio" checked="checked"  />
                                منتج نهائى   </label>
                        </div>
                        <div class="radio-inline">
                            <label>
                                <input value="1" name="searchtype"   type="radio"    />
                                اخر تصنيف   </label>
                        </div>

                    </div>
                    <div class="form-group">
                        <label class="sr-only">استخدام الحد الادنى من </label>
                        <div  class="input-group">
                            <label>  <input value="product" name="searchStoreLimitType" id="searchStoreLimitProduct" type="radio" checked onclick='localStorage.setItem("searchStoreLimitType", "product");
                                    window.location.reload();'>
                                المنتجات</label>
                            <label>
                                <input value="productstore" name="searchStoreLimitType" id="searchStoreLimitProductStore" type="radio" onclick='localStorage.setItem("searchStoreLimitType", "productstore");
                                        window.location.reload();'>
                                الحد الادنى للمنتجات فى المخزن</label>
                        </div>
                    </div>
                    <div style="clear: both"></div>
                    <br />
                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>



            </div>


            <?php ob_start();?><?php echo count($_smarty_tpl->tpl_vars['storedetailData']->value);?>
<?php $_tmp1=ob_get_clean();?><?php if ($_tmp1>0){?>

            <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/>


                    <?php if ($_smarty_tpl->tpl_vars['searchtype']->value==0){?>
                    <table class="table table-black dataTableClass">
                        <thead>
                            <tr>

                                <th>الرقم </th>
                                <th>اسم المخزن</th>
                                <th>اسم المنتج</th>
                                <th>الحد الادنى</th>
                                <th>الكمية</th>


                            </tr>
                        </thead>
                        <tbody>


                            <?php $_smarty_tpl->tpl_vars['total'] = new Smarty_variable(0, null, 0);?>
                            <?php $_smarty_tpl->tpl_vars['x'] = new Smarty_variable(1, null, 0);?>
                            <?php  $_smarty_tpl->tpl_vars['storedetail'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['storedetail']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storedetailData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['storedetail']->key => $_smarty_tpl->tpl_vars['storedetail']->value){
$_smarty_tpl->tpl_vars['storedetail']->_loop = true;
?>
                            <tr>
                                <td><?php echo $_smarty_tpl->tpl_vars['x']->value;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['storedetail']->value->storeName;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['storedetail']->value->productName;?>

                                    <?php if ($_smarty_tpl->tpl_vars['hidecat']->value==1){?>
                                    /<?php echo $_smarty_tpl->tpl_vars['storedetail']->value->productCatName;?>

                                    <?php }?>
                                </td>
                                <td><?php echo $_smarty_tpl->tpl_vars['storedetail']->value->limitamount;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['storedetail']->value->productquantity;?>
</td>

                            </tr>
                            <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'x', null); ob_start(); ?><?php echo $_smarty_tpl->tpl_vars['x']->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 $_smarty_tpl->_capture_stack[0][] = array('default', 'total', null); ob_start(); ?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['storedetail']->value->productquantity;?>
<?php $_tmp2=ob_get_clean();?><?php echo $_smarty_tpl->tpl_vars['total']->value+$_tmp2;?>
<?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 } ?>


                        </tbody>
                    </table>
                    <?php }else{ ?>
                    <table class="table table-black">
                        <thead>
                            <tr>

                                <th>الرقم </th>
                                <th>اسم المنتج</th>
                                <th>الكمية</th>


                            </tr>
                        </thead>
                        <tbody>


                            <?php $_smarty_tpl->tpl_vars['total'] = new Smarty_variable(0, null, 0);?>
                            <?php $_smarty_tpl->tpl_vars['x'] = new Smarty_variable(1, null, 0);?>
                            <?php  $_smarty_tpl->tpl_vars['storedetail'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['storedetail']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['storedetailData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['storedetail']->key => $_smarty_tpl->tpl_vars['storedetail']->value){
$_smarty_tpl->tpl_vars['storedetail']->_loop = true;
?>
                            <tr>
                                <td><?php echo $_smarty_tpl->tpl_vars['x']->value;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['storedetail']->value->productName;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['storedetail']->value->productquantity;?>
</td>

                            </tr>
                            <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'x', null); ob_start(); ?><?php echo $_smarty_tpl->tpl_vars['x']->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 $_smarty_tpl->_capture_stack[0][] = array('default', 'total', null); ob_start(); ?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['storedetail']->value->productquantity;?>
<?php $_tmp3=ob_get_clean();?><?php echo $_smarty_tpl->tpl_vars['total']->value+$_tmp3;?>
<?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 } ?>


                        </tbody>
                    </table>
                    <?php }?>
                    <div class="col-lg-offset-8 col-lg-4">
                        <div class="well well-sm">
                            <h4 class="text-center">اجمالى عدد الوحدات <?php echo $_smarty_tpl->tpl_vars['total']->value;?>
</h4>
                        </div>
                    </div>

                    <?php }?>



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


                    <hr />



                    <?php ob_start();?><?php echo count($_smarty_tpl->tpl_vars['storedetailData']->value);?>
<?php $_tmp4=ob_get_clean();?><?php if ($_tmp4>0){?>
                    <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 hidden-print">طباعة</button>
                                </div>
                            </div>


                        </div>

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

                    <?php }?>



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






            </div>

        </div>
        
        <script>

            var search = localStorage.getItem("searchStoreLimitType");
            if (!search || search == "product") {
                $('#searchStoreLimitProduct').attr('checked', 'checked');
                $('#searchStoreLimitProductStore').removeAttr('checked');
            } else {
                $('#searchStoreLimitProductStore').attr('checked', 'checked');
                $('#searchStoreLimitProduct').removeAttr('checked');
            }
        </script>
        <?php }} ?>