查询
$sql=”select * from choose,course where choose.course_id=course.id and student_id=’$student_id’ and semester_id=”.$_POST[‘term_id’];
$result=mysqli_query($conn,$sql);
while($row=mysqli_fetch_assoc($result)){
?>
“`
(三)教师模块
教师模块是学籍管理系统的另一个核心模块,它负责对学生的信息和成绩信息进行管理。教师模块的主要功能包括查询学生的基本信息、查询学生成绩、录入学生成绩、修改学生成绩等。与学生模块类似,教师模块也需要判断用户的权限,以确定能否访问该模块的功能。
教师模块的代码如下所示:
“`php
header(“Content-Type:text/html; charset=utf-8”);
session_start();
$username=$_SESSION[‘username’];
$password=$_SESSION[‘password’];
if(empty($username)||empty($password)){
echo “alert(‘请先登录’);window.location.href=’login.html’;”;
die();
}
$role=$_SESSION[‘role’];
if($role!=’教师’){
echo “alert(‘您不是教师,无法进入该页面’);window.location.href=’mn.php’;”;
die();
}
$conn = mysqli_connect(“localhost”,”root”,””,”school”);
mysqli_set_charset($conn,”utf8″);
if(isset($_POST[‘student_id’])){
$student_id=$_POST[‘student_id’];
$sql=”select * from student where id=’$student_id'”;
$result=mysqli_query($conn,$sql);
$row=mysqli_fetch_assoc($result);
$name=$row[‘name’];
$gender=$row[‘gender’];
$age=$row[‘age’];
$birthday=$row[‘birthday’];
$birthplace=$row[‘birthplace’];
$major=$row[‘major’];
$class=$row[‘class’];
}
else{
$name=”;
$gender=”;
$age=”;
$birthday=”;
$birthplace=”;
$major=”;
$class=”;
}
if(isset($_POST[‘course_id’])){
$sql=”select * from course where id=”.$_POST[‘course_id’];
$result=mysqli_query($conn,$sql);
$row=mysqli_fetch_assoc($result);
$course_id=$row[‘id’];
$course_name=$row[‘name’];
$credit=$row[‘credit’];
$sql=”select *,choose.score as score from choose,student where choose.course_id=’$course_id’ and student.id=choose.student_id”;
$result=mysqli_query($conn,$sql);
}
else if(isset($_POST[‘student_id’])&&isset($_POST[‘term_id’])){
$student_id=$_POST[‘student_id’];
$term_id=$_POST[‘term_id’];
$sql=”select * from choose,course where choose.course_id=course.id and student_id=’$student_id’ and semester_id=’$term_id'”;
$result=mysqli_query($conn,$sql);
}
else{
$result=mysqli_query($conn,”select * from course”);
}
?>
学籍管理系统-教师模块
学籍管理系统
欢迎您,
退出
课程列表
while($row=mysqli_fetch_assoc($result)){
?>
2 %E6%95%B0%E6%8D%AE%E5%BA%93%E5%AD%A6%E7%B1%8D%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F%E4%BB%A3%E7%A0%81 数据库学籍管理系统代码###
1、使用下面的数据,用C设计一个简单的学籍管理系统,实现出最基本的功能。
求剩余部分
除了查询功能 其他的一模一样 给分后 其他隐链正梁藏的才能够显示
#include
#include
#include
#include
struct student_info
{ char number;/*学号*/棚运
char name;/*姓名*/
char gender;/*性别*/
char sushe_no;/*宿舍号*/
char tel;
};
struct student_grade
{
char number;
char courseno; /*课程号*/
char coursename; /*课程名称*/
int xuefen;
int pingshicj;
int shiyancj;
int juanmiancj;
float zonghecj;
float shidecj;
};
typedef struct student_info stu_info;
typedef struct student_grade stu_grade;
int CourseInfoIndex=0;
int StudentInfoIndex=0;
stu_info *StuInfo=NULL;
stu_grade *StuCour=NULL;
int ReadStuInfo(void) //从原有的学生清枯信息文件中读取信息
{
FILE *fp;
StudentInfoIndex=0;
if((fp=fopen(“a.txt”,”rb”))==NULL)
{
return -1;
}
else
{
while(!feof(fp))
{
if(fread(&StuInfo,sizeof(stu_info),1,fp)==1)
{
StudentInfoIndex++;
}
}
fclose(fp);
return 0;
}
}
int WriteStuInfo(void) //将学生信息写入到文件中
{
FILE *fp;
if(StudentInfoIndex>=0)
{
if((fp=fopen(“a.txt”,”wb”))==NULL)
{
return -1;
}
else
{
fwrite(StuInfo,sizeof(stu_info)*StudentInfoIndex,1,fp);
fclose(fp);
return 0;
}
}
return 0;
}
void PrintStuInfo(int index)
{
int i=0;
ReadStuInfo();
printf(“\nNow print the data of student infomation:\n”);
printf(“StuNO StuName Gender SuSheHao Telphone\n”);
if (index==-1)
{
for(i=0;i=0)
{
if((fp=fopen(“b.txt”,”wb”))==NULL)
{
return -1;
}
else
{
fwrite(StuCour,sizeof(stu_grade)*CourseInfoIndex,1,fp);
fclose(fp);
return 0;
}
}
return 0;
}
void PrintCourseInfo(int index)
{
int i=0;
ReadCourseInfo();
printf(“\nNow print the data of course infomation:\n”);
printf(“StuNO CourseNo CourseName XueFen PingShiCJ ShiYanCJ JuanMianCJ ZongHeCJ ShiDeCJ\n”);
if (index==-1)
{
for(i=0;i=90)
{
StuCour.shidecj=StuCour.xuefen*1.0;
}
else
{
if(StuCour.zonghecj>=70)
{
StuCour.shidecj=StuCour.xuefen*0.8;
}
else
{
if(StuCour.zonghecj>=60)
{
StuCour.shidecj=StuCour.xuefen*0.6;
}
else
{
StuCour.shidecj=0.0;
}
}
}
CourseInfoIndex++;
}
WriteCourseInfo();// 保存到文件中
}
/* 将src指向的一条记录复制给dest指向的记录 */
void CopyStuInfo(stu_info *src,stu_info *dest)
{
int j;
strcpy(dest->number,src->number);
strcpy(dest->name,src->name);
strcpy(dest->gender,src->gender);
strcpy(dest->sushe_no,src->sushe_no);
strcpy(dest->tel,src->tel);
}
void Del(void)
{
char strdel;
int p=0;
int flag=0;
int t=StudentInfoIndex;
printf(“Delete a student infomation record:\n”);
ReadCourseInfo();
ReadStuInfo();
PrintStuInfo(-1); //打印学生信息
printf(“Please input the student number which you will delete:”);
gets(strdel);
while(p=0 )
{
if(strcmp(strdel,StuCour
.number)==0)
{
CopyStuInfo(&StuCour,&StuCour
);
CourseInfoIndex–;
t–;
}
else
{
p++;
}
}
}
WriteStuInfo();
WriteCourseInfo();
PrintStuInfo(-1);
PrintCourseInfo(-1);
}
/* 将src指向的一条记录复制给dest指向的记录 */
void CopyCourseInfo(stu_grade *src,stu_grade *dest)
{
int j;
strcpy(dest->number,src->number);
strcpy(dest->courseno,src->courseno);
strcpy(dest->coursename,src->coursename);
dest->xuefen=src->xuefen;
dest->pingshicj=src->pingshicj;
dest->juanmiancj=src->juanmiancj;
dest->zonghecj=src->zonghecj;
dest->shidecj=src->shidecj;
}
void SortInfo(void)
{
char str;
int i,j;
stu_grade tmps;
printf(“Pease select a sorting way:\n”);
printf(“1.with zonghecj in inc order\n”);
printf(“2.with zonghecj in desc order\n”);
printf(“3.with shidecj in inc order\n”);
printf(“4.with shidecj in desc order\n”);
gets(str);
ReadCourseInfo();//读取文件的信息
if(str’4′) return; /*进行排序*/
for(i=0;iStuCour.zonghecj)||
(str==’2′ && StuCour.zonghecjStuCour.shidecj)||
(str==’4′ && StuCour.shidecj.shidecj))
{
CopyCourseInfo(&StuCour,&tmps);
CopyCourseInfo(&StuCour,&StuCour);
CopyCourseInfo(&tmps,&StuCour);
}
}
}
WriteCourseInfo(); //将排序好的写入到文件中
PrintCourseInfo(-1); //显示信息
}
void ShowMenu(void)
{
char select;
printf(“\n\n\nPlease Select a operate:\n”);
printf(“1.Insert some student information records;\n”);
printf(“2.Insert some student course records;\n”);
printf(“3.Delete a record from student information file;\n”);
printf(“4.Sort student course records;\n”);
printf(“5.Print student information records;\n”);
printf(“6.Print student course records;\n”);
printf(“0.exit\n”);
gets(select);
while(select!=’0′)
{
if(select==’1′) InStuInfo();
if(select==’2′) InStuCourseInfo();
if(select==’3′) Del();
if(select==’4′) SortInfo();
if(select==’5′) PrintStuInfo(-1);
if(select==’6′) PrintCourseInfo(-1);
printf(“\n\n\nPlease Select an operater:\n”);
printf(“1.Insert some student information records;\n”);
printf(“2.Insert some student course records;\n”);
printf(“3.Delete a record from student information file;\n”);
printf(“4.Sort student course records;\n”);
printf(“5.Print student information records;\n”);
。
。此部分被隐藏
成都网站建设公司 -创新互联为您提供网站建设、网站制作、网页设计及定制高端网站建设服务!
使用下面的数据,用C设计一个简单的学籍管理系统,实现出最基本的功能。
求剩余部分
除了查询功能 其他的一模一样 给分后 其他隐链正梁藏的才能够显示
#include
#include
#include
#include
struct student_info
{ char number;/*学号*/棚运
char name;/*姓名*/
char gender;/*性别*/
char sushe_no;/*宿舍号*/
char tel;
};
struct student_grade
{
char number;
char courseno; /*课程号*/
char coursename; /*课程名称*/
int xuefen;
int pingshicj;
int shiyancj;
int juanmiancj;
float zonghecj;
float shidecj;
};
typedef struct student_info stu_info;
typedef struct student_grade stu_grade;
int CourseInfoIndex=0;
int StudentInfoIndex=0;
stu_info *StuInfo=NULL;
stu_grade *StuCour=NULL;
int ReadStuInfo(void) //从原有的学生清枯信息文件中读取信息
{
FILE *fp;
StudentInfoIndex=0;
if((fp=fopen(“a.txt”,”rb”))==NULL)
{
return -1;
}
else
{
while(!feof(fp))
{
if(fread(&StuInfo,sizeof(stu_info),1,fp)==1)
{
StudentInfoIndex++;
}
}
fclose(fp);
return 0;
}
}
int WriteStuInfo(void) //将学生信息写入到文件中
{
FILE *fp;
if(StudentInfoIndex>=0)
{
if((fp=fopen(“a.txt”,”wb”))==NULL)
{
return -1;
}
else
{
fwrite(StuInfo,sizeof(stu_info)*StudentInfoIndex,1,fp);
fclose(fp);
return 0;
}
}
return 0;
}
void PrintStuInfo(int index)
{
int i=0;
ReadStuInfo();
printf(“\nNow print the data of student infomation:\n”);
printf(“StuNO StuName Gender SuSheHao Telphone\n”);
if (index==-1)
{
for(i=0;i=0)
{
if((fp=fopen(“b.txt”,”wb”))==NULL)
{
return -1;
}
else
{
fwrite(StuCour,sizeof(stu_grade)*CourseInfoIndex,1,fp);
fclose(fp);
return 0;
}
}
return 0;
}
void PrintCourseInfo(int index)
{
int i=0;
ReadCourseInfo();
printf(“\nNow print the data of course infomation:\n”);
printf(“StuNO CourseNo CourseName XueFen PingShiCJ ShiYanCJ JuanMianCJ ZongHeCJ ShiDeCJ\n”);
if (index==-1)
{
for(i=0;i=90)
{
StuCour.shidecj=StuCour.xuefen*1.0;
}
else
{
if(StuCour.zonghecj>=70)
{
StuCour.shidecj=StuCour.xuefen*0.8;
}
else
{
if(StuCour.zonghecj>=60)
{
StuCour.shidecj=StuCour.xuefen*0.6;
}
else
{
StuCour.shidecj=0.0;
}
}
}
CourseInfoIndex++;
}
WriteCourseInfo();// 保存到文件中
}
/* 将src指向的一条记录复制给dest指向的记录 */
void CopyStuInfo(stu_info *src,stu_info *dest)
{
int j;
strcpy(dest->number,src->number);
strcpy(dest->name,src->name);
strcpy(dest->gender,src->gender);
strcpy(dest->sushe_no,src->sushe_no);
strcpy(dest->tel,src->tel);
}
void Del(void)
{
char strdel;
int p=0;
int flag=0;
int t=StudentInfoIndex;
printf(“Delete a student infomation record:\n”);
ReadCourseInfo();
ReadStuInfo();
PrintStuInfo(-1); //打印学生信息
printf(“Please input the student number which you will delete:”);
gets(strdel);
while(p=0 )
{
if(strcmp(strdel,StuCour
.number)==0)
{
CopyStuInfo(&StuCour,&StuCour
);
CourseInfoIndex–;
t–;
}
else
{
p++;
}
}
}
WriteStuInfo();
WriteCourseInfo();
PrintStuInfo(-1);
PrintCourseInfo(-1);
}
/* 将src指向的一条记录复制给dest指向的记录 */
void CopyCourseInfo(stu_grade *src,stu_grade *dest)
{
int j;
strcpy(dest->number,src->number);
strcpy(dest->courseno,src->courseno);
strcpy(dest->coursename,src->coursename);
dest->xuefen=src->xuefen;
dest->pingshicj=src->pingshicj;
dest->juanmiancj=src->juanmiancj;
dest->zonghecj=src->zonghecj;
dest->shidecj=src->shidecj;
}
void SortInfo(void)
{
char str;
int i,j;
stu_grade tmps;
printf(“Pease select a sorting way:\n”);
printf(“1.with zonghecj in inc order\n”);
printf(“2.with zonghecj in desc order\n”);
printf(“3.with shidecj in inc order\n”);
printf(“4.with shidecj in desc order\n”);
gets(str);
ReadCourseInfo();//读取文件的信息
if(str’4′) return; /*进行排序*/
for(i=0;iStuCour.zonghecj)||
(str==’2′ && StuCour.zonghecjStuCour.shidecj)||
(str==’4′ && StuCour.shidecj.shidecj))
{
CopyCourseInfo(&StuCour,&tmps);
CopyCourseInfo(&StuCour,&StuCour);
CopyCourseInfo(&tmps,&StuCour);
}
}
}
WriteCourseInfo(); //将排序好的写入到文件中
PrintCourseInfo(-1); //显示信息
}
void ShowMenu(void)
{
char select;
printf(“\n\n\nPlease Select a operate:\n”);
printf(“1.Insert some student information records;\n”);
printf(“2.Insert some student course records;\n”);
printf(“3.Delete a record from student information file;\n”);
printf(“4.Sort student course records;\n”);
printf(“5.Print student information records;\n”);
printf(“6.Print student course records;\n”);
printf(“0.exit\n”);
gets(select);
while(select!=’0′)
{
if(select==’1′) InStuInfo();
if(select==’2′) InStuCourseInfo();
if(select==’3′) Del();
if(select==’4′) SortInfo();
if(select==’5′) PrintStuInfo(-1);
if(select==’6′) PrintCourseInfo(-1);
printf(“\n\n\nPlease Select an operater:\n”);
printf(“1.Insert some student information records;\n”);
printf(“2.Insert some student course records;\n”);
printf(“3.Delete a record from student information file;\n”);
printf(“4.Sort student course records;\n”);
printf(“5.Print student information records;\n”);
。
。此部分被隐藏
数据库学籍管理系统代码的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于数据库学籍管理系统代码,数据库学籍管理系统代码详解,使用下面的数据,用C设计一个简单的学籍管理系统,实现出最基本的功能。的信息别忘了在本站进行查找喔。
数据库运维技术服务 » 数据库学籍管理系统代码详解 (数据库学籍管理系统代码)
网站小编 普通
分享到:
创新互联(cdcxhl.com)提供稳定的云服务器,香港云服务器,BGP云服务器,双线云服务器,高防云服务器,成都云服务器,服务器托管。精选钜惠,欢迎咨询:028-86922220。
网站栏目:数据库学籍管理系统代码详解(数据库学籍管理系统代码)
分享URL:http://www.mswzjz.cn/qtweb/news44/233694.html
攀枝花网站建设、攀枝花网站运维推广公司-贝锐智能,是专注品牌与效果的网络营销公司;服务项目有等
广告
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源:
贝锐智能