<?php /* Smarty version Smarty-3.1.11, created on 2023-08-16 18:25:33
         compiled from "..\views\obgy\visits\visitdiv.html" */ ?>
<?php /*%%SmartyHeaderCode:156664dcf87d611cd0-03801180%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'd986e0ae4bd06d799c1075312dcbf419d7d6d24c' => 
    array (
      0 => '..\\views\\obgy\\visits\\visitdiv.html',
      1 => 1691391130,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '156664dcf87d611cd0-03801180',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'programesetting' => 0,
    'allvisit' => 0,
    'row' => 0,
    'i' => 0,
    'hosturl' => 0,
    'allowEditVisit' => 0,
    'isLab' => 0,
    'allowDeleteVisit' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_64dcf87e0858e5_47004916',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_64dcf87e0858e5_47004916')) {function content_64dcf87e0858e5_47004916($_smarty_tpl) {?><table class="table table-bordered table-striped table-hover rtl dataTable">
    <thead>
        <tr>
            <th class="wds3 txtc">م</th>
            <th class="txtc">اسم الحالة</th>
            <th class="wds5 txtc">رقم الحالة</th>
            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->system_lang==1){?>    
            <th class="txtc"> اسم الزوج </th>
            <?php }?> 
            <th class="txtc"> الموبايل </th>
            <th class="txtc"> نوع الكشف </th>
            <th class="txtc"> التاريخ </th>
            <th class="txtc"> القسم </th>
            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->system_lang==1){?>    
            <th class="txtc"> المريض </th>
            <?php }?> 
            <th class="txtc"> الوقت </th>
            <th class="txtc"> المستخدم  </th>
            <th class="txtc"> ملاحظات  </th>
            <th class="wds3 txtc"> الايصال </th>
            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->confirm_attend==1){?>  
            <th class="wds6 txtc"> الحضور  </th>
            <?php }?> 

            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->whatsapp_sms==1){?>  
            <th class="wds3 txtc"> Whatsapp  </th>
            <?php }?> 


            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->attend_today==1){?>  
            <th class="wds3 txtc"> تم الحضور  </th>
            <?php }?> 
            <th class="wds3 txtc"> تعديل</th> 
            <th class="wds3 txtc"> حذف</th>
        </tr>
    </thead>
    <tbody>
        <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable(1, null, 0);?>
        <?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['allvisit']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['row']->key => $_smarty_tpl->tpl_vars['row']->value){
$_smarty_tpl->tpl_vars['row']->_loop = true;
?>
        <tr class="<?php if ($_smarty_tpl->tpl_vars['row']->value->for_department==12){?>is_lab<?php }else{ ?>not_lab<?php }?> <?php if ($_smarty_tpl->tpl_vars['row']->value->for_department==5){?>is_ray_lab<?php }else{ ?>not_ray_lab<?php }?>"  
            <?php if ($_smarty_tpl->tpl_vars['row']->value->detectionid==9999){?>style="background-color: #efc9cc;" 
            <?php }elseif($_smarty_tpl->tpl_vars['row']->value->tempPatient==1){?> style="background-color: #e1caf4;"   
            <?php }elseif($_smarty_tpl->tpl_vars['row']->value->customer_add==1){?> style="background-color: #f1f16d;"  
            <?php }elseif($_smarty_tpl->tpl_vars['row']->value->confirm_attend==1&&$_smarty_tpl->tpl_vars['programesetting']->value->confirm_attend==1){?> style="background-color: #d0f09f;"  
            <?php }elseif($_smarty_tpl->tpl_vars['row']->value->confirm_attend==2&&$_smarty_tpl->tpl_vars['programesetting']->value->confirm_attend==1){?> style="background-color: #d1a6d1;"  
            <?php }elseif($_smarty_tpl->tpl_vars['row']->value->confirm_attend==3&&$_smarty_tpl->tpl_vars['programesetting']->value->confirm_attend==1){?> style="background-color: #fd8591;"   <?php }?> >


            <td> <?php echo $_smarty_tpl->tpl_vars['i']->value;?>
</td>
            <td>  <?php echo $_smarty_tpl->tpl_vars['row']->value->patientName;?>
  </td>
            <td> <?php echo $_smarty_tpl->tpl_vars['row']->value->patientstatusno;?>
</td>
            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->system_lang==1){?>    
            <td> <?php echo $_smarty_tpl->tpl_vars['row']->value->husbandname;?>
</td>
            <?php }?>
            <td> 
                <ul style="padding-right: unset;"> 
                    <li><?php echo $_smarty_tpl->tpl_vars['row']->value->phone;?>
</li>
                    <li><?php echo $_smarty_tpl->tpl_vars['row']->value->mobile;?>
</li>
                </ul>
            </td>
            <td><?php echo $_smarty_tpl->tpl_vars['row']->value->detection;?>
</td>
            <td> <?php echo $_smarty_tpl->tpl_vars['row']->value->visitdate;?>
</td>
            <td >
                <?php echo $_smarty_tpl->tpl_vars['row']->value->for_department_name;?>
 <?php if (!empty($_smarty_tpl->tpl_vars['row']->value->operation_time)){?>(<?php echo $_smarty_tpl->tpl_vars['row']->value->operation_time;?>
)<?php }?>
                <?php if ($_smarty_tpl->tpl_vars['row']->value->for_department==12){?>
                <a class=" bg-green dltbtn  printLR" data-visitId="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
"><i class="fa fa-print"></i></a>
                <?php }?>
            </td>

            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->system_lang==1){?>    
            <td>
                <?php if ($_smarty_tpl->tpl_vars['row']->value->for_husband==1){?> الزوج 
                <?php }elseif($_smarty_tpl->tpl_vars['row']->value->for_husband==2){?>    
                <?php if ($_smarty_tpl->tpl_vars['row']->value->child_gender==1){?> طفل <?php }else{ ?> طفلة  <?php }?>
                <?php if ($_smarty_tpl->tpl_vars['row']->value->child_name!=''&&$_smarty_tpl->tpl_vars['row']->value->child_name!=null){?>  (<?php echo $_smarty_tpl->tpl_vars['row']->value->child_name;?>
) <?php }?> 
                <?php }else{ ?> الزوجه<?php }?>
            </td>
            <?php }?> 
            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->system_type==2){?>    
            <td> <?php echo $_smarty_tpl->tpl_vars['row']->value->visitHour;?>
</td>
            <?php }else{ ?>
            <td> <?php echo $_smarty_tpl->tpl_vars['row']->value->visit_time;?>
</td>
            <?php }?> 

            <td> <?php echo $_smarty_tpl->tpl_vars['row']->value->user_name;?>
</td>
            <td>   
                <?php if ($_smarty_tpl->tpl_vars['row']->value->showRedirectNote==1){?>    
                <span class="fleft ltr"> Dr Note :   </span>   <span><?php echo $_smarty_tpl->tpl_vars['row']->value->redirect_note;?>
 </span>
                <?php }?>
                <textarea class="form-control  txtc  ltr" rows="2"   placeholder="Enter more text" data-toggle="popover" 
                          data-trigger="hover" data-placement="bottom" data-content="" id="visitComment<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
"><?php echo $_smarty_tpl->tpl_vars['row']->value->notes;?>
</textarea>
                <a class="label  label-primary saveVisitComment"  data-visitId="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" ><i class="fa fa-save"></i></a>
            </td>

            <td>
                <?php if ($_smarty_tpl->tpl_vars['row']->value->printserial>0&&$_smarty_tpl->tpl_vars['row']->value->detectionvalue_cash>0){?> 
                <a class="label  label-success printVisitRecept"  data-visitId="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" ><i class="fa fa-print"></i></a>
                <?php }?>
            </td>

            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->confirm_attend==1){?>  
            <td> 
                <select class="form-control visitAttend updateElementSelect" id="confirmAttend<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" 
                        data-id="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
"  data-colName="confirm_attend"  data-tableName="visits" data-ajax="1" >
                    <option value="0">اختر </option>
                    <option value="1" <?php if ($_smarty_tpl->tpl_vars['row']->value->confirm_attend==1){?>  selected  <?php }?>  style="background-color: #d0f09f ;">تأكيد </option>
                    <option value="2"  <?php if ($_smarty_tpl->tpl_vars['row']->value->confirm_attend==2){?>  selected  <?php }?>   style="background-color: #d1a6d1 ;">تاجيل </option>
                    <option value="3"  <?php if ($_smarty_tpl->tpl_vars['row']->value->confirm_attend==3){?>  selected  <?php }?>   style="background-color: #fd8591 ;">الغاء </option>
                </select>
            </td>
            <?php }?> 


            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->whatsapp_sms==1){?>  
            <td> 
                <?php if ($_smarty_tpl->tpl_vars['row']->value->phone!=''&&$_smarty_tpl->tpl_vars['row']->value->phone!=null){?>  
                <a class="btn btn-success btn-sm" id="whatsSmsBtn"   target="_blank"
                   href="https://wa.me/2<?php echo $_smarty_tpl->tpl_vars['row']->value->phone;?>
/?text=<?php echo $_smarty_tpl->tpl_vars['programesetting']->value->whatsapp_txt;?>
"><i class="fa fa-whatsapp"></i>  </a>
                <?php }?> 
            </td>
            <?php }?> 

            <?php if ($_smarty_tpl->tpl_vars['programesetting']->value->attend_today==1){?>  
            <td>  
                <a class="btn btn-danger btn-sm todayListChange" id="todayListCanc<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
"  data-visitId="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
"   
                   data-val="0"    <?php if ($_smarty_tpl->tpl_vars['row']->value->today_list!=1){?> style="display: none;"       <?php }?> >إلغاء  </a>
                <a class="btn btn-success btn-sm todayListChange"  id="todayListConf<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
"  data-visitId="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
"  
                   data-val="1"  <?php if ($_smarty_tpl->tpl_vars['row']->value->today_list==1){?> style="display: none;"       <?php }?> >تم  </a>

            </td>
            <?php }?> 

            <?php if ($_smarty_tpl->tpl_vars['row']->value->tempPatient==1){?> 
            <td>
                <a class="bg-blue dltbtn" href="<?php echo $_smarty_tpl->tpl_vars['hosturl']->value;?>
/controllers/patients.php?ac=edit&id=<?php echo $_smarty_tpl->tpl_vars['row']->value->patientid;?>
">Profile</a>
            </td>
            <?php }else{ ?>

            <?php if ($_smarty_tpl->tpl_vars['allowEditVisit']->value==1||($_smarty_tpl->tpl_vars['row']->value->customer_add==1&&$_smarty_tpl->tpl_vars['row']->value->service_edit!=1)){?>  
            <?php if ($_smarty_tpl->tpl_vars['row']->value->detectionid==9999){?> 
            <td><a class=" bg-green dltbtn  editRefundVisit" data-visitId="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" id="editvisit<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
">
                    <i class="fa fa-pencil"></i>
                </a>
            </td>
            <?php }elseif($_smarty_tpl->tpl_vars['row']->value->detectionid==999){?> 
            <td><a class=" bg-green dltbtn  editPayValVisit" data-visitId="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" id="editvisit<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
">
                    <i class="fa fa-pencil"></i>
                </a>
            </td>
            <?php }else{ ?>
            <td><a class=" bg-green dltbtn  editVisit" data-visitId="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" id="editvisit<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" data-isLab="<?php echo $_smarty_tpl->tpl_vars['isLab']->value;?>
">
                    <i class="fa fa-pencil"></i>
                </a>
            </td>
            <?php }?>

            <?php }else{ ?>        
            <td></td>
            <?php }?> 
            <?php }?> 


            <?php if ($_smarty_tpl->tpl_vars['allowDeleteVisit']->value==1||($_smarty_tpl->tpl_vars['row']->value->customer_add==1&&$_smarty_tpl->tpl_vars['row']->value->service_edit!=1)){?> 
            <td>
                <a class=" bg-red dltbtn deletevisitAjax "  data-today="0" id="deletevisit<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" data-id="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
" data-link="visits" data-fn="del">
                    <i class="fa fa-close"></i>
                </a>
            </td>
            <?php }else{ ?>        
            <td></td>
            <?php }?> 
        </tr>
        <?php $_smarty_tpl->_capture_stack[0][] = array('default', 'i', null); ob_start(); ?><?php echo $_smarty_tpl->tpl_vars['i']->value+1;?>
<?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
if (!empty($_capture_buffer)) {
 if (isset($_capture_assign)) $_smarty_tpl->assign($_capture_assign, ob_get_contents());
 if (isset( $_capture_append)) $_smarty_tpl->append( $_capture_append, ob_get_contents());
 Smarty::$_smarty_vars['capture'][$_capture_buffer]=ob_get_clean();
} else $_smarty_tpl->capture_error();?>
        <?php } ?>
    </tbody>
</table>

<?php if ($_SESSION['role_id']==12){?>

<style>
    .not_lab{
        display: none;
    }
</style>

<?php }?>

<?php if ($_SESSION['role_id']==5){?>

<style>
    .not_ray_lab{
        display: none;
    }
</style>

<?php }?>


<script>
    $('.dataTable').dataTable();
    //   $('.visitAttend').select2();
</script>
<?php }} ?>