-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
用户评价,管理员,景区管理员登陆,每月人数
- Loading branch information
Showing
69 changed files
with
999 additions
and
144,329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
namespace Home\Controller; | ||
|
||
use Home\Controller\CommonController; | ||
use Org\Util\Upload; | ||
use Org\Util\Image; | ||
use Think\Controller; | ||
|
||
class AdminController extends CommonController { | ||
|
||
public function getadmindata(){ | ||
$ad_id = session("admin.id"); | ||
if(!empty($ad_id)){ | ||
$admin['admin'] = M('admin')->where("ad_id='%s'",array($ad_id))->find(); | ||
// var_dump($admin); | ||
$this->json(1,'ok',$admin); | ||
}else{ | ||
$this->json(0,'未登录'); | ||
} | ||
} | ||
|
||
public function getarea_admindata(){ | ||
$ad_id = session("area_admin.id"); | ||
if(!empty($ad_id)){ | ||
$area_admin['area_admin'] = M('area_admin')->where("ad_id='%s'",array($ad_id))->find(); | ||
// var_dump($admin); | ||
$this->json(1,'ok',$area_admin); | ||
}else{ | ||
$this->json(0,'未登录'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
namespace Home\Controller; | ||
|
||
use Home\Controller\CommonController; | ||
use Org\Util\String; | ||
use Org\Util\Match; | ||
use Think\Controller; | ||
|
||
class AdminRegController extends CommonController{ | ||
public function _construct(){ | ||
|
||
} | ||
|
||
public function loginUser(){ | ||
$ad_id = I('post.ad_id'); | ||
$ad_password = I('post.ad_password'); | ||
$admindata = M('admin')->where("ad_id = '%s'",array($ad_id))->find(); | ||
if(!empty($admindata)){ | ||
if($admindata['ad_password'] == $ad_password){ | ||
session("admin.id",$admindata['ad_id']); | ||
session("admin.name",$admindata['ad_name']); | ||
$this->json(1,'ok'); | ||
} | ||
$this->json(0,'登录失败,账号或密码错误'); | ||
} | ||
} | ||
|
||
/** | ||
* 退出登陆 | ||
*/ | ||
|
||
public function loginOut() | ||
{ | ||
session('admin', NULL); | ||
$this->json(1,'退出成功'); | ||
exit(); | ||
} | ||
|
||
|
||
} |
37 changes: 37 additions & 0 deletions
37
Application/Home/Controller/AreaadminRegController.class.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
namespace Home\Controller; | ||
|
||
use Home\Controller\CommonController; | ||
use Org\Util\String; | ||
use Org\Util\Match; | ||
use Think\Controller; | ||
|
||
class AreaadminRegController extends CommonController{ | ||
public function _construct(){ | ||
|
||
} | ||
public function loginUser(){ | ||
$ad_id = I('post.ad_id'); | ||
$ad_password = I('post.ad_password'); | ||
$admindata = M('area_admin')->where("ad_id = '%s'",array($ad_id))->find(); | ||
if(!empty($admindata)){ | ||
if($admindata['ad_password'] == $ad_password){ | ||
session("area_admin.id",$admindata['ad_id']); | ||
session("area_admin.name",$admindata['ad_name']); | ||
$this->json(1,'ok',$admindata); | ||
} | ||
$this->json(0,'登录失败,账号或密码错误'); | ||
} | ||
} | ||
|
||
/** | ||
* 退出登陆 | ||
*/ | ||
|
||
public function loginOut() | ||
{ | ||
session('area_admin', NULL); | ||
$this->json(1,'退出成功'); | ||
exit(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.