查詢
$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)){
?>
課程編號(hào)
課程名稱
學(xué)分
成績(jī)
“`
(三)教師模塊
教師模塊是學(xué)籍管理系統(tǒng)的另一個(gè)核心模塊,它負(fù)責(zé)對(duì)學(xué)生的信息和成績(jī)信息進(jìn)行管理。教師模塊的主要功能包括查詢學(xué)生的基本信息、查詢學(xué)生成績(jī)、錄入學(xué)生成績(jī)、修改學(xué)生成績(jī)等。與學(xué)生模塊類似,教師模塊也需要判斷用戶的權(quán)限,以確定能否訪問該模塊的功能。
教師模塊的代碼如下所示:
“`php
header(“Content-Type:text/html; charset=utf-8”);
session_start();
$username=$_SESSION[‘username’];
$password=$_SESSION[‘password’];
if(empty($username)||empty($password)){
echo “alert(‘請(qǐng)先登錄’);window.location.href=’login.html’;”;
die();
}
$role=$_SESSION[‘role’];
if($role!=’教師’){
echo “alert(‘您不是教師,無(wú)法進(jìn)入該頁(yè)面’);window.location.href=’mn.php’;”;
die();
}
$conn = mysqli_connect(“l(fā)ocalhost”,”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[‘a(chǎn)ge’];
$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”);
}
?>
學(xué)籍管理系統(tǒng)-教師模塊
學(xué)籍管理系統(tǒng)
歡迎您,
退出
個(gè)人信息
學(xué)生信息管理
成績(jī)錄入
姓名
性別
年齡
出生日期
籍貫
專業(yè)
班級(jí)
課程列表
while($row=mysqli_fetch_assoc($result)){
?>
課程編號(hào)
課程名稱
學(xué)分
操作
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 數(shù)據(jù)庫(kù)學(xué)籍管理系統(tǒng)代碼###
1、使用下面的數(shù)據(jù),用C設(shè)計(jì)一個(gè)簡(jiǎn)單的學(xué)籍管理系統(tǒng),實(shí)現(xiàn)出最基本的功能。
求剩余部分
除了查詢功能 其他的一模一樣 給分后 其他隱鏈正梁藏的才能夠顯示
#include
#include
#include
#include
struct student_info
{ char number;/*學(xué)號(hào)*/棚運(yùn)
char name;/*姓名*/
char gender;/*性別*/
char sushe_no;/*宿舍號(hào)*/
char tel;
};
struct student_grade
{
char number;
char courseno; /*課程號(hào)*/
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) //從原有的學(xué)生清枯信息文件中讀取信息
{
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) //將學(xué)生信息寫入到文件中
{
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指向的一條記錄復(fù)制給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); //打印學(xué)生信息
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指向的一條記錄復(fù)制給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; /*進(jìn)行排序*/
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”);
。
。此部分被隱藏
成都網(wǎng)站建設(shè)公司 -創(chuàng)新互聯(lián)為您提供網(wǎng)站建設(shè)、網(wǎng)站制作、網(wǎng)頁(yè)設(shè)計(jì)及定制高端網(wǎng)站建設(shè)服務(wù)!
使用下面的數(shù)據(jù),用C設(shè)計(jì)一個(gè)簡(jiǎn)單的學(xué)籍管理系統(tǒng),實(shí)現(xiàn)出最基本的功能。
求剩余部分
除了查詢功能 其他的一模一樣 給分后 其他隱鏈正梁藏的才能夠顯示
#include
#include
#include
#include
struct student_info
{ char number;/*學(xué)號(hào)*/棚運(yùn)
char name;/*姓名*/
char gender;/*性別*/
char sushe_no;/*宿舍號(hào)*/
char tel;
};
struct student_grade
{
char number;
char courseno; /*課程號(hào)*/
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) //從原有的學(xué)生清枯信息文件中讀取信息
{
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) //將學(xué)生信息寫入到文件中
{
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指向的一條記錄復(fù)制給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); //打印學(xué)生信息
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指向的一條記錄復(fù)制給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; /*進(jìn)行排序*/
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”);
。
。此部分被隱藏
數(shù)據(jù)庫(kù)學(xué)籍管理系統(tǒng)代碼的介紹就聊到這里吧,感謝你花時(shí)間閱讀本站內(nèi)容,更多關(guān)于數(shù)據(jù)庫(kù)學(xué)籍管理系統(tǒng)代碼,數(shù)據(jù)庫(kù)學(xué)籍管理系統(tǒng)代碼詳解,使用下面的數(shù)據(jù),用C設(shè)計(jì)一個(gè)簡(jiǎn)單的學(xué)籍管理系統(tǒng),實(shí)現(xiàn)出最基本的功能。的信息別忘了在本站進(jìn)行查找喔。
數(shù)據(jù)庫(kù)運(yùn)維技術(shù)服務(wù) ? 數(shù)據(jù)庫(kù)學(xué)籍管理系統(tǒng)代碼詳解 (數(shù)據(jù)庫(kù)學(xué)籍管理系統(tǒng)代碼)
網(wǎng)站小編 普通
分享到:
創(chuàng)新互聯(lián)(cdcxhl.com)提供穩(wěn)定的云服務(wù)器,香港云服務(wù)器,BGP云服務(wù)器,雙線云服務(wù)器,高防云服務(wù)器,成都云服務(wù)器,服務(wù)器托管。精選鉅惠,歡迎咨詢:028-86922220。
當(dāng)前文章:數(shù)據(jù)庫(kù)學(xué)籍管理系統(tǒng)代碼詳解(數(shù)據(jù)庫(kù)學(xué)籍管理系統(tǒng)代碼)
文章位置:http://www.5511xx.com/article/dphdpcp.html