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

提交評論