
{literal}
<style>
    .addressDetails{
        //  margin-left: 45px !important;
    }
</style>
{/literal}

<table class="table table-bordered table-striped table-hover  rtl" >
    <thead>
        <tr>
            <th class="wds20">عدد الحالات    :  </th>
            <td> {$totalResult}</td>
        </tr>
    </thead>
</table>


<div style="max-width: 1650px;max-height: 600px;overflow: auto;white-space: nowrap;">   

    <table class="table table-bordered table-striped table-hover rtl " >
        <tr>
            <th>م </th>
            <th>المحافظة   </th>
            <th class="wds10">  العدد </th>
            <th>المركز  </th>
            <th class="wds10">  </th>
        </tr>
        {assign var=i value=1}
        {foreach $governorates as $governorate}
        <tr style="    border-top: 5px solid #438008;">
            <td rowspan="{$governorate.centersCount}"> {$i}</td>
            <td rowspan="{$governorate.centersCount}"> {$governorate.governorateName}</td>
            <td rowspan="{$governorate.centersCount}"> {$governorate.patientsCount}</td>
            {assign var=j value=1}
            {foreach $governorate.centers as $center}

            {if $j == 1 }
            <td> {if $center.centerId > 0 }  {$center.centerName}   {else} لا يوجد     {/if}</td>
            <td> 
                <a class="btn blue btn-xs addressDetails   " data-centerId="{$center.centerId}" 
                   data-govId="{$governorate.governorateId}"  href="javascript:;"  >
                    {$center.patientsCount} <i class="fa fa-eye fleft"></i>
                </a> 
            </td>
            {/if}
            {capture assign=j}{$j+1}{/capture}
            {/foreach}
        </tr>
        {assign var=j value=1}
        {foreach $governorate.centers as $center}
        {if $j > 1 }
        <tr>

            <td> {if $center.centerId > 0 }  {$center.centerName}   {else} لا يوجد     {/if}</td>
            <td> 
                <a class="btn blue btn-xs addressDetails   " data-centerId="{$center.centerId}" 
                   data-govId="{$governorate.governorateId}"   href="javascript:;"  >
                    {$center.patientsCount} <i class="fa fa-eye fleft"></i>
                </a> 
            </td>

        </tr>
        {/if}
        {capture assign=j}{$j+1}{/capture}
        {/foreach}
        {capture assign=i}{$i+1}{/capture}
        {/foreach}
    </table>

</div>


