<?php /* Smarty version Smarty-3.1.11, created on 2023-10-21 16:35:35
         compiled from "../views/default/userratereportview/show.html" */ ?>
<?php /*%%SmartyHeaderCode:5069636436533d3a7b46856-45607952%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'ada2c71d14b2380c3c52df0b38f44a5fa207660b' => 
    array (
      0 => '../views/default/userratereportview/show.html',
      1 => 1696081268,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '5069636436533d3a7b46856-45607952',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'Programsettingdata' => 0,
    'message' => 0,
    'youtubes' => 0,
    'allsellier' => 0,
    'myallsellier' => 0,
    'selldata' => 0,
    'Returnselldata' => 0,
    'Sellbillandruterndata' => 0,
    'totalPiecesNo' => 0,
    'total' => 0,
    'currency' => 0,
    'totalBillsWithSeller' => 0,
    'awardrate' => 0,
    'final' => 0,
    'myselldata' => 0,
    'myReturnselldata' => 0,
    'mySellbillandruterndata' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_6533d3a7cf2494_75895520',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_6533d3a7cf2494_75895520')) {function content_6533d3a7cf2494_75895520($_smarty_tpl) {?>
<div class="row">
    <div class="container">
        <ol class="breadcrumb">
            <li><a href="#">اداره الفولتير </a></li>
            <li><a href="userController.php?do=show">تقرير نسب <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==0){?> البائعين <?php }elseif($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==1){?>المندوبين <?php }elseif($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==2){?>الاطباء <?php }?></a></li>
            <li class="active"> تقرير نسب <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==0){?> البائعين <?php }elseif($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==1){?>المندوبين <?php }elseif($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==2){?>الاطباء <?php }?></li>
        </ol>
        <div class="panel panel-default panel-m">
            <!-- Default panel contents -->
            <div class="panel-heading">تقرير نسب <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==0){?> البائعين <?php }elseif($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==1){?>المندوبين <?php }elseif($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==2){?>الاطباء <?php }?><br />
                <?php if ($_smarty_tpl->tpl_vars['message']->value!=''){?>
                <?php echo $_smarty_tpl->tpl_vars['message']->value;?>

                <?php }?>
                <a href="<?php echo $_smarty_tpl->tpl_vars['youtubes']->value[24]->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="userratereportController.php?do=show" method="post">
                    <div class="form-group">
                        <label class="sr-only">الموظف</label>
                        <select class="select2 wdt300"  name="sellerid" id="sellerid" >
                            <option value="-1">اختر <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==0){?> بائع <?php }elseif($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==1){?>مندوب <?php }elseif($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==2){?>طبيب <?php }?></option>
                            <option value="0">الكل </option>


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


                            <option value="<?php echo $_smarty_tpl->tpl_vars['myallsellier']->value->userid;?>
"><?php echo $_smarty_tpl->tpl_vars['myallsellier']->value->employeename;?>
</option>


                            <?php } ?>


                        </select>
                    </div>
                    <div class="form-group">
                        <label class="sr-only">نوع السعر</label>
                        <select class="select2 wdt300"  name="priceType" id="priceType" >
                            <option value="-1">اختر </option>
                            <option value="0">جملة</option>
                            <option value="1">تجزئة</option>
                            <option value="2">نصف جملة</option>
                        </select>
                    </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="startDate" >
                    </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="endDate" >
                    </div>
                    <button type="submit" class="btn btn-primary">بحث</button>

                </form>
            </div>
            <hr/>

            <?php if (!empty($_smarty_tpl->tpl_vars['selldata']->value)||!empty($_smarty_tpl->tpl_vars['Returnselldata']->value)||!empty($_smarty_tpl->tpl_vars['Sellbillandruterndata']->value)){?>

            <div class="row">

                <div class="well well-sm2">
                    <h4 class="text-center">إجمالي عدد الفواتير <?php echo count($_smarty_tpl->tpl_vars['selldata']->value)+count($_smarty_tpl->tpl_vars['Returnselldata']->value)+count($_smarty_tpl->tpl_vars['Sellbillandruterndata']->value);?>
</h4>
                </div>

                <div class="well well-sm2">
                    <h4 class="text-center">إجمالي عدد القطع <?php echo $_smarty_tpl->tpl_vars['totalPiecesNo']->value;?>
</h4>
                </div>

                <div class="well well-sm2">
                    <h4 class="text-center">الاجمالى <?php echo $_smarty_tpl->tpl_vars['total']->value;?>
 <?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</h4>
                </div>
                <div class="well well-sm2">
                    <h4 class="text-center">الاجمالى ببائع <?php echo $_smarty_tpl->tpl_vars['totalBillsWithSeller']->value;?>
 <?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</h4>
                </div>


                <div class="well well-sm2">
                    <h4 class="text-center">نسبه <?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==0){?> بائع <?php }elseif($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==1){?>مندوب <?php }elseif($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==2){?>طبيب <?php }?> <?php echo $_smarty_tpl->tpl_vars['awardrate']->value;?>
 %</h4>
                </div>


                <div class="well well-sm2">
                    <h4 class="text-center">المستحق لل<?php if ($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==0){?> بائع <?php }elseif($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==1){?>مندوب <?php }elseif($_smarty_tpl->tpl_vars['Programsettingdata']->value->delegate_seller==2){?>طبيب <?php }?> <?php echo $_smarty_tpl->tpl_vars['final']->value;?>
 <?php echo $_smarty_tpl->tpl_vars['currency']->value;?>
</h4>
                </div>

            </div>



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

            <!-- Table -->
            <table class="table table-black dataTableClass">
                <thead>
                    <tr>
                        <th>الفاتوره</th>
                        <th>تاريخ الفاتوره</th>
                        <th>المجموع</th>
                        <th>عدد القطع</th>
                        <th>نوع السعر</th>
                        <th>البائع</th>
                        <th>العميل</th>
                        <th class="hidden-print">عرض </th>

                    </tr>
                </thead>
                <tbody>

                    <?php  $_smarty_tpl->tpl_vars['myselldata'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['myselldata']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['selldata']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['myselldata']->key => $_smarty_tpl->tpl_vars['myselldata']->value){
$_smarty_tpl->tpl_vars['myselldata']->_loop = true;
?>
                    <tr>
                        <td>فاتوره مبيعات</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['myselldata']->value->sellbilldate;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['myselldata']->value->sellbillaftertotalbill;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['myselldata']->value->sellQuantity;?>
</td>
                        <td><?php if ($_smarty_tpl->tpl_vars['myselldata']->value->pricetype==0){?>جملة<?php }elseif($_smarty_tpl->tpl_vars['myselldata']->value->pricetype==1){?>تجزئة<?php }elseif($_smarty_tpl->tpl_vars['myselldata']->value->pricetype==2){?>نصف جملة<?php }?></td>
                        <td><?php echo $_smarty_tpl->tpl_vars['myselldata']->value->username;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['myselldata']->value->clientname;?>
</td>
                        <td class="hidden-print"> <a href="sellbillController.php?do=editprint&id=<?php echo $_smarty_tpl->tpl_vars['myselldata']->value->sellbillid;?>
" type="button" class="btn btn-default btn-lg editicon"></a> </td>
                    </tr>
                    <?php } ?>


                    <?php  $_smarty_tpl->tpl_vars['myReturnselldata'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['myReturnselldata']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['Returnselldata']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['myReturnselldata']->key => $_smarty_tpl->tpl_vars['myReturnselldata']->value){
$_smarty_tpl->tpl_vars['myReturnselldata']->_loop = true;
?>
                    <tr class="danger">
                        <td>فاتوره مردودات</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['myReturnselldata']->value->returnsellbilldate;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['myReturnselldata']->value->returnsellbillaftertotalbill;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['myReturnselldata']->value->returnsellQuantity;?>
</td>
                        <td><?php if ($_smarty_tpl->tpl_vars['myReturnselldata']->value->pricetype==0){?>جملة<?php }elseif($_smarty_tpl->tpl_vars['myReturnselldata']->value->pricetype==1){?>تجزئة<?php }elseif($_smarty_tpl->tpl_vars['myReturnselldata']->value->pricetype==2){?>نصف جملة<?php }?></td>
                        <td><?php echo $_smarty_tpl->tpl_vars['myReturnselldata']->value->username;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['myReturnselldata']->value->clientname;?>
</td>
                        <td class="hidden-print"> <a href="returnsellbillController.php?do=editprint&id=<?php echo $_smarty_tpl->tpl_vars['myReturnselldata']->value->returnsellbillid;?>
" type="button" class="btn btn-default btn-lg editicon"></a> </td>
                    </tr>
                    <?php } ?>


                    <?php  $_smarty_tpl->tpl_vars['mySellbillandruterndata'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['mySellbillandruterndata']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['Sellbillandruterndata']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['mySellbillandruterndata']->key => $_smarty_tpl->tpl_vars['mySellbillandruterndata']->value){
$_smarty_tpl->tpl_vars['mySellbillandruterndata']->_loop = true;
?>
                    <tr>
                        <td>فاتوره  مبيعات ومردودات</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['mySellbillandruterndata']->value->sellbilldate;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['mySellbillandruterndata']->value->sellbillaftertotalbill;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['mySellbillandruterndata']->value->sellQuantity-$_smarty_tpl->tpl_vars['mySellbillandruterndata']->value->returnsellQuantity;?>
</td>
                        <td><?php if ($_smarty_tpl->tpl_vars['mySellbillandruterndata']->value->pricetype==0){?>جملة<?php }elseif($_smarty_tpl->tpl_vars['mySellbillandruterndata']->value->pricetype==1){?>تجزئة<?php }elseif($_smarty_tpl->tpl_vars['mySellbillandruterndata']->value->pricetype==2){?>نصف جملة<?php }?></td>
                        <td><?php echo $_smarty_tpl->tpl_vars['mySellbillandruterndata']->value->username;?>
</td>
                        <td><?php echo $_smarty_tpl->tpl_vars['mySellbillandruterndata']->value->clientname;?>
</td>
                        <td class="hidden-print"> <a href="sellbillandruternController.php?do=editprint&id=<?php echo $_smarty_tpl->tpl_vars['mySellbillandruterndata']->value->sellbillid;?>
" type="button" class="btn btn-default btn-lg editicon"></a> </td>
                    </tr>
                    <?php } ?>


                </tbody>

            </table>
            <?php }?>
        </div>
    </div>
</div>



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