AdminUserController.class.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * lionfish 商城系统
  4. *
  5. * ==========================================================================
  6. * @link http://www.liofis.com/
  7. * @copyright Copyright (c) 2015 liofis.com.
  8. * @license http://www.liofis.com/license.html License
  9. * ==========================================================================
  10. *
  11. * @author fish
  12. *
  13. */
  14. namespace Admin\Controller;
  15. use Admin\Model\AdminUserModel;
  16. class AdminUserController extends CommonController{
  17. protected function _initialize(){
  18. parent::_initialize();
  19. $this->breadcrumb1='权限管理';
  20. $this->breadcrumb2='管理员信息';
  21. }
  22. public function index(){
  23. $model=new AdminUserModel();
  24. $data=$model->show_admin_user_page();
  25. $this->assign('empty',$data['empty']);// 赋值数据集
  26. $this->assign('list',$data['list']);// 赋值数据集
  27. $this->assign('page',$data['page']);// 赋值分页输出
  28. $this->display();
  29. }
  30. function add(){
  31. $model=new AdminUserModel();
  32. if(IS_POST){
  33. $data=I('post.');
  34. $return=$model->add_admin_user($data);
  35. $this->osc_alert($return);
  36. }
  37. $this->crumbs='新增';
  38. $this->action=U('AdminUser/add');
  39. $this->assign('roles', D('Role', 'Service')->getRoles());
  40. $this->display();
  41. }
  42. function info(){
  43. $model=new AdminUserModel();
  44. if(IS_POST){
  45. $data=I('post.');
  46. $return=$model->edit_admin_user($data);
  47. $this->osc_alert($return);
  48. }
  49. $this->crumbs='编辑';
  50. $this->action=U('AdminUser/info');
  51. $this->data=M('Admin')->find(I('id'));
  52. $this->assign('roles', D('Role', 'Service')->getRoles());
  53. $this->display();
  54. }
  55. }
  56. ?>