Search the web
Sign In
New User? Sign Up
phpKeralaUg · PHP Users Group : Kerala
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Help for Printing-Bill   Message List  
Reply | Forward Message #382 of 409 |
Re: [phpKerala] Help for Printing-Bill

Hi,
Did you try window.print() (javascript) ?
 
You can redirect page with javascript itself.
 
Check this link for more details:
http://www.tizag.com/javascriptT/javascriptprint.php
 
Best Regards
Praveen

--- On Wed, 15/4/09, raji skariah <raji_ska@...> wrote:


From: raji skariah <raji_ska@...>
Subject: [phpKerala] Help for Printing-Bill
To: bang-phpug@yahoogroups.com, php4india@yahoogroups.com,
phpKeralaUg@yahoogroups.com
Date: Wednesday, 15 April, 2009, 4:58 PM








HI
Dear PHP Friends...,     Please ..help me....
I need to enter some details in a form and when I click on the 'Save & Print'
Button, need
to print the details to a small type printer (which is usually used in shops for
billing)
ie, A bill to the customer. and then again back to  the billing data entry
screen.

I just made an html form with the details from 'screen' to print from the
browsers- 'File -> Print'

But here I need to goback to the 'billing data entry' screen again with some
link.
Is there any other method to do the print from the button click from the
'billing data entry
screen' itself? without redirecting?
If so.. how? please help me..

The PHP code I made is like this..

<?php @include 'class/session. php';
    include 'class/connection. php';
    if(!$_SESSION[ 'ADMIN']) {
     header('location: index.php');
     exit;
 }
 ob_start();
 if($_REQUEST[ 'act']==" add") {
    $txt_Tokenno        =    $_REQUEST['txt_ Tokenno'] ;
    $txtDate                =    $_REQUEST['txtDate' ];
    $txtCustName         =    $_REQUEST['txtCustN ame'];
    $txtCustAdd                =    $_REQUEST['txtCustA dd'];
    $txtContactNo                =    $_REQUEST['txtConta ctNo'];
    $txtHandsetModel            =    $_REQUEST['txtHands etModel'] ;
    $txtHandsetIMEI                =    $_REQUEST['txtHands etIMEI'];
    $menu1                    =    $_REQUEST['menu1' ];
        $txtProblem                =    $_REQUEST['txtProbl em'];
    $txtObservation                =    $_REQUEST['txtObser vation'];
 
 $txt_Tokenno                =    htmlentities( $txt_Tokenno, ENT_QUOTES) ;   
     
 $txtCustName                =    htmlentities( $txtCustName, ENT_QUOTES) ;   
     
 $txtCustAdd                =    htmlentities( $txtCustAdd, ENT_QUOTES) ;
 $txtContactNo                =    htmlentities( $txtContactNo, ENT_QUOTES) ;   
     
 $txtHandsetModel            =    htmlentities( $txtHandsetModel ,ENT_QUOTES) ;
 $txtHandsetIMEI            =    htmlentities( $txtHandsetIMEI, ENT_QUOTES) ;   
   

 
 $menu1                    =    htmlentities( $menu1,ENT_ QUOTES);
 $txtProblem                =    htmlentities( $txtProblem, ENT_QUOTES) ;       
 
 $txtObservation            =    htmlentities( $txtObservation, ENT_QUOTES) ;
 
 list($vpath, $vpath1,$ vpath2)=split( "-",$txtDate) ;
                        $y_year=$vpath;
                        $m_month=$vpath1;
                        $d_day=$vpath2;
                        list($vpath3) =split("0000" ,$vpath2) ;
                        $d_day=$vpath3;
                        $txtDate=$vpath3. "/".$vpath1. "/".$vpath;
       
 $insert_sql = "INSERT INTO....
.
.
.
 mysql_query( $insert_sql) or die(mysql_error( ));
 }
?>

<html>
<head><title> PRINT TOKEN</title>
<style type="text/css" >
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
     }
body,td,th
     {
    font-family: Courier New, Courier, mono;
    font-size: 14px;
      }
.style2 {font-size: 14px}
.style3 {font-size: 12px}
.superscript
{
vertical-align: super;
font-size:12px;
}
.style12
 {
    font-size: 20px;
    font-family: "Courier New", Courier, mono;
}
.style15 {font-size: 10px; font-family: "Courier New", Courier, mono; }
</style>

<meta http-equiv=" Content-Type" content="text/ html; charset=iso- 8859-1"><
/head>

         
<body onLoad="document. execCommand( 'SaveAs', true,'Print_ Token.html' );return
false;">
<br>
<table  width="308" border=0 align="center" cellpadding= 0 cellspacing= 0

bordercolor= "#000000" >
<tr width="308"> <td align="center" class="style16" ><strong> Token Details 
</strong> </td>

</tr>
<tr width="308"> <td>&nbsp; </td></tr>
<tr><td>
    <table align="center" width="308">
    <tr width="308">
      <td align="left" width="98" class="style15" >Token No</td> <td

width="10">: </td><td  width="200" align="left" class="style15" > <?php echo

$_POST['txt_ Tokenno'] -1; ?></td>
    </tr>
    <tr>
      <td align="left" class="style15" >Date</td> <td>:</td><td align="left"

class="style15" > <?php echo $_POST['txtDate' ]; ?></td>
    </tr>
    <tr>
      <td align="left" class="style15" >Customer Name</td> <td>:</td><td
align="left"

class="style15" > <?php echo $_POST['txtCustName ']; ?></td>
    </tr>
    <tr>
      <td align="left" class="style15" >Customer Address</td> <td>:</td><td
align="left"

class="style15" > <?php echo $_POST['txtCustAdd' ]; ?></td>
    </tr>
    <tr>
      <td align="left" class="style15" >Contact Number</td> <td>:</td><td
align="left"

class="style15" > <?php echo $_POST['txtContactN o']; ?></td>
    </tr>
    <tr>
      <td align="left" class="style15" >Handset Model</td> <td>:</td><td
align="left"

class="style15" > <?php echo $_POST['txtHandsetM odel']; ?></td>
    </tr>
    <tr>
      <td align="left" class="style15" >Handset IMEI/ESI</td> <td>:</td><td
align="left"

class="style15" > <?php echo $_POST['txtHandsetI MEI']; ?></td>
    </tr>
    <tr>
      <td align="left" class="style15" >Warranty Status</td> <td>:</td><td
align="left"

class="style15" ><?php echo $_POST['menu1' ]; ?></td>
    </tr>
    <tr>
      <td align="left" class="style15" >Problem Report</td> <td>:</td><td
align="left"

class="style15" > <?php echo $_POST['txtProblem' ]; ?></td>
    </tr>
    <tr><td align="left" class="style15" >Observation< /td> <td>:</td><td
align="left"

class="style15" ><?php echo $_POST['txtObservat ion']; ?></td>
    </tr>
    <tr width="308"> <td colspan="3"> &nbsp;</td> </tr>
    <tr><td colspan="3" align="center" ><input type="button" name="Submit34"
value="Thank

You" class="bigButton" onClick="window. location. href='giveToken. php';return
false"></td>
    </tr>
    </table>
    </td></tr>
    </table></body> </html>

Thanks in advance.....

[Non-text portions of this message have been removed]
















[Non-text portions of this message have been removed]




Wed Apr 15, 2009 11:45 am

ninethsense
Offline Offline
Send Email Send Email

Forward
Message #382 of 409 |
Expand Messages Author Sort by Date

HI Dear PHP Friends...,     Please ..help me.... I need to enter some details in a form and when I click on the 'Save & Print' Button, need to print the...
raji skariah
raji_ska
Offline Send Email
Apr 15, 2009
11:29 am

Hi, Did you try window.print() (javascript) ?   You can redirect page with javascript itself.   Check this link for more details:...
Praveen V
ninethsense
Offline Send Email
Apr 15, 2009
11:45 am

Create a text file using fopen in your server folder and use fprintf function to add the text entry on the text file as the format of the bill. Once the text...
Udayakumar Sarangapani
udayakumar.sarangapan...
Send Email
Apr 20, 2009
11:17 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help