介绍
本系统是较为简单的一个可以完成学生信息、学生成绩的增删改查,按照班级学科查询学生成绩,查看所有表单,简单的完成学生选课与删除,查询考课名单等功能。
本系统为本人的期末大作业,所以有很多有待修改的bug以及很多有待优化的功能。
界面与其代码
1.主界面(index.php)
学生信息管理系统
学生信息管理系统
2.表单界面(https://blog.csdn.net/tb20010713/article/details/bd.php)
补考
学生表
学号 |
姓名 |
性别 |
年龄 |
身份证 |
专业编号 |
班级 |
联系方式 |
家庭住址 |
备注 |
echo "
$s[0] | ";
echo "$s[1] | ";
echo "$s[2] | ";
echo "$s[3] | ";
echo "$s[4] | ";
echo "$s[5] | ";
echo "$s[6] | ";
echo "$s[7] | ";
echo "$s[8] | ";
echo "$s[9] | ";
}
echo "
";
?>
课程表
学号 |
姓名 |
课程编号 |
课程名 |
分数 |
echo "
$s[0] | ";
echo "$s[1] | ";
echo "$s[2] | ";
echo "$s[3] | ";
echo "$s[4] | ";
}
echo "
";
?>
选课表
课程编号 |
课程名 |
主编 |
出版社 |
成绩 |
echo "
$s[0] | ";
echo "$s[1] | ";
echo "$s[2] | ";
echo "$s[3] | ";
echo "$s[4] | ";
}
echo "
";
?>
3.学生成绩查询(https://blog.csdn.net/tb20010713/article/details/cjcx.php)
成绩查询
成绩查询
班级 |
学号 |
姓名 |
课程号 |
课程名 |
分数 |
echo "
$s[0] | ";
echo "$s[1] | ";
echo "$s[2] | ";
echo "$s[3] | ";
echo "$s[4] | ";
echo "$s[5] | ";
}
echo "
";
?>
4.学生表管理(https://blog.csdn.net/tb20010713/article/details/xsb.php)
学生信息更新
学生表管理
if ($num!=$XH){
echo "";
}
else {
$update_sql="update student set sname='$name',ssex='$XB',sage='$NL',sid='$SFZH',sspeciality='$ZYBH',sclass='$BJBH',sphone='$LXFS',saddress='$JTZZ',sremarks='$BZ' where sno='$XH'";
$update_result= mysqli_query($conn,$update_sql);
if (mysqli_affected_rows($conn) != 0){
echo "";
} else {
echo "";
}
}
}
if (@$_POST["b"] == '添加') {
$insert_sql = "insert into student(sno,sname,ssex,sage,sid,sspeciality,sclass,sphone,saddress,sremarks) values('$XH','$name','$XB','$NL','$SFZH','$ZYBH','$BJBH','$LXFS','$JTZZ','$BZ')";
$insert_result = mysqli_query($conn, $insert_sql);
if (mysqli_affected_rows($conn) != 0){
echo "";
} else {
echo "";
}
}
if (@$_POST["b"] == '删除') {
if ($num==null) {
echo "";
} else {
$de_sql = "select sno from student where sno='$num'";
$de_result = mysqli_query($conn, $de_sql);
$de_row = mysqli_fetch_array($de_result);
if (!$de_row)
echo "";
else {
$del_sql = "delete from student where sno='$num'";
$del_result = mysqli_query($conn, $del_sql);
if (mysqli_affected_rows($conn) != 0)
echo "";
}
}
}
?>
5.课程表管理(https://blog.csdn.net/tb20010713/article/details/kcb.php)
课程信息更新
课程表管理
if($KCH!=$h_KCH)
echo "";
else {
$update_sql="update course set cname='$KCM',ceditor='$ZB',cpublish='$CBS',ccredit='$XF' where cno='$KCH'";
$update_result= mysqli_query($conn,$update_sql);
if (mysqli_affected_rows($conn)!=0)
echo "";
else
echo "";
}
}
//单击【添加】按钮
if (@$_POST["b"]=='添加')
{
$insert_sql="insert into course(cno,cname,ceditor,cpublish,ccredit) values('$KCH','$KCM','$ZB','$CBS','$XF')";
$insert_result= mysqli_query($conn,$insert_sql)or die('添加失败!');
if(mysqli_affected_rows($conn)!=0)
echo "";
}
//单击【删除】按钮
if (@$_POST["b"]=='删除')
{
if(!$KCH)
{
echo "";
}
else {
$d_sql="select cno from course where cno='$KCH'";
$d_result= mysqli_query($conn,$d_sql);
$d_row= mysqli_fetch_array($d_result);
if (!$d_row)
echo "";
else {
$del_sql="delete from course where cno='$KCH'";
$del_result= mysqli_query($conn,$del_sql)or die('删除失败!');
if (mysqli_affected_rows($conn)!=0)
echo "";
}
}
}
?>
6.选课系统(https://blog.csdn.net/tb20010713/article/details/xk.php)
补考
选课表
课程编号 |
课程名 |
老师 |
教学用书出版社 |
学分 |
echo "$s[0] | ";
echo "$s[1] | ";
echo "$s[2] | ";
echo "$s[3] | ";
echo "$s[4] | ";
}
echo "
";
?>
修改选课
if(!$cno)
{
echo "";
}
$del_sql="delete from sc where cno='$cno' and sno='$sno'";
$del_result= mysqli_query($conn,$del_sql)or die('删除失败!');
if (mysqli_affected_rows($conn)!=0)
echo "";
}
?>