Partner.class.php
1.14 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
<?php
class Controller_Admin_Partner extends Controller_Admin_Base
{
public function indexAction()
{
$this->_view['key'] = Lib_Images::genKey('fragmentimg');
$this->_view['partners'] = Facade_Partner::getPartner();
$this->_view['types'] = Facade_Partner::$types;
}
public function setpartnerAction()
{
$id = $this->_request->query('id', '');
$name = $this->_request->query('name', '');
$pic = $this->_request->query('pic', '');
$type = $this->_request->query('type', 0);
$description = $this->_request->query('description', '');
$url = $this->_request->query('url', '');
if(empty($id))
{
$status = Facade_Partner::setPartner($type, $name, $pic, $url, $description);
}
else
{
$status = Facade_Partner::setPartnerById($id, $type, $name, $pic, $url, $description);
}
if($status)
{
return $this->returnJson(true, 200);
}
else
{
return $this->returnJson(false, 403);
}
}
public function delAction()
{
$id = $this->_request->query('id');
$status = Facade_Partner::delPartner($id);
if($status)
{
return $this->returnJson(true, 200);
}
else
{
return $this->returnJson(false, 403);
}
}
}