
<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">
                            Wife
                        </td>
                        <td>
                            {$date["drugdos"]}
                        </td>

                        <td class="col-md-1">
                            <a href="#"  class="btn green btn-block btn-xs editPre" data-for="0"  data-date="{$date['date']}" data-controller="gyna"> Edit </a>
                        </td>
                        <td class="col-md-1">
                            <a href="#"  class="btn green btn-block btn-xs printPre" data-for="0" data-date="{$date['date']}" data-controller="gyna"> Print </a>
                        </td>
                        <td class="col-md-1">
                            <a href="#"  class="btn green-haze btn-block btn-xs sendPre" data-itr="{$i}" data-for="0" data-date="{$date['date']}" data-controller="gyna"> Send</a>
                            <img src="{$hosturl}/../upload/loading.gif" id="sendLoading0{$i}" style="display: none;">
                            <i class="fa fa-check green" id="sendDone0{$i}" style="display: none;color: green;font-size: large; "></i>
                            <i class="fa fa-exclamation-triangle red" id="sendError0{$i}" style="display: none;color: red;font-size: large; "></i>
                        </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="gynadrugs">
                                <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 editPre" data-for="1" data-date="{$date['date']}" data-controller="gyna"> Edit </a>
                        </td>
                        <td class="col-md-1">
                            <a href="#"  class="btn green btn-block btn-xs printPre" data-for="1" data-date="{$date['date']}" data-controller="gyna"> Print </a>
                        </td>
                        <td class="col-md-1">
                            <a href="#"  class="btn green-haze btn-block btn-xs sendPre" data-itr="{$i}" data-for="1" data-date="{$date['date']}" data-controller="gyna"> Send</a>
                            <img src="{$hosturl}/../upload/loading.gif" id="sendLoading1{$i}" style="display: none;">
                            <i class="fa fa-check green" id="sendDone1{$i}" style="display: none;color: green;font-size: large; "></i>
                            <i class="fa fa-exclamation-triangle red" id="sendError1{$i}" style="display: none;color: red;font-size: large; "></i>
                        </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="gynadrugs">
                                <i class="fa fa-close"></i>
                            </a>
                        </td>

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

</table>