EVOLUTION-NINJA
Edit File: Vertebral_v_old.php
<?php echo view('includes/reports-header'); ?> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css"> <div class="col-sm-9"> <div class="reports-right pt-4"> <input id="save-pdf" type="button" value="Save as PDF" /> <div id="chart_div"></div> <div class="col-sm-9" id="reports-pdf"> <h3 class="mt-2 mb-3 pt-2 txt-center"><u>CNB Reports</u></h3> <h3 class="mt-2 pt-2">Other Procedure Characterisitics - Vertebral Interspace Level</h3> <br /> <div class="row"> <div class="col-sm-6"> <div class="report-detail-tag"> <h4 class="mb-4">Report Details</h4> <h5>From Date : <span id="from_date"> <?php echo date('d-m-Y', strtotime(session()->get('from_date'))); ?> </span></h5> <h5>To Date : <span id="to_date"> <?php echo date('d-m-Y', strtotime(session()->get('to_date'))); ?> </span></h5> <h5>Reported by :<span id="reported_by"> <?php $name = session()->get('name'); if (substr($name, 0, 3) === "Dr. " || substr($name, 0, 3) === "Dr ") { echo session()->get('name'); } else { echo "Dr. " . session()->get('name'); } ?> </span></h5> </div> </div> <div class="col-sm-6"></div> </div> <!-- //============= consolidated =============== --> <h3 class="mt-2 pt-2">Combined of all four procedures</h3> <br> <div class="row" > <div class=" col-sm-6 table-responsive" id="demo-table"> <?php if ($total_n == 0) { print_r("<h4>" . 'No Data Found' . "</h4>"); die(); } else { ?> <h4>Total cases = <?php echo $total0; ?> </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 ($consolidate 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_n) * 100); echo number_format((float) $number, 1, '.', '') . "%"; ?> </p> </td> </tr> <?php } ?> </tbody> </table> </div> <div class="col-sm-4"> <br /> <?php } ?> </div> </div> <!-- CSe --> <h3 class="mt-2 pt-2">CSE</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> <!-- //=================== epidural ====================== --> <h3 class="mt-2 pt-2">Epidural</h3> <div class="row" > <div class=" col-sm-6 table-responsive" id="demo-table"> <?php if ($total_e == 0) { print_r("<h4>" . 'No Data Found' . "</h4>"); } else { ?> <h4>Total cases = <?php echo $total_e; ?> </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 ($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_e) * 100); echo number_format((float) $number, 2, '.', '') . "%"; ?> </p> </td> </tr> <?php } ?> </tbody> </table> </div> <div class="col-sm-1"> <?php } ?> </div> <div class="col-sm-5"> <img src="<?php echo site_url('public/assets/images/spinal_report.png');?>" style="height: 300px;"/> </div> <!-- <br /> --> </div> <!-- //================== spinal =================== --> <h3 class="mt-2 pt-2">Spinal</h3> <div class="row" > <div class=" col-sm-6 table-responsive" id="demo-table"> <?php if ($total_s == 0) { print_r("<h4>" . 'No Data Found' . "</h4>"); } else { ?> <h4>Total cases= <?php echo $total1; ?> </h4> <table class="table table-bordered" style="height: 200px; width: 100%" id="mytable"> <thead> <tr> <th>Spinal Location</th> <th>n</th> <th>Percentage</th> </tr> </thead> <tbody> <?php foreach ($spinal_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'] / $total1) * 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> <!-- //=============== new csa =================== --> <h3 class="mt-2 pt-2" >Continuous Spinal Anaesthesia-CSA</h3> <div class="row" > <div class=" col-sm-6 table-responsive" id="demo-table"> <?php if ($total_csa == 0) { print_r("<h4>" . 'No Data Found' . "</h4>"); } else { ?> <h4>Total cases = <?php echo $total_csa; ?> </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 ($csa 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_csa) * 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> <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('Vertebral_Interspace.pdf'); }); //doc.addImage(pie_chart.getImageURI(),0,0); //doc.addImage(column_chart.getImageURI(),0,0); //doc.save('anatomical.pdf'); }, false); </script> <?php echo view('includes/reports-footer'); ?>