<?php /* Smarty version Smarty-3.1.11, created on 2023-09-02 16:46:20
         compiled from "../views/obgy/visits/lastvisits.html" */ ?>
<?php /*%%SmartyHeaderCode:130694608064d12ff512c4b3-96597001%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '32c9be27661007cc1a625fe458683e4a9a9d8d67' => 
    array (
      0 => '../views/obgy/visits/lastvisits.html',
      1 => 1649838448,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '130694608064d12ff512c4b3-96597001',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_64d12ff51b8793_17814730',
  'variables' => 
  array (
    'system_type' => 0,
    'lastVisitsAll' => 0,
    'patientId' => 0,
    'lastVisits' => 0,
    'data' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_64d12ff51b8793_17814730')) {function content_64d12ff51b8793_17814730($_smarty_tpl) {?>
<?php if ($_smarty_tpl->tpl_vars['system_type']->value!=3){?>
<table class="table table-bordered table-striped table-hover rtl">
    <thead>
        <tr>
            <td colspan="8">
                الزيارات السابقة 
                <?php if ($_smarty_tpl->tpl_vars['lastVisitsAll']->value>3){?>
                <a class="label  label-success getLastVisitAll"   id="getLastVisitAll" 
                   data-patientId="<?php echo $_smarty_tpl->tpl_vars['patientId']->value;?>
"    >عرض الكل  (<?php echo $_smarty_tpl->tpl_vars['lastVisitsAll']->value;?>
)</a> 
                <?php }?>
            </td>
        </tr>
        <tr>
            <th class="wds10">تاريخ الزيارة </th>
            <th>نوع الكشف </th>
            <th>القسم  </th>
            <th>الطبيب  </th>
            <th>  ملاحظات الزيارة   </th>
            <th class="wds6">المدفوع   </th>
            <th class="wds15">المبلغ المرادإسترجاعه   </th>
            <th class="wds15">ملاحظات    </th>
            <th class="wds6"></th>
        </tr>

        <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['lastVisits']->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>
            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['visitdate'];?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['detect'];?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['department'];?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['drName'];?>
</td>
            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['visitNote'];?>
</td>
            <td>
                <?php echo $_smarty_tpl->tpl_vars['data']->value['total_paid'];?>

            </td>
            <?php if ($_smarty_tpl->tpl_vars['data']->value['total_paid']>0){?>
            <td>
                <label class="control-label bold wds10" style=" padding-right: 0px !important;display: inline;">كاش </label>
                <input  class="form-control positiveNo wds30" style="display: inline;"   type="text"     id="refundVal_cash<?php echo $_smarty_tpl->tpl_vars['data']->value['visitid'];?>
" value="0">
                <label class="control-label bold wds10" style=" padding-right: 0px !important;display: inline;">فيزا </label>
                <input  class="form-control positiveNo wds30"   type="text" style="display: inline;"     id="refundVal_visa<?php echo $_smarty_tpl->tpl_vars['data']->value['visitid'];?>
" value="0">
                <span  id="refund<?php echo $_smarty_tpl->tpl_vars['data']->value['visitid'];?>
" style="color:red;" > </span>
            </td>

            <td>
                <input  class="form-control"type="text"   id="notes<?php echo $_smarty_tpl->tpl_vars['data']->value['visitid'];?>
" value="">
            </td>

            <td>
                <a class="label  label-success refund"  data-visitId="<?php echo $_smarty_tpl->tpl_vars['data']->value['visitid'];?>
"  data-paid="<?php echo $_smarty_tpl->tpl_vars['data']->value['total_paid'];?>
"  >استرجاع</a> 
            </td>
            <?php }else{ ?>
            <td>
                <?php if ($_smarty_tpl->tpl_vars['data']->value['paidAll']>0&&$_smarty_tpl->tpl_vars['data']->value['paidAll']==$_smarty_tpl->tpl_vars['data']->value['refundAll']){?>
                تم إستعادة المبلغ  المدفوع بالزيارة  كاملا 
                <?php }?>
            </td>

            <td colspan="2">
                <?php echo $_smarty_tpl->tpl_vars['data']->value['notes'];?>

            </td>
            <?php }?>
        </tr>

        <?php } ?>
    </thead>
    <tbody>

    </tbody>
</table>

<!------------------------------------------------ beauty center ------------------------------------------------>
<?php }else{ ?>
<table class="table table-bordered  rtl">
    <caption class="bold txtc" style="background: #DDD;">
        الزيارات السابقة 
        <?php if ($_smarty_tpl->tpl_vars['lastVisitsAll']->value>3){?>
        <a class="label  label-success getLastVisitAll"   id="getLastVisitAll" 
           data-patientId="<?php echo $_smarty_tpl->tpl_vars['patientId']->value;?>
"    >عرض الكل  (<?php echo $_smarty_tpl->tpl_vars['lastVisitsAll']->value;?>
)</a> 
        <?php }?>

    </caption>
    <tbody>
        <?php  $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['data']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['lastVisits']->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>
            <td>
                <table class="table table-bordered  rtl" style="margin-bottom: 0px;">
                    <thead>
                        <tr>
                            <th class="wds10">تاريخ الزيارة </th>
                            <th>نوع الكشف </th>
                            <th>القسم  </th>
                            <th>الطبيب  </th>
                            <th>  ملاحظات الزيارة   </th>
                            <th class="wds6">المدفوع   </th>
                            <th class="wds20">المبلغ المرادإسترجاعه   </th>
                            <th class="wds15">ملاحظات    </th>
                            <th class="wds6"></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['visitdate'];?>
</td>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['detect'];?>
</td>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['department'];?>
</td>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['drName'];?>
</td>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['visitNote'];?>
</td>
                            <td>  <?php echo $_smarty_tpl->tpl_vars['data']->value['total_paid'];?>
  </td>
                            <?php if ($_smarty_tpl->tpl_vars['data']->value['total_paid']>0){?>
                            <td>
                                <label class="control-label bold wds10" style=" padding-right: 0px !important;display: inline;">كاش </label>
                                <input  class="form-control positiveNo wds30" style="display: inline;"   type="text"     id="refundVal_cash<?php echo $_smarty_tpl->tpl_vars['data']->value['visitid'];?>
" value="0">
                                <label class="control-label bold wds10" style=" padding-right: 0px !important;display: inline;">فيزا </label>
                                <input  class="form-control positiveNo wds30"   type="text" style="display: inline;"     id="refundVal_visa<?php echo $_smarty_tpl->tpl_vars['data']->value['visitid'];?>
" value="0">
                                <span  id="refund<?php echo $_smarty_tpl->tpl_vars['data']->value['visitid'];?>
" style="color:red;" > </span>
                            </td>
                            <td>
                                <input  class="form-control"type="text"   id="notes<?php echo $_smarty_tpl->tpl_vars['data']->value['visitid'];?>
" value="">
                            </td>

                            <td>
                                <a class="label  label-warning refund"  data-visitId="<?php echo $_smarty_tpl->tpl_vars['data']->value['visitid'];?>
"  data-paid="<?php echo $_smarty_tpl->tpl_vars['data']->value['total_paid'];?>
"  >استرجاع</a> 
                            </td>
                            <?php }else{ ?>
                            <td>
                                <?php if ($_smarty_tpl->tpl_vars['data']->value['paidAll']>0&&$_smarty_tpl->tpl_vars['data']->value['paidAll']==$_smarty_tpl->tpl_vars['data']->value['refundAll']){?>
                                تم إستعادة المبلغ  المدفوع بالزيارة  كاملا 
                                <?php }?>
                            </td>

                            <td colspan="2"> </td>
                            <?php }?>
                        </tr>
                    </tbody>
                </table>

                <table class="table table-bordered  rtl wds100" style="margin-bottom: 10px;">
                    <tbody>
                        <tr>
                            <th class="wds10">النوع </th>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['detectionType'];?>
</td>
                            <th>عدد الوحدات  </th>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['detectUnits'];?>
</td>
                            <th>المستخدم    </th>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['unitsUsed'];?>
</td>
                            <th>المتبقى    </th>
                            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['unitsRest'];?>
</td>
                            <td class="wds6" >
                                <?php if ($_smarty_tpl->tpl_vars['data']->value['unitsRest']>0){?>
                                <a class="label  label-primary addPackVisit"  data-rest="<?php echo $_smarty_tpl->tpl_vars['data']->value['unitsRest'];?>
"   
                                   data-visitId="<?php echo $_smarty_tpl->tpl_vars['data']->value['visitid'];?>
"  >إضافة زيارة </a> 
                                <?php }?>
                            </td>
                        </tr>

                        <tr>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>

        <?php } ?>
    </tbody>
</table>
<?php }?>

<?php }} ?>