
<div class="tabbable tabbable-custom tabbable-noborder">

    <ul class="nav nav-tabs" id="rowTab">
        {assign var="i" value="0"}
        {if  isset($operations_main) and $operations_main|@count > 0}
        <li class="aw_3d_list {if $i < 1} active" {/if}> <a href="#tab1" data-toggle="tab"> General reserve </a> </li>
        {assign var="i" value={$i+1}}
        {/if}
        {if  isset($searched_operations_rooms) and $searched_operations_rooms|@count > 0}
        <li class="aw_3d_list {if $i < 1} active" {/if}> <a href="#tab2" data-toggle="tab"> Operation Rooms </a> </li>
        {assign var="i" value={$i+1}}
        {/if}
        {if  isset($searched_residence_rooms) and $searched_residence_rooms|@count > 0}
        <li class="aw_3d_list {if $i < 1} active" {/if}> <a href="#tab3" data-toggle="tab"> Residence Rooms </a> </li>
        {assign var="i" value={$i+1}}
        {/if}
    </ul>





    <div class="tab-content">
        {assign var="x" value="0"}
        {if  isset($operations_main) and $operations_main|@count > 0}
        <div class="tab-pane {if $x < 1} active" {/if} " id="tab1">
            <div class="row">
                <div class="col-md-12">
                    <table class="table table-hover portlet light bg-inverse rtl  dataTableX" style="width: 100%;">
                        <thead>
                            <tr>
                                <th>نوع العمليه</th>
                                <th>غرفه العمليات</th>
                                <th>وقت العمليه</th>
                                <th>غرفه الاقامه</th>
                                <th>وقت الاقامه</th>
                                <th>اسم الطبيب</th>
                            </tr>
                        </thead>
                        <tbody>
                            {foreach $operations_main as $item}   
                            <tr>
                                <td>{$item->operation_type} </td>
                                <td>{$item->operations_room_name} </td>
                                <td>{$item->operation_hours_text} </td>
                                <td>{$item->residence_room_name} </td>
                                <td>{$item->residence_hours_text} </td>
                                <td>{$item->doctor_name} </td>
                            </tr>
                            {/foreach}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        {assign var="x" value={$x+1}}
        {/if}
        {if  isset($searched_operations_rooms) and $searched_operations_rooms|@count > 0}
        <div class="tab-pane {if $x < 1} active" {/if} " id="tab2">
            <div class="row">
                <div class="col-md-12">
                    <div class="portlet light ">
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="icon-edit font-dark"></i>
                                <span class="caption-subject font-dark bold uppercase">غرف العمليات</span>
                            </div>
                        </div>
                        <div class="search-container ">
                            <ul>
                                {foreach $searched_operations_rooms as $room}
                                <li class="search-item clearfix">
                                    <div class="search-content">
                                        <h2 class="search-title">
                                            <a href="javascript:;">{$room->name}</a>
                                        </h2>
                                        <div class="search-desc">
                                            <ul class="list-inline" >
                                                {foreach $room->times as $time}
                                                <li >
                                                    {if $time.status== 3}
                                                    <div class="alert alert-default"  style="background-color: #cbcdce;border-color: #d0d9da;color: #f6feff;"> {$time.hour_text} - غير مفعل</div>
                                                    {elseif $time.status== 0}
                                                    <div class="alert alert-success" > {$time.hour_text}  - غير محجوز </div>
                                                    {elseif $time.status== 1}
                                                    <div class="alert alert-danger" > {$time.hour_text}  - {$time.saved_id} </div>
                                                    {/if}
                                                </li>

                                                {/foreach}
                                            </ul>

                                        </div>
                                    </div>
                                </li>
                                {/foreach}

                                <div class="clearfix"></div>
                            </ul>
                        </div>
                    </div>

                </div>
            </div>
        </div>
        {assign var="x" value={$x+1}}
        {/if}
        {if  isset($searched_residence_rooms) and $searched_residence_rooms|@count > 0}
        <div class="tab-pane {if $x < 1} active" {/if} " id="tab3">
            <div class="row">
                <div class="col-md-12">
                    <div class="portlet light ">
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="icon-edit font-dark"></i>
                                <span class="caption-subject font-dark bold uppercase">غرف الاقامه</span>
                            </div>
                        </div>
                        <div class="search-container ">
                            <ul>
                                {foreach $searched_residence_rooms as $room}
                                <li class="search-item clearfix">
                                    <div class="search-content">
                                        <h2 class="search-title">
                                            <a href="javascript:;">{$room->name}</a>
                                        </h2>
                                        <div class="search-desc">
                                            <ul class="list-inline" >
                                                {foreach $room->times as $time}
                                                <li >
                                                    {if $time.status== 3}
                                                    <div class="alert alert-default"  style="background-color: #cbcdce;border-color: #d0d9da;color: #f6feff;"> {$time.hour_text} - غير مفعل</div>
                                                    {elseif $time.status== 0}
                                                    <div class="alert alert-success" > {$time.hour_text}  - غير محجوز </div>
                                                    {elseif $time.status== 1}
                                                    <div class="alert alert-danger" > {$time.hour_text}  - {$time.saved_id} </div>
                                                    {/if}
                                                </li>
                                                {/foreach}
                                            </ul>

                                        </div>
                                    </div>
                                </li>
                                {/foreach}

                                <div class="clearfix"></div>
                            </ul>
                        </div>
                    </div>

                </div>
            </div>
        </div>
        {assign var="x" value={$x+1}}
        {/if}
    </div>
</div>



{literal}
<script type="text/javascript" >
    $('.dataTableX').dataTable();


</script>
{/literal}

