<?php /* Smarty version Smarty-3.1.11, created on 2025-02-11 23:46:02
         compiled from "../views/obgy/visits/visitdiv.html" */ ?>
<?php /*%%SmartyHeaderCode:36868412167ac51ba2564d0-94321497%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'efc62860668f7ae7e337a0135676ea31f231012b' => 
    array (
      0 => '../views/obgy/visits/visitdiv.html',
      1 => 1640067488,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '36868412167ac51ba2564d0-94321497',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'withPeriod' => 0,
    'allvisit' => 0,
    'day' => 0,
    'dayVisits' => 0,
    'period' => 0,
    'programview' => 0,
    'allowEditVisit' => 0,
    'allowDeleteVisit' => 0,
    'row' => 0,
    'i' => 0,
    'showPeriod' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_67ac51ba378f30_46536527',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_67ac51ba378f30_46536527')) {function content_67ac51ba378f30_46536527($_smarty_tpl) {?><?php if ($_smarty_tpl->tpl_vars['withPeriod']->value==1){?> 
<?php  $_smarty_tpl->tpl_vars['dayVisits'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['dayVisits']->_loop = false;
 $_smarty_tpl->tpl_vars['day'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['allvisit']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['dayVisits']->key => $_smarty_tpl->tpl_vars['dayVisits']->value){
$_smarty_tpl->tpl_vars['dayVisits']->_loop = true;
 $_smarty_tpl->tpl_vars['day']->value = $_smarty_tpl->tpl_vars['dayVisits']->key;
?>
<table class="table table-bordered table-striped table-hover rtl"  >
    <caption class="txtc bold" style="background-color: #666;color: white;"> 
        <?php echo $_smarty_tpl->tpl_vars['day']->value;?>
 
    </caption>
    <tbody>
        <tr>
            <td>
                <?php  $_smarty_tpl->tpl_vars['period'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['period']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['dayVisits']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['period']->key => $_smarty_tpl->tpl_vars['period']->value){
$_smarty_tpl->tpl_vars['period']->_loop = true;
?>
                <table class="table table-bordered table-striped table-hover rtl"  >
                    <caption class="txtc bold" style="background-color: #d8eac6;color: black;"> <?php echo $_smarty_tpl->tpl_vars['period']->value->name;?>
  :  <?php echo $_smarty_tpl->tpl_vars['period']->value->timing;?>
 </caption>
                    <thead>
                        <tr>
                            <th class="wds5 txtc">م</th>

                            <?php if ($_smarty_tpl->tpl_vars['programview']->value==1){?> 
                            <th class="txtc">اسم المريضة</th>
                            <th class="wds5 txtc">رقم الحالة</th>
                            <th class="txtc"> اسم الزوج </th>  
                            <?php }else{ ?>
                            <th class="txtc">اسم المريض</th>
                            <th class="wds5 txtc">رقم الحالة</th>
                            <?php }?>
                            <th class="txtc"> العنوان </th>
                            <th class="wds10 txtc"> الهاتف  </th>
                            <th class="txtc"> نوع الكشف </th>

                            <th class="wds10 txtc"> التاريخ </th>
                            <th class="wds7 txtc"> التوقيت  </th>
                            <th class="wds7 txtc"> حضور </th>
                            <th class="wds7 txtc"> المتبقى  </th>
                            <th class="txtc"> المستخدم  </th>
                            <?php if ($_smarty_tpl->tpl_vars['allowEditVisit']->value==1){?> <th class="wds5 txtc"> تعديل</th>  <?php }?>
                            <?php if ($_smarty_tpl->tpl_vars['allowDeleteVisit']->value==1){?> <th class="wds5 txtc"> حذف</th>  <?php }?>
                        </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['period']->value->periodVisits; 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  <?php if ($_smarty_tpl->tpl_vars['row']->value->detectionid==9999||$_smarty_tpl->tpl_vars['row']->value->patient_edit==1){?>style="background-color: #efc9cc;"  <?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['programview']->value==1){?> <td> <?php echo $_smarty_tpl->tpl_vars['row']->value->husbandname;?>
</td>  <?php }?>
                            <td> <?php echo $_smarty_tpl->tpl_vars['row']->value->address;?>
</td>
                            <td> <?php echo $_smarty_tpl->tpl_vars['row']->value->phone;?>
</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->approx_time;?>
</td>
                            <td>
                                <input type="text" class="form-control newitemP timepicker-15" data-id="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
"  
                                       data-colName="visittime" data-tableName="visits"  id="visittime<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
"
                                       value="<?php echo $_smarty_tpl->tpl_vars['row']->value->visittime;?>
">
                                <button class="setTimeBtn wds100 bg-green-haze"  data-targetId="visittime<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
">  
                                    <i class="fa fa-clock-o"></i>
                                </button>
                            </td>
                            <td> <?php echo $_smarty_tpl->tpl_vars['row']->value->dept;?>
</td>
                            <td>
                                <?php echo $_smarty_tpl->tpl_vars['row']->value->user_name;?>


                                <?php if ($_smarty_tpl->tpl_vars['allowDeleteVisit']->value!=1&&$_smarty_tpl->tpl_vars['row']->value->mobileappvisit==1){?>  
                                - <a class=" bg-yellow-gold dltbtn">حجز بالتطبيق</a>
                                <?php }?>
                            </td>

                            <?php if ($_smarty_tpl->tpl_vars['allowEditVisit']->value==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;?>
">
                                    <i class="fa fa-pencil"></i>
                                </a>
                            </td>
                            <?php }?>
                            <?php }?>

                            <?php if ($_smarty_tpl->tpl_vars['allowDeleteVisit']->value==1){?> 
                            <td>
                                <a class="deletevisitAjax bg-red dltbtn"  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>
                                <?php if ($_smarty_tpl->tpl_vars['row']->value->mobileappvisit==1){?>- <a class=" bg-yellow-gold dltbtn">حجز بالتطبيق</a><?php }?>
                            </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 } ?>
            </td>
        </tr>
    </tbody>
</table>
<?php } ?>




<?php }else{ ?>

<table class="table table-bordered table-striped table-hover rtl"  >
    <thead>
        <tr>
            <th class="wds5 txtc">م</th>

            <?php if ($_smarty_tpl->tpl_vars['programview']->value==1){?> 
            <th class="txtc">اسم المريضة</th>
            <th class="wds5 txtc">رقم الحالة</th>
            <th class="txtc"> اسم الزوج </th>  
            <?php }else{ ?>
            <th class="txtc">اسم المريض</th>
            <th class="wds5 txtc">رقم الحالة</th>
            <?php }?>
            <th class="txtc"> العنوان </th>
            <th class="wds10 txtc"> الهاتف  </th>
            <th class="txtc"> نوع الكشف </th>
            <th class="wds10 txtc"> التاريخ </th>
            <th class="wds7 txtc"> التوقيت </th>
            <th class="wds10 txtc"> حضور </th>
            <?php if ($_smarty_tpl->tpl_vars['showPeriod']->value==1){?> 
            <th class="wds5 txtc">الفترة </th>
            <?php }?>
            <th class="txtc"> المستخدم  </th>
            <?php if ($_smarty_tpl->tpl_vars['allowEditVisit']->value==1){?> <th class="wds5 txtc"> تعديل</th> <?php }?>
            <?php if ($_smarty_tpl->tpl_vars['allowDeleteVisit']->value==1){?> <th class="wds5 txtc"> حذف</th>  <?php }?>
        </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  <?php if ($_smarty_tpl->tpl_vars['row']->value->detectionid==9999){?>style="background-color: #efc9cc;"  <?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['programview']->value==1){?> <td> <?php echo $_smarty_tpl->tpl_vars['row']->value->husbandname;?>
</td>  <?php }?>
            <td> <?php echo $_smarty_tpl->tpl_vars['row']->value->address;?>
</td>
            <td> <?php echo $_smarty_tpl->tpl_vars['row']->value->phone;?>
</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->approx_time;?>
</td>
            <td>
                <input type="text" class="form-control newitemP timepicker-15" data-id="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
"  
                       data-colName="visittime" data-tableName="visits"  id="visittime<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
"
                       value="<?php echo $_smarty_tpl->tpl_vars['row']->value->visittime;?>
">
                <button class="setTimeBtn wds100 bg-green-haze"  data-targetId="visittime<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
">  
                    <i class="fa fa-clock-o"></i>
                </button>
            </td>
            <?php if ($_smarty_tpl->tpl_vars['showPeriod']->value==1){?> 
            <td> <?php echo $_smarty_tpl->tpl_vars['row']->value->period_name;?>
</td>
            <?php }?>

            <td>
                <?php echo $_smarty_tpl->tpl_vars['row']->value->user_name;?>

                <?php if ($_smarty_tpl->tpl_vars['allowDeleteVisit']->value!=1&&$_smarty_tpl->tpl_vars['row']->value->mobileappvisit==1){?>  
                - <a class=" bg-yellow-gold dltbtn">حجز بالتطبيق</a>
                <?php }?>
            </td>

            <?php if ($_smarty_tpl->tpl_vars['allowEditVisit']->value==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;?>
">
                    <i class="fa fa-pencil"></i>
                </a>
            </td>
            <?php }?>
            <?php }?>

            <?php if ($_smarty_tpl->tpl_vars['allowDeleteVisit']->value==1){?> 
            <td>
                <a class="deletevisitAjax bg-red dltbtn"  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>
                <?php if ($_smarty_tpl->tpl_vars['row']->value->mobileappvisit==1){?>- <a class=" bg-yellow-gold dltbtn">حجز بالتطبيق</a><?php }?>
            </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 }?>



<script type="text/javascript" >

    $('.timepicker-15').timepicker({
        autoclose: true,
        minuteStep: 15,
        showSeconds: false,
        showMeridian: false,
        defaultTime: null
    });

    $('.setTimeBtn').on('click', function () {
        var targetId = $(this).attr('data-targetId');
        $('#' + targetId).timepicker('setTime', new Date());
    });

</script>
<?php }} ?>