From 7da6f12c040c5edf50f4feed40dfc92501f82ded Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Tue, 11 Oct 2011 10:06:51 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=8E=A7=E5=88=B6=E5=99=A8=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BA=86=E5=AF=BC=E8=88=AA=E6=A0=8F=20Ticket=20#193?= =?UTF-8?q?=20=E5=A2=9E=E5=8A=A0=E4=BA=86=E9=82=AE=E4=BB=B6=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/SysController.php | 124 +++++++++++++++ application/admin/views/scripts/header.phtml | 53 ++++--- .../admin/views/scripts/sys/emailtext.phtml | 148 ++++++++++++++++++ .../views/scripts/sys/emailtext_edit.phtml | 76 +++++++++ .../views/scripts/sys/emailtext_test.phtml | 148 ++++++++++++++++++ .../admin/views/scripts/sys/index.phtml | 50 ++++++ .../admin/views/scripts/sys/left.phtml | 23 +++ 7 files changed, 596 insertions(+), 26 deletions(-) create mode 100644 application/admin/controllers/SysController.php create mode 100644 application/admin/views/scripts/sys/emailtext.phtml create mode 100644 application/admin/views/scripts/sys/emailtext_edit.phtml create mode 100644 application/admin/views/scripts/sys/emailtext_test.phtml create mode 100644 application/admin/views/scripts/sys/index.phtml create mode 100644 application/admin/views/scripts/sys/left.phtml diff --git a/application/admin/controllers/SysController.php b/application/admin/controllers/SysController.php new file mode 100644 index 00000000..761c7d4c --- /dev/null +++ b/application/admin/controllers/SysController.php @@ -0,0 +1,124 @@ +db=Zend_Registry::get('db'); + $this->view->config = Zend_Registry::get('config'); + $this->messenger=$this->_helper->getHelper('FlashMessenger'); + $this->view->messages = $this->messenger->getMessages(); + $this->_helper->layout->setLayout('administry');//新UI + } + + function postDispatch() + { + $this->view->messages = $this->messenger->getMessages(); + } + + function indexAction() + { + //$this->_helper->viewRenderer(''); + //$this->messenger->addMessage(''); + //$this->_redirect(''); + }//indexAction 首页 + + function emailtextAction(){ + + $ac = $this->_request->getParam('ac'); + $submit = $this->_request->getParam('submit'); + $id = $this->_request->getParam('id'); + + + if($ac=='add' && !empty($submit)) + { + $title = $this->_request->getParam('title'); + $description = $this->_request->getParam('description'); + $body = $this->_request->getParam('body'); + + $auth = Zend_Auth::getInstance(); + if($auth->hasIdentity()) + { + $user = $auth->getIdentity(); + $userid = $user->id; + } + + if(empty($title)) $title=='未命名模板'; + + $sql = "insert into emailtext (title,description,content,userid,ts_create) values ('$title','$description','$body','$userid','".time()."')"; + + try{ + if($this->db->exec($sql)>0) + { + $this->messenger->addMessage('模板添加成功'); + $this->_redirect('/admin/sys/emailtext'); + } + }catch(Exception $e){ + $this->messenger->addMessage('模板添加失败:'.$e->getMessage()); + $this->_redirect('/admin/sys/emailtext'); + } + }//创建新模板 + + else if($ac=='edit'&& !empty($id)) + { + if(!empty($submit)) + { + $title = $this->_request->getParam('title'); + $description = $this->_request->getParam('description'); + $body = $this->_request->getParam('body'); + + $sql = "update emailtext set title='$title',description='$description',content='$body' where id='$id'"; + + try{ + if($this->db->exec($sql)>0) + { + $this->messenger->addMessage('模板编辑成功'); + $this->_redirect('/admin/sys/emailtext'); + } + }catch(Exception $e){ + $this->messenger->addMessage('模板编辑失败:'.$e->getMessage()); + $this->_redirect('/admin/sys/emailtext'); + } + }//模板编辑 + + else if($ac=='test'&& !empty($id)) + { + + if(!empty($submit)) + { + $this->_helper->viewRenderer('emailtext_test'); + } + + }//模板测试 + + else + { + $sql = "select * from emailtext where id='$id'"; + $rs = $this->db->query($sql); + + $rows = $rs->fetch(); + + $this->view->info = $rows; + + $this->_helper->viewRenderer('emailtext_edit'); + }//模板列表 + } + + else + { + $sql = "select id,title,userid,ts_create,description,usetimes from emailtext"; + $rs = $this->db->query($sql); + $rows = $rs->fetchAll(); + + $paginator = Zend_Paginator::factory($rows); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage($this->view->config->page->max); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; + }//邮件模板管理首页 + + }//emailtextAction 邮件模板管理 + + +} + diff --git a/application/admin/views/scripts/header.phtml b/application/admin/views/scripts/header.phtml index 4f55c002..cf3efa07 100755 --- a/application/admin/views/scripts/header.phtml +++ b/application/admin/views/scripts/header.phtml @@ -1,26 +1,27 @@ - -
- -
-hasIdentity()) - { - $user = $auth->getIdentity(); - echo ''.$user->username.' 注销'; - } -?> -
-
+ +
+ +
+hasIdentity()) + { + $user = $auth->getIdentity(); + echo ''.$user->username.' 注销'; + } +?> +
+
diff --git a/application/admin/views/scripts/sys/emailtext.phtml b/application/admin/views/scripts/sys/emailtext.phtml new file mode 100644 index 00000000..186e062e --- /dev/null +++ b/application/admin/views/scripts/sys/emailtext.phtml @@ -0,0 +1,148 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->headScript()->appendFile('/static/js/jquery.dataTables.min.js'); +?> + +
+
+

系统管理

+ +
+
+
+ + + +
+ +
+ + + + + + +
+ + msg or $this->messages) :?> +
+ msg) : ?> + msg; ?> + messages): foreach($this->messages as $msg): ?> + + + +
+ + +
+ +
+ + + + + + + + + paginator)): ?> + + paginator as $item): ?> + + > + + + + + + +
模板名称管理
+
+
+
+
    +
  • 模板说明:
  • +
  • 创建时间:
  • +
  • 使用次数:
  • +
+
+
+
+
+ 删除 | + 查看更改 | + 发送测试 +
+
+ paginator; ?>
+ +
+
+

创建新邮件模板

+ +
+ + +
+

+
+ +

+ +

+
+ +

+ +

+
+ + 查看说明? +

+ +

or

+ +
+ +
+
+
+

+ +

+
+
+ +
+ + + + +
+ +
+ + \ No newline at end of file diff --git a/application/admin/views/scripts/sys/emailtext_edit.phtml b/application/admin/views/scripts/sys/emailtext_edit.phtml new file mode 100644 index 00000000..eefbfcb2 --- /dev/null +++ b/application/admin/views/scripts/sys/emailtext_edit.phtml @@ -0,0 +1,76 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); +?> + +
+
+

系统管理

+ +
+
+
+ + + +
+ +
+ + + + + + +
+ +

邮件模板编辑

+
+ + + +
+

+
+ +

+ +

+
+ +

+ +

+
+ + 查看说明? +

+ +

or

+ +
+ +
+ +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/application/admin/views/scripts/sys/emailtext_test.phtml b/application/admin/views/scripts/sys/emailtext_test.phtml new file mode 100644 index 00000000..186e062e --- /dev/null +++ b/application/admin/views/scripts/sys/emailtext_test.phtml @@ -0,0 +1,148 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->headScript()->appendFile('/static/js/jquery.dataTables.min.js'); +?> + +
+
+

系统管理

+ +
+
+
+ + + +
+ +
+ + + + + + +
+ + msg or $this->messages) :?> +
+ msg) : ?> + msg; ?> + messages): foreach($this->messages as $msg): ?> + + + +
+ + +
+ +
+ + + + + + + + + paginator)): ?> + + paginator as $item): ?> + + > + + + + + + +
模板名称管理
+
+
+
+
    +
  • 模板说明:
  • +
  • 创建时间:
  • +
  • 使用次数:
  • +
+
+
+
+
+ 删除 | + 查看更改 | + 发送测试 +
+
+ paginator; ?>
+ +
+
+

创建新邮件模板

+ +
+ + +
+

+
+ +

+ +

+
+ +

+ +

+
+ + 查看说明? +

+ +

or

+ +
+ +
+
+
+

+ +

+
+
+ +
+ + + + +
+ +
+ + \ No newline at end of file diff --git a/application/admin/views/scripts/sys/index.phtml b/application/admin/views/scripts/sys/index.phtml new file mode 100644 index 00000000..93c4a562 --- /dev/null +++ b/application/admin/views/scripts/sys/index.phtml @@ -0,0 +1,50 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); +?> + +
+
+

系统管理

+ +
+
+
+ + + +
+ +
+ + + + + + +
+ + + +
+ + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/application/admin/views/scripts/sys/left.phtml b/application/admin/views/scripts/sys/left.phtml new file mode 100644 index 00000000..40c20138 --- /dev/null +++ b/application/admin/views/scripts/sys/left.phtml @@ -0,0 +1,23 @@ +
+
+

系统管理

+
+
+ +
+
邮件模板管理
+
发送电子邮件时使用的邮件模板
+ +
+
+
+
+

Tips

+
+
+
+
No Tips
+
+
+
+
\ No newline at end of file