<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" style="height:5px">
                        <div class="caption">
                            <i class="fa fa-edit"></i> {$shcontrollname}
                        </div>


                    </div>
                    <div class="portlet-body " style="padding: 15px">

                        <div class="row">
                            {foreach $rooms as $room}
                                <div class="col-md-3">
                                    <table class="table table-bordered table-hover table-checkable order-column">
                                        <thead>
                                        <tr>
                                            <th colspan="4">
                                                {$room->name}
                                            </th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        {foreach $room->reserves as $reserve}
                                            <tr>
                                                <th colspan="3">{$reserve.name}</th>
                                                <th>{foreach $reserve.hours as $hour}{$hour->reserve_hour}<br/>{/foreach}</th>
                                            </tr>
                                            {foreach $reserve.visits as $visit}
                                                <tr>
                                                    <td>{$visit.patient_name}</td>
                                                    <td>{$visit.detection_name}</td>
                                                    <td>
                                                        {if $visit.clinic_entered eq 1}
                                                            <button type="button" class="purple-intense"><i class="fa fa-check"></i></button>
                                                        {else}
                                                            <a href="{$hosturl}/controllers/{$controllname}.php?ac=enter&visit_id={$visit->id}" class="btn green-haze btn-xs">
                                                                <i class="fa fa-sign-in"></i>
                                                            </a>
                                                        {/if}
                                                    </td>
                                                    <td>
                                                        {if $visit.clinic_out eq 1}
                                                            <button type="button" class="purple-intense"><i class="fa fa-check"></i></button>
                                                        {else}
                                                            <a href="{$hosturl}/controllers/{$controllname}.php?ac=out&visit_id={$visit->id}" class="btn green-haze btn-xs">
                                                                <i class="fa fa-sign-out"></i>
                                                            </a>
                                                        {/if}
                                                    </td>
                                                </tr>
                                            {/foreach}
                                            {if $reserve.visits|@count <= 0}
                                                <tr>
                                                    <td colspan="4">
                                                        لا يوجد اي زيارات
                                                    </td>
                                                </tr>
                                            {/if}
                                        {/foreach}
                                        </tbody>
                                    </table>
                                </div>
                            {/foreach}
                        </div>

                    </div>

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





