MMCT TEAM
Server IP : 2a02:4780:3:1493:0:3736:a38e:7  /  Your IP : 216.73.216.139
Web Server : LiteSpeed
System : Linux sg-nme-web1393.main-hosting.eu 4.18.0-553.40.1.lve.el8.x86_64 #1 SMP Wed Feb 12 18:54:57 UTC 2025 x86_64
User : u926327694 ( 926327694)
PHP Version : 7.4.33
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u926327694/domains/smsoft.in/public_html/demo/accounts/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u926327694/domains/smsoft.in/public_html/demo/accounts/vochers_print.php
<?php
include 'config/config.php';
$id=$_GET["id"];
$data_res=mysqli_query($con,"select * from `vochers` where `V_Id` = '$id'") or die(mysqli_error($con));
$data=mysqli_fetch_array($data_res);

$SchoolCode=$_SESSION['code'];
$Voucherimg="../school_logos/".$SchoolCode."_voucher.jpg";
?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Print Voucher</title>
  <script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.5/jspdf.min.js"></script>
    
</head>
<body style="font-size:18px;>

<div class="PrintArea" style="width: 1005px;" >
<table width="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <th colspan="4" scope="col">
       
 <img src="<?php echo $Voucherimg; ?>" > <!--School Logo -->
 
    </th>
  </tr>
  <tr>
    <th width="7%" scope="row">Date</th>
    <td width="37%"><?php echo "$data[Date]";  ?></td>
    <td><div align="right">Voucher Number : </div></td>
    <td><?php echo $data ['Type']."-".$data['v_counter']; ?></td>
  </tr>
  <tr>
    <th scope="row">&nbsp;</th>
    <th scope="row">Payment Received By  Rs. </th>
    <th width="33%" scope="row"><?php echo "$data[Dr_Ledger]";  ?></th>
    <th width="23%" scope="row"><?php echo "$data[Dr_Amount]";  ?></th>
  </tr>
  <tr>
    <th scope="row">&nbsp;</th>
    <th scope="row">Paid By Rs. </th>
    <th scope="row"><?php echo "$data[Cr_Ledger]";  ?></th>
    <th scope="row"><?php echo "$data[Cr_Amount]";  ?></th>
  </tr>
  <tr>
    <th scope="row"><div align="center"></div></th>
    <th scope="row">Inwords:</th>
    <?php $f = new NumberFormatter("en", NumberFormatter::SPELLOUT); 

    ?>
    <th colspan="2" scope="row"><?php echo $f->format($data['Dr_Amount'])." Only"; ?></th>
  </tr>
  <tr>
    <th scope="row"></th>
    <th scope="row">Narration :</th>
    <th colspan="2" scope="row"><?php echo "$data[Nrtn]";  ?></th>
  </tr>
  <tr>
    <th scope="row">&nbsp;</th>
    <th scope="row"><p>&nbsp;</p>
    <p>&nbsp;</p></th>
    <th colspan="2" scope="row">&nbsp;</th>
  </tr>
  <tr>
    <th scope="row">&nbsp;</th>
    <th scope="row">Approved by</th>
    <th scope="row">Prepared by</th>
    <th scope="row">Received by</th>
  </tr>
</table>
<br><br>
<br>

</div>
<br>
<center><input type="button" value="Print" onclick="window.print()" /> </center>

<script>
    var form = $('.PrintArea'),
         cache_width = form.width,
         a4 = [800, 841.89]; // for a4 size paper width and height
         //console.log(cache_width);
        //create pdf
        function createPDF() {
            getCanvas().then(function (canvas) {
                var
                 img = canvas.toDataURL("image/png"),
                 doc = new jsPDF({
                     unit: 'px',
                     format: 'a4'
                 });
                doc.addImage(img, 'JPEG', 5, 5);
                 // doc.save('');
               doc.save("voucher.pdf");
                form.width(cache_width);
            });
        }

        // create canvas object
        function getCanvas() {
            form.width((a4[0] * 1.33333) - 80).css('max-width', 'none');
            return html2canvas(form, {
                imageTimeout: 2000,
                removeContainer: true
            });
        }
    
</script>
`
</body>
</html>

MMCT - 2023