/    Sign up×
Community /Pin to ProfileBookmark

How to get the date on to a page

?
Dear all,

I want to get the Date for this page before the Epf No.

Given below are the codes.

<?php
require(“C:wampwwwfpdffpdf153fpdf.php”);
//echo date (“F j,Y”);
$ID=$_GET[‘ID’];
$dbhost=’localhost’;
$dbuser=’root’;
$dbpass=”;
$dbname=’metrosite’;
$epf=$_
GET[‘epf’];
$db = mysql_connect(“localhost”, “root”,””) or die(mysql_error());
mysql_select_db(“metrosite”,$db) or die(“db problem”) ;
$sql = “SELECT e.Emp_No as epf,e.First_Name,e.Last_Name,e.Grade,e.Designation ,appraiser.Increment FROM emp e,appraiser where e.Emp_No=’$epf’ and e.Emp_No=appraiser.Mem_Epf_No”;
$result=mysql_query($sql) or die(mysql_error());
$row=mysql_fetch_array($result);
//echo(“hello”.$row[‘epf’]);
//echo($sql);

$pdf=new FPDF(“P”,”in”);
$pdf->AddPage();
$pdf->setFont(‘Times’,’B’,12);
//$pdf->pdf_show($pdf,’ ‘.date(“F j,Y”));

$pdf->Text(1.0,1.0,”Epf no: “.$row[‘epf’]);
$pdf->setFont(‘Helvetica’,”,12);
$y=1.5;
//$pdf->Text(1.0,$y,”Name:”);
//$pdf->Text(2.0,$y,$row[‘First_Name’].” “.$row[‘Last_Name’]);
$pdf->Text(1.0,1.5,$row[‘First_Name’].” “.$row[‘Last_Name’].” “.’,’);
$y+=.25;
//$pdf->Text(1.0,$y,”Designation: “.$row[‘Des’]);
$pdf->Text(1.0,$y,$row[‘Designation’].” “.’,’);
//$pdf->Text(2.0,$y,”66012334″);
$y+=.25;
$pdf->Text(1.0,$y,”Grade: “);
$pdf->Text(1.5,$y,$row[‘Grade’].” “.’.’);
$pdf->setFont(‘Helvetica’,’BU’,12);
$pdf->Text(3,2.5,”Increment Notification “);
$pdf->setFont(‘Helvetica’,”,12);
if($row[‘Increment’]==0)
{
$pdf->Text(1,3,”There is no increment for this year, Try and mprove your weaker aeras for the coming year.”);
}
else
$pdf->Text(1,3,”Your increment for this year is Rs.”.$row[‘Increment’].” /=, Please extend your valuable support and coopration this year too.”);
$pdf->Text(1,3.5,”Wish you all the best”.” “.’.’);
$pdf->Text(1,4,”Thank You”.” “.’,’);
$pdf->Text(1,4.2,”HR Manager”.” “.’.’);
$pdf->Output();
?>

Can any one help me, I am using fpdf.

Regards,
wasantha

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@stephan_gerlachMay 09.2007 — try this one
[code=php]

<?php
require("C:wampwwwfpdffpdf153fpdf.php");
//echo date ("F j,Y");
$ID=$_GET['ID'];
$dbhost='localhost';
$dbuser='root';
$dbpass='';
$dbname='metrosite';
$epf=$_GET['epf'];
$db = mysql_connect("localhost", "root","") or die(mysql_error());
mysql_select_db("metrosite",$db) or die("db problem") ;
$sql = "SELECT e.Emp_No as epf,e.First_Name,e.Last_Name,e.Grade,e.Designation ,appraiser.Increment FROM emp e,appraiser where e.Emp_No='$epf' and e.Emp_No=appraiser.Mem_Epf_No";
$result=mysql_query($sql) or die(mysql_error());
$row=mysql_fetch_array($result);
//echo("hello".$row['epf']);
//echo($sql);

$pdf=new FPDF("P","in");
$pdf->AddPage();
$pdf->setFont('Times','B',12);
//$pdf->pdf_show($pdf,' '.date("F j,Y"));

$pdf->Text(1.0,1.0,date('m-d-Y')." Epf no: ".$row['epf']);
$pdf->setFont('Helvetica','',12);
$y=1.5;
//$pdf->Text(1.0,$y,"Name:");
//$pdf->Text(2.0,$y,$row['First_Name']." ".$row['Last_Name']);
$pdf->Text(1.0,1.5,$row['First_Name']." ".$row['Last_Name']." ".',');
$y+=.25;
//$pdf->Text(1.0,$y,"Designation: ".$row['Des']);
$pdf->Text(1.0,$y,$row['Designation']." ".',');
//$pdf->Text(2.0,$y,"66012334");
$y+=.25;
$pdf->Text(1.0,$y,"Grade: ");
$pdf->Text(1.5,$y,$row['Grade']." ".'.');
$pdf->setFont('Helvetica','BU',12);
$pdf->Text(3,2.5,"Increment Notification ");
$pdf->setFont('Helvetica','',12);
if($row['Increment']==0)
{
$pdf->Text(1,3,"There is no increment for this year, Try and mprove your weaker aeras for the coming year.");
}
else
$pdf->Text(1,3,"Your increment for this year is Rs.".$row['Increment']." /=, Please extend your valuable support and coopration this year too.");
$pdf->Text(1,3.5,"Wish you all the best"." ".'.');
$pdf->Text(1,4,"Thank You"." ".',');
$pdf->Text(1,4.2,"HR Manager"." ".'.');
$pdf->Output();
?>

[/code]
Copy linkTweet thisAlerts:
@wasanthaauthorMay 10.2007 — ?

Dear all,

Thank you so much for your kind help.

It works well, I modified it bit for my application.


Regards,

wasantha
×

Success!

Help @wasantha spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...