当前位置:网站首页>Multilingual Wikipedia website source code development part II
Multilingual Wikipedia website source code development part II
2022-07-04 09:05:00 【qq_ thirty-four million four hundred and ninety-three thousand 】
This is multilingual wikipedia Encyclopedia website source code development Second articles , I talked about the first article , Friends in need can see my blog homepage , Cut the crap and go straight to the topic .
This is also the backstage part , It's the administrator section
Dynamic home page
public function index(){
$where = [];
$where[] = ['status','<>',-1];
$username = input('username');
// search criteria
if (!empty(input('username'))) {
$where[] = ['id|username','like',"%{$username}%"];
}
if(!is_root()){
$where[] = ['role_id','<>',2];
}
$list = Db::name('manager')->where($where)->paginate(10);
$page = $list->render();
View::assign([
'list' => $list,
'page' => $page
]);
return View::fetch();
}
public function status(){
if(d('manager')->where('id',input('id'))->update(['status' => input('status')])){
return $this->success(' Status modification succeeded ');
}
return $this->error(' Failed to modify the status ');
}Administrator's add page
public function add(){
if(Request::isAjax()){
$info = input('info/a');
$password = input('password');
$confirm_password = input('confirm_password');
if($password != $confirm_password){
return $this->error(' Password inconsistency ');
}
$info['password'] = md5($password);
if(d('manager')->insert($info)){
return $this->success(' Add success ');
}
return $this->error(' Add failure ');
}
$where = [];
if(!is_root()){
$where[] = ['id','<>',2];
}
$list = d('role')->where($where)->select();
View::assign([
'list' => $list
]);
return View::fetch();
}Administrator's add page
public function edit(){
if(Request::isAjax()){
$id = input('id');
$info = input('info/a');
$password = input('password');
$confirm_password = input('confirm_password');
if($password != $confirm_password){
return $this->error(' Password inconsistency ');
}
if($password != ''){
$info['password'] = md5($password);
}
if(d('manager')->where('id',$id)->update($info)){
return $this->success(' Modification successful ');
}
return $this->error(' Modification failed ');
}
$where = [];
if(!is_root()){
$where[] = ['id','<>',2];
}
$id = input('id');
$list = d('role')->where($where)->select();
$info = d('manager')->where('id',$id)->find();
View::assign([
'list' => $list,
'info' => $info
]);
return View::fetch();
}
public function del(){
$id = input('id');
if(d('manager')->where([['id','=',$id]])->delete(['status' => -1])){
return json(['code' => 1, 'msg' => ' Delete successful ']);
}
return json(['code' => 0, 'msg' => ' Delete failed ']);
}Administrator menu management
public function index(){
$where = [];
$where[] = ['status','<>',-1];
$username = input('username');
// search criteria
if (!empty(input('username'))) {
$where[] = ['id|username','like',"%{$username}%"];
}
if(!is_root()){
$where[] = ['role_id','<>',2];
}
$list = Db::name('manager')->where($where)->paginate(10);
$page = $list->render();
View::assign([
'list' => $list,
'page' => $page
]);
return View::fetch();
}
public function status(){
if(d('manager')->where('id',input('id'))->update(['status' => input('status')])){
return $this->success(' Status modification succeeded ');
}
return $this->error(' Failed to modify the status ');
}public function index(){
$status = input('status','');
$where = [];
$where[] = ['status','<>',-1];
if($status != ''){
$where[] = ['status','=',$status];
}
$list = d('menu')->where($where)->order('sort,id asc')->select()->toArray();
$list = Cate::toLevel($list);
View::assign([
'list'=>$list
]);
return View::fetch();
}
public function status(){
if(d('menu')->where('id',input('id'))->update(['status' => input('status')])){
return $this->success(' Status modification succeeded ');
}
return $this->error(' Failed to modify the status ');
}
public function sort(){
if(d('menu')->where('id',input('id'))->update(['sort' => input('status')])){
return $this->success(' Modification successful ');
}
return $this->error(' Modification failed ');
}边栏推荐
- Sword finger offer 30 contains the stack of Min function
- 到底什么才是DaaS数据即服务?别再被其他DaaS概念给误导了
- Function comparison between cs5261 and ag9310 demoboard test board | cost advantage of cs5261 replacing ange ag9310
- 地平线 旭日X3 PI (一)首次开机细节
- Private collection project practice sharing [Yugong series] February 2022 U3D full stack class 007 - production and setting skybox resources
- Codeforces Round #750 (Div. 2)(A,B,C,D,F1)
- GoLand environment variable configuration
- awk从入门到入土(5)简单条件匹配
- Awk from entry to earth (15) awk executes external commands
- From scratch, use Jenkins to build and publish pipeline pipeline project
猜你喜欢
![[C Advanced] file operation (2)](/img/50/e3f09d7025c14ee6c633732aa73cbf.jpg)
[C Advanced] file operation (2)

How to ensure the uniqueness of ID in distributed environment

At the age of 30, I changed to Hongmeng with a high salary because I did these three things

Function comparison between cs5261 and ag9310 demoboard test board | cost advantage of cs5261 replacing ange ag9310

Codeforces Global Round 21(A-E)

Codeforces Round #750 (Div. 2)(A,B,C,D,F1)

AMLOGIC gsensor debugging

Sequence model

From scratch, use Jenkins to build and publish pipeline pipeline project

CLion-控制台输出中文乱码
随机推荐
Reload CUDA and cudnn (for tensorflow and pytorch) [personal sorting summary]
微服務入門:Gateway網關
UML 时序图[通俗易懂]
Comparison between sentinel and hystrix
随机事件的关系与运算
《网络是怎么样连接的》读书笔记 - Tcp/IP连接(二)
Getting started with microservices: gateway gateway
[attack and defense world | WP] cat
[C Advanced] file operation (2)
C language - Introduction - Foundation - syntax - [variable, constant light, scope] (V)
Awk from getting started to digging in (9) circular statement
Flutter tips: various fancy nesting of listview and pageview
awk从入门到入土(8)数组
Educational Codeforces Round 115 (Rated for Div. 2)
转:优秀的管理者,关注的不是错误,而是优势
How do microservices aggregate API documents? This wave of show~
awk从入门到入土(14)awk输出重定向
Xcode 6 swift code completion does not work properly - Xcode 6 swift code completion not working
埃氏筛+欧拉筛+区间筛
Opencv environment construction (I)