【发布时间】:2015-03-16 04:45:49
【问题描述】:
我需要在每个 pdf 打印输出后通过递增来显示收据编号,我正在使用 fpdf 创建收据,我想计算第一页的收据编号,第二页 2 等等。
我可以为此使用会话吗?
感谢任何帮助。
这是我的 pdf 代码:
<?php
if(!empty($_POST['register']))
{
$calender=$_POST['datum1'];
$time=$_POST['timepicker_6'];
$respected=$_POST['first_name'];
$month=$_POST['second_name'];
$year=$_POST['third_name'];
$fees=$_POST['fourth_name'];
$amount=$_POST['fifth_name'];
require("fpdf/fpdf.php");
$pdf=new FPDF();
$pdf->Addpage();
// Logo
$pdf->Image('33990.jpg',10,2,30);
$pdf->SetFont("Arial","B",20);
$pdf->cell(0,10,"Madirasheri Mahal Jamath ",0,1,'C');
$pdf->SetFont("Arial","B",18);
$pdf->cell(0,10,"P.O Thrikanapuram-679573,register number:529/98 ",0,1,'C');
$pdf->SetFont("Arial","B",18);
$pdf->Cell(0,10,"Receipt number:",0,0,'C');
$pdf->SetFont("Arial","B",18);
$pdf->cell(0,10,"Date:{$calender} ",0,1,'R');
$pdf->cell(0,10,"Time:{$time}",0,1,'R');
$pdf->cell(0,30,"We have received sum of Rs {$fees},for the month of ",0,1);
$pdf->cell(0,-15,"{$month},{$year} From Mr/Mrs {$respected}.",0,1);
$pdf->cell(0,60,"Amount :{$amount} ",0,1);
$pdf->cell(0,20,"Secretory: ........... ",0,1,'R');
$pdf->output();
}
?>
我正在使用 fpdf:http://www.fpdf.org
【问题讨论】: