<?php /* Smarty version Smarty-3.1.11, created on 2024-08-18 16:06:10
         compiled from "../views/obgy/reports/cashtransferdoctorsearch.html" */ ?>
<?php /*%%SmartyHeaderCode:100292641066c1f1c26d3704-15520581%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'd8e6d2b5d99d51d5cf1bb897fd97398fba361602' => 
    array (
      0 => '../views/obgy/reports/cashtransferdoctorsearch.html',
      1 => 1709038782,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '100292641066c1f1c26d3704-15520581',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'allData' => 0,
    'one' => 0,
    'r' => 0,
    'x' => 0,
    'branch_name' => 0,
    'data' => 0,
    'br_total_detections' => 0,
    'br_total_patients' => 0,
    'br_total_cash' => 0,
    'br_total_services' => 0,
    'br_total_paid' => 0,
    'i' => 0,
    'refer' => 0,
    'total_detections' => 0,
    'total_patients' => 0,
    'total_cash' => 0,
    'total_services' => 0,
    'total_paid' => 0,
    'login_role' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_66c1f1c27f9283_96956048',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_66c1f1c27f9283_96956048')) {function content_66c1f1c27f9283_96956048($_smarty_tpl) {?><?php $_smarty_tpl->tpl_vars["x"] = new Smarty_variable("1", null, 0);?>
<!--<?php $_smarty_tpl->tpl_vars["total_detections"] = new Smarty_variable("0", null, 0);?>-->
<?php $_smarty_tpl->tpl_vars["total_patients"] = new Smarty_variable("0", null, 0);?>
<?php $_smarty_tpl->tpl_vars["total_cash"] = new Smarty_variable("0", null, 0);?>
<?php $_smarty_tpl->tpl_vars["total_services"] = new Smarty_variable("0", null, 0);?>
<?php $_smarty_tpl->tpl_vars["total_paid"] = new Smarty_variable("0", null, 0);?>

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

<?php  $_smarty_tpl->tpl_vars['r'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['r']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['one']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['r']->key => $_smarty_tpl->tpl_vars['r']->value){
$_smarty_tpl->tpl_vars['r']->_loop = true;
?>
<?php $_smarty_tpl->tpl_vars['branch_name'] = new Smarty_variable($_smarty_tpl->tpl_vars['r']->value['branch_name'], null, 0);?>
<?php break 1?>
<?php } ?>
<h3>
    <?php echo $_smarty_tpl->tpl_vars['x']->value;?>
-Branch Name: <?php echo $_smarty_tpl->tpl_vars['branch_name']->value;?>

</h3>
<table class="table table-hover portlet light bg-inverse br_tbl" id="repTable_<?php echo $_smarty_tpl->tpl_vars['x']->value;?>
" style="width: 100%;">
    <thead>
        <tr>
            <th style="width: 10px !important;">#</th>
            <td> Dr. Name </td>
            <th> Patients No.</th>
            <th> Cash </th>
            <th> Services amount total </th>
            <th> Paid </th>
        </tr>
    </thead>
    <tbody>
        <?php $_smarty_tpl->tpl_vars["i"] = new Smarty_variable("1", null, 0);?>
        <!--<?php $_smarty_tpl->tpl_vars["br_total_detections"] = new Smarty_variable("0", null, 0);?>-->
        <?php $_smarty_tpl->tpl_vars["br_total_patients"] = new Smarty_variable("0", null, 0);?>
        <?php $_smarty_tpl->tpl_vars["br_total_cash"] = new Smarty_variable("0", null, 0);?>
        <?php $_smarty_tpl->tpl_vars["br_total_services"] = new Smarty_variable("0", null, 0);?>
        <?php $_smarty_tpl->tpl_vars["br_total_paid"] = new Smarty_variable("0", null, 0);?>
        <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_smarty_tpl->tpl_vars['refer'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['one']->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;
 $_smarty_tpl->tpl_vars['refer']->value = $_smarty_tpl->tpl_vars['data']->key;
?>
        <tr class="odd " <?php if ($_smarty_tpl->tpl_vars['data']->value['detectionid']==9999||$_smarty_tpl->tpl_vars['data']->value['billType']==1){?> style="background-color: #efc9cc;" <?php }elseif($_smarty_tpl->tpl_vars['data']->value['customer_add']==1){?> style="background-color: #f1f16d;" <?php }?>>
            <!--<?php $_smarty_tpl->tpl_vars["br_total_detections"] = new Smarty_variable($_smarty_tpl->tpl_vars['br_total_detections']->value+$_smarty_tpl->tpl_vars['data']->value['detections_no'], null, 0);?>-->
            <?php $_smarty_tpl->tpl_vars["br_total_patients"] = new Smarty_variable($_smarty_tpl->tpl_vars['br_total_patients']->value+$_smarty_tpl->tpl_vars['data']->value['patients_no'], null, 0);?>
            <?php $_smarty_tpl->tpl_vars["br_total_cash"] = new Smarty_variable($_smarty_tpl->tpl_vars['br_total_cash']->value+$_smarty_tpl->tpl_vars['data']->value['cash'], null, 0);?>
            <?php $_smarty_tpl->tpl_vars["br_total_services"] = new Smarty_variable($_smarty_tpl->tpl_vars['br_total_services']->value+$_smarty_tpl->tpl_vars['data']->value['services'], null, 0);?>
            <?php $_smarty_tpl->tpl_vars["br_total_paid"] = new Smarty_variable($_smarty_tpl->tpl_vars['br_total_paid']->value+$_smarty_tpl->tpl_vars['data']->value['paid'], null, 0);?>
            <td><?php echo $_smarty_tpl->tpl_vars['i']->value;?>
</td>
            <td>
                <?php echo $_smarty_tpl->tpl_vars['refer']->value;?>

            </td>
            <!--<td>-->
            <!--    <?php echo $_smarty_tpl->tpl_vars['data']->value['detections_no'];?>
-->
            <!--</td>-->
            <td>
                <?php echo $_smarty_tpl->tpl_vars['data']->value['patients_no'];?>

            </td>
            <td>
                <?php echo $_smarty_tpl->tpl_vars['data']->value['cash'];?>

            </td>
            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['services'];?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['paid'];?>
</td>

        </tr>
        <?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['i']->value+1;?>
<?php $_tmp1=ob_get_clean();?><?php $_smarty_tpl->tpl_vars["i"] = new Smarty_variable($_tmp1, null, 0);?>
        <?php } ?>
    </tbody>
    <tfoot>
        <tr>
            <td></td>
            <td>Branch Total: </td>
            <!--<td><?php echo $_smarty_tpl->tpl_vars['br_total_detections']->value;?>
</td>-->
            <td><?php echo $_smarty_tpl->tpl_vars['br_total_patients']->value;?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['br_total_cash']->value;?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['br_total_services']->value;?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['br_total_paid']->value;?>
</td>
        </tr>
    </tfoot>
</table>
<!--<?php $_smarty_tpl->tpl_vars["total_detections"] = new Smarty_variable($_smarty_tpl->tpl_vars['total_detections']->value+$_smarty_tpl->tpl_vars['br_total_detections']->value, null, 0);?>-->
<?php $_smarty_tpl->tpl_vars["total_patients"] = new Smarty_variable($_smarty_tpl->tpl_vars['total_patients']->value+$_smarty_tpl->tpl_vars['br_total_patients']->value, null, 0);?>
<?php $_smarty_tpl->tpl_vars["total_cash"] = new Smarty_variable($_smarty_tpl->tpl_vars['total_cash']->value+$_smarty_tpl->tpl_vars['br_total_cash']->value, null, 0);?>
<?php $_smarty_tpl->tpl_vars["total_services"] = new Smarty_variable($_smarty_tpl->tpl_vars['total_services']->value+$_smarty_tpl->tpl_vars['br_total_services']->value, null, 0);?>
<?php $_smarty_tpl->tpl_vars["total_paid"] = new Smarty_variable($_smarty_tpl->tpl_vars['total_paid']->value+$_smarty_tpl->tpl_vars['br_total_paid']->value, null, 0);?>

<?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['x']->value+1;?>
<?php $_tmp2=ob_get_clean();?><?php $_smarty_tpl->tpl_vars["x"] = new Smarty_variable($_tmp2, null, 0);?>
<?php } ?>

<?php if ($_smarty_tpl->tpl_vars['login_role']->value!=19){?>
<div id="totalDiv">
    <?php if (!empty($_smarty_tpl->tpl_vars['allData']->value)){?>
    <table class="table table-hover portlet light bg-inverse ">
        <tr>
            <!--<th class="wds15"> Total Detections</th>-->
            <th class="wds15"> Total Patients</th>
            <th class="wds15"> Total Cash</th>
            <th class="wds15"> Total Services Amount</th>
            <th class="wds15"> Total Paid</th>
        </tr>
        <tr>
            <!--<td><?php echo $_smarty_tpl->tpl_vars['total_detections']->value;?>
</td>-->
            <td><?php echo $_smarty_tpl->tpl_vars['total_patients']->value;?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['total_cash']->value;?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['total_services']->value;?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['total_paid']->value;?>
</td>
        </tr>
    </table>
    <?php }?>
</div>
<?php }?>


<script type="text/javascript">
    $('.br_tbl').each(function () {
        let tblId = $(this).attr('id');
        $('#' + tblId).dataTable({
            dom: 'Blfrtip',
            buttons: [
                {
                    extend: 'print',
                    title: 'Doctor Cash Transfer Report',
                    customize: function (win) {
                        // var total = $('#totalDiv').html();
                        // $(win.document.body).append(total); //after the table
                        //    $(win.document.body).prepend('<html elements here>'); //before the table
                    }
                    , exportOptions: {
                        columns: ':not(.hide_me)',
                    },
                    footer: true,
                },
            ],
            "scrollX": true
        });
    });


</script>
<?php }} ?>