Пример #1
0
	public function ajaxdisplayAction()
	{
		$this->_helper->layout()->disableLayout();
		$cppId = $this->_getParam('id',0);
		if($cppId >0)
		{
			$projectId = $this->_getProjectId();
			$cpps = new Pment_Models_CppMapper();
			$cpp = new Pment_Models_Cpp();
			$cpps->find($cppId,$cpp);
			$this->view->cpp = $cpp;
			}
			else
			{
				$this->_redirect('/pment/cpp');
				}
		}
Пример #2
0
	protected function pagePmentCppAjaxDisplay($pdf,$page,$font)
	{
		//put the personal information to the pdf
		$cpps = new Pment_Models_CppMapper();
		$cppId = $this->_getParam('id',0);
		$cpp = new Pment_Models_Cpp();
		$cpps->find($cppId,$cpp);
		$x = 50; $y = 750;
		$currentpage = 1;
		$pageNumber = 1;
		$page->setLineWidth(0.5);
		$page->drawLine(50, 770, 560, 770);
		$page->drawLine(50, 125, 560, 125);
		$page->setFont($font,13)
				->drawText("员工姓名:", $x, $y-=20, 'UTF-8')
				->drawText($cpp->getContactName(), $x+150, $y, 'UTF-8')

				->drawText("岗位名称:", $x, $y-=20, 'UTF-8')
				->drawText($cpp->getPostName(), $x+150, $y, 'UTF-8')

				->drawText("职业资格:", $x, $y-=20, 'UTF-8')
				->drawText($cpp->getQualif(), $x+150, $y, 'UTF-8')

				->drawText("证书编号:", $x, $y-=20, 'UTF-8')
				->drawText($cpp->getCertId(), $x+150, $y, 'UTF-8')

				->drawText("开始承担责任时间:", $x, $y-=20, 'UTF-8')
				->drawText($cpp->getStartDate(), $x+150, $y, 'UTF-8')

				->drawText("岗位职责:", $x, $y-=20, 'UTF-8')
				->drawText($cpp->getPostDetail(), $x+150, $y, 'UTF-8')

				->drawText("具体职责:", $x, $y-=20, 'UTF-8')
				->drawText($cpp->getResponsi(), $x+150, $y, 'UTF-8')
				
				->drawText("备注:", $x, $y-=20, 'UTF-8')
				->drawText($cpp->getRemark(), $x+150, $y, 'UTF-8')

				->drawText("上次修改时间:", $x, $y-=20, 'UTF-8')
				->drawText($cpp->getCTime(), $x+150, $y, 'UTF-8');
		$time = Date("Y-m-d,H:i");
		$users = new System_Models_UserMapper();
		$contactId = $users->getContactId($this->getUserId());
		$contacts = new Employee_Models_ContactMapper();
		$contactName = $contacts->findContactName($contactId);
		$page->setFont($font,11)
				->drawText("工程岗位信息总览", 250, 790, 'UTF-8')
				->drawText("导出人:".$contactName, 50, 100, 'UTF-8')
				->drawText("导出日期:".$time, 250, 100, 'UTF-8')
				->drawText("页数:".$currentpage."(".$pageNumber.")", 500, 100, 'UTF-8');
		$pdf->pages[] = $page;
		$name_string = "工程岗位信息总览".time().".pdf";
		$name_stringEn = urlencode("工程岗位信息总览".time()).".pdf";
		$url = 'tmp/'.$name_string;
		$urlEn='tmp/'.$name_stringEn;
		$pdf->save($url);
		return $urlEn;
	}