From d33d9934beb3970d8206fbf1245244547ddfd5ff Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Mon, 22 Jul 2013 09:16:18 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A1=A8=E5=8D=95=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/DataController.php | 13 +++- .../default/views/scripts/data/pdf.phtml | 11 ++- application/models/order/Order.php | 76 +++++++++++++++++++ 3 files changed, 92 insertions(+), 8 deletions(-) diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index 2fab7e87..de18d113 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -1581,15 +1581,19 @@ class DataController extends Zend_Controller_Action $this->view->formData = $formData = $this->_request->getPost(); - if(empty($formData['title'])) + $s = $order->checkPdfOrderField($formData); + + if($s !== true) { - $this->view->error = \view::Msg('alert-error',""); + $this->view->error = \view::Msg('alert-error',$s); return true; } - $datalist=''; - foreach($rows as $i=>$row) $datalist.=($i+1).". ".$row['title'].";"; + foreach($rows as $i=>$row) + { + $datalist.=($i+1).". ".$row['title'].";"; + } $formData['datalist'] = $datalist; if (@$formData['save']) { @@ -1667,6 +1671,7 @@ class DataController extends Zend_Controller_Action //发送用户邮件进行信息提示和说明 //$mail = new Zend_Mail('utf-8'); + $data = array( "user"=>$formData['realname'], "datalist"=>str_replace(";","\n",$datalist) diff --git a/application/default/views/scripts/data/pdf.phtml b/application/default/views/scripts/data/pdf.phtml index 7a76003e..4aee18a2 100644 --- a/application/default/views/scripts/data/pdf.phtml +++ b/application/default/views/scripts/data/pdf.phtml @@ -34,7 +34,10 @@
msg) : ?> -

msg; ?>

+ msg; ?> + + error) : ?> + error; ?>
@@ -58,13 +61,13 @@
- formData['unit']?>" helper="formText">
+ formData['unit']?>" helper="formText" class="input-block-level">
- formData['address']?>" helper="formText">
+ formData['address']?>" helper="formText" class="input-block-level">
@@ -116,4 +119,4 @@
- + \ No newline at end of file diff --git a/application/models/order/Order.php b/application/models/order/Order.php index e576aecc..11288bcd 100644 --- a/application/models/order/Order.php +++ b/application/models/order/Order.php @@ -184,6 +184,11 @@ class Order return "参数错误"; } + //发送邮件 + public function SendEmail(){ + + } + //生成pdf public function pdf($uid = 0) { @@ -214,4 +219,75 @@ class Order return $rows; } + + public function makePdf($formData,$userid = 0) + { + + } + + public function PdfOrderSave($formData,$uid = 0) + { + + } + + //checkPdfOrderField 检查PDF申请表的信息 + public function checkPdfOrderField($formData) + { + if(empty($formData['realname'])) + { + return "请输入真实姓名"; + } + + if(empty($formData['email'])) + { + return "请输入Email"; + } + + if (!preg_match('/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/',$formData['email'])) + { + return "请输入正确的电子邮件地址"; + } + + if(empty($formData['phone'])) + { + return "请输入联系电话"; + } + + if(empty($formData['unit'])) + { + return "请输入单位"; + } + + if(empty($formData['address'])) + { + return "请输入地址"; + } + + if(empty($formData['postcode']) || !is_numeric($formData['postcode'])) + { + return "请输入邮政编码"; + } + + if(empty($formData['project_id'])) + { + return "请输入项目编号"; + } + + if(empty($formData['project_type'])) + { + return "请选择项目类型"; + } + + if(empty($formData['project_title'])) + { + return "请填写项目标题"; + } + + if(empty($formData['project'])) + { + return "请填写用途"; + } + + return true; + }//checkPdfOrderField } \ No newline at end of file