PHP课程设计报告_第1页
PHP课程设计报告_第2页
PHP课程设计报告_第3页
PHP课程设计报告_第4页
PHP课程设计报告_第5页
已阅读5页,还剩21页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、PHP 编程基础与实例教程课程设计报告学生信息管理系统姓名:班级:14-1专业:信息管理与信息系统完成日期:2017.6.14指导教师:目录1.系统需求分析 .11.1系统分析过程 .11.1.1 系统的总体目标是: .11.2系统可行性分析 .12.数据库逻辑结构设计 .22.2.1数据库 E-R 图 .22.2.2 数据库关系模式: .23.软件结构设计 .63.1开发环境 .63.2系统功能结构 .63.3系统结构 - 模块划分 .73.3.1登陆模块 .73.3.2增删模块 .144.软件调试 .184.1进入主页 .184.2登录界面 .184.3根据用户身份登录到对应界面 .184

2、.3.1学生登录 .184.3.2教师登录 .204.3.3管理员登录 .215.心得 .246PHP参考文献 .241.系统需求分析1.1 系统分析过程1.1.1 系统的总体目标是:设计一个学生成绩管理系统,学生所具有的操作功能如下:浏览个人基本信息;学生登录系统后,修改个人信息,为了保证系统的安全性,学生只能修改个人密码 ,浏览课程信息,进行选课等;教师查询、录入、修改成绩,修改个人密码;管理员查询、录入、修改基本信息 , 修改个人密码 ,同时修改老师教授的课程。1.1.2 系统所能实现的功能有:查询模块:负责学生查询自己的基本信息和成绩, 教师查询成绩和个人基本信息,管理员查询基本信息情

3、况。录入模块:以教师的角色登录, 允许录入成绩; 以管理员身份登录允许录入人员和课程信息;修改模块:以教师的角色登录, 允许修改成绩; 以管理员身份登录允许修改人员和课程信息;系统配置模块:密码修改和重置等。1.2 系统可行性分析1.2.1 经济可行性现在,计算机的价格已经十分低廉, 性能却有了长足的进步。 而本系统的开发,为学校的工作效率带来了一个质的飞跃,为此主要表现有以下几个方面:第一,本系统的运行可以代替人工进行许多繁杂的劳动;第二,本系统的运行可以节省许多资源;第三,本系统的运行可以大大的提高学校的工作效率;所以,本系统在经济上是可行的。1.2.2 技术可行性本系统的开发利用MySQ

4、L作为本系统的数据库, 它是一个支持多用户的新型1数据库,适用于大中规模的数据量需求。学校校园网的建设也为新系统服务器/客户端的结构提供了硬件的支持。使用 wamp与 navicat作为系统开发的开发环境,它提供完善的指令控制语句、类与对象的支持及丰富的数据类型,给开发高性能系统提供的保障为开发满足客户要求的系统, 保证了代码的模块化要求, 而代码模块化的提高, 非常有利于以后对新系统的扩展与修改。1.2.3 操作可行性本系统为一个小型的学生信息管理系统, 所耗费的资源非常的小, 学校的电脑无论是硬件还是软件都能够满足条件,界面设计时充分考虑管理人员的习惯,使得操作简单;数据录入迅速、规范、可

5、靠;统计准确;制表灵活;适应力强;容易扩充,因此,本系统在操作上是可行的2.数据库逻辑结构设计2.2.1 数据库 E-R 图Student_passwordStudent_idStudent_nameStudent_sex学生Student_birthdayStudent_classidClass_idClass_department班级Class_collegeClass_number管理员Student_grade开设选课课程教师Admin_idAdmin_passwordCourse_idCourse_nameCourse_periodCourse_creditCourse_kindTe

6、acher_idTeacher_nameTeacher_sexTeacher_collegeTeacher_password2.2.2 数据库关系模式:Administrator( AdminID , AdminName, AdminPassword); ClassInfo(Class,Major,department)CourseInfo(CourseNumber, CourseName, Grade);2StudentCourse(StudentID , CourseNumber, Marks); StudentInfo(StudentID,StudentName ,Class,Stude

7、ntPassword); TeacherInfo (TeacherID,TeacherName,TeacherPassword); TeachingInfo(CourseNumber,TeacherID);数据库名称 : management拥有的表 :administrator; Classinfo;Courseinfo;StudentCourse;Studentinfo;Teacherinfo;Teachinginfo;各个表的属性及数据:Administrator (AdminID char(20) primary key, , AdminName char(20),AdminPassw

8、ord char(20);包含:管理员编号 AdminID 、管理员姓名 AdminName、管理员密码 AdminPasswordClassinfo(Class char(20) primary key,Major char(20),department char(20);包含:班级号Class、专业Major、学院department3Courseinfo(CourseNumber char(20) primary key,CourseName char(20),Grade int); 包 含 : 课 程 编 号 CourseNumber 、 课 程 姓 名 CourseName 、 学

9、分GradeStudentCourse (StudentID char(20),CourseNumber char(20),Marks int); 包含:学号 StudentID、课程编号 CourseNumber、得分 MarksStudentinfo(StudentID char(20) primary key,StudentName char(20),Class char(20),4StudentPassword Char(20);包含:学号StudentID 、学生姓名StudentName、班级号Class、学生密码StudentPasswordTeacherinfo(Teacher

10、ID char(20) primary key,TeacherName char(20), TeacherPassword char(20);包含:教师编号TeacherID、教师姓名 TeacherName、教师密码 TeacherPasswordTeachinginfo(CourseNumber char(20) primary key,TeacherID char(20); 包含:课程编号 CourseNumber、教师编号 TeacherID53. 软件结构设计3.1 开发环境基于 windows 7 操作系统,数据库系统使用 Mysql ,服务器搭建使用Apache,Web 编写使用

11、 PHP。3.2 系统功能结构登录系统ID,密码身份判断ID,密码,身份信息ID,密码,确认信息身份,密码确认ID,密码,确认信息ID,密码,确认信息显示学生信息显示教师信息,其显示管理员信息,他功能选项其他功能选项新成绩,学生ID操作请求,新的信息修改学生成绩判断操作类型,操作对象身份修改密码修改人员,课程基删除人员,课程基本信息本信息添加人员,课程基本信息63.3 系统结构 -模块划分3.3.1 登陆模块系统使用人员登陆系统,输入 ID 号密码,选择身份。之后根据身份,查询系统数据库,判断该 ID 是否存在,密码是否正确,确认无误之后继续进行之后的功能。实现程序段( login.php 与

12、 login_check.php):login.php<?phpsession_start();$_SESSION'firstlogin'=1;?><head><meta http-equiv="Content-Type" content="text/html; charset=gbk" /> <title> 学生管理信息系统 </title><style>*padding:0px;margin:0px;acolor:Whitebodyfont-family:Aria

13、l, Helvetica, sans-serif; background:url('images/grass.jpg') no-repeat center; font-size:13px;imgborder:0;.lgwidth:468px; height:468px; margin:100px auto; background:url('images/login_bg.png') no-repeat;align: center;.lg_top height:200px; width:468px;align: center;.lg_mainwidth:400px

14、; height:180px; margin:0 25px;align="center".lg_m_1width:290px;height:100px;padding:60px 55px 20px 55px;margin:0px auto;.ur7height:37px;border:0;color:#666;width:236px;margin:4px 28px;background:url('images/user.png') no-repeat;padding-left:10px;font-size:16pt;font-family:Arial, He

15、lvetica, sans-serif;.pwheight:37px;border:0;color:#666;width:236px;margin:4px 28px;background:url('images/password.png') no-repeat;padding-left:10px;font-size:16pt;font-family:Arial, Helvetica, sans-serif;.lg_footheight:80px;width:330px;padding: 6px 68px 0 68px;align="center"</s

16、tyle></head><body class="b"><div class="lg"><div class="lg_top"></div><div class="lg_main"><div class="lg_m_1"><form method="post" action="login_check.php"><input type="te

17、xt" name='user_name' class="ur"/><input type="password" name='user_pass' class="pw"/> <p style="text-align: center"><font size='3' face='楷体 '><strong>请选择身份 </strong></font>:<br/>

18、</p><body style="text-align:center;"><select name="shenfen" size="1" style="text-align: center"><optionvalue="1"> 学生 </option><optionvalue="2"> 教师 </option><optionvalue="3"> 管理员 <

19、/option>8</select><pstyle="text-align:center"><inputname="submit1"type="submit"value="登录 " /></p></form><form method="post" action="login.php"><pstyle="text-align:center"><inputname=

20、"submitO"type="submit"value=" 重置 " /></p></form></div></div></form></body></html>Login_check.php<?phpsession_start();if($_SESSION'firstlogin')$_SESSION'username'=$_POST'user_name'$_SESSION'passw

21、ord'=$_POST'user_pass'$_SESSION'shenfen'=$_POST'shenfen'$_SESSION'firstlogin'=false;$shenfen=$_SESSION'shenfen'$user_name=$_SESSION'username'$user_pass=$_SESSION'password'?><html><head><title> 登陆成功 !</title><me

22、ta http-equiv="Content-Type" content="text/html; charset=gbk"> <style type="text/css">body background-image: url(images/banner.jpg);background-repeat: repeat;</style></head><body><?php$db= mysql_connect(':3306','root

23、9;,'') or die ("连接失败 "); mysql_select_db('management',$db) or die(mysql_error($db);if($shenfen'shenfen'=1)$query="SELECT9StudentID,StudentName,studentinfo.Class,Major,department fromstudentinfo,ClassInfowhereStudentID='$user_name' AND StudentPassword=&#

24、39;$user_pass' AND studentinfo.Class=ClassInfo.Class;"mysql_query("set names 'gbk'");mysql_query("SET CHARACTER SET gbk");$result=mysql_query($query,$db) or die ("ERROR"); if(mysql_numrows($result)=0)echo "用户名或密码错误! ".'<br/>'echo

25、 "<a href='login.php'>"echo "重新登录 "echo "</a>"elseecho "<a href='login.php' >"echo "<p align ='right'>注销 </p>"echo "</a>"echo "<a href='password_change.php'>&quo

26、t;echo "<p align ='right'>修改密码 </p>"."<br/>"echo "</a>"echo "<a href='course_select.php'>"echo "<p align=right>修改选课信息 </p>"echo "</a>"/show the resultsecho '<table borde

27、r="0" align=center >'echo "<td>用户信息: </td>"echo '<table border="1" align=center >'$row=array('学号 ','姓名 ','班级 ','专业 ','学院 ');echo '<tr>'foreach($row as $value)echo '<td>'

28、.$value.'</td>'while($row=mysql_fetch_assoc($result)echo '<tr>'foreach($row as $value)echo '<td>'.$value.'</td>'echo '</tr>'echo '</table>'/ extract($row);/echo $StudentID . '-' . $StudentName . '-' .

29、 $class .'-' .10$StudentPassword.'<br/>'echo '</br>'echo '</br>'$query="SELECTstudentcourse.CourseNumber,CourseName,Grade,Marks fromstudentcourse,CourseInfowhereStudentID='$user_name'andstudentcourse.CourseNumber=CourseInfo.CourseNumber&

30、quot;$result=mysql_query($query,$db) or die ("未知错误 !");echo '<table border="0" align=center >'echo "<td>选课信息: </td>"echo '<table border="1" align=center >'$row=array('课程编号 ','课程名 ','学分 ','分数 &

31、#39;);echo '<tr>'foreach($row as $value)echo '<td>'.$value.'</td>'while($row=mysql_fetch_assoc($result)echo '<tr>'foreach($row as $value)echo '<td>'.$value.'</td>'echo '</tr>'echo '</table>

32、9;if($shenfen'shenfen'=2)/检查 username是否存在/检差 password是否存在/显示老师个人信息,获得任课科目$query="SELECT TeacherID,TeacherName from Teacherinfo where TeacherID='$user_name' AND TeacherPassword='$user_pass'"mysql_query("set names 'gbk'");mysql_query("SET CHARAC

33、TER SET gbk");$result=mysql_query($query,$db) or die ("The user doesn't exist or password ");if(mysql_numrows($result)=0)echo "用户名或密码错误! ".'<br/>'11echo "<a href='login.php'>"echo "重新登录 "echo "</a>"elseecho

34、"<a href='login.php'>"echo "<p align='right'>注销 </p>"echo "</a>"echo "<a href='password_change.php'>"echo "<p align='right'> 修改密码 </p>"."<br/>"echo "</a

35、>"echo '<table border="0" align="center">'echo "<td>教师信息: </td>"echo '<table border="1" align="center">'$row=array('教师编号 ','姓名 ');echo '<tr>'foreach($row as $value)echo 

36、9;<td>'.$value.'</td>'while($row=mysql_fetch_assoc($result)echo '<tr>'foreach($row as $value)echo '<td>'.$value.'</td>'echo '</tr>'echo '</table>'$query="SELECTTeachinginfo.CourseNumber,CourseNamefromT

37、eachinginfo,CourseInfowhereTeacherID='$user_name'andTeachinginfo.CourseNumber=CourseInfo.CourseNumber"$result=mysql_query($query,$db)ordie("Unexpectederror(mark)!");echo "<p align=center>课程 :</p>"while(mysql_num_rows($result)!=0&&$row=mysql_fetch_

38、assoc($result)extract($row);echo "<a href='scole.php?course=$CourseNumber'>" echo"<p align=center> $CourseName</p>" echo "</a>"12if($shenfen'shenfen'=3)/检查 username是否存在/检查 password是否正确$query="SELECT AdminID,AdminName from adm

39、inistrator where AdminID='$user_name' AND AdminPassword='$user_pass'"mysql_query("set names 'gbk'");mysql_query("SET CHARACTER SET gbk");$result=mysql_query($query,$db) or die ("The user doesn't exist or password ");if(mysql_numrows($res

40、ult)=0)echo "用户名或密码错误! ".'<br/>'echo "<a href='login.php'>"echo "重新登录 "echo "</a>"elseecho "<a href='login.php'>"echo "<p align=right>注销 </p>"echo "</a>"echo "

41、<a href='password_change.php'>"echo "<p align=right>修改密码 </p>"."<br/>"echo "</a>"echo '<table border="0" align=center>'echo "<td>管理员信息: </td>"echo '<table border="1"

42、; align=center>'$row=array('管理员编号 ','姓名 ');echo '<tr>'foreach($row as $value)echo '<td>'.$value.'</td>'while($row=mysql_fetch_assoc($result)echo '<tr>'foreach($row as $value)echo '<td>'.$value.'</td&g

43、t;'echo '</tr>'echo '</table>'echo "<p align=center>请选择要修改的内容: </p>","<br/>" echo "<a href='admin_select.php?select=1'>"echo "<p align=center>管理员信息 </p>"."<br/>"13echo

44、"</a>"echo "<a href='teacher_select.php?select=2'>"echo "<p align=center>教师信息 </p>"."<br/>"echo "</a>"echo "<a href='student_select.php?select=3'>"echo "<p align=center>学生

45、信息 </p>"."<br/>"echo "</a>"echo "<a href='c_select.php?select=4'>"echo "<p align=center>课程信息 </p>"."<br/>"echo "</a>"echo "<a href='t_select.php?select=5'>"

46、;echo "<p align=center>教师授课信息 </p>"."<br/>"echo "</a>"?></div></body></html>3.3.2 增删模块教师部分,输入新学生ID ,新成绩,再根据教师是的任课课程修改数据可中的学生成绩。管理员部分, 先选择想要录入的人员身份或者是课程编号,再根据输入的基本信息,录入到数据库中。实现程序段:<?phpsession_start();$_SESSION'admin_se

47、lect'=$_GET'select'$admin_select=$_SESSION'admin_select'$db= mysql_connect('','root','') or die ("Unable to connect. Checkyour connection parameters.");mysql_select_db('management',$db) or die(mysql_error($db);?><head>&l

48、t;title> 输入教师编号 </title><style type="text/css">body background-image: url(pic/in_20.gif);</style></head><body><?php14echo "<a href='login_check.php'>"echo "<p align=right>返回 </p>"echo "</a>"my

49、sql_query("set names 'gbk'");mysql_query("SET CHARACTER SET gbk");$query="SELECT TeacherID,TeacherName from Teacherinfo"$result=mysql_query($query,$db) or die("Unexpected error(scole)"); echo '<table border="1">'$row=array('

50、教师编号 ','姓名 ');echo '<tr>'foreach($row as $value)echo '<td>'.$value.'</td>'while($row=mysql_fetch_assoc($result)echo '<tr>'foreach($row as $value)echo '<td>'.$value.'</td>'echo '</tr>'echo &#

51、39;</table>'?><form method="post" action="t_modify.php"><p><strong>输入要修改的教师编号 </strong>:<br /><input type="text" name="sel_id" /></p><p><input type="submit" name="submit4" valu

52、e=" 确认 "/></p> </form></body></html>修改模块 :以教师身份登录,根据已有学生ID ,和输入的新成绩,对数据库进行修改。一管理员身份登录, 先选择要修改那种身份人员或课程的信息,根据输入的新信息修改数据库。实现程序段:已修改学生成绩为例<?phpsession_start();$_SESSION'new_course'=$_GET'course'$teaching_course=$_SESSION'new_course'$user_n

53、ame=$_SESSION'username'$user_pass=$_SESSION'password'$db= mysql_connect('','root','') or die ("Unable to connect. Checkyour connection parameters.");mysql_select_db('management',$db) or die(mysql_error($db);15?><html><hea

54、d><title> 课程信息 </title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css">body background-image: url(pic/in_20.gif);background-repeat: repeat;</style></head><body><?phpecho "<

55、;a href='login_check.php'>"echo "<p align=right>返回 </p>"echo "</a>"echo "<br>"."课程编号: ",$teaching_course,"<br>" mysql_query("set names 'gbk'");mysql_query("SET CHARACTER SET gbk&quo

56、t;);$query_scole="selectstudentcourse.StudentID,StudentName,Marksfromstudentcourse,StudentInfowherestudentcourse.StudentID=StudentInfo.StudentID and CourseNumber='$teaching_course'order byStudentID"$result_scole=mysql_query($query_scole,$db) or die("Unexpected error(scole)&quo

57、t;);echo '<table border="1">'$row=array('学号 ','姓名 ','分数 ');echo '<tr>'foreach($row as $value)echo '<td>'.$value.'</td>'while($row=mysql_fetch_assoc($result_scole)echo '<tr>'foreach($row as $value)echo '<td>'.$value.'</td>'echo '</tr>'16echo '</table>'/显示学生成绩/1 2与 科目名字对应问题?><form method="post" action="update_scole_result.php" align=center > <p><strong>输入要修改学生

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论