Invitation.class.php
2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
class Controller_Invitation extends Controller_Abstract
{
public function indexAction()
{
;
}
/**
* 提交
*/
public function submitAction()
{
$category = $this->_request->query('category', 'media');
$sub = $this->_request->query('sub', 0);
$name = $this->_request->query('name','');
$contacter = $this->_request->query('contacter','');
$phone = $this->_request->query('phone', '');
$email = $this->_request->query('email', '');
$ret = false;
if($category && $sub && $name && $contacter && $phone && $email)
{
$ret = Facade_Invitation::add(1, $category, $sub, $name, $contacter, $phone, $email);
}
if($ret)
{
$return = $this->returnJson(true,200,null,'申请成功');
}
else
{
$return = $this->returnJson(false,404,null,'申请失败');
}
if ($callback = $this->_request->query('callback')){
exit("{$callback}({$return})");
}
return $return;
}
/**
* 申请列表
*/
public function applylistAction()
{
if ($this->_request->query('page'))
{
list($offset, $limit) = $this->getLimit();
$data = Facade_Invitation::getApplyList($offset, $limit);
}else
{
$data = Facade_Invitation::getApplyList();
}
foreach ($data as $k=>$row){
$row['category'] = Config_Admin_Var::$invitation_category[$row['category']];
$row['sub'] = Config_Admin_Var::$invitation_sub[$row['sub']];
$data[$k] = $row;
}
$return = $this->returnJson(true,200,$data,'邀请函申请列表');
if ($callback = $this->_request->query('callback')){
exit("{$callback}({$return})");
}
return $return;
}
/**
* 通过列表
*/
public function passlistAction()
{
if ($this->_request->query('page'))
{
list($offset, $limit) = $this->getLimit();
$data = Facade_Invitation::getPassList($offset, $limit);
}else
{
$data = Facade_Invitation::getPassList();
}
foreach ($data as $k=>$row){
$row['category'] = Config_Admin_Var::$invitation_category[$row['category']];
$row['sub'] = Config_Admin_Var::$invitation_sub[$row['sub']];
$data[$k] = $row;
}
$return = $this->returnJson(true,200,$data,'邀请函通过列表');
if ($callback = $this->_request->query('callback')){
exit("{$callback}({$return})");
}
return $return;
}
}