public function ajaxdeleteAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); $mstprgId = $this->_getParam('id',0); if($mstprgId > 0) { $mstprgs = new Pment_Models_MstprgMapper(); try{ $mstprgs->delete($mstprgId); echo "s"; } catch(Exception $e) { echo "f"; } } else { $this->_redirect('/pment/mstprg'); } }
protected function pagePmentMsprgDisplay($pdf,$page,$font) { //put the personal information to the pdf $mstprgs = new Pment_Models_MstprgMapper(); $mstprgId = $this->_getParam('id',0); $mstprg = new Pment_Models_Mstprg(); $mstprgs->find($mstprgId,$mstprg); $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($mstprg->getMstprgId(), $x+100, $y, 'UTF-8') ->drawText("总进度任务名称:", $x, $y-=20, 'UTF-8') ->drawText($mstprg->getTask(), $x+100, $y, 'UTF-8') ->drawText("开始日期:", $x, $y-=20, 'UTF-8') ->drawText($mstprg->getStartDate(), $x+100, $y, 'UTF-8') ->drawText("结束日期:", $x, $y-=20, 'UTF-8') ->drawText($mstprg->getEndDate(), $x+100, $y, 'UTF-8') ->drawText("工期(天):", $x, $y-=20, 'UTF-8') ->drawText($mstprg->getPeriod(), $x+100, $y, 'UTF-8') ->drawText("编制人:", $x, $y-=20, 'UTF-8') ->drawText($mstprg->getContactName(), $x+100, $y, 'UTF-8') ->drawText("备注:", $x, $y-=20, 'UTF-8') ->drawText($mstprg->getRemark(), $x+100, $y, 'UTF-8') ->drawText("上次修改时间:", $x, $y-=20, 'UTF-8') ->drawText($mstprg->getCTime(), $x+100, $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; }