<table class="table table-hover portlet light bg-inverse" id="repTable">
     <thead>
                                        <tr style="color:#5ce4f2;">
                                            <th colspan="5"></th>
                                            <th colspan="2"></th>
                                            <th colspan="2" >Infertility</th>
                                            <th colspan="27" >ICSI cycle</th>
                                        </tr>
                                        <tr style="color:#bd0606;">
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">Name</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">Age</th>
                                            <th colspan="1"style="border-bottom: 0.1px solid #fff !important;">BMI</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">AMH</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">evaluation</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">Name</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">evaluation</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">Type</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">Durat</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">Trial</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">Protocol</th>
                                            <th colspan="3">COH</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">TOO</th>
                                            <th colspan="3">OPU</th>
                                            <th colspan="2">Semen</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">F/E D2</th>
                                            <th colspan="2">Thawing</th>
                                            <th colspan="1">SS</th>
                                            <th colspan="5">ET</th>
                                            <th colspan="3">Fr</th>
                                            <th colspan="1">Re</th>
                                            <th colspan="3">Outcome</th>
                                        </tr>
                                         <tr style="color:red;">
                                            <th colspan="1" ></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1">HMG</th>
                                            <th colspan="1">Durat</th>
                                            <th colspan="1">E</th>
                                            <th colspan="1"></th>
                                            <th colspan="1">date</th>
                                            <th colspan="1">N</th>
                                            <th colspan="1">MII</th>
                                            <th colspan="1">Fresh/frozen</th>
                                            <th colspan="1">Sample/TESE</th>
                                            <th colspan="1"></th>
                                            <th colspan="1">Date</th>
                                            <th colspan="1">ST.N</th>
                                            <th colspan="1">result</th>
                                            <th colspan="1">Date</th>
                                            <th colspan="1">D</th>
                                            <th colspan="1">N</th>
                                            <th colspan="1">G</th>
                                            <th colspan="1">cancel</th>
                                            <th colspan="1">D</th>
                                            <th colspan="1">ST</th>
                                            <th colspan="1">EN</th>
                                            <th colspan="1">EN</th>
                                            <th colspan="1">HCG</th>
                                            <th colspan="1">TVS</th>
                                            <th colspan="1">Deliv</th>
                                           
                                        </tr>
                                    </thead>
                                    <tbody>
                                        
                                        {assign var="i" value="1"}
                                        {foreach $allData as $data}                                        <tr>
                                            <td><a href="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$data->patientid}" target="_new">{$data->info->wifename}</a></td>
                                            <td>{$data->info->wifeage}</td>
                                            <td>{$data->examinations->bmi}</td>
                                            <td>{$data->anamh}</td>
                                            <td>{$data->anevaluation}</td>
                                            <td>{$data->info->husdandname}</td>
                                            <td>{$data->anevaluations}</td>
                                            <td>{$data->antypet->title}</td>
                                            <td>{$data->anduration}</td>
                                            <td>{$data->annn}</td>
                                            <td>{$data->anprotocolt->title}</td>
                                            <td> {$data->ovsthmgs->ovsthmg} </td>
                                            {if $data->frozenor == "fresh"}
                                             <td>{$data->countovst}</td>
                                             <td>{$data->ovste->eovst}</td>
                                            {else}
                                             <td>{$data->counteprep}</td>
                                             <td>{$data->eprepdes->eprepe}</td>
                                             {/if}
                                           
                                            
                                            <td>{$data->toodrug}</td>
                                            <td>{$data->opudate}</td>
                                            <td>{$data->opun}</td>
                                            <td>{$data->opumll}</td>
                                            <td>{$data->sseement->title}</td>
                                            <td>{$data->icsisement->title}</td>
                                            <td>{$data->fefn}</td>
                                            <td>
                                                 {$data->eprepasc->thawingdate} 
                                             </td>
                                            <td>  
                                                 {$data->eprepasc->thawingstn}
                                             </td>
                                              {if $data->frozenor == "fresh"}
                                            <td>{$data->sssresult}</td>
                                            <td>{$data->ettdate}</td>
                                            <td>{$data->ssscd}</td>
                                            <td>{$data->ettn}</td>
                                            <td>{$data->ettg}</td>
                                            <td>{$data->ettcancel}</td>
                                            <td>{$data->frrcd}</td>
                                            <td>{$data->frrst}</td>
                                            <td>{$data->frren}</td>
                                            <td>{$data->refren}</td>
                                            <td>{$data->ooutcomehsgn}</td>
                                            <td>{$data->ooutcometvsn}</td>
                                            <td>{$data->ooutcomedeln}</td>
                                            {else}
                                            <td>{$data->ssresult}</td>
                                            <td>{$data->ettdate}</td>
                                            <td>{$data->ssscd}</td>
                                            <td>{$data->ettn}</td>
                                            <td>{$data->etg}</td>
                                            <td>{$data->etcancel}</td>
                                            <td>{$data->frrcd}</td>
                                            <td>{$data->frrst}</td>
                                            <td>{$data->frren}</td>
                                            <td>{$data->refren}</td>
                                            <td>{$data->outcomehsgn}</td>
                                            <td>{$data->outcometvsn}</td>
                                            <td>{$data->outcomedeln}</td>
                                            {/if}
                                         </tr>
                                        {assign var="i" value={$i+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">EPC Date</h4></center>
                <table class="table table-hover portlet light bg-inverse" >
                     <thead>
                                        <tr style="color:#5ce4f2;">
                                            <th colspan="5"></th>
                                            <th colspan="2"></th>
                                            <th colspan="2" >Infertility</th>
                                            <th colspan="27" >ICSI cycle</th>
                                        </tr>
                                        <tr style="color:#bd0606;">
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">Name</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">Age</th>
                                            <th colspan="1"style="border-bottom: 0.1px solid #fff !important;">BMI</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">AMH</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">evaluation</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">Name</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">evaluation</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">Type</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">Durat</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">Trial</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">Protocol</th>
                                            <th colspan="3">COH</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">TOO</th>
                                            <th colspan="3">OPU</th>
                                            <th colspan="2">Semen</th>
                                            <th colspan="1" style="border-bottom: 0.1px solid #fff !important;">F/E D2</th>
                                            <th colspan="2">Thawing</th>
                                            <th colspan="1">SS</th>
                                            <th colspan="5">ET</th>
                                            <th colspan="3">Fr</th>
                                            <th colspan="1">Re</th>
                                            <th colspan="3">Outcome</th>
                                        </tr>
                                         <tr style="color:red;">
                                            <th colspan="1" ></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1"></th>
                                            <th colspan="1">HMG</th>
                                            <th colspan="1">Durat</th>
                                            <th colspan="1">E</th>
                                            <th colspan="1"></th>
                                            <th colspan="1">date</th>
                                            <th colspan="1">N</th>
                                            <th colspan="1">MII</th>
                                            <th colspan="1">Fresh/frozen</th>
                                            <th colspan="1">Sample/TESE</th>
                                            <th colspan="1"></th>
                                            <th colspan="1">Date</th>
                                            <th colspan="1">ST.N</th>
                                            <th colspan="1">result</th>
                                            <th colspan="1">Date</th>
                                            <th colspan="1">D</th>
                                            <th colspan="1">N</th>
                                            <th colspan="1">G</th>
                                            <th colspan="1">cancel</th>
                                            <th colspan="1">D</th>
                                            <th colspan="1">ST</th>
                                            <th colspan="1">EN</th>
                                            <th colspan="1">EN</th>
                                            <th colspan="1">HCG</th>
                                            <th colspan="1">TVS</th>
                                            <th colspan="1">Deliv</th>
                                           
                                        </tr>
                                    </thead>
                                    <tbody>
                                        
                                        {assign var="i" value="1"}
                                        {foreach $allData as $data}                                        <tr>
                                            <td><a href="{$hosturl}/controllers/patienthistory.php?ac=show&patientid={$data->patientid}" target="_new">{$data->info->wifename}</a></td>
                                            <td>{$data->info->wifeage}</td>
                                            <td>{$data->examinations->bmi}</td>
                                            <td>{$data->anamh}</td>
                                            <td>{$data->anevaluation}</td>
                                            <td>{$data->info->husdandname}</td>
                                            <td>{$data->anevaluations}</td>
                                            <td>{$data->antypet->title}</td>
                                            <td>{$data->anduration}</td>
                                            <td>{$data->annn}</td>
                                            <td>{$data->anprotocolt->title}</td>
                                            <td> {$data->ovsthmgs->ovsthmg} </td>
                                            {if $data->frozenor == "fresh"}
                                             <td>{$data->countovst}</td>
                                             <td>{$data->ovste->eovst}</td>
                                            {else}
                                             <td>{$data->counteprep}</td>
                                             <td>{$data->eprepdes->eprepe}</td>
                                             {/if}
                                           
                                            
                                            <td>{$data->toodrug}</td>
                                            <td>{$data->opudate}</td>
                                            <td>{$data->opun}</td>
                                            <td>{$data->opumll}</td>
                                            <td>{$data->sseement->title}</td>
                                            <td>{$data->icsisement->title}</td>
                                            <td>{$data->fefn}</td>
                                            <td>
                                                 {$data->eprepasc->thawingdate} 
                                             </td>
                                            <td>  
                                                 {$data->eprepasc->thawingstn}
                                             </td>
                                               {if $data->frozenor == "fresh"}
                                            <td>{$data->sssresult}</td>
                                            <td>{$data->ettdate}</td>
                                            <td>{$data->ssscd}</td>
                                            <td>{$data->ettn}</td>
                                            <td>{$data->ettg}</td>
                                            <td>{$data->ettcancel}</td>
                                            <td>{$data->frrcd}</td>
                                            <td>{$data->frrst}</td>
                                            <td>{$data->frren}</td>
                                            <td>{$data->refren}</td>
                                            <td>{$data->ooutcomehsgn}</td>
                                            <td>{$data->ooutcometvsn}</td>
                                            <td>{$data->ooutcomedeln}</td>
                                            {else}
                                            <td>{$data->ssresult}</td>
                                            <td>{$data->ettdate}</td>
                                            <td>{$data->ssscd}</td>
                                            <td>{$data->ettn}</td>
                                            <td>{$data->etg}</td>
                                            <td>{$data->etcancel}</td>
                                            <td>{$data->frrcd}</td>
                                            <td>{$data->frrst}</td>
                                            <td>{$data->frren}</td>
                                            <td>{$data->refren}</td>
                                            <td>{$data->outcomehsgn}</td>
                                            <td>{$data->outcometvsn}</td>
                                            <td>{$data->outcomedeln}</td>
                                            {/if}
                                         </tr>
                                        {assign var="i" value={$i+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}
