{foreach $allvisit as  $day => $dayVisits}
<table class="table table-bordered table-striped table-hover"  >
    <caption class="txtc bold" style="background-color: #666;color: white;"> 
        {$day} 
    </caption>
    <thead>
        <tr>
            <th class="wds3 txtc"># </th>
            <th class="wds5 txtc">Ptn No </th>
            <th class="txtc">Ptn Name</th>
            <th class="txtc">Address</th>  
            <th class="txtc">Tel</th>  
            <th class="txtc">4D</th>  
            <th class="txtc">User </th>  
            <th class="txtc">EDD</th>  
            <th class="txtc"> W </th>
            <th class="txtc wds6" colspan="3"> T1 </th>
            <th class="txtc wds6" colspan="3"> T2 </th>
            <th class="txtc wds2"> D </th>
            <th class="txtc wds2"> Conf. </th>
            <th class="txtc">Notes</th>  
            <th class="wds3 txtc"> </th>
            <th class="wds3 txtc"> </th>
            <th class="wds3 txtc"> </th>
        </tr>
    </thead>
    <tbody>
        {assign var=i value=1}
        {foreach $dayVisits as $row}
        <tr>
            <td> {$i}</td>
            <td> {$row.patientNo}</td>
            <td> {$row.patientName} -  {$row.husbandName}</td>
            <td> {$row.address}</td>
            <td> {$row.phone}</td>
            <td> {$row.four_d}</td>
            <td> {$row.userName}</td>
            <td> {$row.sheetedd}</td>
            <td> {$row.weeks}</td>
            <td style="background-color: yellow;"> 
                <input  class="form-control updateElementCheck"  type="checkbox"  value="1" 
                        data-id="{$row.id}" data-colName="t1" data-tableName="op_4d_list" 
                        {if $row.t1  == 1   } checked="checked" {/if}>
            </td>
            <td style="background-color: green;"> 
                <input  class="form-control updateElementCheck"  type="checkbox"  value="1" 
                        data-id="{$row.id}" data-colName="t11" data-tableName="op_4d_list" 
                        {if $row.t11  == 1   } checked="checked" {/if}>
            </td>
            <td style="background-color: red;"> 
                <input  class="form-control updateElementCheck"  type="checkbox"  value="1" 
                        data-id="{$row.id}" data-colName="t12" data-tableName="op_4d_list" 
                        {if $row.t12  == 1   } checked="checked" {/if}>
            </td>
            <td style="background-color: yellow;"> 
                <input  class="form-control updateElementCheck"  type="checkbox"  value="1" 
                        data-id="{$row.id}" data-colName="t2" data-tableName="op_4d_list" 
                        {if $row.t2  == 1   } checked="checked" {/if}>
            </td> 
            <td style="background-color: green;"> 

                <input  class="form-control updateElementCheck"  type="checkbox"  value="1" 
                        data-id="{$row.id}" data-colName="t21" data-tableName="op_4d_list" 
                        {if $row.t21  == 1   } checked="checked" {/if}>
            </td>
            <td style="background-color: red;"> 
                <input  class="form-control updateElementCheck"  type="checkbox"  value="1" 
                        data-id="{$row.id}" data-colName="t22" data-tableName="op_4d_list" 
                        {if $row.t22  == 1   } checked="checked" {/if}>
            </td>
            <td> 
                <input  class="form-control updateElementCheck"  type="checkbox"  value="1" 
                        data-id="{$row.id}" data-colName="done" data-tableName="op_4d_list" 
                        {if $row.done  == 1   } checked="checked" {/if}>
            </td>
            <td> 
                <input  class="form-control updateElementCheck"  type="checkbox"  value="1" 
                        data-id="{$row.id}" data-colName="confirm" data-tableName="op_4d_list" 
                        {if $row.confirm  == 1   } checked="checked" {/if} style="width: 50%;margin-left: 25%;">
            </td>
            <td> {$row.notes}</td>

            <td><a class=" bg-green-haze dltbtn  sendToVisits" data-visitId="{$row.id}" id="sendToVisits{$row.id}">
                    <i class="fa fa-envelope"></i>
                </a> </td>

            <td><a class=" bg-green dltbtn  edit4DVisit" data-visitId="{$row.id}" id="edit4DVisit{$row.id}">
                    <i class="fa fa-pencil"></i>
                </a>
            </td>
            <td>
                <a class="deleteOpVisitAjax bg-red dltbtn"  data-today="0"  id="deleteOpvisit{$row.id}" data-id="{$row.id}" 
                   data-link="op_4d_list" data-fn="del">
                    <i class="fa fa-close"></i>
                </a>
            </td>
        </tr>
        {capture assign=i}{$i+1}{/capture}
        {/foreach}
    </tbody>
</table>
{/foreach}
