westdc-zf1/application/models/ApplicantPDF.php

45 lines
1.5 KiB
PHP
Raw Normal View History

2009-03-06 03:20:46 +00:00
<?php
//生成西部数据中心离线申请表
require_once('fpdf/chinese-unicode.php');
require_once('fpdi/fpdi.php');
class ApplicantPDF extends FPDI
{
public $template;//模板文件的路径
public $data;//包含具体的数据,数组
public $fontsize=10;
function drawWestdc()
{
$pagecount = $this->setSourceFile($this->template);
$tplidx = $this->importPage(1, '/MediaBox');
$this->addPage();
$this->useTemplate($tplidx);
$this->AddUniGBhwFont('ugb','AdobeSongStd-Light-Acro');
$this->SetFont('ugb','',$this->fontsize);
2009-07-17 09:30:48 +00:00
$this->setXY(45,77);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$this->data['realname']);
2009-07-17 09:10:34 +00:00
$this->SetXY(34,87);
2009-03-06 03:20:46 +00:00
$this->MultiCell (0, 4, str_replace(";","\n",$this->data['datalist']));
2009-07-17 09:28:16 +00:00
$this->setXY(34,130);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,trim($this->data['project']));
2009-07-17 09:28:16 +00:00
$this->setXY(34,251);
2009-07-17 09:10:34 +00:00
$this->Write($this->fontsize,$this->data['realname']);
$this->setXY(34,258);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$this->data['unit']);
2009-07-17 09:10:34 +00:00
$this->setXY(100,258);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$this->data['address']);
2009-07-17 09:10:34 +00:00
$this->setXY(164,258);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$this->data['postcode']);
2009-07-17 09:28:16 +00:00
$this->setXY(34,264);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$this->data['email']);
2009-07-17 09:28:16 +00:00
$this->setXY(100,264);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$this->data['phone']);
$t=getdate();
2009-07-17 09:30:48 +00:00
$this->setXY(159,264);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$t['year']);
2009-07-17 09:30:48 +00:00
$this->setXY(171,264);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$t['mon']);
2009-07-17 09:30:48 +00:00
$this->setXY(180,264);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$t['mday']);
}
}
?>