




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、PHP 編程基礎(chǔ)與實例教程課程設(shè)計報告學生信息管理系統(tǒng)姓名:班級:14-1專業(yè):信息管理與信息系統(tǒng)完成日期:2017.6.14指導教師:目錄1.系統(tǒng)需求分析 .11.1系統(tǒng)分析過程 .11.1.1 系統(tǒng)的總體目標是: .11.2系統(tǒng)可行性分析 .12.數(shù)據(jù)庫邏輯結(jié)構(gòu)設(shè)計 .22.2.1數(shù)據(jù)庫 E-R 圖 .22.2.2 數(shù)據(jù)庫關(guān)系模式: .23.軟件結(jié)構(gòu)設(shè)計 .63.1開發(fā)環(huán)境 .63.2系統(tǒng)功能結(jié)構(gòu) .63.3系統(tǒng)結(jié)構(gòu) - 模塊劃分 .73.3.1登陸模塊 .73.3.2增刪模塊 .144.軟件調(diào)試 .184.1進入主頁 .184.2登錄界面 .184.3根據(jù)用戶身份登錄到對應界面 .184
2、.3.1學生登錄 .184.3.2教師登錄 .204.3.3管理員登錄 .215.心得 .246PHP參考文獻 .241.系統(tǒng)需求分析1.1 系統(tǒng)分析過程1.1.1 系統(tǒng)的總體目標是:設(shè)計一個學生成績管理系統(tǒng),學生所具有的操作功能如下:瀏覽個人基本信息;學生登錄系統(tǒng)后,修改個人信息,為了保證系統(tǒng)的安全性,學生只能修改個人密碼 ,瀏覽課程信息,進行選課等;教師查詢、錄入、修改成績,修改個人密碼;管理員查詢、錄入、修改基本信息 , 修改個人密碼 ,同時修改老師教授的課程。1.1.2 系統(tǒng)所能實現(xiàn)的功能有:查詢模塊:負責學生查詢自己的基本信息和成績, 教師查詢成績和個人基本信息,管理員查詢基本信息情
3、況。錄入模塊:以教師的角色登錄, 允許錄入成績; 以管理員身份登錄允許錄入人員和課程信息;修改模塊:以教師的角色登錄, 允許修改成績; 以管理員身份登錄允許修改人員和課程信息;系統(tǒng)配置模塊:密碼修改和重置等。1.2 系統(tǒng)可行性分析1.2.1 經(jīng)濟可行性現(xiàn)在,計算機的價格已經(jīng)十分低廉, 性能卻有了長足的進步。 而本系統(tǒng)的開發(fā),為學校的工作效率帶來了一個質(zhì)的飛躍,為此主要表現(xiàn)有以下幾個方面:第一,本系統(tǒng)的運行可以代替人工進行許多繁雜的勞動;第二,本系統(tǒng)的運行可以節(jié)省許多資源;第三,本系統(tǒng)的運行可以大大的提高學校的工作效率;所以,本系統(tǒng)在經(jīng)濟上是可行的。1.2.2 技術(shù)可行性本系統(tǒng)的開發(fā)利用MySQ
4、L作為本系統(tǒng)的數(shù)據(jù)庫, 它是一個支持多用戶的新型1數(shù)據(jù)庫,適用于大中規(guī)模的數(shù)據(jù)量需求。學校校園網(wǎng)的建設(shè)也為新系統(tǒng)服務器/客戶端的結(jié)構(gòu)提供了硬件的支持。使用 wamp與 navicat作為系統(tǒng)開發(fā)的開發(fā)環(huán)境,它提供完善的指令控制語句、類與對象的支持及豐富的數(shù)據(jù)類型,給開發(fā)高性能系統(tǒng)提供的保障為開發(fā)滿足客戶要求的系統(tǒng), 保證了代碼的模塊化要求, 而代碼模塊化的提高, 非常有利于以后對新系統(tǒng)的擴展與修改。1.2.3 操作可行性本系統(tǒng)為一個小型的學生信息管理系統(tǒng), 所耗費的資源非常的小, 學校的電腦無論是硬件還是軟件都能夠滿足條件,界面設(shè)計時充分考慮管理人員的習慣,使得操作簡單;數(shù)據(jù)錄入迅速、規(guī)范、可
5、靠;統(tǒng)計準確;制表靈活;適應力強;容易擴充,因此,本系統(tǒng)在操作上是可行的2.數(shù)據(jù)庫邏輯結(jié)構(gòu)設(shè)計2.2.1 數(shù)據(jù)庫 E-R 圖Student_passwordStudent_idStudent_nameStudent_sex學生Student_birthdayStudent_classidClass_idClass_department班級Class_collegeClass_number管理員Student_grade開設(shè)選課課程教師Admin_idAdmin_passwordCourse_idCourse_nameCourse_periodCourse_creditCourse_kindTe
6、acher_idTeacher_nameTeacher_sexTeacher_collegeTeacher_password2.2.2 數(shù)據(jù)庫關(guān)系模式: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);數(shù)據(jù)庫名稱 : management擁有的表 :administrator; Classinfo;Courseinfo;StudentCourse;Studentinfo;Teacherinfo;Teachinginfo;各個表的屬性及數(shù)據(jù):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、專業(yè)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. 軟件結(jié)構(gòu)設(shè)計3.1 開發(fā)環(huán)境基于 windows 7 操作系統(tǒng),數(shù)據(jù)庫系統(tǒng)使用 Mysql ,服務器搭建使用Apache,Web 編寫使用
11、 PHP。3.2 系統(tǒng)功能結(jié)構(gòu)登錄系統(tǒng)ID,密碼身份判斷ID,密碼,身份信息ID,密碼,確認信息身份,密碼確認ID,密碼,確認信息ID,密碼,確認信息顯示學生信息顯示教師信息,其顯示管理員信息,他功能選項其他功能選項新成績,學生ID操作請求,新的信息修改學生成績判斷操作類型,操作對象身份修改密碼修改人員,課程基刪除人員,課程基本信息本信息添加人員,課程基本信息63.3 系統(tǒng)結(jié)構(gòu) -模塊劃分3.3.1 登陸模塊系統(tǒng)使用人員登陸系統(tǒng),輸入 ID 號密碼,選擇身份。之后根據(jù)身份,查詢系統(tǒng)數(shù)據(jù)庫,判斷該 ID 是否存在,密碼是否正確,確認無誤之后繼續(xù)進行之后的功能。實現(xiàn)程序段( 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> 學生管理信息系統(tǒng) </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('學號 ','姓名 ','班級 ','專業(yè) ','學院 ');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('課程編號 ','課程名 ','學分 ','分數(shù) &
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>請選擇要修改的內(nèi)容: </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 ,新成績,再根據(jù)教師是的任課課程修改數(shù)據(jù)可中的學生成績。管理員部分, 先選擇想要錄入的人員身份或者是課程編號,再根據(jù)輸入的基本信息,錄入到數(shù)據(jù)庫中。實現(xiàn)程序段:<?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>修改模塊 :以教師身份登錄,根據(jù)已有學生ID ,和輸入的新成績,對數(shù)據(jù)庫進行修改。一管理員身份登錄, 先選擇要修改那種身份人員或課程的信息,根據(jù)輸入的新信息修改數(shù)據(jù)庫。實現(xiàn)程序段:已修改學生成績?yōu)槔?lt;?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('學號 ','姓名 ','分數(shù) ');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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 海上旅客運輸與旅游產(chǎn)業(yè)市場細分市場考核試卷
- 2021-2023年高考英語真題分項解讀及變式匯編4 連詞和代詞真題匯編(解析版)
- 青少年足球夏令營活動計劃
- 中小學德育工作創(chuàng)新計劃
- 學校消防管網(wǎng)施工方案與技術(shù)措施
- 五年級上冊數(shù)學社團活動計劃
- 二年級下冊科學跨學科融合計劃
- 建筑工程施工風險管理與控制措施
- 秋冬季藥品流通疫情防控工作措施
- 小學一年級美術(shù)作品展覽計劃
- 特種設(shè)備操作人員培訓管理制度
- 客服質(zhì)檢管理競聘述職報告
- 2025年湖北省孝感市中考物理模擬試卷(3月份)(含解析)
- 2024年四年級英語下冊 Module 4 Things we enjoy Unit 12 The ugly duckling第1課時教學實錄 牛津滬教版(三起)
- 2025年煤化工主要設(shè)備一覽及工作原理等分析
- ICU醫(yī)院感染暴發(fā)應急處置演練方案
- 中外教育史知到課后答案智慧樹章節(jié)測試答案2025年春泰山學院
- 基礎(chǔ)有機化學實驗知到智慧樹章節(jié)測試課后答案2024年秋浙江大學
- 特種設(shè)備安全管理的法律法規(guī)遵守培訓計劃
- 國家安全教育知到智慧樹章節(jié)測試課后答案2024年秋山東大學(威海)
- 駱駝祥子-(一)-劇本
評論
0/150
提交評論