<?php /* Smarty version Smarty-3.1.11, created on 2023-08-16 18:32:16
         compiled from "..\views\obgy\reserve_clinic\add_h.html" */ ?>
<?php /*%%SmartyHeaderCode:464d1228a971506-97544344%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '39bbba69257296716cd9a41d72a7d8272d1f4e3b' => 
    array (
      0 => '..\\views\\obgy\\reserve_clinic\\add_h.html',
      1 => 1641356232,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '464d1228a971506-97544344',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.11',
  'unifunc' => 'content_64d1228b0b1a90_50773856',
  'variables' => 
  array (
    'hosturl' => 0,
    'controllname' => 0,
    'departs' => 0,
    'row' => 0,
    'days' => 0,
    'day' => 0,
    'rooms' => 0,
    'room' => 0,
    'hour' => 0,
    'key' => 0,
    'today' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_64d1228b0b1a90_50773856')) {function content_64d1228b0b1a90_50773856($_smarty_tpl) {?><meta charset="utf8">
<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
    <div class="page-content">
        <div class="row">

            <div class="col-md-12 ">
                <div class="portlet box blue">
                    <div class="portlet-title">
                        <div class="caption fright">

                            الحجوزات
                        </div>
                        <div class="tools fleft">
                            <a href="#" class="collapse" title="تصغير / تكبير"></a>
                            <!--a class="fff bold" href="<?php echo $_smarty_tpl->tpl_vars['hosturl']->value;?>
/controllers/<?php echo $_smarty_tpl->tpl_vars['controllname']->value;?>
.php?ac=show">عرض جميع  الحجوزات </a-->
                        </div>
                    </div>

                    <div class="portlet-body">
                        <div class="table-toolbar">

                        </div>  
                        <table class="table table-bordered  table-hover rtl">
                            <tr>
                                <th style="width: 18%;">القسم</th>
                                <td>
                                    <select class="select2h" style="width: 100%;"  id="reserve_dept" placeholder="اختر القسم " required >
                                        <option value=""></option>
                                        <?php  $_smarty_tpl->tpl_vars['row'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['row']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['departs']->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;
?>
                                        <option value="<?php echo $_smarty_tpl->tpl_vars['row']->value->id;?>
"><?php echo $_smarty_tpl->tpl_vars['row']->value->name;?>
</option>
                                        <?php } ?>
                                    </select>
                                </td>
                                <td style="width: 18%;" >
                                    <a href="javascript:;"  id="deptClinicsDisplay"
                                       class="btn blue-soft btn-block btn-xs">غرف العيادة </a>
                                    <span id="clinicsError"  style="color: red;display: none;">اختر قسم أولا ....</span>
                                </td>
                            </tr>
                        </table>

                        <div id="dept_clinics_div">
                            <div class="table-toolbar">
                                <a href="javascript:;"  id="reserve_cancel"
                                   class="btn red btn-block btn-xs fleft wds10">إلغاء حجز   </a>
                                <span id="reserve_cancelError"  style="color: red;display: none;float: left;">اختر ساعات محجوزة أولا  </span>


                            </div>  

                            <div class="tabbable tabbable-custom tabbable-noborder">
                                <ul class="nav nav-tabs" id="rowTab" style="float: right;">
                                    <li class="fright aw_3d_list active"> <a href="#tab1" data-toggle="tab"> السبت  </a> </li>
                                    <li class="fright aw_3d_list"> <a href="#tab2" data-toggle="tab"> الأحد  </a> </li>
                                    <li class="fright aw_3d_list"> <a href="#tab3" data-toggle="tab"> الإثنين </a> </li>
                                    <li class="fright aw_3d_list"> <a href="#tab4" data-toggle="tab"> الثلاثاء </a> </li>
                                    <li class="fright aw_3d_list"> <a href="#tab5" data-toggle="tab"> الأربعاء </a> </li>
                                    <li class="fright aw_3d_list"> <a href="#tab6" data-toggle="tab"> الخميس </a> </li>
                                    <li class="fright aw_3d_list"> <a href="#tab7" data-toggle="tab"> الجمعة </a> </li>
                                </ul>
                            </div>


                            <div class="tab-content">
                                <?php  $_smarty_tpl->tpl_vars['day'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['day']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['days']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['day']->key => $_smarty_tpl->tpl_vars['day']->value){
$_smarty_tpl->tpl_vars['day']->_loop = true;
?>
                                <div class="tab-pane <?php if ($_smarty_tpl->tpl_vars['day']->value['no']==1){?>active <?php }?> " id="tab<?php echo $_smarty_tpl->tpl_vars['day']->value['no'];?>
">
                                    <div class="row">
                                        <div class="col-md-12">
                                            <table class="table  table-bordered table-hover">
                                                <caption style="text-align: center;font-weight: bolder">ساعات اليوم  

                                                    <a href="javascript:;"  data-dayNo="<?php echo $_smarty_tpl->tpl_vars['day']->value['no'];?>
"
                                                       class="btn green-haze btn-block btn-xs fleft wds10 printDay">  طباعة   </a>
                                                </caption>
                                                <thead>
                                                    <tr>
                                                        <th></th>
                                                        <?php  $_smarty_tpl->tpl_vars['room'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['room']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['rooms']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['room']->key => $_smarty_tpl->tpl_vars['room']->value){
$_smarty_tpl->tpl_vars['room']->_loop = true;
?>
                                                        <th><?php echo $_smarty_tpl->tpl_vars['room']->value['name'];?>
 </th>
                                                        <?php } ?>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <?php  $_smarty_tpl->tpl_vars['hour'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['hour']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['day']->value['hours']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['hour']->key => $_smarty_tpl->tpl_vars['hour']->value){
$_smarty_tpl->tpl_vars['hour']->_loop = true;
?>
                                                    <tr>
                                                        <td><?php echo $_smarty_tpl->tpl_vars['hour']->value;?>
 </td>
                                                        <?php  $_smarty_tpl->tpl_vars['room'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['room']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['rooms']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['room']->key => $_smarty_tpl->tpl_vars['room']->value){
$_smarty_tpl->tpl_vars['room']->_loop = true;
?>


                                                        <?php if ($_smarty_tpl->tpl_vars['day']->value['no']==1){?>
                                                        <?php if (in_array($_smarty_tpl->tpl_vars['hour']->value,$_smarty_tpl->tpl_vars['room']->value['resHours1'])){?> 
                                                        <?php $_smarty_tpl->tpl_vars["key"] = new Smarty_variable(array_search($_smarty_tpl->tpl_vars['hour']->value,$_smarty_tpl->tpl_vars['room']->value['resHours1']), null, 0);?>
                                                        <td class="dayBusy" data-dayNo="<?php echo $_smarty_tpl->tpl_vars['day']->value['no'];?>
" data-room="<?php echo $_smarty_tpl->tpl_vars['room']->value['id'];?>
"  data-hour="<?php echo $_smarty_tpl->tpl_vars['hour']->value;?>
" >
                                                            <?php if ($_smarty_tpl->tpl_vars['key']->value!==false){?>
                                                            <?php echo $_smarty_tpl->tpl_vars['room']->value['resNames1'][$_smarty_tpl->tpl_vars['key']->value];?>

                                                            <?php }?>
                                                        </td>
                                                        <?php }else{ ?>
                                                        <td class="dayFree" data-dayNo="<?php echo $_smarty_tpl->tpl_vars['day']->value['no'];?>
" data-room="<?php echo $_smarty_tpl->tpl_vars['room']->value['id'];?>
"   
                                                            data-hour="<?php echo $_smarty_tpl->tpl_vars['hour']->value;?>
" >
                                                        </td>
                                                        <?php }?>
                                                        <!------------------------------------------------------------------------------------------------------------>
                                                        <?php }elseif($_smarty_tpl->tpl_vars['day']->value['no']==2){?>
                                                        <?php if (in_array($_smarty_tpl->tpl_vars['hour']->value,$_smarty_tpl->tpl_vars['room']->value['resHours2'])){?> 
                                                        <?php $_smarty_tpl->tpl_vars["key"] = new Smarty_variable(array_search($_smarty_tpl->tpl_vars['hour']->value,$_smarty_tpl->tpl_vars['room']->value['resHours2']), null, 0);?>
                                                        <td class="dayBusy" data-dayNo="<?php echo $_smarty_tpl->tpl_vars['day']->value['no'];?>
" data-room="<?php echo $_smarty_tpl->tpl_vars['room']->value['id'];?>
"  data-hour="<?php echo $_smarty_tpl->tpl_vars['hour']->value;?>
" > 
                                                            <?php if ($_smarty_tpl->tpl_vars['key']->value!==false){?>
                                                            <?php echo $_smarty_tpl->tpl_vars['room']->value['resNames2'][$_smarty_tpl->tpl_vars['key']->value];?>

                                                            <?php }?>
                                                        </td>
                                                        <?php }else{ ?>
                                                        <td class="dayFree" data-dayNo="<?php echo $_smarty_tpl->tpl_vars['day']->value['no'];?>
" data-room="<?php echo $_smarty_tpl->tpl_vars['room']->value['id'];?>
"   
                                                            data-hour="<?php echo $_smarty_tpl->tpl_vars['hour']->value;?>
" >
                                                        </td>
                                                        <?php }?>
                                                        <!------------------------------------------------------------------------------------------------------------>
                                                        <?php }elseif($_smarty_tpl->tpl_vars['day']->value['no']==3){?>
                                                        <?php if (in_array($_smarty_tpl->tpl_vars['hour']->value,$_smarty_tpl->tpl_vars['room']->value['resHours3'])){?> 
                                                        <?php $_smarty_tpl->tpl_vars["key"] = new Smarty_variable(array_search($_smarty_tpl->tpl_vars['hour']->value,$_smarty_tpl->tpl_vars['room']->value['resHours3']), null, 0);?>
                                                        <td class="dayBusy" data-dayNo="<?php echo $_smarty_tpl->tpl_vars['day']->value['no'];?>
" data-room="<?php echo $_smarty_tpl->tpl_vars['room']->value['id'];?>
"  data-hour="<?php echo $_smarty_tpl->tpl_vars['hour']->value;?>
" > 
                                                            <?php if ($_smarty_tpl->tpl_vars['key']->value!==false){?>
                                                            <?php echo $_smarty_tpl->tpl_vars['room']->value['resNames3'][$_smarty_tpl->tpl_vars['key']->value];?>

                                                            <?php }?>
                                                        </td>
                                                        <?php }else{ ?>
                                                        <td class="dayFree" data-dayNo="<?php echo $_smarty_tpl->tpl_vars['day']->value['no'];?>
" data-room="<?php echo $_smarty_tpl->tpl_vars['room']->value['id'];?>
"   
                                                            data-hour="<?php echo $_smarty_tpl->tpl_vars['hour']->value;?>
" >
                                                        </td>
                                                        <?php }?>
                                                        <!------------------------------------------------------------------------------------------------------------>
                                                        <?php }elseif($_smarty_tpl->tpl_vars['day']->value['no']==4){?>
                                                        <?php if (in_array($_smarty_tpl->tpl_vars['hour']->value,$_smarty_tpl->tpl_vars['room']->value['resHours4'])){?> 
                                                        <?php $_smarty_tpl->tpl_vars["key"] = new Smarty_variable(array_search($_smarty_tpl->tpl_vars['hour']->value,$_smarty_tpl->tpl_vars['room']->value['resHours4']), null, 0);?>
                                                        <td class="dayBusy" data-dayNo="<?php echo $_smarty_tpl->tpl_vars['day']->value['no'];?>
" data-room="<?php echo $_smarty_tpl->tpl_vars['room']->value['id'];?>
"  data-hour="<?php echo $_smarty_tpl->tpl_vars['hour']->value;?>
" > 
                                                            <?php if ($_smarty_tpl->tpl_vars['key']->value!==false){?>
                                                            <?php echo $_smarty_tpl->tpl_vars['room']->value['resNames4'][$_smarty_tpl->tpl_vars['key']->value];?>

                                                            <?php }?>
                                                        </td>
                                                        <?php }else{ ?>
                                                        <td class="dayFree" data-dayNo="<?php echo $_smarty_tpl->tpl_vars['day']->value['no'];?>
" data-room="<?php echo $_smarty_tpl->tpl_vars['room']->value['id'];?>
"   
                                                            data-hour="<?php echo $_smarty_tpl->tpl_vars['hour']->value;?>
" >
                                                        </td>
                                                        <?php }?>
                                                        <!------------------------------------------------------------------------------------------------------------>
                                                        <?php }elseif($_smarty_tpl->tpl_vars['day']->value['no']==5){?>
                                                        <?php if (in_array($_smarty_tpl->tpl_vars['hour']->value,$_smarty_tpl->tpl_vars['room']->value['resHours5'])){?> 
                                                        <?php $_smarty_tpl->tpl_vars["key"] = new Smarty_variable(array_search($_smarty_tpl->tpl_vars['hour']->value,$_smarty_tpl->tpl_vars['room']->value['resHours5']), null, 0);?>
                                                        <td class="dayBusy" data-dayNo="<?php echo $_smarty_tpl->tpl_vars['day']->value['no'];?>
" data-room="<?php echo $_smarty_tpl->tpl_vars['room']->value['id'];?>
"  data-hour="<?php echo $_smarty_tpl->tpl_vars['hour']->value;?>
" > 
                                                            <?php if ($_smarty_tpl->tpl_vars['key']->value!==false){?>
                                                            <?php echo $_smarty_tpl->tpl_vars['room']->value['resNames5'][$_smarty_tpl->tpl_vars['key']->value];?>

                                                            <?php }?>
                                                        </td>
                                                        <?php }else{ ?>
                                                        <td class="dayFree" data-dayNo="<?php echo $_smarty_tpl->tpl_vars['day']->value['no'];?>
" data-room="<?php echo $_smarty_tpl->tpl_vars['room']->value['id'];?>
"   
                                                            data-hour="<?php echo $_smarty_tpl->tpl_vars['hour']->value;?>
" >
                                                        </td>
                                                        <?php }?>
                                                        <!------------------------------------------------------------------------------------------------------------>
                                                        <?php }elseif($_smarty_tpl->tpl_vars['day']->value['no']==6){?>
                                                        <?php if (in_array($_smarty_tpl->tpl_vars['hour']->value,$_smarty_tpl->tpl_vars['room']->value['resHours6'])){?> 
                                                        <?php $_smarty_tpl->tpl_vars["key"] = new Smarty_variable(array_search($_smarty_tpl->tpl_vars['hour']->value,$_smarty_tpl->tpl_vars['room']->value['resHours6']), null, 0);?>
                                                        <td class="dayBusy" data-dayNo="<?php echo $_smarty_tpl->tpl_vars['day']->value['no'];?>
" data-room="<?php echo $_smarty_tpl->tpl_vars['room']->value['id'];?>
"  data-hour="<?php echo $_smarty_tpl->tpl_vars['hour']->value;?>
" > 
                                                            <?php if ($_smarty_tpl->tpl_vars['key']->value!==false){?>
                                                            <?php echo $_smarty_tpl->tpl_vars['room']->value['resNames6'][$_smarty_tpl->tpl_vars['key']->value];?>

                                                            <?php }?>
                                                        </td>
                                                        <?php }else{ ?>
                                                        <td class="dayFree" data-dayNo="<?php echo $_smarty_tpl->tpl_vars['day']->value['no'];?>
" data-room="<?php echo $_smarty_tpl->tpl_vars['room']->value['id'];?>
"   
                                                            data-hour="<?php echo $_smarty_tpl->tpl_vars['hour']->value;?>
" >
                                                        </td>
                                                        <?php }?>
                                                        <!------------------------------------------------------------------------------------------------------------>
                                                        <?php }elseif($_smarty_tpl->tpl_vars['day']->value['no']==7){?>
                                                        <?php if (in_array($_smarty_tpl->tpl_vars['hour']->value,$_smarty_tpl->tpl_vars['room']->value['resHours7'])){?> 
                                                        <?php $_smarty_tpl->tpl_vars["key"] = new Smarty_variable(array_search($_smarty_tpl->tpl_vars['hour']->value,$_smarty_tpl->tpl_vars['room']->value['resHours7']), null, 0);?>
                                                        <td class="dayBusy" data-dayNo="<?php echo $_smarty_tpl->tpl_vars['day']->value['no'];?>
" data-room="<?php echo $_smarty_tpl->tpl_vars['room']->value['id'];?>
"  data-hour="<?php echo $_smarty_tpl->tpl_vars['hour']->value;?>
" > 
                                                            <?php if ($_smarty_tpl->tpl_vars['key']->value!==false){?>
                                                            <?php echo $_smarty_tpl->tpl_vars['room']->value['resNames7'][$_smarty_tpl->tpl_vars['key']->value];?>

                                                            <?php }?>
                                                        </td>
                                                        <?php }else{ ?>
                                                        <td class="dayFree" data-dayNo="<?php echo $_smarty_tpl->tpl_vars['day']->value['no'];?>
" data-room="<?php echo $_smarty_tpl->tpl_vars['room']->value['id'];?>
"   
                                                            data-hour="<?php echo $_smarty_tpl->tpl_vars['hour']->value;?>
" >
                                                        </td>
                                                        <?php }?>
                                                        <!------------------------------------------------------------------------------------------------------------>
                                                        <?php }?>

                                                        <?php $_smarty_tpl->tpl_vars["i"] = new Smarty_variable("3", null, 0);?>
                                                        <?php $_smarty_tpl->tpl_vars["k"] = new Smarty_variable('', null, 0);?>
                                                        <?php } ?>
                                                    </tr>
                                                    <?php } ?>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>

                                </div>
                                <?php } ?>
                            </div>



                        </div>

                        <table class="table table-bordered  table-hover rtl" id="reserve_action_div" style="display: none;">
                            <tr>
                                <th style="width: 18%;">الطبيب </th>
                                <td>
                                    <select  style="width: 100%;"  id="reserve_doctor" placeholder="اختر الطبيب " required >
                                    </select>
                                </td>
                                <th style="width: 10%;">بدءا من  </th>
                                <td style="width: 10%;" >
                                    <input class="form-control patientvisitidCheckDate  datepicker edited"
                                           type="text"  id="start_date"  value="<?php echo $_smarty_tpl->tpl_vars['today']->value;?>
">
                                </td>
                                <td style="width: 18%;" >
                                    <a href="javascript:;"  id="reserve_clinic"
                                       class="btn blue-soft btn-block btn-xs">حجز  </a>
                                    <span id="reserve_clinicError"  style="color: red;display: none;"> </span>
                                </td>
                            </tr>
                        </table>


                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<input type="hidden" id="controllName" value="reserve_clinic"/>

<div id="displayClinicsDiv"></div>
<div id="printDayDiv"></div>
<?php }} ?>