Invitation.class.php
2.28 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
<?php
class Controller_Admin_Invitation extends Controller_Admin_Base
{
public function indexAction()
{
$type = $this->_request->query('type', 1);
$data = Facade_Invitation::getByType($type);
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;
}
$this->_view['type'] = $type;
$this->_view['data'] = $data;
}
/**
* 提交
*/
public function submitAction()
{
$type = $this->_request->query('type',1);
$category = $this->_request->query('category', '');
$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($type && $category && $sub && $name && $contacter && $phone && $email)
{
$ret = Facade_Invitation::add($type, $category, $sub, $name, $contacter, $phone, $email);
}
if($ret)
{
return $this->returnJson(true,200,null);
}
else
{
return $this->returnJson(false,404,null,'新增失败');
}
}
/**
* 控制是否显示在申请列表中
*/
public function showinapplyAction()
{
$id = $this->_request->query('id',0);
$status = $this->_request->query('status',0);
$ret = Facade_Invitation::showInApplyList($id, $status);
if($ret)
{
return $this->returnJson(true,200,null);
}
else
{
return $this->returnJson(false,404,null);
}
}
/**
* 控制是否显示在通过列表中
*/
public function showinpassAction()
{
$id = $this->_request->query('id',0);
$status = $this->_request->query('status',0);
$ret = Facade_Invitation::showInPassList($id, $status);
if($ret)
{
return $this->returnJson(true,200,null);
}
else
{
return $this->returnJson(false,404,null);
}
}
}