当前位置:网站首页>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 ');
}边栏推荐
- 26. Delete duplicates in the ordered array (fast and slow pointer de duplication)
- UML sequence diagram [easy to understand]
- 埃氏筛+欧拉筛+区间筛
- C language - Introduction - Foundation - syntax - [main function, header file] (II)
- C语言-入门-基础-语法-[运算符,类型转换](六)
- Flutter 小技巧之 ListView 和 PageView 的各种花式嵌套
- 《网络是怎么样连接的》读书笔记 - FTTH
- awk从入门到入土(6)正则匹配
- What is uid? What is auth? What is a verifier?
- Getting started with microservices: gateway gateway
猜你喜欢

How can we make a monthly income of more than 10000? We media people with low income come and have a look

Target detection -- intensive reading of yolov3 paper

User login function: simple but difficult

AMLOGIC gsensor debugging

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

Relationship and operation of random events

Comparison between sentinel and hystrix

Sword finger offer 30 contains the stack of Min function

After unplugging the network cable, does the original TCP connection still exist?
![C language - Introduction - Foundation - syntax - [main function, header file] (II)](/img/5a/c6a3c5cd8038d17c5b0ead2ad52764.png)
C language - Introduction - Foundation - syntax - [main function, header file] (II)
随机推荐
Live in a dream, only do things you don't say
Educational Codeforces Round 115 (Rated for Div. 2)
随机事件的关系与运算
What is permission? What is a role? What are users?
Flutter 小技巧之 ListView 和 PageView 的各种花式嵌套
awk从入土到入门(10)awk内置函数
1211 or chicken and rabbit in the same cage
HMS core helps baby bus show high-quality children's digital content to global developers
Reading notes of how the network is connected - understanding the basic concepts of the network (I)
C language - Introduction - Foundation - syntax - [main function, header file] (II)
Langage C - démarrer - base - syntaxe - [opérateur, conversion de type] (vi)
How to ensure the uniqueness of ID in distributed environment
Bishi blog (13) -- oral arithmetic test app
20220701 barbarat lemma proof
Reading notes on how to connect the network - tcp/ip connection (II)
Four essential material websites for we media people to help you easily create popular models
《网络是怎么样连接的》读书笔记 - FTTH
"How to connect the Internet" reading notes - FTTH
Codeforces Round #803 (Div. 2)(A-D)
C language - Introduction - Foundation - syntax - [operators, type conversion] (6)