EVOLUTION-NINJA
Edit File: v_cse_single_v.php
<?php echo view('includes/obstetric-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>Obstetric 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> <!---------------single------------------------------------------> <div class='row'> <div class='col-sm-12 reports-right'> <h3 class="mt-2 pt-2">CSE - Single Interspace Technique </h3> <div class="row"> <div class=" col-sm-6 table-responsive" id="demo-table"> <?php if ($total_single == 0) { print_r("<h4>" . 'No Data Found' . "</h4>"); } else { ?> <h4>Total cases = <?php echo $total_single; ?> </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 ($single 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_single) * 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> <!------------individual new report------------------------------> <div class='row'> <div class='col-sm-12 reports-right'> <h3 class="mt-2 pt-2">CSE - Single Individual Levels</h3> <div class="row" > <div class=" col-sm-10 table-responsive" id="demo-table"> <?php if ($total_single == 0) { print_r("<h4>" . 'No Data Found' . "</h4>"); } else { ?> <table class="table table-bordered" style="height: 200px; width: 100%" id="mytable"> <thead> <?php if ($t_Cervical == 0) { print_r("<h4>" . 'Single Cervical Individual Level (No Data Found)' . "</h4>"); } else {?> <tr> <th>Cervical Level (n=<?php echo $t_Cervical ?>)</th> <th>n</th> <th>%</th> <th>Graphical Data</th> </tr> </thead> <tbody> <?php foreach ($Cervical_individual 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'] / $t_Cervical) * 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 ($t_Thoracic == 0) { print_r("<h4>" . 'Single Thoracic Individual Level (No Data Found)' . "</h4>"); } else {?> <tr> <th>Thoracic Level (n=<?php echo $t_thoracic ?>)</th> <th>n</th> <th>%</th> <th>Graphical Data</th> </tr> </thead> <tbody> <?php foreach ($Thoracic_individual 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'] / $t_Thoracic) * 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 ($t_Lumbar == 0) { print_r("<h4>" . ' Single Lumbar Individual Level (No Data Found)' . "</h4>"); } else {?> <thead> <tr> <th>Lumbar Level (n=<?php echo $t_Lumbar ?>)</th> <th>n</th> <th>%</th> <th style="width:50%;">Graphical Data</th> </tr> </thead> <tbody> <?php foreach ($Lumbar_individual 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'] / $t_Lumbar) * 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 == 0) { print_r("<h4>" . 'Single Caudal Individual Level (No Data Found)' . "</h4>"); } else {?> <tr> <th>Cervical Level (n=<?php echo $Caudal ?>)</th> <th>n</th> <th>%</th> <th>Graphical Data</th> </tr> </thead> <tbody> <?php foreach ($Caudal_individual 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) * 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> </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 single 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/obstetric-reports-footer'); ?>