如何在输出中添加限制,以便页脚不会转到下一页?
class myPDF extends FPDF{
function header(){
$dates = new DateTime();
$date2 = $dates->format('Y');
$date=$_POST['month'];
$this->SetFont('Arial','B',14);
$this->Cell(189,5,'ABSTRACT OF COMMUNITY TAX CERTIFICATES',0,0,'C');
$this->Ln();
$this->SetFont('Times','',13);
$this->Cell(189,10,'For the month of '.$date.' '.$date2,0,0,'C');
$this->Ln(20);
}
function headerTable(){
$this->SetTextColor(136,0,0);
$this->SetFont('Times','B',10);
$this->Cell(30,8,'Date',1,0,'C');
$this->Cell(30,8,'CTC No.',1,0,'C');
$this->Cell(60,8,'Name',1,0,'C');
$this->Cell(23,8,'Individual',1,0,'C');
$this->Cell(23,8,'Corporation',1,0,'C');
$this->Cell(24,8,'Total',1,0,'C');
$this->Ln();
}
function viewTable($db){
$this->SetTextColor(0,0,0);
$this->SetFont('Times','',10);
$name = $_SESSION['name'];
$repnumber=$_POST['id'];
$stmt = $db->query("select * from tblctcab where cedrepnum='$repnumber' and username='$name' order by repdate asc");
$count=0;
while($data = $stmt->fetch(PDO::FETCH_OBJ)){
$this->Cell(30,8,$data->repdate,1,0,'C');
$this->Cell(30,8,$data->ctcnumber,1,0,'C');
$this->Cell(60,8,$data->cedlname.', '.$data->cedfname,1,0,'C');
$this->Cell(23,8,$data->totalampa,1,0,'C');
$this->Cell(23,8,'',1,0,'C');
$this->Cell(24,8,$data->totalampa,1,0,'C');
$this->Ln();
}
$stmts = $db->query("select * from tblctcc where cedrepn='$repnumber' and username='$name' order by rpdate asc");
$count=0;
while($dat = $stmts->fetch(PDO::FETCH_OBJ)){
$this->Cell(30,8,$dat->rpdate,1,0,'C');
$this->Cell(30,8,$dat->ctcnum,1,0,'C');
$this->Cell(60,8,$dat->comfname,1,0,'C');
$this->Cell(23,8,'',1,0,'C');
$this->Cell(23,8,$dat->totalampas,1,0,'C');
$this->Cell(24,8,$dat->totalampas,1,0,'C');
$this->Ln();
}
$dbs=new mysqli('localhost' , 'root' , '', 'tres');
$repdate=$_POST['id'];
$ctcab = $dbs->query("select sum(totalampa) as totalampa from tblctcab where cedrepnum='$repnumber' and username='$name'");
$data = $ctcab->fetch_assoc();
$totalab = $data['totalampa'];
$ctcc = $dbs->query("select sum(totalampas) as totalampas from tblctcc where cedrepn='$repnumber' and username='$name'");
$datac = $ctcc->fetch_assoc();
$totalcc = $datac['totalampas'];
$overall = $totalab + $totalcc;
$this->SetTextColor(136,0,0);
$this->SetFont('Times','B',10);
$this->Cell(120,8,$_POST['id'],1,0,'C');
//$this->Cell(55,8,'TOTAL',1,0,'C');
$this->Cell(23,8,number_format($totalab),1,0,'C');
$this->Cell(23,8,number_format($totalcc),1,0,'C');
$this->Cell(24,8,number_format($totalab),1,0,'C');
$this->Ln();
$this->SetTextColor(0,0,0);
$this->SetFont('Times','',10);
$this->Cell(95,8,'',0,0,'C');
$this->Cell(95,8,'',0,0,'C');
$this->Ln();
$this->Cell(95,5,'Prepared By:',0,0,'L');
$this->Cell(95,5,' Certified By:',0,0,'L');
$this->Ln();
$this->SetFont('Times','',10);
$this->Cell(95,5,$_SESSION['name'],0,0,'C');
$this->Cell(95,5,'CONNIE',0,0,'C');
$this->Ln();
$this->Cell(95,5,$_SESSION['position'],0,0,'C');
$this->Cell(95,5,'Treasurer',0,0,'C');
$this->Ln();
}
function footer(){
$this->SetY(-15);
$this->SetFont('Arial','',8);
$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'R');
}
}
$pdf = new myPDF();
$pdf->AliasNbPages();
$pdf->AddPage('','A4',0);
$pdf->headerTable();
$pdf->viewTable($db);
$pdf->Output();