<?php /* Smarty version Smarty-3.1.11, created on 2024-08-14 14:37:42
         compiled from "../views/obgy/organizations/org_search.html" */ ?>
<?php /*%%SmartyHeaderCode:64988294066bc9706795538-04262781%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'f6d13cfb52b5a1bca8b79635bcae2d231c5d57cb' => 
    array (
      0 => '../views/obgy/organizations/org_search.html',
      1 => 1721881427,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '64988294066bc9706795538-04262781',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'allData' => 0,
    'i' => 0,
    'hosturl' => 0,
    'data' => 0,
    'contract_price' => 0,
    'patient_hold' => 0,
    'restPrice' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_66bc9706831e25_11545025',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_66bc9706831e25_11545025')) {function content_66bc9706831e25_11545025($_smarty_tpl) {?><table class="table table-hover portlet light bg-inverse" id="repTable" style="width: 100%;">
    <thead>
        <tr>
            <th style="width: 10px !important;">#</th>
            <th>   Patient Name</th>
            <th >   Patient No.</th>
            <th>   Type</th>
            <th>   Visit Dr</th>
            <th>   Contract Price      </th>
            <th>   Patient hold      </th>
            <th>   Patient hold  Value     </th>
            <th>Rest</th>
        </tr>
    </thead>
    <tbody>
        <?php $_smarty_tpl->tpl_vars["i"] = new Smarty_variable("1", null, 0);?>
        <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allData']->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;
?>
        <tr class="odd " >
            <td><?php echo $_smarty_tpl->tpl_vars['i']->value;?>
</td>
            <td>
                <a href="<?php echo $_smarty_tpl->tpl_vars['hosturl']->value;?>
/controllers/patienthistory.php?ac=show&patientid=<?php echo $_smarty_tpl->tpl_vars['data']->value['patientid'];?>
" target="_new">
                    <?php if ($_smarty_tpl->tpl_vars['data']->value['for_husband']==1){?>
                    <?php echo $_smarty_tpl->tpl_vars['data']->value['husdandname'];?>

                    <?php }elseif($_smarty_tpl->tpl_vars['data']->value['for_husband']==2){?>
                    طفل    /  <?php echo $_smarty_tpl->tpl_vars['data']->value['wifename'];?>

                    <?php }else{ ?>
                    <?php echo $_smarty_tpl->tpl_vars['data']->value['wifename'];?>

                    <?php }?>
                </a>
            </td>
            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['statusno'];?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['type'];?>
</td>
            <td> <?php echo $_smarty_tpl->tpl_vars['data']->value['visitDoctor'];?>
 </td>
            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['contract_price'];?>
</td>
            <td> <?php echo $_smarty_tpl->tpl_vars['data']->value['patient_hold'];?>
</td>
            <td> <?php echo $_smarty_tpl->tpl_vars['data']->value['patient_hold_price'];?>
</td>
            <td> <?php echo $_smarty_tpl->tpl_vars['data']->value['restPrice'];?>
</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>
</table>

<div id="totalDiv">
    <?php if (!empty($_smarty_tpl->tpl_vars['allData']->value)){?>
    <table class="table table-hover portlet light bg-inverse ">
        <tr>
        <tr>
            <th class="wds15"> </th>
            <th>   Contract Price      </th>
            <th>   Patient hold  Value     </th>
            <th>Rest</th>
        </tr>

        <tr>
            <td>Total</td>
            <td id="contract_price" ><?php echo $_smarty_tpl->tpl_vars['contract_price']->value;?>
 </td>
            <td id="patient_hold" ><?php echo $_smarty_tpl->tpl_vars['patient_hold']->value;?>
 </td>
            <td id="restPrice" > <?php echo $_smarty_tpl->tpl_vars['restPrice']->value;?>
</td>
        </tr>
    </table>
    <?php }?>
</div>



<script type="text/javascript" >
    $('#repTable').dataTable({
        dom: 'Blfrtip',
        buttons: [
            {
                extend: 'print',
                title: 'Organization  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)',
                }
            }
            , {
                extend: 'excel'
                , text: 'excel '
                , title: 'Financial Report'

                , customize: function (xlsx) {
                    var sheet = xlsx.xl.worksheets['sheet1.xml'];
                    var clRow = $('row', sheet);
                    var newIndex = 5 + clRow.length;



                    function Addrow(newIndex, data) {
                        row = '  <row r="' + newIndex + '"> ';
                        row += '  <c t="inlineStr" r="C' + newIndex + '"><is><t>' + data[0] + '</t></is></c> ';
                        row += ' <c t="inlineStr" r="D' + newIndex + '"><is><t>' + data[1] + ' </t></is></c>  ';
                        row += '  <c t="inlineStr" r="E' + newIndex + '"><is><t>' + data[2] + ' </t></is></c> ';
                        row += '  <c t="inlineStr" r="F' + newIndex + '"><is><t>' + data[3] + ' </t></is></c> ';
                        row += ' </row>  ';
                        $('sheetData', sheet).append(row);
                    }

                    Addrow(newIndex, [' ', 'Contract Price', 'Patient hold Value', 'Rest']);
                    newIndex = 1 + newIndex;
                    Addrow(newIndex, [' Total ', $('#contract_price').html(), $('#patient_hold').html(), $('#restPrice').html()]);
                }

            }
        ],
        "scrollX": true
    });


</script>
<?php }} ?>