EVOLUTION-NINJA
Edit File: CSE_LA.php
<?php echo view('includes/labour-user-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>Labour Reports</u></h3> <h3 class="mt-4 pt-2">LA Utilisation - CSE LA </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_from_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> <h4>Epidural</h4> <div class="row" id="demo-table"> <h5 class="mt-4"><strong>Heavy Local Anasthesia Solution (Without Adrenaline)</strong></h5> <?php if ($total_n == 0) { ?> <h4>No Data Found</h4> <?php } else { ?> <div class="col-sm-8"> <div class="table-responsive"> <h4>Total cases = <?php echo $total_n; ?> </h4> <table class="table table-bordered" id="mytable"> <thead> <tr> <th>Heavy Local Anaesthetic Solution</th> <th>n</th> <th>Percentage</th> </tr> </thead> <tbody> <?php foreach ($products 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 if ($total_n != 0) { $number = (($row['sell'] / $total_n) * 100); echo number_format((float) $number, 1, '.', '') . "%"; } else { echo "0%"; } ?> </p> </td> </tr> <?php } ?> </tbody> </table> </div> </div> <div class="col-sm-4"> <!-- <div id="GoogleLineChart" style="height: 400px; width: 100%"></div> --> <div id="GoogleBarChart" style="height: 400px; width: 100%"></div> </div> <?php } ?> </div> <!-- <br /> </div> --> <!-- <div class="col-sm-9"> <div class="reports-right pt-4"> --> <div id="chart_div"></div> <br /> <div class="row" id="demo-table"> <h5 class="mt-4"><strong>Iso / Hypobaric Local Anasthesia Solution (With Adrenaline)</strong></h5> <?php if ($total_n1 == 0) { ?> <h4>No Data Found</h4> <?php } else { ?> <div class="col-sm-8"> <div class="table-responsive"> <h4>Total cases = <?php if ($total_n1 == 0) { print_r(0); } else { echo $total_n1; } ?> </h4> <table class="table table-bordered" id="mytable"> <thead> <tr> <th>Iso / Hypobaric Local Anaesthetic Solution</th> <th>n</th> <th>Percentage</th> </tr> </thead> <tbody> <?php foreach ($products1 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 if ($total_n1 == 0) { echo '0%'; } else { $number = (($row['sell'] / $total_n1) * 100); echo number_format((float) $number, 1, '.', '') . "%"; } ?> </p> </td> </tr> <?php } ?> </tbody> </table> </div> </div> <div class="col-sm-4"> <!-- <div id="GoogleLineChart1" style="height: 400px; width: 100%"></div> --> <div id="GoogleBarChart1" style="height: 400px; width: 100%"></div> </div> <?php } ?> </div> <!-- </div> </div> --> <!-- <div class="col-sm-9"> <div class="reports-right pt-4"> --> <div id="chart_div"></div> <br /> <div class="row" id="demo-table"> <div class="col-sm-5"> <div class="table-responsive"> <?php if ($total_combo_ep != 0) { ?> <h4>Total combo = <?php echo $total_combo_ep; ?> </h4> <table class="table table-bordered" id="mytable"> <thead> <tr> <th>characteristics</th> <th>n</th> <!-- <th>Percentage</th> --> </tr> </thead> <tbody> <?php foreach ($products_combo_ep 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 if ($total_n1 == 0) { echo '0%'; } else { $number = (($row['sell'] / $total_combo) * 100); echo number_format((float) $number, 1, '.', '') . "%"; } ?> </p> </td> --> </tr> <?php } ?> </tbody> </table> <?php } else { echo "<h4>No combos Found</h4>"; } ?> <br /> </div> </div> </div> <!-- ================== new ==================== --> <h4>Spinal</h4> <div class="row" id="demo-table"> <h5 class="mt-4"><strong>Heavy Local Anaesthetic Solution</strong></h5> <?php if ($total_ns == 0) { ?> <h4>No Data Found</h4> <?php } else { ?> <div class="col-sm-8"> <div class="table-responsive"> <h4>Total cases = <?php echo $total_ns; ?> </h4> <table class="table table-bordered" id="mytable"> <thead> <tr> <th>Heavy Local Anaesthetic Solution</th> <th>n</th> <th>Percentage</th> </tr> </thead> <tbody> <?php foreach ($products_spinal 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 if ($total_n != 0) { $number = (($row['sell'] / $total_n) * 100); echo number_format((float) $number, 1, '.', '') . "%"; } else { echo "0%"; } ?> </p> </td> </tr> <?php } ?> </tbody> </table> </div> </div> <div class="col-sm-4"> <!-- <div id="GoogleLineChart" style="height: 400px; width: 100%"></div> --> <div id="GoogleBarChart" style="height: 400px; width: 100%"></div> </div> <?php } ?> </div> <!-- <br /> </div> --> <!-- <div class="col-sm-9"> <div class="reports-right pt-4"> --> <div id="chart_div"></div> <br /> <div class="row" id="demo-table"> <h5 class="mt-4"><strong>Iso / Hypobaric Local Anaesthetic Solution</strong></h5> <?php if ($total_ns1 == 0) { ?> <h4>No Data Found</h4> <?php } else { ?> <div class="col-sm-8"> <div class="table-responsive"> <h4>Total cases = <?php if ($total_ns1 == 0) { print_r(0); } else { echo $total_ns1; } ?> </h4> <table class="table table-bordered" id="mytable"> <thead> <tr> <th>Iso / Hypobaric Local Anaesthetic Solution</th> <th>n</th> <th>Percentage</th> </tr> </thead> <tbody> <?php foreach ($products_spinal1 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 if ($total_n1 == 0) { echo '0%'; } else { $number = (($row['sell'] / $total_n1) * 100); echo number_format((float) $number, 1, '.', '') . "%"; } ?> </p> </td> </tr> <?php } ?> </tbody> </table> </div> </div> <div class="col-sm-4"> <!-- <div id="GoogleLineChart1" style="height: 400px; width: 100%"></div> --> <div id="GoogleBarChart1" style="height: 400px; width: 100%"></div> </div> <?php } ?> </div> <!-- </div> </div> --> <!-- <div class="col-sm-9"> <div class="reports-right pt-4"> --> <div id="chart_div"></div> <br /> <div class="row" id="demo-table"> <div class="col-sm-5"> <div class="table-responsive"> <?php if ($total_combo_sp != 0) { ?> <h4>Total combo = <?php echo $total_combo_sp; ?> </h4> <table class="table table-bordered" id="mytable"> <thead> <tr> <th>characteristics</th> <th>n</th> <!-- <th>Percentage</th> --> </tr> </thead> <tbody> <?php foreach ($products_combo_sp 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 if ($total_n1 == 0) { echo '0%'; } else { $number = (($row['sell'] / $total_combo) * 100); echo number_format((float) $number, 1, '.', '') . "%"; } ?> </p> </td> --> </tr> <?php } ?> </tbody> </table> <?php } else { echo "<h4>No combos Found</h4>"; } ?> <br /> </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> google.load('visualization', '1.0', {'packages':['corechart']}); google.charts.load('current', {'packages':['corechart', 'bar','table']}); google.charts.setOnLoadCallback(drawChart); // Line Chart function drawChart() { var data1 = google.visualization.arrayToDataTable([ ['Characteristics', 'Stats'], <?php echo "['Total number of cases recorded with minimum data set','N’'],"; echo "['Total number of cases with complete entry','Nc'],"; ?> ]); var data = google.visualization.arrayToDataTable([ ['Characteristics', 'Count'], <?php foreach ($products as $row){ echo "['".$row['day']."',".$row['sell']."],"; } ?> ]); var options = { title: 'Heavy Local Anaesthetic Solution', curveType: 'function', legend: { position: 'top' } }; // var pie_chart = new google.visualization.PieChart(document.getElementById('GoogleLineChart')); // pie_chart.draw(data, options); var column_chart = new google.visualization.ColumnChart(document.getElementById('GoogleBarChart')); column_chart.draw(data, options); } </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() { var data11 = google.visualization.arrayToDataTable([ ['Epidural LA without adrenaline', 'Count'], <?php foreach ($products1 as $row){ echo "['".$row['day']."',".$row['sell']."],"; } ?> ]); var options = { title: 'Iso / Hypobaric Local Anaesthetic Solution', curveType: 'function', legend: { position: 'top' } }; // var pie_chart1 = new google.visualization.PieChart(document.getElementById('GoogleLineChart1')); // pie_chart1.draw(data11, options); var column_chart1 = new google.visualization.ColumnChart(document.getElementById('GoogleBarChart1')); column_chart1.draw(data11, options); } </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.pdf'); }); //doc.addImage(pie_chart.getImageURI(),0,0); //doc.addImage(column_chart.getImageURI(),0,0); //doc.save('Surgical_location.pdf'); }, false); // } </script> <?php echo view('includes/labour-user-reports-footer'); ?>