Esempio n. 1
0
	public function indexAction()
	{
		$errorMsg = null;
		$loginForm = new Admin_Form_Login();
		$logins = new Admin_Models_LoginMapper();
		$loginForm = $logins->formValidator($loginForm);
		$request = $this->getRequest();
		if ($request->isPost()) {
			if ($loginForm->isValid($request->getPost())) {
				if ($this->_process($loginForm->getValues())) {
					// We're authenticated! Redirect to the home page
					$value = $loginForm->getValues();
					$userName = $value['username'];
					$users = new System_Models_UserMapper();
					$userId = $users->getUserId($userName);
					$userNamespace = new Zend_Session_Namespace('userNamespace');
					$userNamespace->userId = $userId;
					// add user to online list
					$onlines = new System_Models_OnlineMapper();
					$onlines->save($userId);
					$onlines->updateOnlineUsers();
					// add user to ulog list
					$ulogs = new System_Models_UlogMapper();
					$ulogs->save($userId,'登陆');
					$this->_redirect('/');
				}
				else
				{
					$errorMsg = General_Models_Text::$text_loginFailed;
					}
			}
		}
		$this->view->errorMsg = $errorMsg;
		$this->view->loginForm = $loginForm;
	}
	protected function getGroupId()
	{
		$userId = $this->getUserId();
		$users = new System_Models_UserMapper();
		$groupId = $users->getGroupId($userId);
		return $groupId;
	}
Esempio n. 3
0
	public function checkAuth($userId,$modName)
	{
		$users = new System_Models_UserMapper();
		$groupId = $users->getGroupId($userId);
		$mns = new System_Models_ModnameMapper();
		$modId = $mns->getModId($modName);
		
		$result = $this->getDbtable()->checkAuth($groupId,$modId);
		
		$auth = $result['modPriv'];
		return $auth;
	}
	public function find($id,System_Models_Improvement $improvement)
	{
		$resultSet = $this->getDbTable()->find($id);

		if (0 == count($resultSet)) {

			return;
		}

		$row = $resultSet->current();

		$improvement->setId($row->imprId)
				->setTypeId($row->typeId)
				->setUserId($row->userId)
				->setPriority($row->priority)
				->setDescription($row->description)
				->setITime($row->iTime)
				->setModId($row->modId)
				->setStatus($row->status);
		$status = $improvement->getStatus();
		if($status == 0)
		{
			$improvement->setStatusCh('等待处理');
			}
			elseif($status == 1)
			{
				$improvement->setStatusCh('处理中');
			}
			elseif($status == 2)
			{
				$improvement->setStatusCh('已解决');
				}
			elseif($status == 3)
			{
				$improvement->setStatusCh('暂时不能解决');
				}
		$users = new System_Models_UserMapper();
		$contactId = $users->getContactId($improvement->getUserId());
		$contacts = new Employee_Models_ContactMapper();
		$contactName = $contacts->findContactName($contactId);
		$modnames = new System_Models_ModnameMapper();
		$modNameCh = $modnames->getModNameCh($improvement->getModId());
		$imptypes = new System_Models_ImptypeMapper();
		$typeName = $imptypes->getTypeName($improvement->getTypeId());
		
		$improvement->setContactId($contactId);
		$improvement->setContactName($contactName);
		$improvement->setTypeName($typeName);
		$improvement->setModNameCh($modNameCh);
	}
Esempio n. 5
0
	public function indexAction()
	{
		$userId = $this->getUserId();
		$editForm = new System_Forms_UserEdit();
		$users = new System_Models_UserMapper();
		$user = new System_Models_User();
		$users->find($userId,$user);
		$editForm->submit->setLabel('修改密码');
		$errorMsg = null;
		$ugs = new System_Models_UsergroupMapper();
		$editForm = $users->formValidatorEdit($editForm);
			
		if($this->getRequest()->isPost())
		{
			$formData = $this->getRequest()->getPost();
			if($editForm->isValid($formData))
			{
				$array = $users->dataValidatorEdit($formData,$userId);
				$trigger = $array['trigger'];
				$errorMsg = $array['errorMsg'];
				if($trigger == 0)
				{
					$salt = md5(General_Models_GenRandomString::genRandomString(8));
					$password = sha1($formData['password'].$salt);
					$user->setPassword($password);
					$user->setSalt($salt);
					$users->save($user);
					$this->_redirect('/admin/login/logout');
					}
					else
					{
						$editForm->populate($formData);
						}
				}
				else
				{
					$editForm->populate($formData);
					}
		}
		$this->view->user = $user;
		$this->view->errorMsg = $errorMsg;
		$this->view->editForm = $editForm;
	}
Esempio n. 6
0
	protected function pagePmentPlogDisplay($pdf,$page,$font)
	{
		//put the personal information to the pdf
		$plogs = new Pment_Models_PlogMapper();
		$plogId = $this->_getParam('id',0);
		$plog = new Pment_Models_Plog();
		$plogs->find($plogId,$plog);
		$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($plog->getLogDate(), $x+150, $y, 'UTF-8')

				->drawText("天气(上午):", $x, $y-=20, 'UTF-8')
				->drawText($plog->getWeatherAm(), $x+150, $y, 'UTF-8')

				->drawText("天气(下午):", $x, $y-=20, 'UTF-8')
				->drawText($plog->getWeatherPm(), $x+150, $y, 'UTF-8')

				->drawText("最高温度(摄氏度):", $x, $y-=20, 'UTF-8')
				->drawText($plog->getTempHi(), $x+150, $y, 'UTF-8')

				->drawText("最低温度(摄氏度):", $x, $y-=20, 'UTF-8')
				->drawText($plog->getTempLo(), $x+150, $y, 'UTF-8')

				->drawText("施工部位:", $x, $y-=20, 'UTF-8')
				->drawText($plog->getPart(), $x+150, $y, 'UTF-8')

				->drawText("施工人数:", $x, $y-=20, 'UTF-8')
				->drawText($plog->getNumber(), $x+150, $y, 'UTF-8')

				->drawText("负责操作人:", $x, $y-=20, 'UTF-8')
				->drawText($plog->getOperator(), $x+150, $y, 'UTF-8')
				
				->drawText("责任工长:", $x, $y-=20, 'UTF-8')
				->drawText($plog->getForeman(), $x+150, $y, 'UTF-8')

				->drawText("安全情况:", $x, $y-=20, 'UTF-8')
				->drawText($plog->getSafety(), $x+150, $y, 'UTF-8')

				->drawText("存在问题:", $x, $y-=20, 'UTF-8')
				->drawText($plog->getProblem(), $x+150, $y, 'UTF-8')

				->drawText("解决问题:", $x, $y-=20, 'UTF-8')
				->drawText($plog->getResolve(), $x+150, $y, 'UTF-8')

				->drawText("往来文件:", $x, $y-=20, 'UTF-8')
				->drawText($plog->getRelatedFile(), $x+150, $y, 'UTF-8')

				->drawText("变更签证:", $x, $y-=20, 'UTF-8')
				->drawText($plog->getPart(), $x+150, $y, 'UTF-8')

				->drawText("材料设备情况:", $x, $y-=20, 'UTF-8')
				->drawText($plog->getMaterial(), $x+150, $y, 'UTF-8')

				->drawText("填报人:", $x, $y-=20, 'UTF-8')
				->drawText($plog->getContactName(), $x+150, $y, 'UTF-8')
				
				->drawText("备注:", $x, $y-=20, 'UTF-8')
				->drawText($plog->getRemark(), $x+150, $y, 'UTF-8')

				->drawText("创建时间:", $x, $y-=20, 'UTF-8')
				->drawText($plog->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;
	}
	public function editAction()
	{
		$errorMsg = null;
		$editForm = new Pment_Forms_MeasureSave();
		$measures = new Pment_Models_MeasureMapper();
		$editForm->submit->setLabel('保存修改');
		$editForm->submit2->setAttrib('class','hide');
		$meaId = $this->_getParam('id',0);
		$projectId =$this->_getProjectId();
		$editForm = $measures->formValidator($editForm,1);

		if($this->getRequest()->isPost())
		{
			$formData = $this->getRequest()->getPost();
			if($editForm->isValid($formData))
			{
				$array = $measures->dataValidator($formData,1);
				$trigger = $array['trigger'];
				$errorMsg = $array['errorMsg'];
				if($trigger == 0)
				{
					$userId = $this->_getUserId();
					$users = new System_Models_UserMapper();
					$contactId = $users->getContactId($userId); 
					$measure = new Pment_Models_Measure();
					$measure->setMeaId($meaId);
					$measure->setProjectId($projectId);
					$measure->setMeaDate($editForm->getValue('meaDate'));
					$measure->setProblem($editForm->getValue('problem'));
					$measure->setMeasure($editForm->getValue('measure'));
					$measure->setContactId($contactId);
					$measure->setRemark($editForm->getValue('remark'));
					$measures->save($measure); 
					$this->_helper->flashMessenger->addMessage('对安全措施信息的修改成功。');
					$this->_redirect('/pment/measure');
					}
					else
					{
						$editForm->populate($formData);
						}
				}
				else
				{
					$editForm->populate($formData);
					}
			}
			else
			{
				if($meaId >0)
				{
					$arrayMeasure = $measures->findarrayMeasure($meaId);
					$editForm->populate($arrayMeasure);
					}
					else
					{
						$this->_redirect('/pment/measure');
						}
				}
		$this->view->errorMsg = $errorMsg;
		$this->view->editForm = $editForm;
		$this->view->id = $meaId; 
	}
Esempio n. 8
0
	public function userIdToContactId($userId)
	{
		$users = new System_Models_UserMapper();
		$contactId = $users->getContactId($userId);
		return $contactId;
		}
Esempio n. 9
0
	public function ajaxdeleteAction()
	{
		$this->_helper->layout()->disableLayout();
		$this->_helper->viewRenderer->setNoRender(true);

		$id = $this->_getParam('id',0);
		if($id > 0)
		{
			$users = new System_Models_UserMapper();
			try{
				$users->delete($id);
				echo "s";
			}
			catch(Exception $e)
			{
				echo "f";
			}
		}
		else
		{
			$this->_redirect('/system/user');
		}
	}
Esempio n. 10
0
	public function editAction()
	{
		$errorMsg = null;
		$editForm = new Pment_Forms_TechSave();
		$techs = new Pment_Models_TechMapper();
		$editForm->submit->setLabel('保存修改');
		$editForm->submit2->setAttrib('class','hide');
		$techId = $this->_getParam('id',0);
		$projectId =$this->_getProjectId();
		
		$editForm = $techs->formValidator($editForm,1);

		if($this->getRequest()->isPost())
		{
			$formData = $this->getRequest()->getPost();
			if($editForm->isValid($formData))
			{
				$array = $techs->dataValidator($formData,1);
				$trigger = $array['trigger'];
				$errorMsg = $array['errorMsg'];
				if($trigger == 0)
				{
					$userId = $this->_getUserId();
					$users = new System_Models_UserMapper();
					$contactId = $users->getContactId($userId); 
					$tech = new Pment_Models_Tech();
					$tech->setTechId($techId);
					$tech->setProjectId($projectId);
					$tech->setTechDate($editForm->getValue('techDate'));
					$tech->setContent($editForm->getValue('content'));
					$tech->setName($editForm->getValue('name'));
					$tech->setContactId($contactId);
					$tech->setRemark($editForm->getValue('remark'));
					$techs->save($tech); 
					$this->_helper->flashMessenger->addMessage('对技术交底信息的修改成功。');
					$this->_redirect('/pment/tech');
					}
					else
					{
						$editForm->populate($formData);
						}
				}
				else
				{
					$editForm->populate($formData);
					}
			}
			else
			{
				if($techId >0)
				{
					$arrayTech = $techs->findarrayTech($techId);
					$editForm->populate($arrayTech);
					}
					else
					{
						$this->_redirect('/pment/tech');
						}
				}
		$this->view->errorMsg = $errorMsg;
		$this->view->editForm = $editForm;
		$this->view->id = $techId; 
	}
Esempio n. 11
0
	public function editAction()
	{
		$errorMsg = null;
		$editForm = new Pment_Forms_WkprgSave();
		$wkprgs = new Pment_Models_WkprgMapper();
		$editForm->submit->setLabel('保存修改');
		$editForm->submit2->setAttrib('class','hide');
		$wkprgId = $this->_getParam('id',0);
		$projectId =$this->_getProjectId();
		$wkNum = $wkprgs->findWkNum($wkprgId);
		$tbwkNum = $editForm->getElement('wkNum');
		$tbwkNum->setValue($wkNum);
		
		$tbWkPlan = $editForm->getElement('wkPlan');
		$wkPlan = null;
		if($wkNum != 1)
		{
			$tbWkPlan->setAttrib('disabled','disabled');
			$wkPlan = $wkprgs->findWkPlan($wkNum,$projectId);
			$tbWkPlan->setValue($wkPlan);
				}
		
		$editForm = $wkprgs->formValidator($editForm,1);

		if($this->getRequest()->isPost())
		{
			$formData = $this->getRequest()->getPost();
			if($editForm->isValid($formData))
			{
				$array = $wkprgs->dataValidator($formData,1);
				$trigger = $array['trigger'];
				$errorMsg = $array['errorMsg'];
				if($trigger == 0)
				{
					$userId = $this->_getUserId();
					$users = new System_Models_UserMapper();
					$contactId = $users->getContactId($userId); 
					$wkprg = new Pment_Models_Wkprg();
					$wkprg->setWkprgId($wkprgId);
					$wkprg->setProjectId($projectId);
					$wkprg->setWkNum($wkNum);
					$wkprg->setStartDate($editForm->getValue('startDate'));
					$wkprg->setEndDate($editForm->getValue('endDate'));
					if($wkNum == 1)
					{
						$wkprg->setWkPlan($addForm->getValue('wkPlan'));
						}
						else
						{
							$wkprg->setWkPlan($wkPlan);
							}
					$wkprg->setWkAct($editForm->getValue('wkAct'));
					$wkprg->setNextPlan($editForm->getValue('nextPlan'));
					$wkprg->setProblem($editForm->getValue('problem'));
					$wkprg->setResolve($editForm->getValue('resolve'));
					$wkprg->setContactId($contactId);
					$wkprg->setRemark($editForm->getValue('remark'));
					$wkprgs->save($wkprg); 
					$this->_helper->flashMessenger->addMessage('对计划: 周'.$wkprg->getwkNum().'的修改成功。');
					$this->_redirect('/pment/wkprg');
					}
					else
					{
						$editForm->populate($formData);
						$tbWkNum = $editForm->getElement('wkNum');
						$tbWkNum->setValue($wkNum);
						if($wkNum != 1)
						{
							$wkPlan = $wkprgs->findWkPlan($wkNum,$projectId);
							$tbWkPlan->setValue($wkPlan);
							$tbWkPlan->setAttrib('disabled','disabled');
							}
						}
				}
				else
				{
					$editForm->populate($formData);
					$tbWkNum = $editForm->getElement('wkNum');
					$tbWkNum->setValue($wkNum);
					if($wkNum != 1)
						{
							$wkPlan = $wkprgs->findWkPlan($wkNum,$projectId);
							$tbWkPlan->setValue($wkPlan);
							$tbWkPlan->setAttrib('disabled','disabled');
							}
					}
			}
			else
			{
				if($wkprgId >0)
				{
					$arrayWkprg = $wkprgs->findarrayWkprg($wkprgId);
					$editForm->populate($arrayWkprg);
					}
					else
					{
						$this->_redirect('/pment/wkprg');
						}
				}
		$this->view->errorMsg = $errorMsg;
		$this->view->editForm = $editForm;
		$this->view->id = $wkprgId; 
	}
Esempio n. 12
0
	public function editAction()
	{
		$errorMsg = null;
		$editForm = new Pment_Forms_PlogSave();
		$plogs = new Pment_Models_PlogMapper();
		$editForm->submit->setLabel('保存修改');
		$editForm->submit2->setAttrib('class','hide');
		$plogId = $this->_getParam('id',0);
		$projectId =$this->_getProjectId();
		$editForm = $plogs->formValidator($editForm,1);

		if($this->getRequest()->isPost())
		{
			$formData = $this->getRequest()->getPost();
			$formData['projectId'] = $projectId;
			if($editForm->isValid($formData))
			{
				$array = $plogs->dataValidator($formData,1);
				$trigger = $array['trigger'];
				$errorMsg = $array['errorMsg'];
				if($trigger == 0)
				{
					$userId = $this->_getUserId();
					$users = new System_Models_UserMapper();
					$contactId = $users->getContactId($userId); 
					$plog = new Pment_Models_Plog();
					$plog->setPlogId($plogId);
					$plog->setProjectId($projectId);
					$plog->setLogDate($editForm->getValue('logDate'));
					$plog->setWeatherAm($editForm->getValue('weatherAm'));
					$plog->setWeatherPm($editForm->getValue('weatherPm'));
					$plog->setTempHi($editForm->getValue('tempHi'));
					$plog->setTempLo($editForm->getValue('tempLo'));
					$plog->setPart($editForm->getValue('part'));
					$plog->setNumber($editForm->getValue('number'));
					$plog->setOperator($editForm->getValue('operator'));
					$plog->setForeman($editForm->getValue('foreman'));
					$plog->setSafety($editForm->getValue('safety'));
					$plog->setProblem($editForm->getValue('problem'));
					$plog->setResolve($editForm->getValue('resolve'));
					$plog->setRelatedFile($editForm->getValue('relatedFile'));
					$plog->setChangeSig($editForm->getValue('changeSig'));
					$plog->setMaterial($editForm->getValue('material'));
					$plog->setContactId($contactId);
					$plog->setRemark($editForm->getValue('remark'));
					$plogs->save($plog); 
					$this->_helper->flashMessenger->addMessage('对日志: '.$plog->getLogDate().'的修改成功。');
					$this->_redirect('/pment/plog/display/id/'.$plog->getPlogId());
					}
					else
					{
						$editForm->populate($formData);
						}
				}
				else
				{
					$editForm->populate($formData);
					}
			}
			else
			{
				if($plogId >0)
				{
					$arrayPlog = $plogs->findarrayPlog($plogId);
					$editForm->populate($arrayPlog);
					}
					else
					{
						$this->_redirect('/pment/plog');
						}
				}
		$this->view->errorMsg = $errorMsg;
		$this->view->editForm = $editForm;
		$this->view->id = $plogId; 
	}
Esempio n. 13
0
	public function addAction()
	{
		$addForm = new Vendor_Forms_VendorSave();
		$addForm->submit->setLabel("保存继续新建");
		$addForm->submit2->setLabel("保存返回上页");
		$errorMsg = null;
		$vendors = new Vendor_Models_VendorMapper();
		$vtypes = new General_Models_VtypeMapper();
		$vtypes->populateDd($addForm);
		$addForm = $vendors->formValidator($addForm,0);

		if($this->getRequest()->isPost())
		{
			$btClicked = $this->getRequest()->getPost('submit');
			$formData = $this->getRequest()->getPost();
			if($addForm->isValid($formData))
			{
				$array = $vendors->dataValidator($formData,0);
				$trigger = $array['trigger'];
				$errorMsg = $array['errorMsg'];
				if($trigger == 0)
				{
					$userId = $this->getUserId();
					$users = new System_Models_UserMapper();
					$contactId = $users->getContactId($userId); 
					$vendor = new Vendor_Models_Vendor();
					$vendor->setName($addForm->getValue('name'));
					$vendor->setContact($addForm->getValue('contact'));
					$vendor->setTypeId($addForm->getValue('typeId'));
					$vendor->setBusiField($addForm->getValue('busiField'));
					$vendor->setPhoneNo($addForm->getValue('phoneNo'));
					$vendor->setOtherContact($addForm->getValue('otherContact'));
					$vendor->setAddress($addForm->getValue('address'));
					$vendor->setRemark($addForm->getValue('remark'));
					$vendor->setContactId($contactId);
					$vendors->save($vendor);
					$errorMsg = General_Models_Text::$text_save_success;
					$addForm->reset();
					if($btClicked=="保存返回上页")
					{
						$this->_helper->flashMessenger->addMessage('对供应商:'.$vendor->getName().'的新建成功。');
						$this->_redirect('/vendor');
						}
					}
					else
					{
						$addForm->populate($formData);
						}
				}
				else
				{
					$addForm->populate($formData);
					}
		}
		$this->view->errorMsg = $errorMsg;
		$this->view->addForm = $addForm;
	}
Esempio n. 14
0
	public function fetchAllNews($toId)
	{
		$resultSet = $this->getDbTable()->fetchAllNews($toId);
		
		$arrayMessages = null;
		foreach($resultSet as $row)
		{
			$message = new Admin_Models_Message();
			$message->setMsgId($row->msgId)
				->setFromId($row->fromId)
				->setTitle($row->title)
				->setSendTime($row->sendTime);
			$users = new System_Models_UserMapper();
			$contactId = $users->getContactId($message->getFromId());
			$contacts = new Employee_Models_ContactMapper();
			$contactName = $contacts->findContactName($contactId);
			$message->setFromCname($contactName);
			$message->setFromCid($contactId);
			$arrayMessages[] = $message;
			}
		return $arrayMessages;
	}
Esempio n. 15
0
	public function ajaxpdfAction()
	{
		$this->_helper->layout()->disableLayout();
	//	$this->_helper->viewRenderer->setNoRender(true);
		
		$pdf = new Zend_Pdf();
		$page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
		$font = Zend_Pdf_Font::fontWithPath('font/simkai.ttf',(Zend_Pdf_Font::EMBED_SUPPRESS_EMBED_EXCEPTION |
Zend_Pdf_Font::EMBED_DONT_COMPRESS));
		//put the personal information to the pdf
		$contacts = new Employee_Models_ContactMapper();
		$arrayContacts = $contacts->fetchAllJoin();
		$count = 1;//every page show approximately 20 pieces;
		//$arrayCount = count($arrayContacts);
		$totalItems = $arrayContacts->getTotalItemCount();
		$arrayContacts->setItemCountPerPage($totalItems);

		$pageNumber = ceil($totalItems / 25);
		$x = 0; $y = 750;
		$currentpage = 1;
		foreach($arrayContacts as $contact)
		{
			if($count == 1)
			{
				$page->setLineWidth(0.5);
				$page->drawLine(50, 770, 560, 770);
				$page->drawLine(50, 125, 560, 125);
				$page->setFont($font,13)
						->drawText("编号", 50, $y, 'UTF-8')
						->drawText("姓名", 100, $y, 'UTF-8')
						->drawText("性别", 145, $y, 'UTF-8')
						->drawText("生日", 195, $y, 'UTF-8')
						->drawText("部门", 275, $y, 'UTF-8')
						->drawText("职务", 335, $y, 'UTF-8')
						->drawText("入职时间", 415, $y, 'UTF-8')
						->drawText("手机号码", 495, $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');
				}
				$y -= 25;$count++;
				$page->setFont($font, 11)
						->drawText($contact->contactId, $x+=50, $y, 'UTF-8')
						->drawText($contact->contactName, $x+=50, $y, 'UTF-8')
						->drawText($contact->gender, $x+=45, $y, 'UTF-8')
						->drawText($contact->birth, $x+=50, $y, 'UTF-8')
						->drawText($contact->deptName, $x+=80, $y, 'UTF-8')
						->drawText($contact->dutyName, $x+=60, $y, 'UTF-8')
						->drawText($contact->enroll, $x+=80, $y, 'UTF-8')
						->drawText($contact->phoneMob, $x+=80, $y, 'UTF-8');
			if($count >= 25)
			{
				$pdf->pages[] = $page;
				$page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
				$count = 1;
				$y = 750;
				$currentpage++;
				}
			$x = 0;
			}
		$pdf->pages[] = $page;
		$name_string = "公司员工信息总览".time().".pdf";
		//server
		$base = General_Models_ServerInfo::$localUrl;
		$url = 'tmp/'.$name_string;
		$pdf->save($url);
		$murl = $base.'/'.$url;
		$this->view->murl = $murl;
		}
Esempio n. 16
0
	public function findReviewer($planId,$userId)
	{
		$users = new System_Models_UserMapper();
		$contactId = $users->getContactId($userId);
		$resultSet = $this->getDbTable()->findReviewer($planId,$contactId);
		
		$reviewer = new Pment_Models_Reviewer();
		
		$row = $resultSet[0];
		
		$reviewer->setPlanId($planId);
		$reviewer->setContactId($row->contactId);
		$reviewer->setAddDate($row->addDate);
		$reviewer->setReId($row->reId);
		$reviewer->setStatus($row->status);
		if($row->status == 0)
		{
			$reviewer->setStatusName('未核验');
			}
			elseif($row->status == 1)
			{
				$reviewer->setStatusName('已核验');
				}
		return $reviewer;
	}
Esempio n. 17
0
	public function addAction()
	{
		$specId = $this->_getParam('id',0);
		$files = new File_Models_FileMapper();
		$errorMsg = null;
		$fileForm = new File_Forms_FileSave();
		$fileForm->setAttrib('enctype', 'multipart/form-data');
		
		$specs = new General_Models_SpecMapper();
		$arraySpecs = $specs->fetchAll();
		$spec = new General_Models_Spec();
		$specs->findSpec($specId,$spec);
		
		if($this->getRequest()->isPost())
		{
			$formData = $this->getRequest()->getPost();
			if($fileForm->isValid($formData))
			{
				if($fileForm->fileUpload->receive())
				{
					$file = new File_Models_File();
					$files = new File_Models_FileMapper();
					
					$size = $fileForm->fileUpload->getFileSize(); //size
					$fullName = $fileForm->fileUpload->getFileName();//name
					$arr = explode('/',$fullName);
					$fileName = end($arr);
					$arr2 = explode('.',$fileName);
					$fName = $arr2[0]; //displayName
					$type = $arr2[1];
					$userId = $this->getUserId();
					$users = new System_Models_UserMapper();
					$contactId = $users->getContactId($userId); //contactId
					
					$file->setName($fullName);
					$file->setDisplay($fName);
					$file->setSize($size);
					$file->setSpecId($specId);
					$file->setEdition($fileForm->getValue('edition'));
					$file->setContactId($contactId);
					$file->setInFlag($fileForm->getValue('inFlag'));
					$file->setProjFlag(0);
					$file->setProjectId(0);
					$file->setStatus($fileForm->getValue('status'));
					$file->setParent($fileForm->getValue('parent'));
					$file->setRemark($fileForm->getValue('remark'));
					$file->setType($type);
					$files->save($file);
					$this->_helper->flashMessenger->addMessage('文件上传成功。');
					$this->_redirect('/file/index/index/id/'.$specId);
					}
				}
			}
		$this->view->spec = $spec;
		$this->view->specId = $specId;
		$this->view->arraySpecs = $arraySpecs;
		$this->view->errorMsg = $errorMsg;
		$this->view->fileForm = $fileForm;
	}