From 39f35c47653563dfe5b0a2b13e971a6f2a15c7c0 Mon Sep 17 00:00:00 2001 From: wlx Date: Fri, 13 Mar 2009 02:41:26 +0000 Subject: [PATCH] =?UTF-8?q?fix=20ticket=20#66:=E4=BF=AE=E6=AD=A3=E9=82=AE?= =?UTF-8?q?=E4=BB=B6=E7=B1=BB=E9=94=99=E8=AF=AF=EF=BC=8CFPDF=E7=B1=BB?= =?UTF-8?q?=E8=A6=81=E6=B1=82=E9=94=99=E8=AF=AF=E6=A8=A1=E5=BC=8F=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E4=B8=BAstrict=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/default/controllers/DataController.php | 13 +++++++------ application/models/WestdcMailer.php | 4 ++-- htdocs/index.php | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index b623b034..8de5afbc 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -746,21 +746,22 @@ class DataController extends Zend_Controller_Action $sql="update offlineapp set username=?,email=?,phone=?,address=?,postcode=?,project=?,unit=?,datalist=?,ts_created=now() where id=?"; $this->db->query($sql,array($formData['realname'],$formData['email'],$formData['phone'],$formData['address'],$formData['postcode'],$formData['project'],$formData['unit'],$datalist,$row['id'])); } else { - $sql="insert into offlineapp (userid,username,email,phone,address,postcode,project,unit,datalist) values(?,?,?,?,?,?,?)"; + $sql="insert into offlineapp (userid,username,email,phone,address,postcode,project,unit,datalist) values(?,?,?,?,?,?,?,?,?)"; $this->db->query($sql,array($userid,$formData['realname'],$formData['email'],$formData['phone'],$formData['address'],$formData['postcode'],$formData['project'],$formData['unit'],$datalist)); } + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); //生成PDF $pdf = new ApplicantPDF(); $pdf->template=$this->view->config->offline->template; $pdf->data = $formData; $pdf->drawWestdc(); - $this->_helper->layout->disableLayout(); - $this->_helper->viewRenderer->setNoRender(); header("Content-Disposition: inline; filename=result.pdf"); header("Content-Type:application/pdf"); //header("Content-Length: " . strlen($pdfstring)); - echo $pdf->Output('数据申请.pdf','S'); - exit; + echo $pdf->Output('westdc-data-apply.pdf','S'); + die(); + //exit; } elseif ($formData['submit']) { //提交 //生成PDF @@ -779,7 +780,7 @@ class DataController extends Zend_Controller_Action $sql="update offlineapp set username=?,email=?,phone=?,address=?,postcode=?,project=?,unit=?,datalist=?,ts_created=now(),pdflink=? where id=?"; $this->db->query($sql,array($formData['realname'],$formData['email'],$formData['phone'],$formData['address'],$formData['postcode'],$formData['project'],$formData['unit'],$datalist,$fn,$row['id'])); } else { - $sql="insert into offlineapp (userid,username,email,phone,address,postcode,project,unit,datalist,pdflink) values(?,?,?,?,?,?,?,?)"; + $sql="insert into offlineapp (userid,username,email,phone,address,postcode,project,unit,datalist,pdflink) values(?,?,?,?,?,?,?,?,?,?)"; $this->db->query($sql,array($userid,$formData['realname'],$formData['email'],$formData['phone'],$formData['address'],$formData['postcode'],$formData['project'],$formData['unit'],$datalist,$fn)); } $sql="update dataorder set status=3 where status=2 and userid=?"; diff --git a/application/models/WestdcMailer.php b/application/models/WestdcMailer.php index 9a5f97e2..f1e53d7a 100644 --- a/application/models/WestdcMailer.php +++ b/application/models/WestdcMailer.php @@ -1,7 +1,7 @@ tr=new Zend_Mail_Transport_Smtp($smtp->host, array('ssl' => $smtp->ssl, 'auth'=>$smtp->auth, diff --git a/htdocs/index.php b/htdocs/index.php index 2ee50a45..73377c11 100755 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -1,5 +1,5 @@