<?php /* Smarty version Smarty-3.1.11, created on 2023-10-21 20:52:32
         compiled from "../views/default/productsellsreportview/show.html" */ ?>
<?php /*%%SmartyHeaderCode:162595065265340fe06f9e66-84529703%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '630812adef224aa5473adc4097f05a29c04eb680' => 
    array (
      0 => '../views/default/productsellsreportview/show.html',
      1 => 1695133818,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '162595065265340fe06f9e66-84529703',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'youtubes' => 0,
    'productCatData' => 0,
    'productCat' => 0,
    'productData' => 0,
    'message' => 0,
    'totalRemainQuantity' => 0,
    'nothavedate' => 0,
    'loadData' => 0,
    'totalproductproft' => 0,
    'totaltotalsell' => 0,
    'total_sell_without_discount' => 0,
    'i' => 0,
    'product' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_65340fe07f4ec7_36231618',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_65340fe07f4ec7_36231618')) {function content_65340fe07f4ec7_36231618($_smarty_tpl) {?><style>
    .myresult {
        -webkit-print-color-adjust: exact;
    }

    @media print {

        p,
        h4,
        h3,
        h2,
        h1,
        span,
        label,
        td,
        th,
        div.dataTables_info,
        a,
        .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
        div.dataTables_wrapper div.dataTables_info,
        tr.odd td.sorting_1,
        .table tfoot>tr>th,
        .table thead>tr>td,
        .table tbody>tr>td,
        .table tfoot>tr>td {
            color: #000 !important
        }

        .table thead>tr>th,
        .table tbody>tr>th,
        .table tfoot>tr>th,
        .table thead>tr>td,
        .table tbody>tr>td,
        .table tfoot>tr>td {
            text-align: center
        }
    }
</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[72]->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="productsellsreportController.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>
                    <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>
                    <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-4 ">
                        <div class="well well-sm">
                            <h4 class="text-center">اجمالى القطع المباعه: <?php echo $_smarty_tpl->tpl_vars['totalRemainQuantity']->value;?>
</h4>
                        </div>
                    </div>

                    <?php if ($_smarty_tpl->tpl_vars['nothavedate']->value==1&&$_smarty_tpl->tpl_vars['loadData']->value->netprofit!=1){?>
                    <div class=" col-lg-4 ">
                        <div class="well well-sm">
                            <h4 class="text-center">اجمالى الربح: <?php echo $_smarty_tpl->tpl_vars['totalproductproft']->value;?>
</h4>
                        </div>


                    </div>

                    <div class=" col-lg-4 ">
                        <div class="well well-sm">
                            <h4 class="text-center">اجمالى المبيعات: <?php echo $_smarty_tpl->tpl_vars['totaltotalsell']->value;?>
</h4>
                        </div>


                    </div>

                    <div class=" col-lg-4 ">
                        <div class="well well-sm">
                            <h4 class="text-center">اجمالى المبيعات بدون خصومات <?php echo $_smarty_tpl->tpl_vars['total_sell_without_discount']->value;?>
</h4>
                        </div>


                    </div>
                    <?php }?>

                    <hr />
                    <table class="table table-black dataTableClass">
                        <thead>
                            <tr>
                                <th>
                                    <center>الرقم</center>
                                </th>
                                <th>
                                    <center>اسم المنتج</center>
                                </th>
                                <th>
                                    <center>المبيعات</center>
                                </th>
                                <th>
                                    <center>مردودات المبيعات</center>
                                </th>
                                <th>
                                    <center>صافى الكميه المباعه</center>
                                </th>
                                <th>
                                    <center> مبلغ المبيعات </center>
                                </th>
                                <?php if ($_smarty_tpl->tpl_vars['loadData']->value->netprofit!=1){?>
                                <th>
                                    <center>صافى الربح</center>
                                </th>
                                <?php }?>
                                <th>
                                    <center> المبيعات بدون خصومات</center>
                                </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>
                                            <center><?php echo $_smarty_tpl->tpl_vars['i']->value;?>
</center>
                                        </td>
                                        <td>
                                            <center>
                                                <?php echo $_smarty_tpl->tpl_vars['productCatName'.($_smarty_tpl->tpl_vars['i']->value)]->value;?>

                                                <?php echo $_smarty_tpl->tpl_vars['product']->value->productName;?>

                                            </center>
                                        </td>
                                        <td>
                                            <center><?php echo $_smarty_tpl->tpl_vars['totalSellsQuantity'.($_smarty_tpl->tpl_vars['i']->value)]->value;?>
</center>
                                        </td>
                                        <td>
                                            <center><?php echo $_smarty_tpl->tpl_vars['totalReturnSellsQuantity'.($_smarty_tpl->tpl_vars['i']->value)]->value;?>
</center>
                                        </td>
                                        <td>
                                            <center><?php echo $_smarty_tpl->tpl_vars['remainQuantity'.($_smarty_tpl->tpl_vars['i']->value)]->value;?>
</center>
                                        </td>
                                        <td>
                                            <center><?php echo $_smarty_tpl->tpl_vars['totalsell'.($_smarty_tpl->tpl_vars['i']->value)]->value;?>
</center>
                                        </td>
                                        <?php if ($_smarty_tpl->tpl_vars['loadData']->value->netprofit!=1){?>
                                        <td>
                                            <center><?php echo $_smarty_tpl->tpl_vars['productproft'.($_smarty_tpl->tpl_vars['i']->value)]->value;?>
</center>
                                        </td>
                                        <?php }?>
                                        <td>
                                            <center><?php echo $_smarty_tpl->tpl_vars['totalsell_withoutdiscount'.($_smarty_tpl->tpl_vars['i']->value)]->value;?>
</center>
                                        </td>

                                        <!--                                <?php if ($_smarty_tpl->tpl_vars['nothavedate']->value==1){?>
                                                        <td><?php echo $_smarty_tpl->tpl_vars['remainQuantity'.($_smarty_tpl->tpl_vars['i']->value)]->value;?>
</td>
                                                        <td><?php echo $_smarty_tpl->tpl_vars['totalsell'.($_smarty_tpl->tpl_vars['i']->value)]->value;?>
</td>
                                                        <td><?php echo $_smarty_tpl->tpl_vars['productproft'.($_smarty_tpl->tpl_vars['i']->value)]->value;?>
</td>
                                                         <td><?php echo $_smarty_tpl->tpl_vars['totalsell_withoutdiscount'.($_smarty_tpl->tpl_vars['i']->value)]->value;?>
</td>

                                                        <?php }else{ ?>
                                                        <td colspan="3"  style="text-align:center"> <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['i']->value;?>
<?php $_tmp2=ob_get_clean();?><?php if ($_tmp2==1){?>       من فضلك اختر تاريخ لظهور النتيجه <?php }?></td>
                                                        <?php }?>-->


                                    </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-4 ">
                        <div class="well well-sm">
                            <h4 class="text-center">اجمالى القطع المباعه: <?php echo $_smarty_tpl->tpl_vars['totalRemainQuantity']->value;?>
</h4>
                        </div>


                    </div>

                    <?php if ($_smarty_tpl->tpl_vars['nothavedate']->value==1){?>
                    <?php if ($_smarty_tpl->tpl_vars['loadData']->value->netprofit!=1){?>
                    <div class=" col-lg-4 ">
                        <div class="well well-sm">
                            <h4 class="text-center">اجمالى الربح: <?php echo $_smarty_tpl->tpl_vars['totalproductproft']->value;?>
</h4>
                        </div>


                    </div>
                    <?php }?>
                    <div class=" col-lg-4 ">
                        <div class="well well-sm">
                            <h4 class="text-center">اجمالى المبيعات: <?php echo $_smarty_tpl->tpl_vars['totaltotalsell']->value;?>
</h4>
                        </div>


                    </div>
                    <div class=" col-lg-4 ">
                        <div class="well well-sm">
                            <h4 class="text-center">اجمالى المبيعات بدون خصومات <?php echo $_smarty_tpl->tpl_vars['total_sell_without_discount']->value;?>
</h4>
                        </div>


                    </div>

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