Hướng dẫn php code for print bill - code php in hóa đơn

How I can print bill from web application ?. the web design by HTML,PHP,and MYSQL .

in below , the PHP code print the result in web page , I want to print the result as hard copy . so what I do ?

while($row = mysql_fetch_array($result)){ 
                echo " ";
                echo "
"; echo "
"; echo $row['finame']; echo "
"; echo "
"; echo $row['scname']; echo "
"; echo "
"; echo $row['file_id']; echo "
"; echo "
"; echo $row['na_id']; echo "
" ; echo "
" ; echo $row['phone']; echo "
"; echo "
" ; echo $row['sex']; echo "
" ; echo "
" ; echo $row['placeOfBirth']; echo "
"; echo "
"; echo $row['birthday

asked Mar 14, 2015 at 18:43

Hướng dẫn php code for print bill - code php in hóa đơn

5

See the fiddle

Use







This is not printed
"; // your code.... echo "
"; } ?> Click to print 2 in javascript to print the complete webpage

Read more about it here

answered Mar 14, 2015 at 18:47

Hướng dẫn php code for print bill - code php in hóa đơn

Print only the elements with the







This is not printed
"; // your code.... echo "
"; } ?> Click to print 3 class







This is not printed
"; // your code.... echo "
"; } ?> Click to print

side note:

  1. 
    
    
    
    
    
    
    This is not printed
    "; // your code.... echo "
"; } ?> Click to print 4* is deprecated, use






This is not printed
"; // your code.... echo "
"; } ?> Click to print 5 or






This is not printed
"; // your code.... echo "
"; } ?> Click to print 6
  • your html table is wrong, use
    
    
    
    
    
    
    
    This is not printed
    "; // your code.... echo "
  • "; } ?> Click to print 7 structure

    answered Mar 14, 2015 at 18:55

    Simone NigroSimone Nigro

    4,4952 gold badges31 silver badges69 bronze badges

    You can't output directly to the printer. Instead you should call a javascript function that opens a printer dialog and sends the html page to the printer. Add the following code to your page and you should be good to go.

    Click to Print This Page
    

    You can also add the javascript code to the onload method in the body tag so the dialog shows up when the page loads.

    answered Mar 14, 2015 at 18:49

    Marc WitteveenMarc Witteveen

    7431 gold badge10 silver badges25 bronze badges

    Simple Invoice Management Panel

    Hướng dẫn php code for print bill - code php in hóa đơn

    The Simple Invoice generator System in PHP project is developed using Simple PHP language. The Project is based on the concept of calculating the total bill and generating the invoice of the customer. Talking about the project, it contains less but important features. A user can select any category, CRUD items before calculating the bill. The design of this is so simple that the user won’t find

    • Read more about Simple Invoice Management Panel
    • Add new comment
    • 7408 views

    in this post, We will explain how to create your own invoice system with PHP &

    I am extending my previous tutorials. I’ll add an invoice management system.

    What’s Invoice Management Systems

    Because the majority of transactions are now done online, invoice or billing management systems are increasingly popular. Every vendor and buyer now requires an invoicing system to manage online billing.

    in this article, we’ll cover following functionalities:

    • Create a new Invoice
    • Edit a Invoice
    • Listing invoice
    • Print Invoice

    Create Billing Management Systems

    We’ll create an invoice module in the admin folder.

    Let’s create the above blank files: