Student performance management system based on PHP and MySql (with full version code)

System development and operating environment

  • Operating system : win10

  • Software : AppServ (php+apache+mysql), nginx (proxy)

2.2 Functional requirements

2.2.1 Staff

Have an overall understanding of student performance, which can be improved in future teaching. At the same time, you can modify the courses you teach to further understand the personal situation of students, so as to facilitate teaching students in accordance with their aptitude. When a student's personal information changes, the teacher can modify it in time. For example, if a student transfers to another school, later transfers to the department, or a graduate leaves the school, the teacher can add, modify, or delete the student information according to the specific situation. Be able to manage course information, reasonably arrange courses taught by teachers, and provide students with course selection information in a timely manner. Teachers can modify and update the course name, course number, credits, etc. Able to publish, modify, and delete student grades, and clearly understand students' grades for summary and improvement.

2.2.2 Students

Ability to query individual academic performance and overall student performance for new orientation.

  • Result query : score modification, score addition, score deletion, etc.

  • Course query : course modification, course addition, course deletion, etc.

  • Student query : modify student information, add student information, delete student information, etc.

2.3 Feasibility Analysis


In order to make the system play a greater role in the management of the college, realize the computerization of the work process, and improve work efficiency and work quality, the following system development goals are proposed:

  • Provides a platform for results query, which can be used to publish results

  • Any student can go up and check their grades

  • Students can use their student number to inquire

  • Administrators can add data

The purpose of the feasibility study is to determine whether the problem can be solved in the shortest possible time with the minimum cost. That is to say, the purpose of the feasibility study is not to solve the problem, but to determine whether the problem is worth solving, and to study whether the development of a new system has the necessary resources and other conditions under the current specific conditions.

2.3.1 Economic feasibility

It mainly analyzes and evaluates the project from the economic point of view. On the one hand, it is the expenditure, including equipment purchase fee, management and maintenance fee, personnel salary and training fee, etc., and the other is the income obtained. This is an ultra-small management system, which is very small in terms of manpower, financial and material resources. It only needs a computer and a printer to set up this system. Considering that there are computers in the school, it is only necessary to purchase A printer will do. In terms of saving manpower, it can free managers from complicated and complicated work, and do more work, which can improve teaching management to a higher level.

2.3.2 Manageability

The student grade management system is a simple system for managing student grades. It is mainly composed of grade input, output, browsing, printing, and data backup. Therefore, it can be used in any school for grade management. The management method of the system is scientific, the corresponding management system is mature, the original data recorded is accurate, and the operation is simple and fast. A certain degree of feasibility will be widely adopted.

2.3.3 Technical

When developing this application, I followed the software cycle. The student performance management system I designed is an application system developed with front-end and back-end separation using php and Mysql plus front-end js framework.

2.4 Safety and Integrity Requirements


Create database users and set their permissions. Determine the primary key, index, referential integrity, and user-defined integrity of each table.

2.5 Data Dictionary


Student table (student number, name, gender, department, student age)

Course schedule (course number, course name, class hours, credits)

Transcript (course number, student number, grade.)

Teacher list (teacher name, teacher number, courses taught, contact number)

  • Name: Teacher information Description: Information of all teachers stored in the student performance management system Definition: Teacher information = teacher name + courses taught + teacher number + contact number

  • Name: Student information Description: All student information stored in student performance management Definition: Student information = student number + student name + student gender + student department + student age Location: storage output for query

  • Name: Course Information Description: Composition of multiple necessary course information Definition: Course Information = Course Number + Course Name + Class Hours + Credit Location: Store output for query

  • Name: user table information description: user's personal information definition: user information = user name location: storage output for query

  • Name: Student grade information Input: Student name Output: Corresponding student grade information

  • Name: Query Information Description: The specific query request made by the user Definition: Query Information = [Course Query Information] + [Student Query Information]
    Location: Curriculum Table, Student Table, Grade Sheet

  • Name: Add information Input: student number, student name, student gender, department, student age Output: newly entered student information

  • Name: delete information input: select the student information to be deleted output: delete the entity and contact of the completed system

3 Conceptual structure design


3.1 Relationship between system and entity


According to the results of requirement analysis, the entities designed in this system include:

  • Basic information of students : student number, name, college, class, age, gender

  • Basic course information : course name, course number, class hours

  • Teacher basic information : teacher number, teacher name, title, age, gender, college

  • Basic information of the college : college name, college number, dean’s name

Links between these entities include:

  • Each student can study multiple courses, and each course can be studied by multiple students

  • Each class can be taught by multiple teachers, and each teacher can teach multiple courses

  • Students can get a grade for each course they choose, and if they don't take this course, they can't get the grade for that course

3.2 ER diagram of each entity


3.2.1 Student table

3.2.2 Teacher table

3.2.3 Class schedule

3.2.4 Transcript

3.2.5 Overall Entity Practice Diagram

3.3 Convert ER diagram to relational model


3.3.1 Student table

attribute name

data description

type of data

Is it empty

Remark

sno

student ID

Char(8)

empty is not allowed

primary key

takes off

Name

Char(10)

empty is not allowed

Ssex

gender

Char(2)

empty is not allowed

Ssex

gender

C has(2)

empty is not allowed

breath

date of birth

tattoos(8)

Allow empty

class

class

Char(4)

empty is not allowed

type

Char(7)

Allow empty

3.3.2 Teacher table

attribute name

data description

type of data

Is it empty

Remark

tno

teacher number

char(5)

empty is not allowed

primary key

tname

Name

varchar(10)

empty is not allowed

depart

department

varchar(8)

不允许为空

Tsex

性别

char(2)

不允许为空

Tbirth

出生日期

datetime ,

允许为空

prof

职称

char(6)

允许为空

3.3.3 课程表

属性名

数据描述

数据类型

是否为空

备注

cno

课程号

Char(5)

不允许为空

主键

cname

课程名称

varchar(10)

不允许为空

tno

教师编号

char(3)

不允许为空

3.3.4 成绩表

属性名

数据描述

数据类型

是否为空

备注

sno

学号

Char(8)

不允许为空

主键

cno

课程号

Char(5)

不允许为空

主键

degree

成绩

Float(8)

不允许为空

5 物理结构设计


4.1 确定关系模型的存取方法


在将概念模型转换成物理模型之后,我们可以对物理模型进行设计,双击 物理模型的关系,可以对该关系的名称、注释等信息进行查询。可对该关系的属 性列进行设计,可分别设置其名称、码、数据类型以及主码、是否为空等。在实 际设计中最常用的存取方法是索引发,使用索引可以大大减少数据的查询时间, 在建立索引时应遵循:在经常需要搜索的列上建立索引; 在主关键字上建立 索引;在经常用于连接的列上建立索引,即在外键上建立索引;在经常需要根据 范围进行搜索的列上创建索引,因为索引已经排序,其指定的范围是连续的等规 则。才能充分利用索引的作用避免因索引引起的负面作用。

4.2 数据流图


该数据流图主要体现教职工对学生信息、课程信息和学生成绩的管理,然后 存储的信息作用于查询系统。在学生能够操作的只有成绩查询,如图所示:

5 效果图


5.1 登录


5.1.1 学生

5.1.2 教师

5.1.3 管理员

5.2.学生界面


5.2.1 首页

5.2.2 个人信息

5.2.3 成绩查询

默认当前学期

选择学期

5.2.4 本学期课表

5.3 教师界面


5.3.1 欢迎界面

5.3.2 查询教授的课程

5.3.3 录入成绩

5.3.4 已录警告

5.3.5 录入

5.3.6 选择查看教授的课程已录入的成绩

5.4 管理员界面


5.4.1 学生管理界面

查询所有

分类模糊查询

添加学生

编辑信息

删除学生

5.4.2 教师管理

查询所有

分类模糊查询

添加教师

编辑信息

删除学生

5.4.3 课程管理

5.4.4 排课管理

5.5 其他


5.5.1 退出登录

5.5.2 修改密码

6 主要代码


6.1 database.php


<?phpreturn[// 数据库类型
'type'=>'mysql',// 服务器地址
'hostname'=>'127.0.0.1',// 数据库名
'database'=>'grademanager',// 用户名
'username'=>'root',// 密码
'password'=>'123456',// 端口
'hostport'=>'3306',// 连接dsn
'dsn'=>'',// 数据库连接参数
'params'=>[],// 数据库编码默认采用utf8
'charset'=>'utf8',// 数据库表前缀
'prefix'=>'',// 数据库调试模式
'debug'=>true,// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'deploy'=>0,// 数据库读写是否分离 主从式有效
'rw_separate'=>false,// 读写分离后 主服务器数量
'master_num'=>1,// 指定从服务器序号
'slave_no'=>'',// 是否严格检查字段是否存在
'fields_strict'=>true,// 数据集返回类型
'resultset_type'=>'array',// 自动写入时间戳字段
'auto_timestamp'=>false,// 时间字段取出后的默认时间格式
'datetime_format'=>'Y-m-d H:i:s',// 是否需要进行SQL性能分析
'sql_explain'=>false,];

6.2 登录代码


// 登录
		publicfunctionlogin(){
			$t=model('CommonResData');
			if(input('post.username')&&input('post.password')){
				$username=input('post.username');
				$password=input('post.password');
				$identity=input('post.identity');
				if($identity==0){
						$t->data=Db::query("select admin_name from admin where admin_id=$username and admin_password='$password'");
					if($t->data){
							$t->code=0;
							$t->data=$t->data[0]['admin_name'];
								// return JSON($t->resData($t->code,$t->data));
					}else{
							$t->code=3;
							$t->data='没有该用户或密码错误';
					}
				}elseif($identity==1){
					$t->data=Db::query("select teacher_name from teacher where teacher_id=$username and teacher_password='$password'");
					if($t->data){
							$t->code=0;
							$t->data=$t->data[0]['teacher_name'];
								// return JSON($t->resData($t->code,$t->data));
					}else{
							$t->code=3;
							$t->data='没有该用户或密码错误';
					}
				}elseif($identity==2){
					$t->data=Db::query("select student_name from student where student_id = $username and student_password='$password'");
					if($t->data){
							$t->code=0;
							$t->data=$t->data[0]['student_name'];
					}else{
							$t->code=3;
							$t->data='没有该用户或密码错误';
					}
				}else{
						$t->code=2;
						$t->data='登录失败';
				}
					Session::set('islogin',$username);
					Session::set('identity',$identity);
		returnJSON($t->resData($t->code,$t->data));	
			}else{
					$t->code=2;
					$t->data="用户名密码不能为空";
		returnJSON($t->resData($t->code,$t->data));
			}}

6.3 判断是否登录


publicfunctionisLogin(){$isLogin=Session::get('islogin');$t=model('CommonResData');if(!$isLogin){$t->code=1;$t->data='未登录';return;}else{$t->code=0;session('islogin',$isLogin);}}

完整项目代码:https://download.csdn.net/download/weixin_55771290/87395199

Guess you like

Origin blog.csdn.net/pythonyanyan/article/details/128751629