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 @@