EVOLUTION-NINJA
Edit File: duty_drawback_report.php
<html> <head> <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"> </head> <?php function IND_money_format($number){ $decimal = (string)($number - floor($number)); $money = floor($number); $length = strlen($money); $delimiter = ''; $money = strrev($money); for($i=0;$i<$length;$i++){ if(( $i==3 || ($i>3 && ($i-1)%2==0) )&& $i!=$length){ $delimiter .=','; } $delimiter .=$money[$i]; } $result = strrev($delimiter); $decimal = preg_replace("/0\./i", ".", $decimal); $decimal = substr($decimal, 0, 3); if( $decimal != '0'){ $result = $result.$decimal; } return '₹ '.$result; } ?> <body> <table align="center" style="border: 1px solid black;"> <tr> <td> <a href = "<?php echo base_url();?>g_reports/summery_report_order_date" >Orders Received</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/summery_report_marketing" >Delivery Tracker</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/summery_report" >Sales Summary</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/export_report" >Sales - Export</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/fabric_reports" >Fabrics - Export</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/madeups_reports" >Madeups - Export</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/rex_report" >REX Details</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/duty_drawback_report" >Duty Drawback / Export Incentive Details</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/gst_report" >IGST List</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/gst_summery_reports" >IGST Summary</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/hscode_summery_reports" >HS Code Summary</a> </td> <td> <a href = "<?php echo base_url();?>g_reports/po_reports" >PO Summary</a> </td> </tr> </table> <p style="background:#485b7f;"> <img src="<?php echo base_url();?>assets/img/2ND%20TT.svg" alt="logo" width="180" style="margin-top:3px;"/> </p> <div id="reports-pdf"> <h2>Duty Drawback Details</h2> <p> <h4><?php echo 'Financial Year : '.$year;?></h4> </p> <table align="center" style="border: 1px solid black;"> <tr> <th>Duty Drawback</th> <th>Apr</th> <th>May</th> <th>Jun</th> <th>Jul</th> <th>Aug</th> <th>Sept</th> <th>Oct</th> <th>Nov</th> <th>Dec</th> <th>Jan</th> <th>Feb</th> <th>March</th> </tr> <tr> <td><p> <?php echo 'Eligible INR'; ?></p> </td> <?php $total_val = 0; for($i = 0; $i<count($products) ; $i++){ ?> <td><p><?php echo IND_money_format(number_format((float)($products[$i]), 2, '.', ''));?></p></td> <?php } ?> </tr> <tr> <td><p> <?php echo 'Credited INR'; ?></p> </td> <?php $total_val = 0; for($i = 0; $i<count($recieved) ; $i++){ ?> <td><p><?php echo IND_money_format(number_format((float)($recieved[$i]), 2, '.', ''));?></p></td> <?php } ?> </tr> <tr> <td><p> <?php echo 'Due INR'; ?></p> </td> <?php $total_val = 0; for($i = 0; $i<count($recieved) ; $i++){ ?> <?php $diff = $products[$i] - $recieved[$i]; ?> <td><p><?php echo IND_money_format(number_format((float)($diff), 2, '.', ''));?></p></td> <?php } ?> </tr> </table> <h2>Export Incentive Details</h2> <table align="center" style="border: 1px solid black;"> <tr> <th>Export Incentive</th> <th>Apr</th> <th>May</th> <th>Jun</th> <th>Jul</th> <th>Aug</th> <th>Sept</th> <th>Oct</th> <th>Nov</th> <th>Dec</th> <th>Jan</th> <th>Feb</th> <th>March</th> </tr> <tr> <td><p> <?php echo 'Eligible INR'; ?></p> </td> <?php $total_val = 0; for($i = 0; $i<count($Export) ; $i++){ ?> <td><p><?php echo IND_money_format(number_format((float)($Export[$i]), 2, '.', ''));?></p></td> <?php } ?> </tr> <tr> <td><p> <?php echo 'Credited INR'; ?></p> </td> <?php $total_val = 0; for($i = 0; $i<count($Export_recieved) ; $i++){ ?> <td><p><?php echo IND_money_format(number_format((float)($Export_recieved[$i]), 2, '.', ''));?></p></td> <?php } ?> </tr> <tr> <td><p> <?php echo 'Due INR'; ?></p> </td> <?php $total_val = 0; for($i = 0; $i<count($Export_recieved) ; $i++){ ?> <?php $diff = ($Export[$i] - $Export_recieved[$i]); ?> <td><p><?php echo IND_money_format(number_format((float)($diff), 2, '.', ''));?></p></td> <?php } ?> </tr> </table> </div> </body> <php ?> <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 data = google.visualization.arrayToDataTable([ ['Surgical location', 'Count'], <?php foreach ($products as $row){ echo "['".$row['day']."',".$row['sell']."],"; } ?> ]); var options = { title: 'Exports', curveType: 'function', colors: ['#e0440e', '#e6693e', '#ec8f6e', '#f3b49f', '#f6c7b6'], legend: { position: 'top' } }; var column_chart = new google.visualization.ColumnChart(document.getElementById('summery_chart')); column_chart.draw(data, options); 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('Analgesia.pdf'); }); //doc.addImage(pie_chart.getImageURI(),0,0); //doc.addImage(column_chart.getImageURI(),0,0); //doc.save('Surgical_location.pdf'); }, false); } </script> <style> .chart-container { display: flex; align-items: center; } .legend { display: flex; flex-direction: column; margin-right: 20px; } .legend-item { display: flex; align-items: center; margin-bottom: 5px; } .legend-color { width: 20px; height: 20px; display: inline-block; margin-right: 5px; } </style> <style> table { font-family: arial, sans-serif; border-collapse: collapse; width: 100%; } td, th { border: 1px solid #dddddd; text-align: left; padding: 8px; } tr:nth-child(even) { background-color: #dddddd; } </style>