EVOLUTION-NINJA
Edit File: obstetric_satisfaction_score_v.php
<?php echo view('includes/obstetric-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><br /> <div class="col-sm-9" id = "reports-pdf"> <h3 class="mt-2 mb-3 pt-2 txt-center"><u>Labour Reports</u></h3> <h3 class="mt-2 pt-2">Feedback - Satisfaction Score with Anaesthesia care</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('l_from_date'))); ?></span></h5> <h5>To Date : <span id="to_date"><?php echo date('d-m-Y',strtotime(session()->get('l_to_date'))); ?></span></h5> <h5>Reported by :<span id="reported_by"><?php $name = session()->get('l_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> <div class="row" id="demo-table"> <div class="col-sm-6"> <!-- --> <div class="table-responsive" id="demo-table"> <?php if ($total== 0) { ?> <h4>No Data Found</h4> <?php die();} ?> <h4>Total cases with data = <?php echo $total;?></h4> <table class="table table-bordered"> <thead> <tr> <th>Did you feel you had time to ask your anaesthetist, questions before your labour pain relief procedure?</th> <th>n</th> <th>Percentage</th> </tr> </thead> <tbody> <?php foreach($product_anaesthesist_time as $row){ ?> <tr> <td id="report-td-bg"><p> <?php echo $row['name']; ?></p> </td> <td><p> <?php echo $row['count']; ?></p> </td> <td> <p> <?php echo number_format((float) (($row['count'] / $total) * 100), 2, '.', '') . "%"; ?> </p> </td> </tr> <?php } ?> </tbody> </table> </div> </div> <div class="col-sm-6"> <div class="row"> <div id="product_anaesthesist_time_GooglepieChart" style="height: 400px; width: 100%"></div> </div></div> </div> <div class="row" id="demo-table"> <div class="col-sm-6"> <!-- --> <div class="table-responsive" id="demo-table"> <h4>Total cases with data = <?php echo $total;?></h4> <table class="table table-bordered"> <thead> <tr> <th>How satisfied were you with the information on Regional anaesthesia provided by your anaesthetist?</th> <th>n</th> <th>Percentage</th> </tr> </thead> <tbody> <?php foreach($product_anaesthesia_satisfaction as $row){ ?> <tr> <td id="report-td-bg"><p> <?php echo $row['name']; ?></p> </td> <td><p> <?php echo $row['count']; ?></p> </td> <td> <p> <?php echo number_format((float) (($row['count'] / $total) * 100), 2, '.', '') . "%"; ?> </p> </td> </tr> <?php } ?> </tbody> </table> </div> </div> <div class="col-sm-6"> <div class="row"> <div id="product_anaesthesia_satisfaction_GooglepieChart" style="height: 400px; width: 100%"></div> </div></div> </div> <div class="row" id="demo-table"> <div class="col-sm-6"> <!-- --> <div class="table-responsive" id="demo-table"> <h4>Total cases with data = <?php echo $total;?></h4> <table class="table table-bordered"> <thead> <tr> <th>How satisfied were you from labour pain relief procedure ?</th> <th>n</th> <th>Percentage</th> </tr> </thead> <tbody> <?php foreach($product_pain_therapy_satisfaction as $row){ ?> <tr> <td id="report-td-bg"><p> <?php echo $row['name']; ?></p> </td> <td><p> <?php echo $row['count']; ?></p> </td> <td> <p> <?php echo number_format((float) (($row['count'] / $total) * 100), 2, '.', '') . "%"; ?> </p> </td> </tr> <?php } ?> </tbody> </table> </div> </div> <div class="col-sm-6"> <div class="row"> <div id="product_pain_therapy_satisfaction_GooglepieChart" style="height: 400px; width: 100%"></div> </div></div> </div> <!-- --> <div class="row" id="demo-table"> <div class="col-sm-6"> <!-- --> <div class="table-responsive" id="demo-table"> <h4>Total cases with data = <?php echo $total;?></h4> <table class="table table-bordered"> <thead> <tr> <th>To what degree after the operation, did numbness or heaviness of the anaesthetised limb or body part bother you ?</th> <th>n</th> <th>Percentage</th> </tr> </thead> <tbody> <?php foreach($product_numbness_limb_bothering as $row){ ?> <tr> <td id="report-td-bg"><p> <?php echo $row['name']; ?></p> </td> <td><p> <?php echo $row['count']; ?></p> </td> <td> <p> <?php echo number_format((float) (($row['count'] / $total) * 100), 2, '.', '') . "%"; ?> </p> </td> </tr> <?php } ?> </tbody> </table> </div> </div> <div class="col-sm-6"> <div class="row"> <div id="product_numbness_limb_bothering_GooglepieChart" style="height: 400px; width: 100%"></div> </div></div> </div> <div class="row" id="demo-table"> <div class="col-sm-6"> <!-- --> <div class="table-responsive" id="demo-table"> <h4>Total cases with data = <?php echo $total;?></h4> <table class="table table-bordered"> <thead> <tr> <th>When the numbness/heaviness related to the regional anaesthesia wore off, how much pain did you experience ?</th> <th>n</th> <th>Percentage</th> </tr> </thead> <tbody> <?php foreach($product_numbness_pain_experience as $row){ ?> <tr> <td id="report-td-bg"><p> <?php echo $row['name']; ?></p> </td> <td><p> <?php echo $row['count']; ?></p> </td> <td> <p> <?php echo number_format((float) (($row['count'] / $total) * 100), 2, '.', '') . "%"; ?> </p> </td> </tr> <?php } ?> </tbody> </table> </div> </div> <div class="col-sm-6"> <div class="row"> <div id="product_numbness_pain_experience_GooglepieChart" style="height: 400px; width: 100%"></div> </div></div> </div> <div class="row" id="demo-table"> <div class="col-sm-6"> <!-- --> <div class="table-responsive" id="demo-table"> <h4>Total cases with data = <?php echo $total;?></h4> <table class="table table-bordered"> <thead> <tr> <th>Overall satisfaction score (1:Least satisfied to 10:most satisfied)</th> <th>n</th> <th>Percentage</th> </tr> </thead> <tbody> <?php foreach($product_overall_satisfaction as $row){ ?> <tr> <td id="report-td-bg"><p> <?php echo $row['name']; ?></p> </td> <td><p> <?php echo $row['count']; ?></p> </td> <td> <p> <?php echo number_format((float) (($row['count'] / $total) * 100), 2, '.', '') . "%"; ?> </p> </td> </tr> <?php } ?> </tbody> </table> </div> </div> <div class="col-sm-6"> <div class="row"> <div id="product_overall_satisfaction_GooglepieChart" style="height: 400px; width: 100%"></div> </div></div> </div> <div class="row"> <div class="col-sm-6"> <div id="GoogleLineChart" style="height: 400px; width: 100%"></div> </div> <div class="col-sm-6"> <div id="GoogleBarChart" style="height: 400px; width: 100%"></div> </div> </div> <!-- <div class="col-sm-2"></div> --> </div><!--row---> <br/> <!--------------------------------------------------------------------> <!--------------------------------------------------------------------> <!--------------------------------------------------------------------> </div> </div> </div> </div> </section> <!---------------- Menu Drodown ---------------------> <script type = "text/javascript"> </script> <script type="text/javascript"> jQuery(document).ready(function($) { $('.mobimenu li.dropdown').hover(function() { $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn(500); }, function() { $(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut(500); }); }); </script> <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> google.load('visualization', '1.0', {'packages':['corechart']}); google.charts.load('current', {'packages':['corechart', 'bar','table']}); google.charts.setOnLoadCallback(drawChart); // Line Chart function drawChart() { // $data['product_pain_before_surgery'] = $product_pain_before_surgery ; // var data1 = google.visualization.arrayToDataTable([ // ['ASA', 'Count'], // <?php // foreach ($product_pain_before_surgery as $row) { // echo "['" . $row['name'] . "'," . $row['count'] . "],"; // } ?> // ]); // var options1 = { // title: 'Did you had pain before surgery ?', // curveType: 'function', // legend: { // position: 'top' // } // }; // $data['product_anaesthesist_time'] = $product_anaesthesist_time ; var data2 = google.visualization.arrayToDataTable([ ['ASA', 'Count'], <?php foreach ($product_anaesthesist_time as $row) { echo "['" . $row['name'] . "'," . $row['count'] . "],"; } ?> ]); var options2 = { title: 'Did you feel you had time to ask your Anaesthetist, questions before your surgery?', curveType: 'function', legend: { position: 'top' } }; // $data['product_pain_therapy_satisfaction'] = $product_pain_therapy_satisfaction ; var data3 = google.visualization.arrayToDataTable([ ['ASA', 'Count'], <?php foreach ($product_pain_therapy_satisfaction as $row) { echo "['" . $row['name'] . "'," . $row['count'] . "],"; } ?> ]); var options3 = { title: 'How satisfied have you been with pain therapy after surgery ?', curveType: 'function', legend: { position: 'top' } }; // $data['product_nausea_vomit_satisfaction'] = $product_nausea_vomit_satisfaction ; // var data4 = google.visualization.arrayToDataTable([ // ['ASA', 'Count'], // <?php // foreach ($product_nausea_vomit_satisfaction as $row) { // echo "['" . $row['name'] . "'," . $row['count'] . "],"; // } ?> // ]); // var options4 = { // title: 'How satisfied were you with treatment of nausea and vomiting after the operation?', // curveType: 'function', // legend: { // position: 'top' // } // }; // $data['product_numbness_limb_bothering'] = $product_numbness_limb_bothering; var data5 = google.visualization.arrayToDataTable([ ['ASA', 'Count'], <?php foreach ($product_numbness_limb_bothering as $row) { echo "['" . $row['name'] . "'," . $row['count'] . "],"; } ?> ]); var options5 = { title: 'To what degree after the operation, did numbness or heaviness of the anaesthetised limb or body part bother you ?', curveType: 'function', legend: { position: 'top' } }; // $data['product_numbness_pain_experience'] = $product_numbness_pain_experience ; var data6 = google.visualization.arrayToDataTable([ ['ASA', 'Count'], <?php foreach ($product_numbness_pain_experience as $row) { echo "['" . $row['name'] . "'," . $row['count'] . "],"; } ?> ]); var options6 = { title: 'When the numbness/heaviness related to the regional anaesthesia wore off, how much pain did you experience ?', curveType: 'function', legend: { position: 'top' } }; // $data['product_similar_op_again'] = $product_similar_op_again ; // var data7 = google.visualization.arrayToDataTable([ // ['ASA', 'Count'], // <?php // foreach ($product_similar_op_again as $row) { // echo "['" . $row['name'] . "'," . $row['count'] . "],"; // } ?> // ]); // var options7 = { // title: 'Were you to require a similar operation again, would you be happy to have the same type of a regional anaesthetic again ?', // curveType: 'function', // legend: { // position: 'top' // } // }; // $data['product_overall_satisfaction'] = $product_overall_satisfaction ; var data8 = google.visualization.arrayToDataTable([ ['ASA', 'Count'], <?php foreach ($product_overall_satisfaction as $row) { echo "['" . $row['name'] . "'," . $row['count'] . "],"; } ?> ]); var options8 = { title: 'Overall satisfaction score (1:Least satisfied to 10:most satisfied)', curveType: 'function', legend: { position: 'top' } }; // $data['product_anaesthesia_satisfaction'] = $product_anaesthesia_satisfaction ; var data9 = google.visualization.arrayToDataTable([ ['ASA', 'Count'], <?php foreach ($product_anaesthesia_satisfaction as $row) { echo "['" . $row['name'] . "'," . $row['count'] . "],"; } ?> ]); var options9 = { title: 'How satisfied were you from anaesthesia ?', curveType: 'function', legend: { position: 'top' } }; // $data['product_well_managed'] = $product_well_managed ; // var data10 = google.visualization.arrayToDataTable([ // ['ASA', 'Count'], // <?php // foreach ($product_well_managed as $row) { // echo "['" . $row['name'] . "'," . $row['count'] . "],"; // } ?> // ]); // var options10 = { // title: 'How well was it managed ?', // curveType: 'function', // legend: { // position: 'top' // } // }; // var pie_chart1 = new google.visualization.PieChart(document.getElementById('pain_before_surgery_GooglepieChart')); // pie_chart1.draw(data1, options1); var pie_chart2 = new google.visualization.PieChart(document.getElementById('product_anaesthesist_time_GooglepieChart')); pie_chart2.draw(data2, options2); var pie_chart3 = new google.visualization.PieChart(document.getElementById('product_pain_therapy_satisfaction_GooglepieChart')); pie_chart3.draw(data3, options3); // var pie_chart4 = new google.visualization.PieChart(document.getElementById('product_nausea_vomit_satisfaction_GooglepieChart')); // pie_chart4.draw(data4, options4); var pie_chart5 = new google.visualization.PieChart(document.getElementById('product_numbness_limb_bothering_GooglepieChart')); pie_chart5.draw(data5, options5); var pie_chart6 = new google.visualization.PieChart(document.getElementById('product_numbness_pain_experience_GooglepieChart')); pie_chart6.draw(data6, options6); // var pie_chart7 = new google.visualization.PieChart(document.getElementById('product_similar_op_again_GooglepieChart')); // pie_chart7.draw(data7, options7); var pie_chart8 = new google.visualization.ColumnChart(document.getElementById('product_overall_satisfaction_GooglepieChart')); pie_chart8.draw(data8, options8); var pie_chart9 = new google.visualization.PieChart(document.getElementById('product_anaesthesia_satisfaction_GooglepieChart')); pie_chart9.draw(data9, options9); // var pie_chart10 = new google.visualization.PieChart(document.getElementById('well_managed_GooglepieChart')); // pie_chart10.draw(data10, options10); var btnSave = document.getElementById('save-pdf'); 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('SatisfactionScoreAnaesthesia_care.pdf'); }); //doc.addImage(pie_chart.getImageURI(),0,0); //doc.addImage(column_chart.getImageURI(),0,0); //doc.save('anatomical.pdf'); }, false); } </script> <!---------------- Menu Drodown ---------------------> <?php echo view('includes/obstetric-reports-footer'); ?>