<table class="table table-hover portlet light bg-inverse" id="repTable">
    <thead>
        <tr>
             <th  width="5%">No.</th>
                                            <th width="15%">
                                                Patient Name
                                            </th>
                                            <th width="15%">
                                                Operation  
                                            </th>
                                            <th width="5%">place</th>
                                            <th width="15%">date</th>
                                            <th width="15%">Histopath</th>
                                            <th width="10%">Cost</th>
                                            <th width="10%">note</th>
        </tr>
    </thead>
    <tbody>
                                        {assign var="i" value="1"}
                                        {foreach $allData as $data}
                                        <tr class="odd gradeX">
                                            <td >{$i}</td>
                                            <td>
                                                <a href="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$data->patientid}" target="_new">{$data->info->wifename}</a>
                                            </td>
                                            <td>
                                                {foreach $data->operationc as $data2}
                                                 {$data2->title} / 
                                                  {/foreach}
                                            </td>
                                            <td>
                                                {$data->placec->title}
                                            </td>
                                            <td>
                                                {$data->date}
                                            </td>
                                            <td>
                                                {foreach $data->histopathc as $data3}
                                                 {$data3->title} / 
                                                  {/foreach}
                                            </td>
                                            <td>
                                            <input type="text" name="cost" value="{$data->cost}"  data-id="{$data->id}"  data-table="operations" class="form-control digitsOnly" />
                                            </td>
                                            <td>
                                                {$data->note}
                                            </td>
                                        </tr>
                                        {assign var="i" value={$i+1}}
                                        {/foreach}
                                        {assign var="i2" value=$i}
                                        {foreach $allData2 as $data}
                                        <tr class="odd gradeX">
                                            <td >{$i2}</td>
                                            <td>
                                                <a href="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$data->patientid}" target="_new">{$data->info->wifename}</a>
                                            </td>
                                            <td>
                                                hysteroscopy
                                            </td>
                                            <td>
                                                {$data->copyplace->title}
                                            </td>
                                            <td>
                                                {$data->date}
                                            </td>
                                            <td>
                                                
                                            </td>
                                            
                                            <td width="10%"><input type="text" name="coast" value="{$data->coast}"  data-id="{$data->id}"  data-table="hysteroscopy" class="form-control digitsOnly" />
                                            </td> 
                                            <td>
                                                {$data->hysintervention}
                                            </td>
                                        </tr>
                                        {assign var="i2" value={$i2+1}}
                                        {/foreach}
                                        {assign var="i3" value=$i2}
                                        {foreach $allData3 as $data}
                                        <tr class="odd gradeX">
                                            <td >{$i3}</td>
                                            <td>
                                                <a href="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$data->patientid}" target="_new">{$data->info->wifename}</a>
                                            </td>
                                            <td>
                                                laparoscopy
                                            </td>
                                            <td>
                                                {$data->laparplace->title}
                                            </td>
                                            <td>
                                                {$data->date}
                                            </td>
                                            <td>
                                                
                                            </td>
                                            
                                            <td width="10%"><input type="text" name="coast" value="{$data->coast}"  data-id="{$data->id}"  data-table="laparoscopy" class="form-control digitsOnly" />
                                            </td> 
                                            <td>
                                                {$data->lapintervention}
                                            </td>
                                        </tr>
                                        {assign var="i3" value={$i3+1}}
                                        {/foreach}
                                    </tbody>
</table>

<div id="long" class="modal fade modal-scroll" tabindex="-1" data-replace="true">
    <div class="modal-dialog wds75">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close hidden-print" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title"></h4>
            </div>
            <div class="modal-body printtable" id="printd">
                <center><h4 class="modal-title">Operations Date</h4></center>
                <table class="table table-hover portlet light bg-inverse" >
                    <thead>
                        <tr>
                             <th  width="5%">No.</th>
                                            <th width="15%">
                                                Patient Name
                                            </th>
                                            <th width="15%">
                                                Operation  
                                            </th>
                                            <th width="5%">place</th>
                                            <th width="15%">date</th>
                                            <th width="15%">Histopath</th>
                                            <th width="10%">Cost</th>
                                            <th width="10%">note</th>
                        </tr>
                    </thead>
                    <tbody>
                                        {assign var="i" value="1"}
                                        {foreach $allData as $data}
                                        <tr class="odd gradeX">
                                            <td >{$i}</td>
                                            <td>
                                                <a href="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$data->patientid}" target="_new">{$data->info->wifename}</a>
                                            </td>
                                            <td>
                                                {foreach $data->operationc as $data2}
                                                 {$data2->title} / 
                                                  {/foreach}
                                            </td>
                                            <td>
                                                {$data->placec->title}
                                            </td>
                                            <td>
                                                {$data->date}
                                            </td>
                                            <td>
                                                {foreach $data->histopathc as $data3}
                                                 {$data3->title} / 
                                                  {/foreach}
                                            </td>
                                            
                                            <td width="10%"><input type="text" name="cost" value="{$data->cost}"  data-id="{$data->id}"  data-table="operations" class="form-control digitsOnly" />
                                            </td> 
                                            <td>
                                                {$data->note}
                                            </td>
                                        </tr>
                                        {assign var="i" value={$i+1}}
                                        {/foreach}
                                        {assign var="i2" value=$i}
                                        {foreach $allData2 as $data}
                                        <tr class="odd gradeX">
                                            <td >{$i2}</td>
                                            <td>
                                                <a href="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$data->patientid}" target="_new">{$data->info->wifename}</a>
                                            </td>
                                            <td>
                                                hysteroscopy
                                            </td>
                                            <td>
                                                {$data->copyplace->title}
                                            </td>
                                            <td>
                                                {$data->date}
                                            </td>
                                            <td>
                                                
                                            </td>
                                            
                                            <td width="10%"><input type="text" name="coast" value="{$data->coast}"  data-id="{$data->id}"  data-table="hysteroscopy" class="form-control digitsOnly" />
                                            </td> 
                                            <td>
                                                {$data->hysintervention}
                                            </td>
                                        </tr>
                                        {assign var="i2" value={$i2+1}}
                                        {/foreach}
                                        {assign var="i3" value=$i2}
                                        {foreach $allData3 as $data}
                                        <tr class="odd gradeX">
                                            <td >{$i3}</td>
                                            <td>
                                                <a href="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$data->patientid}" target="_new">{$data->info->wifename}</a>
                                            </td>
                                            <td>
                                                laparoscopy
                                            </td>
                                            <td>
                                                {$data->laparplace->title}
                                            </td>
                                            <td>
                                                {$data->date}
                                            </td>
                                            <td>
                                                
                                            </td>
                                            
                                            <td width="10%"><input type="text" name="coast" value="{$data->coast}"  data-id="{$data->id}"  data-table="laparoscopy" class="form-control digitsOnly" />
                                            </td> 
                                            <td>
                                                {$data->lapintervention}
                                            </td>
                                        </tr>
                                        {assign var="i3" value={$i3+1}}
                                        {/foreach}
                                    </tbody>
                </table>
            </div>
            <div class="modal-footer">
                <button type="button" data-dismiss="modal" class="btn hidden-print">Close</button>
                <button type="button" id="print1" class="btn red hidden-print">print</button>
            </div>
        </div>
    </div>
</div>


{literal}
<script type="text/javascript" >
    $('#repTable').dataTable({
        // Internationalisation. For more info refer to http://datatables.net/manual/i18n

        // Uncomment below line("dom" parameter) to fix the dropdown overflow issue in the datatable cells. The default datatable layout
        // setup uses scrollable div(table-scrollable) with overflow:auto to enable vertical scroll(see: assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js).
        // So when dropdowns used the scrollable div should be removed.
        //"dom": "<'row'<'col-md-6 col-sm-12'l><'col-md-6 col-sm-12'f>r>t<'row'<'col-md-5 col-sm-12'i><'col-md-7 col-sm-12'p>>",

        //"bStateSave": true, // save datatable state(pagination, sort, etc) in cookie.

        "lengthMenu": [
            [15, 20, -1],
            [15, 20, "All"] // change per page values here
        ],
        // set the initial value
        "pageLength": 15,
        "language": {
            "lengthMenu": " _MENU_",
            "aria": {
                "sortAscending": ": Used to order Ascending",
                "sortDescending": ": Used to order Descending"
            },
            "emptyTable": "NO data",
            "info": "Show _START_ From _END_ To _TOTAL_ item",
            "infoFiltered": "(Filter is _MAX_ from total)",
            "lengthMenu": "_MENU_",
            "search": "",
            "zeroRecords": "No search data"
        },
        "columnDefs": [{// set default column settings
            'orderable': true,
            'targets': [0]
        }],
        "order": [
            [4, "asc"]
        ] // set first column as a default sort by asc
    });
</script>
{/literal}
