
{if $archive == 1 }

<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">Investigations </div></th>
        </tr>
    </thead>


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


                            {foreach $inv.investsw as $invest}

                            <div class="form-group " style=" width: 32%; float: left; ">
                                <label class="col-md-8 control-label bold" style=" font-size: 16px; margin-left: 4px;">{$invest->invname}:</label>

                                {if $invest->invResId > 0 }  
                                <a class="btn primary  btn-xs  invResShow" data-id="{$invest->invResId}"  
                                   data-itr="{$i}"    style=" float: left;" href="#" >
                                    <i class="fa fa-book"></i>
                                </a>
                                {else}
                                <label class="col-md-3 control-label" style=" font-size: 14px; ">{$invest->investresult}</label>
                                {/if}
                            </div>
                            {/foreach}
                        </td>
                        <td class="wds7">
                            <button type="button" class="btn green btn-block btn-xs printInv" data-for="wife"  data-date="{$inv.date}"  data-controller="antenalvisit">  Print  </button></td>
                        <td class="wds7">
                            <a class="btn grey-cascade btn-xs delNew" data-id="1" data-for="0" data-date="{$inv['date']}" style=" float: left;" href="#" data-link="gyna" data-fn="del" data-tableName="mainantenentalinvest">
                                <i class="fa fa-close"></i>
                            </a>
                        </td>
                    </tr>
                    {/if}
                    {if $countHusband[$inv["date"]] > 0 }
                    <tr>
                        <td class="bold col-md-1">
                            Husband
                        </td>

                        <td>
                            {foreach $inv.investsh as $invest}

                            <div class="form-group " style=" width: 32%; float: left; ">
                                <label class="col-md-8 control-label bold" style=" font-size: 16px; margin-left: 4px;">{$invest->invname}:</label>

                                {if $invest->invResId > 0 }  
                                <a class="btn primary  btn-xs  invResShow" data-id="{$invest->invResId}"  
                                   data-itr="{$i}"    style=" float: left;" href="#" >
                                    <i class="fa fa-book"></i>
                                </a>
                                {else}
                                <label class="col-md-3 control-label" style=" font-size: 14px; ">{$invest->investresult}</label>
                                {/if}
                            </div>
                            {/foreach}
                        </td>
                        <td class="wds7">
                            <button type="button" class="btn green btn-block btn-xs printInv" data-for="husband"  
                                    data-date="{$inv.date}"  data-controller="antenalvisit">  Print  </button>
                        </td>
                        <td class="wds7">
                            <a class="btn grey-cascade btn-xs delNew" data-id="1" data-for="1" data-date="{$inv['date']}" style=" float: left;" href="#" data-link="gyna" data-fn="del" data-tableName="mainantenentalinvest">
                                <i class="fa fa-close"></i>
                            </a>
                        </td>
                    </tr>
                    {/if}
                </table>
            </td>
        </tr>

        <tr>
            <td id="invResShowTd_{$i}" data-show="0"  data-current="0" colspan="4" class="invResShowTd">

            </td>
        </tr>


        {assign var="i" value={$i+1}}
        {/foreach}
    </tbody>

</table>


{else}

<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">Investigations </div></th>
        </tr>
    </thead>


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

                            {foreach $inv.investsw as $invest}

                            <div class="form-group " style=" width: 32%; float: left; ">
                                <label class="col-md-8 control-label bold txtl" style=" font-size: 16px; margin-left: 4px;">{$invest->invname}:</label>
                                <div class="col-md-3">
                                    {if $invest->invResId > 0 }  
                                    <a class="btn primary  btn-xs  invResShow" data-id="{$invest->invResId}"  
                                       data-itr="{$i}"    style=" float: left;" href="#" >
                                        <i class="fa fa-book"></i>
                                    </a>
                                    {else}
                                    <input type="text" class="form-control updateElement" data-colName="investresult" 
                                           data-id="{$invest->id}"  data-tableName="mainantenentalinvest" 
                                           value="{$invest->investresult}">
                                    {/if}

                                </div>
                            </div>
                            {/foreach}
                        </td>
                        <td class="wds7">
                            <button type="button" class="btn green btn-block btn-xs printInv" data-for="wife"  
                                    data-date="{$inv.date}"  data-controller="antenalvisit">  Print  </button>
                        </td>
                        <td class="wds7">
                            <a class="btn grey-cascade btn-xs delNew" data-id="1" data-for="0" data-date="{$inv['date']}" style=" float: left;" href="#" data-link="gyna" data-fn="del" data-tableName="mainantenentalinvest">
                                <i class="fa fa-close"></i>
                            </a>
                        </td>
                    </tr>
                    {/if}
                    {if $countHusband[$inv["date"]] > 0 }
                    <tr>
                        <td class="bold col-md-1">
                            Husband
                        </td>

                        <td>

                            {foreach $inv.investsh as $invest}

                            <div class="form-group " style=" width: 32%; float: left; ">
                                <label class="col-md-8 control-label bold txtl" style=" font-size: 16px; margin-left: 4px;">{$invest->invname}:</label>
                                <div class="col-md-3">
                                    {if $invest->invResId > 0 }  
                                    <a class="btn primary  btn-xs  invResShow" data-id="{$invest->invResId}"  
                                       data-itr="{$i}"    style=" float: left;" href="#" >
                                        <i class="fa fa-book"></i>
                                    </a>
                                    {else}
                                    <input type="text" class="form-control updateElement" data-colName="investresult" 
                                           data-id="{$invest->id}"  data-tableName="mainantenentalinvest" 
                                           value="{$invest->investresult}">
                                    {/if}

                                </div>
                            </div>
                            {/foreach}
                        </td>
                        <td class="wds7">
                            <button type="button" class="btn green btn-block btn-xs printInv" data-for="husband"  
                                    data-date="{$inv.date}"  data-controller="antenalvisit">  Print  </button>
                        </td>
                        <td class="wds7">
                            <a class="btn grey-cascade btn-xs delNew" data-id="1" data-for="1" data-date="{$inv['date']}" style=" float: left;" href="#" data-link="gyna" data-fn="del" data-tableName="mainantenentalinvest">
                                <i class="fa fa-close"></i>
                            </a>
                        </td>
                    </tr>
                    {/if}
                </table>
            </td>
        </tr>

        <tr>
            <td id="invResShowTd_{$i}" data-show="0"  data-current="0" colspan="4" class="invResShowTd">

            </td>
        </tr>


        {assign var="i" value={$i+1}}
        {/foreach}
    </tbody>

</table>


{/if}


