EVOLUTION-NINJA
Edit File: user_v_epidural_v.php
<?php echo view('includes/user-reports-header'); ?> <div class="col-sm-9"> <?php if($total_epidural>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">Epidural Interspace Levels</h3> <div class="row" > <div class=" col-sm-6 table-responsive" id="demo-table"> <?php if ($total_epidural == 0) { print_r("<h4>" . 'No Data Found' . "</h4>"); } else { ?> <h4>Total cases= <?php echo $total_epidural; ?> </h4> <table class="table table-bordered" style="height: 200px; width: 100%" id="mytable"> <thead> <tr> <th>Epidural Location</th> <th>n</th> <th>Percentage</th> </tr> </thead> <tbody> <?php foreach ($epidural_level_name 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_epidural) * 100); echo number_format((float) $number, 1, '.', '') . "%"; ?> </p> </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------------------------------> <div class='row'> <div class='col-sm-12 reports-right'> <h3 class="mt-2 pt-2">Individual Epidural Interspace Levels</h3> <div class="row" > <div class=" col-sm-10 table-responsive" id="demo-table"> <?php if ($total_epidural == 0) { print_r("<h4>" . 'No Data Found' . "</h4>"); } else { ?> <table class="table table-bordered" style="height: 200px; width: 100%" id="mytable"> <?php if ($C_cervical == 0) { print_r("<h4>" . 'No Data Found in Cervical' . "</h4>"); } else { ?> <thead> <tr> <th>Cervical Level (n=<?php echo $C_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'] / $C_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> <?php if ($L_Lumbar == 0) { print_r("<h4>" . 'No Data Found in Lumbar' . "</h4>"); } else { ?> <thead> <tr> <th>Lumbar Level (n=<?php echo $L_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'] / $L_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> <?php if ($L_Thoracic == 0) { print_r("<h4>" . 'No Data Found in Thoracic' . "</h4>"); } else { ?> <thead> <tr> <th>Thoracic Level (n=<?php echo $L_Thoracic ?>)</th> <th>n</th> <th>%</th> <th style="width:50%;">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'] / $L_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 ($L_Caudal == 0) { print_r("<h4>" . 'No Data Found in Caudal' . "</h4>"); } else { ?> <thead> <tr> <th>Caudal Level (n=<?php echo $L_Caudal?>)</th> <th>n</th> <th>%</th> <th style="width:50%;">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'] / $L_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('Epidural 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'); ?>