westdc-zf1/application/models/ApplicantPDF.php

41 lines
1.3 KiB
PHP
Raw Normal View History

2009-03-06 03:20:46 +00:00
<?php
//生成西部数据中心离线申请表
require_once('fpdf/chinese-unicode.php');
2009-07-17 09:45:44 +00:00
require_once('fpdi/fpdi.php');
2009-03-06 03:20:46 +00:00
class ApplicantPDF extends FPDI
{
public $template;//模板文件的路径
public $data;//包含具体的数据,数组
public $fontsize=10;
function drawWestdc()
{
$pagecount = $this->setSourceFile($this->template);
2011-11-22 12:46:58 +00:00
$tplidx = $this->importPage(1);
2009-03-06 03:20:46 +00:00
$this->addPage();
$this->useTemplate($tplidx);
$this->AddUniGBhwFont('ugb','AdobeSongStd-Light-Acro');
$this->SetFont('ugb','',$this->fontsize);
2011-11-22 12:46:58 +00:00
$this->setXY(71,45);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$this->data['realname']);
2011-11-22 12:46:58 +00:00
$this->SetXY(34,55);
$this->MultiCell (166, 4, str_replace(";","\n",$this->data['datalist']));
2011-11-22 12:46:58 +00:00
$this->setXY(30,100);
$this->MultiCell(166,4,trim($this->data['project']));
//$this->setXY(34,239);
//$this->Write($this->fontsize,$this->data['realname']);
2011-11-22 12:46:58 +00:00
$this->setXY(32,225);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$this->data['unit']);
2011-11-22 12:46:58 +00:00
$this->setXY(112,225);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$this->data['email']);
2011-11-22 12:46:58 +00:00
$this->setXY(174,225);
$this->Write($this->fontsize,$this->data['postcode']);
$this->setXY(32,231);
$this->Write($this->fontsize,$this->data['address']);
$this->setXY(112,231);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$this->data['phone']);
2011-11-22 12:46:58 +00:00
$t=date("Y-m-d");
$this->setXY(174,231);
$this->Write($this->fontsize,$t);
2009-03-06 03:20:46 +00:00
}
}
?>