{assign var=count value=1}
{foreach $rooms as $room}
    <table class="table table-striped table-hover ">
        <thead>
        <tr>
            <th class="bg{$count}" style="padding: 10px!important;">{$room.name}</th>
        </tr>
        <tr>
            <th class="bg5" style="padding: 10px!important;">{if empty($room.reserve.name)}لا يوجد طبيب{else}{$room.reserve.name}{/if}</th>
        </tr>
        <tr class=" bb">
            <th> اسم الحالة</th>
        </tr>
        </thead>
        <tbody>
        {assign var=op_itr value=1}
        {foreach $room.reserve.visits as $single}
            <tr class="{if $op_itr eq 1}even bg-success{elseif $op_itr eq 2}bg-info bb{/if}">
                <td>{$op_itr} - {$single->patient_name}</td>
            </tr>
            {capture assign=op_itr}{$op_itr+1}{/capture}
        {/foreach}
        </tbody>

    </table>
    {capture assign=count}{$count+1}{/capture}
{/foreach}