<table class="table table-hover portlet light bg-inverse" id="repTable">
    <caption class="txtc"> Visits </caption>
    <thead>
        <tr>
            <th style="width: 10px !important;">#</th>
            <th>   Patient Name </th>
            <th>Patient Number</th>
            <th>Visit Date</th> 
            <th>Type</th>
            <th>   Total      </th>
            <th>   Debt </th>
            <th>   Notes </th>
        </tr>
    </thead>
    <tbody>
        {assign var="i" value="1"}
        {foreach $visits as $data}
        <tr class="odd " >
            <td>{$i}</td>
            <td>
                <a href="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$data.patientid}" target="_new">{$data.wifename}</a>
            </td>
            <td>{$data.statusno}</td>
            <td>   {$data.visitdate}  </td>  
            <td>{$data.type}</td>
            <td>  {$data.totaldetectionvalue} </td>
            <td> {$data.dept} </td>
            <td> {$data.vnotes} </td>
        </tr>
        {assign var="i" value={$i+1}}
        {/foreach}
    </tbody>
</table>


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