<?php /* Smarty version Smarty-3.1.11, created on 2024-08-12 09:39:33
         compiled from "../views/obgy/visits/lastvisits.html" */ ?>
<?php /*%%SmartyHeaderCode:162276759266b9ae258981b0-52369704%%*/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 => 1701139734,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '162276759266b9ae258981b0-52369704',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'system_type' => 0,
    'branchesActivate' => 0,
    'lastVisitsAll' => 0,
    'patientId' => 0,
    'lastVisits' => 0,
    'data' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_66b9ae259515c7_18571684',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_66b9ae259515c7_18571684')) {function content_66b9ae259515c7_18571684($_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 <?php if ($_smarty_tpl->tpl_vars['branchesActivate']->value==1){?> colspan="10" <?php }else{ ?> colspan="9"  <?php }?> >
                الزيارات السابقة 
                <?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>
            <?php if ($_smarty_tpl->tpl_vars['branchesActivate']->value==1){?>  <th>الفرع    </th> <?php }?>
            <th>نوع الكشف </th>
            <th>القسم  </th>
            <th>الطبيب  </th>
            <th>  ملاحظات الزيارة   </th>
            <th class="wds6">المدفوع   </th>
            <th class="wds15">المبلغ المرادإسترجاعه   </th>
            <th class="wds15">ملاحظات    </th>
            <th class="wds6"></th>#f6fe94
        </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 <?php if ($_smarty_tpl->tpl_vars['data']->value['branch_id']==1){?> style="background-color: #fbd9b3;" 
            <?php }elseif($_smarty_tpl->tpl_vars['data']->value['branch_id']==2){?> style="background-color: #ead2ff;" 
            <?php }?>>
            <td><?php echo $_smarty_tpl->tpl_vars['data']->value['visitdate'];?>
</td>
            <?php if ($_smarty_tpl->tpl_vars['branchesActivate']->value==1){?>  <td><?php echo $_smarty_tpl->tpl_vars['data']->value['branch_name'];?>
    </td> <?php }?>
            <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 }} ?>