
<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 col-md-1"> <div align="center">For </div></th>
            <th class="bold"> <div align="center">{$title} </div></th>
        </tr>
    </thead>


    <tbody>
        {foreach $dates as $inv}
        {if $countWife[$inv["date"]] > 0 }
        <tr>
            {if $countHusband[$inv["date"]] > 0 }  <td rowspan="2"> {else} <td> {/if}
                {$inv["date"]}
            </td>
            <td>
                Patient
            </td>
            <td colspan="3">

                {foreach $inv.rayswG as $invest}
                <label style=" width: 32%; float: left; text-align: left; ">
                    <span>
                        <input type="checkbox" class="iiin" data-tableName="{$invest->tableName}" data-id="{$invest->id}"  
                               value="{$invest->origin->id}" name="internalCheck[]"  data-name="{$invest->invname}"
                               data-price="{$invest->origin->price}" data-contract="{$invest->origin->contract}"
                               data-discount="{$invest->origin->discount}">
                    </span> {$invest->invname}

                    {if $labVisit != 1  }
                    <span class="fright">
                        {if $invest->origin->contract > 0 }
                        ({$invest->origin->contract}) =>  ({$invest->origin->hold})  {else }  ( 0 )    {/if}
                    </span>
                    {/if}

                </label>
                {/foreach}
                {foreach $inv.rayswA as $invest}

                <label style=" width: 32%; float: left; text-align: left; ">
                    <span>
                        <input type="checkbox" class="iiin" data-tableName="{$invest->tableName}" data-id="{$invest->id}" 
                               value="{$invest->origin->id}" name="internalCheck[]"  data-name="{$invest->invname}"
                               data-price="{$invest->origin->price}" data-contract="{$invest->origin->contract}"
                               data-discount="{$invest->origin->discount}">
                    </span> {$invest->invname}
                    {if $labVisit != 1  }
                    <span class="fright">
                        {if $invest->origin->contract > 0 }
                        ({$invest->origin->contract}) =>  ({$invest->origin->hold})  {else }  ( 0 )    {/if}
                    </span>
                    {/if}
                </label>
                {/foreach}
                {foreach $inv.rayswN as $invest}

                <label style=" width: 32%; float: left;  text-align: left;">
                    <span>
                        <input type="checkbox" class="iiin" data-tableName="{$invest->tableName}" data-id="{$invest->id}" 
                               value="{$invest->origin->id}" name="internalCheck[]"  data-name="{$invest->invname}"
                               data-price="{$invest->origin->price}" data-contract="{$invest->origin->contract}"
                               data-discount="{$invest->origin->discount}">
                    </span> {$invest->invname}

                    {if $labVisit != 1  }
                    <span class="fright">
                        {if $invest->origin->contract > 0 }
                        ({$invest->origin->contract}) =>  ({$invest->origin->hold})  {else }  ( 0 )    {/if}
                    </span>
                    {/if}
                </label>
                {/foreach}
            </td>

        </tr>
        {/if}
        {if $countHusband[$inv["date"]] > 0 }
        <tr>
            {if $countWife[$inv["date"]] > 0 }{else}  <td> {$inv["date"]}</td>{/if}
            <td>
                Husband
            </td>

            <td colspan="3">

                {foreach $inv.rayshG as $invest}

                <label style=" width: 32%; float: left; text-align: left; ">
                    <span>
                        <input type="checkbox" class="iiin" data-tableName="{$invest->tableName}" data-id="{$invest->id}"
                               value="{$invest->origin->id}" name="internalCheck[]"  data-name="{$invest->invname}"
                               data-price="{$invest->origin->price}" data-contract="{$invest->origin->contract}"
                               data-discount="{$invest->origin->discount}">
                    </span> {$invest->invname}

                    {if $labVisit != 1  }
                    <span class="fright">
                        {if $invest->origin->contract > 0 }
                        ({$invest->origin->contract}) =>  ({$invest->origin->hold})  {else }  ( 0 )    {/if}
                    </span>
                    {/if}
                </label>
                {/foreach}
                {foreach $inv.rayshA as $invest}

                <label style=" width: 32%; float: left;  text-align: left;">
                    <span>
                        <input type="checkbox" class="iiin" data-tableName="{$invest->tableName}" data-id="{$invest->id}"
                               value="{$invest->origin->id}" name="internalCheck[]"  data-name="{$invest->invname}"
                               data-price="{$invest->origin->price}" data-contract="{$invest->origin->contract}"
                               data-discount="{$invest->origin->discount}">
                    </span> {$invest->invname}

                    {if $labVisit != 1  }
                    <span class="fright">
                        {if $invest->origin->contract > 0 }
                        ({$invest->origin->contract}) =>  ({$invest->origin->hold})  {else }  ( 0 )    {/if}
                    </span>
                    {/if}
                </label>
                {/foreach}
                {foreach $inv.rayshN as $invest}

                <label style=" width: 32%; float: left; text-align: left;">
                    <span>
                        <input type="checkbox" class="iiin" data-tableName="{$invest->tableName}" data-id="{$invest->id}" 
                               value="{$invest->origin->id}" name="internalCheck[]"  data-name="{$invest->invname}"
                               data-price="{$invest->origin->price}" data-contract="{$invest->origin->contract}"
                               data-discount="{$invest->origin->discount}">
                    </span> {$invest->invname}

                    {if $labVisit != 1  }
                    <span class="fright">
                        {if $invest->origin->contract > 0 }
                        ({$invest->origin->contract}) =>  ({$invest->origin->hold})  {else }  ( 0 )    {/if}
                    </span>
                    {/if}
                </label>
                {/foreach}
            </td>

        </tr>
        {/if}

        {/foreach}
    </tbody>


</table>

<input type="hidden"  name="title"  id="title"  value="{$title}">