<?php /* Smarty version Smarty-3.1.11, created on 2023-10-21 21:23:43
         compiled from "../views/default/productbuyreportview/show.html" */ ?>
<?php /*%%SmartyHeaderCode:3964773546534172f706592-28661942%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '1829a2ec497a4ac004b1a34dd1f4a00f6ff3dcc5' => 
    array (
      0 => '../views/default/productbuyreportview/show.html',
      1 => 1693253994,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '3964773546534172f706592-28661942',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'youtubes' => 0,
    'productCatData' => 0,
    'productCat' => 0,
    'storesData' => 0,
    'store' => 0,
    'productData' => 0,
    'message' => 0,
    'totalRemainQuantity' => 0,
    'totalreturn' => 0,
    'i' => 0,
    'product' => 0,
    'hidecat' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_6534172f7b4175_10498455',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6534172f7b4175_10498455')) {function content_6534172f7b4175_10498455($_smarty_tpl) {?><style>
    .myresult {
        -webkit-print-color-adjust: exact;
    }
</style>

<script>



    function hidebuyfun() {

        if (document.getElementById('hidebuy').checked == true)
        {

            $('.buy1').css('display', 'none');
        } else if (document.getElementById('hidebuy').checked == false)
        {
            $('.buy1').css('display', 'block');
        }


    }

</script>



<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[74]->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="productBuyreportController.php?do=show" method="post">
                    <div class="form-group">
                        <label class="sr-only">تصنيفات المنتج</label>
                        <select class="select2 wdt100"  name="productCatId" id="productCatId" >
                            <option value="-1">اختر تصنيف</option>
                            <option value="all">كل الأصناف</option>

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



                            <option value="<?php echo $_smarty_tpl->tpl_vars['productCat']->value->productCatId;?>
"><?php echo $_smarty_tpl->tpl_vars['productCat']->value->productCatName;?>
 </option>


                            <?php } ?>


                        </select>
                    </div>
                    <div class="form-group">
                        <label class="sr-only"> المخزن</label>
                        <select id="storeid" name="storeid" class="select2 wdt100">
                            <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['storesData']->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>
                    <br/>
                    <div class="form-group">
                        <label class="sr-only">من التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="from" >
                    </div>
                    <div class="form-group">
                        <label class="sr-only">إلى التاريخ</label>
                        <input type="text" class="form-control awdatepicker" autocomplete="off"   data-date-format="yyyy-mm-dd" name="to" >
                    </div>

                    <br />


                    <div class="form-group">
                        <label class="sr-only"> اخفاء المشتريات  </label>
                        <input type="checkbox" name="hidebuy" id="hidebuy"  onchange="hidebuyfun();"/>
                    </div>


                    <br />
                    <button type="submit" class="btn btn-primary">بحث</button>
                </form>
            </div>
            <?php ob_start();?><?php echo count($_smarty_tpl->tpl_vars['productData']->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">


                    <div class="col-lg-offset-8 col-lg-4 hidden-print buy1">
                        <div class="well well-sm">
                            <h4 class="text-center ">الإجمالي:  <?php echo $_smarty_tpl->tpl_vars['totalRemainQuantity']->value;?>
</h4>
                        </div>
                    </div>

                    <div class="col-lg-offset-8 col-lg-4 hidden-print  ">
                        <div class="well well-sm">
                            <h4 class="text-center ">  اجمالى مردودات المشتريات :  <?php echo $_smarty_tpl->tpl_vars['totalreturn']->value;?>
</h4>
                        </div>
                    </div>


                    <hr/>
                    <table class="table table-black">
                        <thead>
                            <tr>
                                <th>الرقم</th>
                                <th>اسم المنتج</th>
                                <th > <div class="buy1"> المشتريات </div> </th>
                                <th>مردودات  المشتريات</th>
                                <th><div class="buy1">  الباقى </div>  </th>
                            </tr>
                        </thead>
                        <tbody>

                            <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable(1, null, 0);?>
                            <?php  $_smarty_tpl->tpl_vars['product'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['product']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['productData']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['product']->key => $_smarty_tpl->tpl_vars['product']->value){
$_smarty_tpl->tpl_vars['product']->_loop = true;
?>
                            <?php if ($_smarty_tpl->tpl_vars['totalSellsQuantity'.($_smarty_tpl->tpl_vars['i']->value)]->value>0||$_smarty_tpl->tpl_vars['totalReturnSellsQuantity'.($_smarty_tpl->tpl_vars['i']->value)]->value>0){?>
                            <tr>
                                <td><?php echo $_smarty_tpl->tpl_vars['i']->value;?>
</td>
                                <td><?php echo $_smarty_tpl->tpl_vars['product']->value->productName;?>

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

                                    <?php }?></td>
                                <td> <div class="buy1" > <?php echo $_smarty_tpl->tpl_vars['totalSellsQuantity'.($_smarty_tpl->tpl_vars['i']->value)]->value;?>
 </div></td>

                                <td><?php echo $_smarty_tpl->tpl_vars['totalReturnSellsQuantity'.($_smarty_tpl->tpl_vars['i']->value)]->value;?>
</td>

                                <td> <div  class="buy1"> <?php echo $_smarty_tpl->tpl_vars['remainQuantity'.($_smarty_tpl->tpl_vars['i']->value)]->value;?>
 </div></td>
                            </tr>

                            <?php }?>
                            <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'i', null); ob_start(); ?><?php echo $_smarty_tpl->tpl_vars['i']->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 } ?>

                        </tbody>

                    </table>


                    <?php }?>
                    <div class="clearfix"></div>
                    <hr />

                    <div class="col-lg-offset-8 col-lg-4 buy1">
                        <div class="well well-sm">
                            <h4 class="text-center">الإجمالي:  <?php echo $_smarty_tpl->tpl_vars['totalRemainQuantity']->value;?>
</h4>
                        </div>
                    </div>

                    <div class="col-lg-offset-8 col-lg-4 hidden-print  ">
                        <div class="well well-sm">
                            <h4 class="text-center ">  اجمالى مردودات المشتريات :  <?php echo $_smarty_tpl->tpl_vars['totalreturn']->value;?>
</h4>
                        </div>
                    </div>


                    <?php ob_start();?><?php echo count($_smarty_tpl->tpl_vars['productData']->value);?>
<?php $_tmp2=ob_get_clean();?><?php if ($_tmp2>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>
<?php }} ?>