当前位置:网站首页>(PHP graduation project) obtained based on thinkphp5 campus news release management system
(PHP graduation project) obtained based on thinkphp5 campus news release management system
2022-07-28 06:18:00 【BiShe source code library】
be based on thinkphp5 Campus news release management system
Campus news release management system is based on php Programming languages and mysql database ,thinkphp5 Developed BS Architecture system , This system is divided into two roles: user and administrator , User login system , View news categories , News detail , News reviews , Website message and other functions , Administrators are for news , classification , user , Leaving a message. , Management of evaluation information . The design interface is beautiful , The function is all ready , For a php Graduation project reference and learning .
One . Technical environment
php edition : 5.4 above
php frame :thinkphp5
development tool : notepad++,sublime,phpstorm All right
database : mysql
The server : apache
Integrated environment : phpstudy
The front frame :bootstrap
Detailed technical :HTML+CSS+JS+PHP+MYSQL+PhpStudy
Two . Project documents

3、 ... and . system function

Four . Code example
<?php
namespace app\admin\controller;
use think\Controller;
use think\Request;
use app\admin\controller\Base;
class News extends Base
{
/* Show news information */
public function index()
{
$user = session('User','','adminuser');
if(!$user || !$user->id){
return $this->redirect(url('user/login'));
}else{
$username = $user['username'];
$news = Model('News')->getList('News');
foreach ($news as $key => $value) {
$value['category'] = Model('Category')->get($value['category_id'])['name'];
if($value['se_category_id'] == 0){
$value['se_category'] = ' nothing ';
}else{
$value['se_category'] = Model('Category')->get($value['se_category_id'])['name'];
}
}
return $this->fetch('',[
'username'=>$username,
'news'=>$news,
]);
}
}
/* Add news information */
public function add()
{
$user = session('User','','adminuser');
if(!$user || !$user->id){
return $this->redirect(url('user/login'));
}else{
$username = $user['username'];
$category = Model('Category')->getParentCategory();
return $this->fetch('',[
'username'=>$username,
'category'=>$category,
]);
}
}
/* Edit page */
public function edit(){
$user = session('User','','adminuser');
if(!$user || !$user->id){
return $this->redirect(url('user/login'));
}else{
$username = $user['username'];
$id = Request::instance()->param('id');
$news = Model('News')->get($id);
if($news['se_category_id'] == 0){
$news['second'] = 0;
}else{
$news['second'] = 1;
$news['se_category'] = Model('Category')->getCategoryByParentID($news['category_id']);
}
$category = Model('Category')->getParentCategory();
return $this->fetch('',[
'username'=>$username,
'news'=>$news,
'category'=>$category,
]);
}
}
/* Modify news information */
public function update(){
$data = input('post.');
if(isset($data['fileselect'])){
unset($data['fileselect']);
}
$data['update_time'] = date('Y-m-d H:i:s',time());
$result =model('News')->update($data,['id'=>intval($data['id'])]);
if($result){
return $this->success(' Modification successful !',url('news/index'));
}else{
return $this->error(' Modification failed !');
}
}
/* Save news information */
public function save()
{
if(request()->isPost()){
$now = date('Y-m-d H:i:s',time());
$data = input('post.');
// $data = Request::instance()->param();
if(isset($data['fileselect'])){
unset($data['fileselect']);
}
// p($data);exit();
$data['create_time'] = $now;
$data['update_time'] = $now;
$res = Model('News')->add($data);
if($res){
return $this->success(' Add success ',url('news/index'));
}else{
return $this->error(' Add failure ');
}
}
}
}
5、 ... and . Project screenshots













边栏推荐
- 硬件电路设计学习笔记1--温升设计
- Addition and multiplication calculation of GF (2^8)
- UNL class diagram
- Why is the kotlin language not popular now? What's your opinion?
- 深度学习数据窃取攻击在数据沙箱模式下的威胁分析与防御方法研究阅读心得
- frameset 用法示例
- 端接电阻详解 信号完整系列 硬件学习笔记7
- 五、视频处理与GStreamer
- 无约束低分辨率人脸识别综述一:用于低分辨率人脸识别的数据集
- Summary of command injection bypass methods
猜你喜欢

File upload vulnerability summary

Solution to the crash after setting up a cluster

Realization of topic function

后门攻击与对抗样本攻击的比较研究

电快速脉冲群(EFT)设计-EMC系列 硬件设计笔记4

关于接触器线圈控制电路设计分析

Common CTF encryption methods JS

Reinforcement learning - dqn in value learning

4、 Model optimizer and inference engine

Differences between processes and threads
随机推荐
Classification of iris based on Neural Network
五、视频处理与GStreamer
Deep learning - metaformer is actually what you need for vision
Which enterprises are suitable for small program production and small program development?
Deep learning (self supervision: simpl) -- a simple framework for contractual learning of visual representations
Which is more reliable for small program development?
Prime_ Series range from detection to weight lifting
Using neural network to predict the weather
端接电阻详解 信号完整系列 硬件学习笔记7
EIGamal cryptosystem description
D2sc-gan: low resolution face recognition of classroom scenes based on dual depth and shallow channel generation confrontation network
利用辅助未标记数据增强无约束人脸识别《Boosting Unconstrained Face Recognition with Auxiliary Unlabeled Data》
How to choose an applet development enterprise
ESXi 7.0 Update 1c中加入的systemMediaSize启动选项
详解爬电距离和电气间隙
Neural network optimization
神经网络实现鸢尾花分类
Knowledge point 21 generic
Clustering of machine learning
Basic usage of word2vec and Bert