当前位置:网站首页>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 ');
}边栏推荐
- After unplugging the network cable, does the original TCP connection still exist?
- Codeforces Global Round 21(A-E)
- Sequence model
- Research Report on research and investment prospects of China's testing machine industry (2022 Edition)
- Awk from digging into the ground to getting started (10) awk built-in functions
- Awk from entry to penetration (6) regular matching
- Reading notes of how the network is connected - understanding the basic concepts of the network (I)
- Report on research and investment prospects of polyglycolic acid industry in China (2022 Edition)
- Industry depression has the advantages of industry depression
- awk从入门到入土(12)awk也可以写脚本,替代shell
猜你喜欢

Opencv environment construction (I)

HMS core helps baby bus show high-quality children's digital content to global developers

Codeforces Global Round 21(A-E)

CLion-控制台输出中文乱码
](/img/3f/4d8f4c77d9fde5dd3f53ef890ecfa8.png)
C语言-入门-基础-语法-[运算符,类型转换](六)

Ehrlich sieve + Euler sieve + interval sieve

到底什么才是DaaS数据即服务?别再被其他DaaS概念给误导了
![Langage C - démarrer - base - syntaxe - [opérateur, conversion de type] (vi)](/img/3f/4d8f4c77d9fde5dd3f53ef890ecfa8.png)
Langage C - démarrer - base - syntaxe - [opérateur, conversion de type] (vi)

Target detection -- intensive reading of yolov3 paper

保姆级JDEC增删改查练习
随机推荐
awk从入门到入土(4)用户自定义变量
Awk from entry to earth (14) awk output redirection
[error record] no matching function for call to 'cacheflush' cacheflush();)
awk从入门到入土(12)awk也可以写脚本,替代shell
Mac platform forgets the root password of MySQL
Explain TCP protocol in detail three handshakes and four waves
什么是权限?什么是角色?什么是用户?
Flutter 小技巧之 ListView 和 PageView 的各种花式嵌套
Solve the problem of "Chinese garbled MySQL fields"
Launchpad x | mode
Four essential material websites for we media people to help you easily create popular models
保姆级JDEC增删改查练习
Educational Codeforces Round 119 (Rated for Div. 2)
1211 or chicken and rabbit in the same cage
C语言-入门-基础-语法-[运算符,类型转换](六)
Getting started with microservices: gateway gateway
Ehrlich sieve + Euler sieve + interval sieve
What is inner connection and outer connection? What are the uses and benefits
Report on research and investment prospects of polyglycolic acid industry in China (2022 Edition)
Implementation principle of redis string and sorted set