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


    <tbody>
        {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.raysw as $invest}

                            <div class="form-group " style=" width: 50%; float: left; ">
                                <label class="col-md-4 control-label bold" style=" font-size: 16px; margin-left: 4px;">{$invest->invname}:</label>
                                <label class="col-md-6 control-label" style=" font-size: 14px; ">{$invest->rayresult}</label>
                                {if $invest->rayimg}
                                <a class="btn blue" target="_blank"   title="تنزيل " href="{$hosturl}/../upload/rayimg/{$invest->rayimg}"> <i class="fa fa-download"></i>  </a>
                                {/if}
                            </div>
                            {/foreach}
                        </td>
                        <td class="col-md-1"><button type="button" class="btn green btn-block btn-xs printRayShow" data-for="wife"  data-date="{$inv.date}"  data-controller="antenalvisit">  Print  </button></td>
                        <td class="col-md-1">
                            <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="mainantenentalrays">
                                <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.raysh as $invest}

                            <div class="form-group " style=" width: 50%; float: left; ">
                                <label class="col-md-4 control-label bold" style=" font-size: 16px; margin-left: 4px;">{$invest->invname}:</label>
                                <label class="col-md-6 control-label" style=" font-size: 14px; ">{$invest->rayresult}</label>
                                {if $invest->rayimg}
                                <a class="btn blue" target="_blank"   title="تنزيل " href="{$hosturl}/../upload/rayimg/{$invest->rayimg}"> <i class="fa fa-download"></i>  </a>
                                {/if}
                            </div>
                            {/foreach}
                        </td>
                        <td class="col-md-1"><button type="button" class="btn green btn-block btn-xs printRayShow" data-for="husband"  data-date="{$inv.date}"  data-controller="antenalvisit">  Print  </button></td>
                        <td class="col-md-1">
                            <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="mainantenentalrays">
                                <i class="fa fa-close"></i>
                            </a>
                        </td>
                    </tr>
                    {/if}
                </table>
            </td>
        </tr>
        {/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">Rays </div></th>
        </tr>
    </thead>


    <tbody>
        {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.raysw as $invest}

                            <div class="form-group " style=" width: 50%; float: left; ">
                                <label class="col-md-4 control-label bold txtl" style=" font-size: 16px; margin-left: 4px;">{$invest->invname}:</label>
                                <div class="col-md-6">
                                    <input type="text" class="form-control updateElement" data-colName="rayresult" data-id="{$invest->id}"  data-tableName="mainantenentalrays" value="{$invest->rayresult}">

                                </div>
                                {if $invest->rayimg}
                                <a class="btn blue" target="_blank"   title="تنزيل " href="{$hosturl}/../upload/rayimg/{$invest->rayimg}"> <i class="fa fa-download"></i>  </a>
                                {/if}
                            </div>
                            {/foreach}
                        </td>
                        <td class="col-md-1"><button type="button" class="btn green btn-block btn-xs printRayShow" data-for="wife"  data-date="{$inv.date}"  data-controller="antenalvisit">  Print  </button></td>
                        <td class="col-md-1">
                            <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="mainantenentalrays">
                                <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.raysh as $invest}

                            <div class="form-group " style=" width: 50%; float: left; ">
                                <label class="col-md-4 control-label bold txtl" style=" font-size: 16px; margin-left: 4px;">{$invest->invname}:</label>
                                <div class="col-md-6">
                                    <input type="text" class="form-control updateElement" data-colName="rayresult" data-id="{$invest->id}"  data-tableName="mainantenentalrays" value="{$invest->rayresult}">

                                </div>
                                {if $invest->rayimg}
                                <a class="btn blue" target="_blank"   title="تنزيل " href="{$hosturl}/../upload/rayimg/{$invest->rayimg}"> <i class="fa fa-download"></i>  </a>
                                {/if}
                            </div>
                            {/foreach}
                        </td>
                        <td class="col-md-1"><button type="button" class="btn green btn-block btn-xs printRayShow" data-for="husband"  data-date="{$inv.date}"  data-controller="antenalvisit">  Print  </button></td>
                        <td class="col-md-1">
                            <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="mainantenentalrays">
                                <i class="fa fa-close"></i>
                            </a>
                        </td>
                    </tr>
                    {/if}
                </table>
            </td>
        </tr>
        {/foreach}
    </tbody>

</table>


{/if}



<!--{literal}
<script type="text/javascript" >
    $('#presTable').dataTable({"pageLength": 50,"order": [[0, "asc"]]});
</script>
{/literal}-->