2013-09-05 01:52:27 +00:00
|
|
|
<?php
|
|
|
|
namespace Order\mount;
|
|
|
|
|
|
|
|
use Helpers\View as view;
|
|
|
|
use Helpers\dbh;
|
|
|
|
use Mail\Mail;
|
|
|
|
use Order\Manager\Offlineapp;
|
|
|
|
|
|
|
|
//事件中存在的操作
|
|
|
|
class ManagerOperate implements \Order\listener\ManagerEvents
|
|
|
|
{
|
|
|
|
private $db;
|
|
|
|
private $config;
|
|
|
|
|
|
|
|
function __construct($db = NULL)
|
|
|
|
{
|
|
|
|
if(empty($db))
|
|
|
|
{
|
|
|
|
$this->db = \Zend_Registry::get('db');
|
|
|
|
}else{
|
|
|
|
$this->db = $db;
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->config = \Zend_Registry::get('config');
|
|
|
|
}
|
|
|
|
|
|
|
|
//申请成功提交之后
|
|
|
|
public function received(\Zend_EventManager_Event $e)
|
|
|
|
{
|
|
|
|
$id = $e->getParam('id');
|
|
|
|
|
|
|
|
try{
|
|
|
|
|
|
|
|
$OM = new Offlineapp();
|
|
|
|
|
|
|
|
$data = $OM->getOneAppInfo($id);
|
|
|
|
|
|
|
|
$emailkeys = array(
|
|
|
|
"user"=>$data[0]['username'],
|
|
|
|
"datalist"=>str_replace(";","\n",$data[0]['datalist']),
|
|
|
|
);
|
|
|
|
|
|
|
|
$mail = new Mail();
|
|
|
|
$mail->loadTemplate("offline-start",$emailkeys);
|
|
|
|
$mail->addTo($data[0]['email'],$data[0]['username']);
|
|
|
|
$mail->send();
|
|
|
|
|
|
|
|
}catch(Exception $e)
|
|
|
|
{
|
|
|
|
return $e->getMessage();
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//申请表重置
|
|
|
|
public function appFormReseted(\Zend_EventManager_Event $e)
|
|
|
|
{
|
|
|
|
$id = $e->getParam('id');
|
|
|
|
|
|
|
|
try{
|
|
|
|
|
|
|
|
$OM = new Offlineapp();
|
|
|
|
|
|
|
|
$data = $OM->getOneAppInfo($id);
|
|
|
|
|
|
|
|
$emailkeys = array(
|
|
|
|
"user"=>$data[0]['username'],
|
2013-09-26 07:16:43 +00:00
|
|
|
"link"=> view::getHostLink() . '/data/order/ac/offline2'
|
2013-09-05 01:52:27 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
$mail = new Mail();
|
|
|
|
$mail->loadTemplate("offline-appformreseted",$emailkeys);
|
|
|
|
$mail->addTo($data[0]['email'],$data[0]['username']);
|
|
|
|
$mail->send();
|
|
|
|
|
|
|
|
}catch(Exception $e)
|
|
|
|
{
|
|
|
|
return $e->getMessage();
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//专题数据集
|
|
|
|
public function checkDataSource()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|