<table class="table table-hover portlet light bg-inverse rtl"  style="width: 100%;">
    <thead>
        <tr>
            <th>  رقم  المريض</th>
            <td> {$patient.statusno}</td>
            <th>  اسم المريض</th>
            <td> {$patient.wifename}</td>
            <th>  اسم الزوج</th>
            <td>  {$patient.husdandname}</td>
        </tr>
    </thead>
</table>


<table class="table table-hover portlet light bg-inverse rtl" id="repTable" style="width: 100%;">
    <thead>
        <tr>
            <th rowspan="2"> التاريخ</th>
            {foreach $locations as $location}
            <th colspan="{$location.floorsCount}">    {$location.locationName}</th>
            {/foreach}
        </tr>

        <tr>
            {foreach $locations as $location}
            {foreach $location.floors as $floor}
            <th>    {$floor.floorName}</th>
            {/foreach}
            {/foreach}
        </tr>
    </thead>
    <tbody>
        {assign var="i" value="1"}
        {foreach $dates as $date}
        <tr>
            <td> {$date.visit_date}</td>
            {foreach $date.records as $record}
            <td style="direction: ltr;">    {$record}</td>
            {/foreach}
        </tr>
        {assign var="i" value={$i+1}}
        {/foreach}
    </tbody>
</table>