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');
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);
$tplidx = $this->importPage(1, '/MediaBox');
$this->addPage();
$this->useTemplate($tplidx);
$this->AddUniGBhwFont('ugb','AdobeSongStd-Light-Acro');
$this->SetFont('ugb','',$this->fontsize);
2010-05-24 13:48:46 +00:00
$this->setXY(45,62);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$this->data['realname']);
2010-05-24 13:48:46 +00:00
$this->SetXY(34,72);
$this->MultiCell (166, 4, str_replace(";","\n",$this->data['datalist']));
2010-05-24 13:48:46 +00:00
$this->setXY(30,110);
$this->MultiCell(166,4,trim($this->data['project']));
//$this->setXY(34,239);
//$this->Write($this->fontsize,$this->data['realname']);
2010-05-24 13:48:46 +00:00
$this->setXY(34,245);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$this->data['unit']);
2010-05-24 13:48:46 +00:00
$this->setXY(100,245);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$this->data['address']);
2010-05-24 13:48:46 +00:00
$this->setXY(164,245);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$this->data['postcode']);
2010-05-24 13:48:46 +00:00
$this->setXY(34,251);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$this->data['email']);
2010-05-24 13:48:46 +00:00
$this->setXY(100,251);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$this->data['phone']);
$t=getdate();
2010-05-24 13:48:46 +00:00
$this->setXY(163,251);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$t['year']);
2010-05-24 13:48:46 +00:00
$this->setXY(175,251);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$t['mon']);
2010-05-24 13:48:46 +00:00
$this->setXY(184,251);
2009-03-06 03:20:46 +00:00
$this->Write($this->fontsize,$t['mday']);
}
}
?>