
<table class="table table-striped table-hover table-bordered">
    <thead>
        <tr>
            <th class="bold col-md-1"> <div align="center">Date </div></th>
            <th class="bold"> <div align="center">Drugs </div></th>
        </tr>
    </thead>


    <tbody>
        {assign var=i value=1}
        {foreach  $dates as $date}
        <tr>
            <td>{$date["date"]}</td>
            <td>
                <table class="table table-striped table-hover table-bordered">
                    {if $countWife[$date["date"]] > 0 }
                    <tr>
                        <td class="bold col-md-1">
                            Patient
                        </td>
                        <td>
                            {$date["drugdos"]}
                        </td>

                        <td class="col-md-1">
                            <a href="#"  class="btn green btn-block btn-xs editChronicPre" data-for="0"  data-date="{$date['date']}" data-controller="approvals"> Edit </a>
                        </td>
                        
                               <td class="col-md-1">
                            <a href="#"  class="btn green btn-block btn-xs duplicateChronicPre" data-for="0"  data-date="{$date['date']}" data-controller="approvals"> New </a>
                        </td>
                        <td class="col-md-1">
                            <a href="#"  class="btn green btn-block btn-xs printChronicPre" data-for="0" data-date="{$date['date']}" data-controller="approvals"> Print </a>
                        </td>
                        <td class="col-md-1">
                            <a class="btn grey-cascade btn-xs delNew" data-id="1" data-for="0" data-date="{$date['date']}" style=" float: left;" href="#" 
                               data-link="gyna" data-fn="del" data-tableName="gynachronicdrugs">
                                <i class="fa fa-close"></i>
                            </a>
                        </td>

                    </tr>
                    {/if}
                    {if $countHusband[$date["date"]] > 0 }
                    <tr>
                        <td class="bold col-md-1">
                            Husband
                        </td>
                        <td>
                            {$date["drugtype"]}
                        </td>

                        <td class="col-md-1"> 
                            <a href="#"  class="btn green btn-block btn-xs editChronicPre" data-for="1" data-date="{$date['date']}" data-controller="approvals"> Edit </a>
                        </td>
                        
                               <td class="col-md-1">
                            <a href="#"  class="btn green btn-block btn-xs duplicateChronicPre" data-for="1"  data-date="{$date['date']}" data-controller="approvals"> New </a>
                        </td>
                        
                        
                        <td class="col-md-1">
                            <a href="#"  class="btn green btn-block btn-xs printChronicPre" data-for="1" data-date="{$date['date']}" data-controller="approvals"> Print </a>
                        </td>
                        <td class="col-md-1">
                            <a class="btn grey-cascade btn-xs delNew" data-id="1" data-for="1" data-date="{$date['date']}" style=" float: left;" href="#" 
                               data-link="gyna" data-fn="del" data-tableName="gynachronicdrugs">
                                <i class="fa fa-close"></i>
                            </a>
                        </td>

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

</table>