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...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

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 #381 of 409 |
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['txtCustName'];
    $txtCustAdd                =    $_REQUEST['txtCustAdd'];
    $txtContactNo                =    $_REQUEST['txtContactNo'];
    $txtHandsetModel            =    $_REQUEST['txtHandsetModel'];
    $txtHandsetIMEI                =    $_REQUEST['txtHandsetIMEI'];
    $menu1                    =    $_REQUEST['menu1'];
        $txtProblem                =    $_REQUEST['txtProblem'];
    $txtObservation                =    $_REQUEST['txtObservation'];
 
 $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['txtContactNo']; ?></td>
    </tr>
    <tr>
      <td align="left" class="style15" >Handset Model</td> <td>:</td><td
align="left"

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

class="style15"> <?php echo $_POST['txtHandsetIMEI']; ?></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['txtObservation']; ?></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]




Wed Apr 15, 2009 11:28 am

raji_ska
Offline Offline
Send Email Send Email

Forward
Message #381 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