<table class="table table-bordered table-striped table-hover"  id="resTable" >
    <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">EDD</th>  
            <th class="txtc"> W </th>
            <th class="txtc" colspan="4"> T1 </th>
            <th class="txtc" colspan="4"> T2 </th>
            <th class="txtc">Notes</th>  
            <th class="wds3 txtc"> </th>
            <th class="wds3 txtc"> </th>
            <th class="wds3 txtc"> V</th>
        </tr>
    </thead>
    <tbody>
        {assign var=i value=1}
        {foreach $allvisit as $row}
        {if $row.is_show == 1 }
        <tr>
            <td> {$i}</td>
            <td> {$row.patientNo}</td>
            <td> {$row.patientName} -  {$row.husbandName}</td>
            <td> {$row.address}</td>
            <td> {$row.phone}</td>

            <td> {$row.sheetedd}</td>
            <td> {$row.weeks}</td>

            <td> {if $row.t1  == 1  } {$row.t1UserName} {/if}</td>

            <td style="background-color: yellow;width: 2%;"> 
                <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: red;width: 2%;"> 
                <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: green;width: 2%;"> 
                <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> {if $row.t2  == 1  } {$row.t2UserName} {/if}</td>

            <td style="background-color: yellow;width: 2%;"> 
                <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: red;width: 2%;"> 
                <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 style="background-color: green;width: 2%;"> 
                <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>   <textarea class="form-control" rows="3"  data-table="op_4d_list" 
                             name="notes" data-id="{$row.id}"> {$row.notes}</textarea></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>
        {/if}
        {capture assign=i}{$i+1}{/capture}
        {/foreach}
    </tbody>
</table>



{literal}
<script type="text/javascript" >
    $('#resTable').dataTable();
</script>
{/literal}