EVOLUTION-NINJA
Edit File: user_v_cse_double_v.php
<?php echo view('includes/user-reports-header'); ?> <div class="col-sm-9"> <?php if($total_cse>0){ ?> <button type="submit" id="save-pdf" class="ml-5">Save as PDF</button> <?php }?> <div id="reports-pdf" class="pl-5"> <div class="row"> <div class="col-sm-12 reports-right"> <h3 class="mt-2 mb-3 pt-2 txt-center"><u>CNB Reports</u></h3> <h3 class="mt-2 pt-2 ">CSE - Combined Spinal Epidural </h3> <div class="row"> <div class=" col-sm-6 table-responsive" id="demo-table"> <?php if ($total_cse == 0) { print_r("<h4>" . 'No Data Found' . "</h4>"); } else { ?> <h4>Total cases = <?php echo $total_cse; ?> </h4> <table class="table table-bordered" style="height: 200px; width: 100%" id="mytable"> <thead> <tr> <th>Characteristics</th> <th>n</th> <th>Percentage</th> </tr> </thead> <tbody> <?php foreach ($cse as $row) { ?> <tr> <td id="report-td-bg"> <p> <?php echo $row['day']; ?> </p> </td> <td> <p> <?php echo $row['sell']; ?> </p> </td> <td> <p> <?php $number = (($row['sell'] / $total_cse) * 100); echo number_format((float) $number, 1, '.', '') . "%"; ?> </p> </td> </tr> <?php } ?> </tbody> </table> </div> <div class="col-sm-4"> <br /> <?php } ?> </div> </div> </div> </div> <!-----------------------double interspace technique-----------------------> <div class='row'> <div class='col-sm-12 reports-right'> <h3 class="mt-2 pt-2">CSE - Double Interspace Technique </h3> <div class="row"> <div class=" col-sm-6 table-responsive" id="demo-table"> <?php if ($total_double == 0) { print_r("<h4>" . 'No Data Found' . "</h4>"); } else { ?> <table class="table table-bordered" style="height: 200px; width: 100%" id="mytable"> <thead> <tr> <th>Characteristics</th> <th>n</th> <th>Percentage</th> </tr> </thead> <tbody> <tr > <td colspan='3'><h4>Total epidural = <?php echo $total_double; ?> </h4></td> </tr> <?php foreach ($double as $row) { ?> <tr> <td id="report-td-bg"> <p> <?php echo $row['day']; ?> </p> </td> <td> <p> <?php echo $row['sell']; ?> </p> </td> <td> <p> <?php $number = (($row['sell'] / $total_double) * 100); echo number_format((float) $number, 1, '.', '') . "%"; ?> </p> </td> </tr> <?php } ?> <tr> <td colspan='3'><h4>Total spinal = <?php echo $total_double1; ?> </h4></td> </tr> <?php foreach ($double1 as $row) { ?> <tr> <td id="report-td-bg"> <p> <?php echo $row['day']; ?> </p> </td> <td> <p> <?php echo $row['sell']; ?> </p> </td> <td> <p> <?php $number = (($row['sell'] / $total_double1) * 100); echo number_format((float) $number, 1, '.', '') . "%"; ?> </p> </td> </tr> <?php } ?> </tbody> </table> </div> <div class="col-sm-4"> <br /> <?php } ?> </div> </div> </div> </div> <div class='row'> <div class='col-sm-12 reports-right'> <h3 class="mt-2 pt-2">CSE - Double Epidural Individual Levels</h3> <div class="row" > <div class=" col-sm-10 table-responsive" id="demo-table"> <?php if ($total_double == 0) { print_r("<h4>" . 'No Data Found' . "</h4>"); } else { ?> <table class="table table-bordered" style="height: 200px; width: 100%" id="mytable"> <thead> <?php if ($Cervical_d == 0) { print_r("<h4>" . 'Double Epidural Cervical Individual Level (No Data Found)' . "</h4>"); } else {?> <tr> <th>Cervical Level (n=<?php echo $Cervical_d ?>)</th> <th>n</th> <th>%</th> <th>Graphical Data</th> </tr> </thead> <tbody> <?php foreach ($Cervical_individual_double as $row) { ?> <tr> <td id="report-td-bg"> <p> <?php echo $row['one']; ?> </p> </td> <td> <p> <?php echo $row['two']; ?> </p> </td> <td> <p> <?php $number = (($row['two'] / $Cervical_d) * 100); echo number_format((float) $number, 1, '.', '') . "%"; ?> </p> </td> <td> <div class="progress"> <div class="progress-bar" role="progressbar" style="width: <?php echo $number; ?>%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100" ><b class='pl-1'><?php echo $row['two']; ?></b></div> </div> </td> </tr> <?php }} ?> </tbody> <thead> <?php if ($Thoracic_d == 0) { print_r("<h4>" . 'Double Epidural Thoracic Individual Level (No Data Found)' . "</h4>"); } else {?> <tr> <th>Thoracic Level (n=<?php echo $Thoracic_d ?>)</th> <th>n</th> <th>%</th> <th>Graphical Data</th> </tr> </thead> <tbody> <?php foreach ($Thoracic_individual_double as $row) { ?> <tr> <td id="report-td-bg"> <p> <?php echo $row['one']; ?> </p> </td> <td> <p> <?php echo $row['two']; ?> </p> </td> <td> <p> <?php $number = (($row['two'] / $Thoracic_d) * 100); echo number_format((float) $number, 1, '.', '') . "%"; ?> </p> </td> <td> <div class="progress"> <div class="progress-bar" role="progressbar" style="width: <?php echo $number; ?>%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100" ><b class='pl-1'><?php echo $row['two']; ?></b></div> </div> </td> </tr> <?php }} ?> </tbody> <?php if ($Lumbar_d == 0) { print_r("<h4>" . ' Double Epidural Lumbar Individual Level (No Data Found)' . "</h4>"); } else {?> <thead> <tr> <th>Lumbar Level (n=<?php echo $Lumbar_d ?>)</th> <th>n</th> <th>%</th> <th style="width:50%;">Graphical Data</th> </tr> </thead> <tbody> <?php foreach ($Lumbar_individual_double as $row) { ?> <tr> <td id="report-td-bg"> <p> <?php echo $row['one']; ?> </p> </td> <td> <p> <?php echo $row['two']; ?> </p> </td> <td> <p> <?php $number = (($row['two'] / $Lumbar_d) * 100); echo number_format((float) $number, 1, '.', '') . "%"; ?> </p> </td> <td> <div class="progress"> <div class="progress-bar" role="progressbar" style="width: <?php echo $number; ?>%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100" ><b class='pl-1'><?php echo $row['four']; ?></b></div> </div> </td> </tr> <?php }} ?> </tbody> <thead> <?php if ($Caudal_d == 0) { print_r("<h4>" . 'Double Epidural Caudal Individual Level (No Data Found)' . "</h4>"); } else {?> <tr> <th>Cervical Level (n=<?php echo $Caudal_d ?>)</th> <th>n</th> <th>%</th> <th>Graphical Data</th> </tr> </thead> <tbody> <?php foreach ($Caudal_individual_double as $row) { ?> <tr> <td id="report-td-bg"> <p> <?php echo $row['one']; ?> </p> </td> <td> <p> <?php echo $row['two']; ?> </p> </td> <td> <p> <?php $number = (($row['two'] / $Caudal_d) * 100); echo number_format((float) $number, 1, '.', '') . "%"; ?> </p> </td> <td> <div class="progress"> <div class="progress-bar" role="progressbar" style="width: <?php echo $number; ?>%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100" ><b class='pl-1'><?php echo $row['two']; ?></b></div> </div> </td> </tr> <?php }} ?> </tbody> </table> </div> <div class="col-sm-1"> <br /> <?php } ?> </div> <div class="col-sm-5"> <!-- <img src="<?php echo site_url('public/assets/images/spinal_report.png');?>" style="height: 300px;"/> --> </div> </div> </div> </div> <!------------individual new report spinal------------------------------> <div class='row'> <div class='col-sm-12 reports-right'> <h3 class="mt-2 pt-2">CSE - Double Spinal Individual Levels</h3> <div class="row" > <div class=" col-sm-10 table-responsive" id="demo-table"> <?php if ($total_double1 == 0) { print_r("<h4>" . 'No Data Found' . "</h4>"); } else { ?> <table class="table table-bordered" style="height: 200px; width: 100%" id="mytable"> <thead> <?php if ($Thoracic_d1 == 0) { print_r("<h4>" . 'Double Spinal Thoracic Individual Level (No Data Found)' . "</h4>"); } else {?> <tr> <th>Thoracic Level (n=<?php echo $Thoracic_d1 ?>)</th> <th>n</th> <th>%</th> <th>Graphical Data</th> </tr> </thead> <tbody> <?php foreach ($Thoracic_individual_spinal as $row) { ?> <tr> <td id="report-td-bg"> <p> <?php echo $row['one']; ?> </p> </td> <td> <p> <?php echo $row['two']; ?> </p> </td> <td> <p> <?php $number = (($row['two'] / $Thoracic_d1) * 100); echo number_format((float) $number, 1, '.', '') . "%"; ?> </p> </td> <td> <div class="progress"> <div class="progress-bar" role="progressbar" style="width: <?php echo $number; ?>%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100" ><b class='pl-1'><?php echo $row['two']; ?></b></div> </div> </td> </tr> <?php }} ?> </tbody> <?php if ($Lumbar_d1 == 0) { print_r("<h4>" . 'Double Spinal Lumbar Individual Level (No Data Found)' . "</h4>"); } else {?> <thead> <tr> <th>Lumbar Level (n=<?php echo $Lumbar_d1 ?>)</th> <th>n</th> <th>%</th> <th style="width:50%;">Graphical Data</th> </tr> </thead> <tbody> <?php foreach ($Lumbar_individual_spinal as $row) { ?> <tr> <td id="report-td-bg"> <p> <?php echo $row['three']; ?> </p> </td> <td> <p> <?php echo $row['four']; ?> </p> </td> <td> <p> <?php $number = (($row['four'] / $Lumbar_d1) * 100); echo number_format((float) $number, 1, '.', '') . "%"; ?> </p> </td> <td> <div class="progress"> <div class="progress-bar" role="progressbar" style="width: <?php echo $number; ?>%;" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100" ><b class='pl-1'><?php echo $row['four']; ?></b></div> </div> </td> </tr> <?php }} ?> </tbody> </table> </div> <div class="col-sm-1"> <br /> <?php } ?> </div> <div class="col-sm-5"> <!-- <img src="<?php echo site_url('public/assets/images/spinal_report.png');?>" style="height: 300px;"/> --> </div> </div> </div> </div> <!------------dural-----------------------------> </div> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.5/jspdf.min.js"></script> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script src="https://html2canvas.hertzen.com/dist/html2canvas.js"></script> <script> var btnSave = document.getElementById('save-pdf'); btnSave.disabled = false; btnSave.addEventListener('click', function () { var doc = new jsPDF(); html2canvas($('#reports-pdf').get(0)).then(function (canvas) { // export pdf var pdfDoc = new jsPDF({ orientation: 'potrait', unit: 'px', format: [canvas.width, canvas.height] }); pdfDoc.addImage(canvas.toDataURL('image/png'), 0, 0); pdfDoc.save('CSE Double Individual.pdf'); }); //doc.addImage(pie_chart.getImageURI(),0,0); //doc.addImage(column_chart.getImageURI(),0,0); //doc.save('anatomical.pdf'); }, false); </script> <style> .progress-bar{ background-color: rgb(0 123 255 / 70%); color:black; } .progress{ height:1.6rem; } </style> <?php echo view('includes/reports-footer'); ?>