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; ?>
+
+ error) : ?>
+ error; ?>
-
+
\ 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