ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118...

82
115 ภาคผนวก

Transcript of ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118...

Page 1: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

115

ภาคผนวก

Page 2: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

116

ภาคผนวก ก วธการตดตง โปรแกรมตาง ๆ ทเกยวของ

Page 3: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

117

ขนตอนการตดตงโปรแกรม

การตดตงโปรแกรม AppServ โปรแกรม AppServ เปนโปรแกรมทรวบรวมโปรแกรม Open Source Software หลายๆ อยางเขาดวยกน โดยภายในโปรแกรม AppServ ประกอบดวยโปรแกรมตางๆ ดงน 1. Apache Web Server 2.2.8 เปนโปรแกรมส าหรบใชในการท าเวบเซรฟเวอร

2. PHP V5.2.6 เปนโปรแกรมภาษา PHP 3. MySQL V.5.0.51b เปนโปรแกรมฐานขอมล MySQL 4. phpMyAdmin V.2.10.3 เปนโปรแกรมชวยในการจดการฐานขอมล MySQL

ขนตอนการตดตงโปรแกรม AppServ 1.ดาวนโหลดโปรแกรมไดจาก www.appservnetwork.com เมอดาวนโหลดมาไดแลวใหท าการตดตงโปรแกรม

ภาพท 1 ดาวนโหลดโปรแกรม

Page 4: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

118

2.การตดตงโปรแกรมทดาวนโหลดมาโดยการ Double Click ทไอคอน appserv-win32-2.5.10เพอท าการตดตงโปรแกรม Apace Web Server, โปรแกรมภาษา PHP, โปรแกรม MySQL และโปรแกรม phpMyAdmin

ภาพท 2 การตดตงโปรแกรมทดาวนโหลดมา

3.แสดงขอความตอนรบเขาสการตดตงโปรแกรม AppServ ใหคลกปม Next

ภาพท 3 แสดงขอความตอนรบเขาสการตดตงโปรแกรม

Page 5: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

119

4.คลกปม I Agree เพอยอมรบเงอนไข

ภาพท 4 คลกปม I Agree เพอยอมรบเงอนไข

5.เลอก path ทตองการตดตงโปรแกรม แลวคลกปม Next

ภาพท 5 เลอก path ทตองการตดตงโปรแกรม

Page 6: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

120

6.เลอกโปรแกรมเสรมทตองการตดตง แลวคลกปม Next

ภาพท 6เลอกโปรแกรมเสรมทตองการตดตง แลวคลกปม Next

7.ในชอง Server Name ใหกรอกเปน localhost และกรอกอเมลของผใชงาน

ภาพท 7 ชอง Server Name ใหกรอกเปน localhost และกรอกอเมลของผใชงาน

Page 7: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

121

8.ตงคา MySQL Server โดยตงรหสผานและกรอกรหสผานอกครงเพอยนยนรหสผาน

ภาพท 8 ตงคา MySQL Server

9.รอสกครโปรแกรมก าลงท าการตดตง

ภาพท 9 โปรแกรมก าลงท าการตดตง

Page 8: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

122

10.เสรจสนการตดตงโปรแกรม คลกทปม Finish

ภาพท 10 เสรจสนการตดตงโปรแกรม

Page 9: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

123

ภาคผนวก ข Source Code

Page 10: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

124

config.inc.php

<? $config["user"] = "std49010911227"; $config["password"] = "1812"; $config["host"] = "localhost"; $config["databasename"] = "std49010911227"; $connect = mysql_connect($config["host"],$config["user"],$config["password"]) or die ("connect ไมได".mysql_error()); mysql_query("SET NAMES tis620"); mysql_db_query($config["databasename"],"SET NAMES tis620"); ?>

index.php

<? session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>ขอมลตารางสอน</title> <style type="text/css"> <!-- .menu10 {font-family: "MS Sans Serif", Tahoma, sans-serif; font-size: 10px; color: 444444; } --> </style> <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- #apDiv1 { position:absolute; left:270px; top:175px; width:694px; height:26px; z-index:1; } body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-image: url(); background-repeat: repeat; background-color: #99CCFF; } --> </style> </head> <script language="javascript"> function select_room(room,term) { var w = 750; var h = 550; var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 4; window.open('show_table.php?room='+room+'&term='+term, 'win_member', 'toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=0,width='+w+',height='+h+',top='+wint+',left='+winl)

Page 11: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

125

} //end function function select_teacher(term) { var teacher_name =document.getElementById("teacher_name").value; var w = 750; var h = 550; var winl = (screen.width-260 ); var wint = (screen.height-90 ) ; window.open('show_table_3.php?teacher_name='+teacher_name+'&term='+term, 'win_member', 'toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=0,width='+winl+',height='+wint+',top=0,left=100'); } //end function function select_std(term) { var std_name =document.getElementById("std_name").value; var w = 750; var h = 550; var winl = (screen.width-258 ); var wint = (screen.height-90 ) ; window.open('show_table_4.php?std_name='+std_name+'&term='+term, 'win_member', 'toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=0,width='+winl+',height='+wint+',top=0,left=100'); } function open_link(url) { var w = 750; var h = 550; var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 4; window.open(url,'win_admin', 'toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=0,width='+w+',height='+h+',top='+wint+',left='+winl) } //end function </script> <body> <? include("includes/config.inc.php"); ?> <table width="54%" height="143" border="0" align="center" cellpadding="1" cellspacing="1"> <tr><td align="right"><img src="images/logo.jpg" alt="" width="662" height="127" /></td> </tr> </table> </td> </tr> <tr> <td><div align="center"> <table width="703" height="23" border="0" cellpadding="0" cellspacing="0"> <tr> <td><marquee> <div align="center"><font color="#0000FF">ระบบจดตารางสอน กรณศกษาคณะการบญชและการจดการ มหาวทยาลยมหาสารคาม </font></div> <tr> <td align="center"><div align="center"><a href="manual_reserv_room.pdf" target="_blank"><img src="images/addedit.png" width="48" height="48" border="0" align="absmiddle" />Download คมอการใชงานไดทน </a></div></td> </tr> <tr> <td><form action="" method="post" name="form1" id="form1"> <table width="54%" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#CCCCCC" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF" class="menu10"> <tr bgcolor="EFEFEF">

Page 12: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

126

<td height="16" background="images/had.jpg" bgcolor="EFEFEF"><strong>ระบบจองหองเรยน</strong> <? $sql_list = "Select * From tbl_config Where strConfig = 'acc1' " ; $result = mysql_query($sql_list,$connect); $rs1 = mysql_fetch_array($result); $reserv_over30day = $rs1["reserv_over30day"]; if ($reserv_over30day > 0 ) { ?> (ระบบจองหองเรยนอนญาตใหจองลวงหนาไดไมเกน <strong><font color="red"> <?=$reserv_over30day?> </font></strong> <strong>วน</strong> ) <? } //end if ?> </td> </tr> <tr> <td background="images/bb.jpg"><table width="99%" border="0" background="images/hoo.jpg" class="menu10"> <tr> <td width="42%" align="right">ภาคเรยนท</td> <td width="2%" align="right">&nbsp;</td> <td width="56%"> <div align="left"> <? $sql = "SELECT * FROM tbl_term Where currentTerm = 1"; $result = mysql_query($sql,$connect)or die(mysql_error()); $Row = mysql_num_rows($result); if ($Row > 0 ) { while ($row = mysql_fetch_array($result)) { $startTerm= $row["startTerm"]; $endTerm= $row["endTerm"]; $strTerm .= "'".$row["strTerm"]."',"; } //end while loop $strTerm = substr($strTerm,0,-1); } //end if row ?> <input type="hidden" name="strTerm" value="<?=$strTerm?>" /> <?=$strTerm;?> </div></td> </tr> <tr> <td align="right">หองเรยน: </td> <td align="right">&nbsp;</td> <td><div align="left"> <select name="room" id="room"> <? $sql_list = "Select room From tbl_teaching Where term in (select strTerm From tbl_term Where currentTerm = '1') Group by room order by room " ; $result_content = mysql_query($sql_list,$connect); $intRow_content = mysql_num_rows($result_content); if ($intRow_content != 0 ) { while ($rs = mysql_fetch_array($result_content)) { $room = $rs["room"]; ?> <option value="<?=$room?>"> <?=$room?> </option> <? } //end while } //end if ?> </select> </div></td> </tr>

Page 13: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

127

<tr> <td>&nbsp;</td> <td>&nbsp;</td> <td> </td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td><div align="left"> <input type="button" name="Submit" value="แสดงขอมล" onclick="select_room(room.value,strTerm.value);" /> </div></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td><div align="center"><a href="form_search_table.php?term=<?=$strTerm?>">Quick Search (คนหาเวลาและหองเรยนวาง คลกทน) </a></div></td> </tr> </table></td> </tr> </table> </form></td> </tr> <tr> <td>&nbsp;</td> </tr> <tr> <td align="center" bgcolor="#000000"> <? if ($_GET["status"] == "ok") { echo "<strong>บนทกขอมลเรยบรอยแลว</strong>"; ?> <a href="#" onclick="open_link('list_reserv.php?term=<?=urlencode($strTerm)?>');">รายงานการใชหอง/จองหองเรยน</a> <? } //end if ?> </td> </tr> <? if (empty($_SESSION["session_userid"])) { ?> <tr> <td align="center">กรณททานขอมล Username และ Password กรณา Login เพอเขาใชงาน</td> </tr> <tr> <td align="center"><form name="form1" method="post" action="login.php?strPage=index.php"> <table width="54%" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#CCCCCC" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF" background="images/login.jpg" class="menu10"> <tr bgcolor="EFEFEF"> <td height="16" align="left" background="images/had.jpg" bgcolor="EFEFEF"><strong> Login <font color="#FF0000"><?=$strShow?></font> </strong></td> </tr> <tr> <td background="images/bb.jpg"><table width="99%" border="0" align="center" background="images/hoo.jpg" class="menu10"> <tr> <td width="42%" align="right">Username : </td> <td width="58%" align="left"> <span id="sprytextfield1"> <label>

Page 14: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

128

<input type="text" name="username" id="username" /> </label> <span class="textfieldRequiredMsg">กรณากรอก Username</span></span></td> </tr> <tr> <td align="right">Password : </td> <td align="left"> <span id="sprytextfield2"> <label> <input type="password" name="password" id="password" /> </label> <span class="textfieldRequiredMsg">กรณากรอก Password</span></span> </td> </tr> <tr> <td align="left">&nbsp;</td> <td align="left"><input type="submit" name="Submit4" value="Login"> <input type="hidden" name="strAction" value="post"> </td> </tr> </table></td> </tr> </table> <p><br /> ทานทยงไมม Username และ password </p> <p>ตดตอรบทคณ<strong> ธวชชย รชสมบต โทร.081-5440539</strong></p> <p><strong> อเมล:[email protected] </strong> </p> </form></td> </tr> <? } else { ?> <tr> <td><table width="53%" border="1" cellspacing="0" class="menu10" cellpadding="5" bordercolor="#CCCCCC" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF" align="center"> <tr bgcolor="EFEFEF"> <td height="16" background="images/had.jpg"><strong>เมน<font color="#FF0000"></font> ส าหรบ<? if ($_SESSION["user_type"] == "E") { echo "คณ";} ?><?=$_SESSION["session_name"];?></strong></td> </tr> <tr> <td background="images/bb.jpg"><table width="102%" height="422" border="0" align="center" background="images/hol.jpg" class="menu10"> <tr> <td align="right"><img src="images/b_tblimport.png" width="16" height="16" /></td> <td><div align="left"><a href="Report_cal.php?term=<?=urlencode($strTerm)?>">ปฏทนการจองหองเรยน</a></div></td> </tr> <tr> <td align="right"><img src="images/b_usrdrop.png" width="16" height="16" /></td> <td><div align="left"><a href="cancel_teaching.php?term=<?=urlencode($strTerm)?>">แจงยกเลกการสอนเพอใหหองเรยนวาง (กรณทยงไมไดจองหองเพอสอนชดเชย) </a></div></td> </tr> <tr> <td width="36%" align="right"><img src="images/icon_menu.gif" width="16" height="16" /></td> <td width="64%"><div align="left"><a href="#" onclick="open_link('list_reserv.php?term=<?=urlencode($strTerm)?>');">รายงานการใชหอง/จองหองเรยน</a></div></td> </tr> <? if ($_SESSION["user_admin"] == "admin") { ?> <tr> <td colspan="2"><hr /></td> </tr> <tr> <td align="right"><img src="images/b_usrcheck.png" width="16" height="16" /></td>

Page 15: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

129

<td><div align="left"><a href="manage_teacher.php">เพมรายชอผใชระบบจองหองเรยน <strong>new</strong></a></div></td> </tr> <tr> <td align="right"><img src="images/b_tblimport.png" width="16" height="16" /></td> <td><div align="left"><a href="list_teaching.php">แกไขขอมลตารางเรยน</a></div></td> </tr> <tr> <td align="right"><img src="images/b_calendar.png" width="16" height="16" /></td> <td><div align="left"><a href="setTerm.php">ก าหนดภาคเรยนปจจบน</a> (วนเปด/วนปดภาคเรยน) </div></td> </tr> <tr> <td align="right"><img src="images/icon_menu.gif" width="16" height="16" /></td> <td><div align="left"><a href="set_room_not_reserv.php">จดการหองและก าหนดระยะเวลาทอนญาตใหจองได</a></div></td> </tr> <? } //end if user_type if ($_SESSION["session_userid"] == 10) { //for ตกตา ?> <tr> <td align="right"><img src="images/icon_menu.gif" alt="" width="16" height="16" /></td> <td><div align="left"><a href="#" onclick="open_link('list_get_doc.php?term=<?=urlencode($strTerm)?>');">บนทกรบเอกสารการสอนชดเชย (ส าหรบคณตกตา) <strong>new</strong></a></div></td> </tr> <? } //end if if ($_SESSION["session_userid"] == 18) { //for ไกโตง ?> <tr> <td align="right"><img src="images/icon_menu.gif" alt="" width="16" height="16" /></td> <td><div align="left"><a href="#" onclick="open_link('list_number_approve.php?term=<?=urlencode($strTerm)?>');">ก าหนดหมายเลขบนทก (ส าหรบคณเฉลมพล) <strong>new</strong></a></div></td> </tr> <? } //end if ?> <tr> <td align="right"><img src="images/b_print.png" width="16" height="16" /></td> <td><div align="left"><a href="#" onclick="open_link('list_green_print.php?term=<?=urlencode($strTerm)?>');">ระบบสงพมพใบเขยว (กรณทสอนชดเชย) </a></div></td> </tr> <? // } //end if ?> <tr> <td align="right"><img src="images/icon_menu.gif" width="16" height="16" /></td> <td valign="top"><div align="left"><a href="new_password.php">เปลยนรหสผาน</a></div></td> </tr> <tr> <td align="right"> <img src="images/icon_menu.gif" width="16" height="16" /></td> <td><div align="left">แสดงตารางสอนอาจารย</div></td> </tr> <tr> <td align="right" valign="bottom">&nbsp;</td> <td><p align="left"> <? $strName = split(" ",$_SESSION["session_name"]); $teacher_name = $_GET["teacher_name"]; if ($teacher_name) { $strTeacher_name = $teacher_name; } elseif ($_SESSION["user_type"] == "T") { $strTeacher_name = $strName[0]; } //end if

Page 16: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

130

$sql_list = "Select distinct teacher_name From tbl_teaching Where 1 ".$strWhere." AND term in (select strTerm From tbl_term Where currentTerm = '1') order by teacher_name " ; $result_content = mysql_query($sql_list,$connect); $intRow_content = mysql_num_rows($result_content); ?> <select name="teacher_name" id="teacher_name"> <? if ($intRow_content != 0 ) { while ($rs = mysql_fetch_array($result_content)) { $teacher_name = $rs["teacher_name"]; if ($teacher_name == $strTeacher_name) { $selected = "selected"; } else { $selected = ""; } ?> <option value="<?=$teacher_name;?>" <?=$selected;?>> <?=$teacher_name;?> </option> <? } //end while } //end if ?> </select> <input type="hidden" name="strTerm2" value="<?=$strTerm?>" /> </p> <p align="left"> <input type="button" name="Submit2" value="แสดงตารางสอน" onclick="select_teacher(<?=$strTerm?>);" /> <br /> </p></td> </tr> <tr> <td align="right"> <img src="images/icon_menu.gif" width="16" height="16" /></td> <td><div align="left">แสดงตารางเรยนนกเรยน</div></td> </tr> <tr> <td align="right" valign="bottom">&nbsp;</td> <td><p align="left"> <? $strName = split(" ",$_SESSION["session_name"]); $teacher_name = $_GET["teacher_name"]; if ($teacher_name) { $strTeacher_name = $teacher_name; } elseif ($_SESSION["user_type"] == "T") { $strTeacher_name = $strName[0]; } //end if $sql_std = "Select distinct std_group From tbl_teaching Where term in (select strTerm From tbl_term Where currentTerm = '1') order by std_group" ; $result_std = mysql_query($sql_std,$connect); $intRow_std= mysql_num_rows($result_std); ?> <select name="std_name" id="std_name"> <? if ($intRow_content != 0 ) { while ($rsstd = mysql_fetch_array($result_std)) { ?> <option value="<?=$rsstd[std_group];?>" ><?=$rsstd[std_group];?> </option> <? } //end while } //end if ?>

Page 17: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

131

</select> <input type="hidden" name="strTerm2" value="<?=$strTerm?>" /> </p> <p align="left"> <input type="button" name="Submit2" value="แสดงตารางเรยน" onclick="select_std(<?=$strTerm?>);" /> <br /> </p></td> </tr> <tr> <td align="right"> <img src="images/s_loggoff.png" alt="" width="16" height="16" /></td> <td><div align="left"><a href="logout.php">ออกจากระบบ</a> <? if ($_SESSION["user_admin" ]=="admin" ){ ?> </div></td> </tr> <tr> <td colspan="2" align="right"><hr /></td> </tr> <tr> <td align="right"><img src="images/b_usrcheck.png" width="16" height="16" /></td> <td><div align="left"><a href="manage_std.php"> ขอมลนสต</div></td> </tr> <tr> <td align="right"><img src="images/b_usrcheck.png" width="16" height="16" /></td> <td><div align="left"><a href="subject.php"> ขอมลรายวชา</div></td> </tr> <tr> <td align="right"><img src="images/b_usrcheck.png" width="16" height="16" /></td> <td><div align="left"><a href="manage_sub.php">รายวชาทเปดสอน</div></td> </tr> <tr> <td align="right"><img src="images/b_usrcheck.png" width="16" height="16" /></td> <td><div align="left"><a href="fine_teacher.php"> จดตารางสอน</div></td> </tr> <tr> <td align="right"><img src="images/b_usrcheck.png" width="16" height="16" /></td> <td><div align="left"><a href="del_teach.php">ยกเลกตารางสอน</div></td> </tr> <tr> <td align="right">&nbsp;</td> <td>&nbsp;</td> </tr> <? } ?> </table></td> </tr> </table> <p>&nbsp;</p></td> </tr> <tr> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> </tr> <? } //end if ?> <script type="text/javascript"> <!-- var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1"); var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2"); //-->

Page 18: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

132

</script> </body> </html>

manage_std.php

<? include("includes/config.inc.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>::ขอมลนสต::</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #F5F4F7; } .style1 { font-size: 14px; font-weight: bold; } .style4 {font-size: 16px} .style5 {font-size: small} --> </style></head> <body> <form id="form1" name="form1" method="post" action=""><table width="100%" border="0" cellspacing="2" cellpadding="2"> <tr> <td width="38"><strong><br /> </strong> </td> <td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="122">&nbsp;</td> <td width="122">&nbsp;</td> <td width="122">&nbsp;</td> <td width="627"><div align="right"><a href="index.php" class="style5">กลบหนาหลก</a></div></td> </tr> </table> <strong><br /> </strong></td> <td width="164" class="style4"><label></label></td> <td width="166" class="style4"><label></label></td> </tr> <tr> <td class="style4">&nbsp;</td> <td colspan="3" class="style4"> <form id="frmSearch" name="frmSearch" method="post" action="" onsubmit="return check_search();"> <span class="style4"> <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>ค าคน</strong> </label> </span> <span class="style4"> <label> </label> </span> <label> <input type="text" name="inKeyword" id="inKeyword" /> </label> <label> <input type="submit" name="btnFine" id="btnFine" value="คนหา" />

Page 19: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

133

<br /><br /> <table width="464" border="0" cellpadding="2" cellspacing="2"> <tr> <td width="34"></td> <td width="109" bgcolor="#B3E7FF" class="style1"><div align="center">หองเรยน</div></td> <td width="101" bgcolor="#B3E7FF" class="style1"><div align="center">จ านวนนสต</div></td> <td width="194">&nbsp;</td> </tr> <?php if(isset($_POST[btnFine])) { $keyword = $_POST[inKeyword]; $sql= "Select * From tbl_student Where class_name like '%".$keyword."%' "; // like '%$keyword%' "; $result = mysql_query($sql) or die(mysql_error()); $num= mysql_num_rows($result); $i = 0; while ($data1 = mysql_fetch_array($result)){ ?> <tr> <td>&nbsp;</td> <td bgcolor="#E8E8E8"><?=$data1[class_name]?></td> <td bgcolor="#E8E8E8"><?=$data1[number_std]?></td> <td><a href="update_student.php?sid=<?="$data1[class_name]";?>">แกไข</a> | <a href="manage_std.php?id_use2=<?="$data1[class_name]";?>">ลบ</a></td> </tr> <? $i++; } //end if } //end while if($i==0){ echo "<tr><td colspan='3' align='center'><font color='red' size='+1'><br>ไมมขอมล!</font></td></tr>"; } ?> </table> <br /> <br /> <br /> <hr /> <br /> <table width="486" border="0" cellspacing="2" cellpadding="2"> <tr> <td>&nbsp;</td> <td bgcolor="#F5F4F7"><a href="insert_student.php" class="style4">เพมขอมล<br /> <br /> </a></td> <td bgcolor="#F5F4F7">&nbsp;</td> <td bgcolor="#F5F4F7">&nbsp;</td> </tr> <tr> <td width="34">&nbsp;</td> <td width="101" bgcolor="#B3E7FF"><div align="center" class="style1"> <div align="center">หองเรยน</div> </div></td> <td width="130" bgcolor="#B3E7FF"><div align="center" class="style1">จ านวนนสต</div></td> <td width="195" bgcolor="#F5F4F7"><div align="center" class="style1"></div></td> </tr> <? $sql1 = "SELECT * FROM tbl_student "; $result = mysql_query($sql1) ; while ($data1 = mysql_fetch_array($result)){ $class=$data1["class_name"]; $num_std=$data1["number_std"]; ?> <tr> <td>&nbsp;</td> <td bgcolor="#E8E8E8"><?=$class ?></td> <td bgcolor="#E8E8E8"><?=$num_std ?></td>

Page 20: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

134

<td bgcolor="#F5F4F7"><a href="update_student.php?sid=<?="$data1[class_name]";?>">แกไขขอมล</a> | <a href="manage_std.php?id_use2=<?="$data1[class_name]";?>">ลบ</a></td> </tr> <? } ?> </table> <br /> <table width="500" border="0" cellspacing="2" cellpadding="2"> <tr> <td width="33" bgcolor="#F5F4F7">&nbsp;</td> <td width="453" bgcolor="#F5F4F7"><? $id_use2=$_GET[id_use2]; if($id_use2!=""){ $sql2="DELETE FROM tbl_student WHERE class_name='$id_use2' "; $result2=mysql_query($sql2) or die("ลบขอมลไมได"); echo"<meta http-equiv=refresh content=1;url=manage_std.php />"; echo "<B><font color =red>ลบขอมลเรยบรอยแลว....</B>"; } ?> </td> </tr> </table> <p><hr/><br /> </label> </p> <label><br /> </label> </form> </td> </tr> <tr></tr> <br /> <br /> </body> </html>

Page 21: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

135

insert_student.php

<? include("includes/config.inc.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>::เพมขอมล ::</title> <style type="text/css"> <!-- body { background-color: #F5F4F7; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } .style2 {font-size: 16px} .style3 {font-size: small} --> </style></head> <body> <table width="776" height="92" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="178">&nbsp;</td> <td width="178">&nbsp;</td> <td width="178">&nbsp;</td> <td width="343"><div align="right"><a href="manage_std.php" class="style3">ยอนกลบ</a></div></td> </tr> </table> <form id="form1" name="form1" method="post" action=""> <table width="852" border="0" cellspacing="2" cellpadding="2"> <tr> <td width="28">&nbsp;</td> <td width="203" valign="middle"><div align="left"><strong><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong><strong>&nbsp;&nbsp;เพมขอมล</strong><br /> <br /> </div></td> <td width="438">&nbsp;</td> <td width="157">&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td><label></label></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><div align="right" class="style2">หองเรยน :</div></td> <td><label> <input name="room" type="text" id="room" size="12" /> </label></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><div align="right" class="style2">จ านวนนสต :</div></td> <td><input name="unit_std" type="text" id="unit_std" size="8" /></td> <td>&nbsp;</td>

Page 22: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

136

</tr> <tr> <td height="27">&nbsp;</td> <td>&nbsp;</td> <td><br /> <input type="submit" name="Submit" id="button" value="บนทก" /> <input type="reset" name="Submit22" value="ยกเลก" onclick="location.href='<?=$_SERVER['PHP_SELF']?>?txtFind=<?=$txtFind?>';" /></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td><? if(isset($_POST[Submit])) { $sql="INSERT INTO tbl_student VALUES( '".$_POST["room"]."','".$_POST["unit_std"]."')"; mysql_query($sql); echo"<font color = red ><b> เพมขอมลเรยบรอยแลว.."; echo"<meta http-equiv=refresh content=1;url=manage_std.php />"; } ?></td> <td>&nbsp;</td> </tr> <tr> <td colspan="4"><hr/>&nbsp;</td> </tr> </table> <br /> </form> </body> </html>

update_student.php

<? include("includes/config.inc.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>::แกไขขอมล ::</title> <style type="text/css"> <!-- body { background-color: #F5F4F7; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } .style2 {font-size: small} --> </style></head> <body> <table width="730" height="92" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="129">&nbsp;</td> <td width="129">&nbsp;</td> <td width="129">&nbsp;</td> <td width="343"><div align="right"><a href="manage_std.php" class="style2">ยอนกลบ</a></div></td> </tr> </table>

Page 23: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

137

<form id="form1" name="form1" method="post" action=""> <? $sql4 = "select * from tbl_student where class_name ='$_GET[sid]' "; $result4= mysql_query($sql4); $data4 = mysql_fetch_array($result4); ?> <table width="769" border="0" cellspacing="2" cellpadding="2"> <tr> <td width="97">&nbsp;</td> <td width="136" valign="middle"><div align="left"><strong><br /> </strong><strong>แกไขขอมล</strong><br /> <br /> </div></td> <td width="306">&nbsp;</td> <td width="204">&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><div align="right">หองเรยน :</div></td> <td><label> <input name="room" type="text" id="room" size="12" value="<?= $data4[class_name];?>" /> </label></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><div align="right">จ านวนนสต :</div></td> <td><label> <input name="unit_std" type="text" id="unit_std" value="<?= $data4[number_std];?>" size="8" /> </label></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td height="27">&nbsp;</td> <td><input type="hidden" name="room2" id="room2" value="<?=$sid;?>"/></td> <td><input type="submit" name="Submit" id="button" value="บนทก" /> <input type="reset" name="Submit22" value="ยกเลก" onclick="location.href='<?=$_SERVER['PHP_SELF']?>?txtFind=<?=$txtFind?>';" /></td> <td>&nbsp;</td> </tr> <tr> <td height="46" colspan="4"><hr/></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table> </form> <? if(isset($_POST[Submit])) { $sql4="UPDATE tbl_student set class_name='$_POST[room]', number_std='$_POST[unit_std]' where class_name='$_POST[room2]' "; //var_dump($sql5) ; exit ; mysql_query($sql4); echo "<B>แกไขขอมลเรยบรอยแลว....</B>"; echo"<meta http-equiv=refresh content=1;url=manage_std.php />";

Page 24: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

138

} ?> </body> </html>

Page 25: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

139

subject.php

<? include("includes/config.inc.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>::ขอมลรายวชา::</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #F5F4F7; } .style1 { font-size: 14px; font-weight: bold; } .style7 { color: #000000 } .style8 {font-size: smaller} --> </style></head> <body> <table width="100%" height="84" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="144" height="33">&nbsp;</td> <td width="144">&nbsp;</td> <td width="105">&nbsp;</td> <td width="627"><div align="right"><a href="index.php" class="style8">กลบหนาหลก</a></div></td> </tr> </table> <form id="form1" name="form1" method="post" action=""> <br /> <table width="500" border="0" cellspacing="2" cellpadding="2"> <tr> <td width="38"><div align="right"></div></td> <td width="106">&nbsp;</td> <td width="164"><label></label></td> <td width="166"><label></label> <div align="right"></div></td> </tr> <tr> <td>&nbsp;</td> <td colspan="3"> <form id="frmSearch" name="frmSearch" method="post" action="" onsubmit="return check_search();"> <span class="style4"> <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>ค าคน</strong> </label> </span> <input type="text" name="inKeyword" id="inKeyword" /> </label> <label> <input type="submit" name="btnFine" id="btnFine" value="คนหา" /> <br /><br /> <table width="839" border="0" cellpadding="2" cellspacing="2"> <tr> <td width="34"></td> <td width="101" bgcolor="#B3E7FF" class="style1 style7">รหสวชา</td> <td width="131" bgcolor="#B3E7FF" class="style1"><div align="center">ภาษาไทย</div></td> <td width="125" bgcolor="#B3E7FF" class="style1"><div align="center">ภาษาองกฤษ</div></td>

Page 26: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

140

<td width="109" bgcolor="#B3E7FF" class="style1"><div align="center">ประเภทรายวชา</div></td> <td width="101" bgcolor="#B3E7FF" class="style1"><div align="center">จ านวนหนวยกต</div></td> <td width="194">&nbsp;</td> </tr> <?php if(isset($_POST[btnFine])) { $keyword = $_POST[inKeyword]; $sql= "Select * From tbl_subject Where name_th like '%".$keyword."%' "; // like '%$keyword%' "; $result = mysql_query($sql) or die(mysql_error()); $num= mysql_num_rows($result); $i = 0; while ($data1 = mysql_fetch_array($result)){ ?> <tr> <td>&nbsp;</td> <td bgcolor="#E8E8E8"><?=$data1[sub_id]?></td> <td bgcolor="#E8E8E8"><?=$data1[name_th]?></td> <td bgcolor="#E8E8E8"><?=$data1[name_en]?></td> <td bgcolor="#E8E8E8"><?=$data1[type_sub]?></td> <td bgcolor="#E8E8E8"><?=$data1[unit]?></td> <td><a href="update_subject.php?sid=<?="$data1[sub_id]";?>">แกไข</a> | <a href="subject.php?id_use11=<?="$data1[sub_id]";?>">ลบ</a></td> </tr> <? $i++; } //end if } //end while if($i==0){ echo "<tr><td colspan='6.5' align='center'><font color='red' size='+1'><br>ไมมขอมล!</font></td></tr>"; } ?> </table> <br /> <br /> </label> <label><br /> </label> <hr/> </form> </td></tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr></tr> <tr> <td>&nbsp;</td> <td><a href="insert_subject.php">เพมขอมล</a></td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <table width="839" border="0" cellpadding="2" cellspacing="2"> <tr> <td width="34">&nbsp;</td> <td width="101" bgcolor="#B3E7FF"><div align="center" class="style1"> <div align="left">รหสวชา</div> </div></td> <td width="131" bgcolor="#B3E7FF"><div align="center" class="style1">ชอวชาภาษาไทย</div></td>

Page 27: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

141

<td width="125" bgcolor="#B3E7FF"><div align="center" class="style1">ชอวชาภาษาองกฤษ</div></td> <td width="109" bgcolor="#B3E7FF"><div align="center" class="style1">ประเภทรายวชา</div></td> <td width="101" bgcolor="#B3E7FF"><span class="style1">จ านวนหนวยกต</span></td> <td width="194" bgcolor="#F5F4F7"><div align="center" class="style1"></div></td> </tr> <? $sql1 = "SELECT * FROM tbl_subject "; $result = mysql_query($sql1) ; while ($data1 = mysql_fetch_array($result)){ $user_id=$data1["sub_id"]; $th=$data1["name_th"]; $en=($data1["name_en"]); $type=($data1["type_sub"]); $unit=$data1["unit"]; ?> <tr> <td>&nbsp;</td> <td bgcolor="#E8E8E8"><?=$user_id ?></td> <td bgcolor="#E8E8E8"><?=$th ?></td> <td bgcolor="#E8E8E8"><?= $en ?></td> <td bgcolor="#E8E8E8"><?=$type ?></td> <td bgcolor="#E8E8E8"><div align="center"> </div> </td> <td><a href="update_subject.php?sid=<?="$data1[sub_id]";?>">แกไขขอมล</a> | <a href="subject.php?id_use11=<?="$data1[sub_id]";?>">ลบ</a></td> </tr> <? } ?> </table> <table width="839" cellpadding="2" cellspacing="2"> <tr> <td> <br/><hr/> </td> </tr> </table> <br /> <table width="493" border="0" cellspacing="2" cellpadding="2"> <tr> <td width="33">&nbsp;</td> <td width="446"><? $id_use11=$_GET[id_use11]; if($id_use11!=""){ $sql2="DELETE FROM tbl_subject WHERE sub_id='$id_use11' "; $result2=mysql_query($sql2) or die("ลบขอมลไมได"); echo"<meta http-equiv=refresh content=1;url=subject.php />"; echo "<B><font color =red>ลบขอมลเรยบรอยแลว....</B>"; } ?></td> </tr> </table> </body> </html>

insert_subject.php

<? include("includes/config.inc.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>::เพมขอมล ::</title>

Page 28: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

142

<style type="text/css"> <!-- body { background-color: #F5F4F7; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } .style2 {font-size: small} --> </style></head> <body> <form id="form1" name="form1" method="post" action=""> <table width="755" height="92" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="178">&nbsp;</td> <td width="178">&nbsp;</td> <td width="178">&nbsp;</td> <td width="627"><div align="right"><a href="subject.php" class="style2">ยอนกลบ</a></div></td> </tr> </table> <table width="852" border="0" cellspacing="2" cellpadding="2"> <tr> <td width="107"><div align="center"><strong>เพมขอมล</strong></div></td> <td width="124" valign="middle"><div align="left"><strong><br /> </strong><br /> <br /> </div></td> <td width="438">&nbsp;</td> <td width="157">&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>รหสวชา :</td> <td><label> <input name="t_id" type="text" id="t_id" size="12" /> </label></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>ชอวชาภาษาไทย :</td> <td><label> <input type="text" name="t_th" id="t_th" /> </label></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>ชอวชาภาษาองกฤษ :</td> <td><label> <input type="text" name="t_en" id="t_en" /> </label></td> <td>&nbsp;</td> </tr> <tr> <td height="27">&nbsp;</td> <td>ประเภทรายวชา :</td> <td><label> <select name="type" id="type"> <option value="เลอกประเภทรายวชา">---เลอกประเภทรายวชา ---</option> <option value="วชาแกน">วชาแกน</option> <option value="วชาเอก">วชาเอก</option> <option value="วชาเลอก">วชาเลอก</option> </select> </label></td>

Page 29: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

143

<td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>จ านวนหนวยกต :</td> <td><label> <input name="t_unit" type="text" id="t_unit" size="3" /> </label></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><? if(isset($_POST[Submit])) { $sql="INSERT INTO tbl_subject VALUES( '".$_POST["t_id"]."','".$_POST["t_th"]."','".$_POST["t_en"]."','".$_POST["type"]."','".$_POST["t_unit"]."')"; mysql_query($sql); echo"<font color = red ><b> เพมขอมลเรยบรอยแลว.."; echo"<meta http-equiv=refresh content=1;url=subject.php />"; } ?></td> <td><label> <input type="submit" name="Submit" id="button" value="บนทก" /> <input type="reset" name="Submit22" value="ยกเลก" onclick="location.href='<?=$_SERVER['PHP_SELF']?>?txtFind=<?=$txtFind?>';" /> </label></td> <td>&nbsp;</td> </tr> <tr> <td height="40" colspan="4"><hr/></td> </tr> </table> </form> </body> </html>

update_subject.php

<? include("includes/config.inc.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>::แกไขขอมล ::</title> <style type="text/css"> <!-- body { background-color: #F5F4F7; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } .style2 {font-size: small} -->

Page 30: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

144

</style></head> <body> <form id="form1" name="form1" method="post" action=""> <?php $sql3 = "select * from tbl_subject where sub_id ='$_GET[sid]' "; $result3= mysql_query($sql3); $data3 = mysql_fetch_array($result3); ?> <table width="714" height="92" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="178">&nbsp;</td> <td width="178">&nbsp;</td> <td width="178">&nbsp;</td> <td width="627"><div align="right"><a href="subject.php" class="style2">ยอนกลบ</a></div></td> </tr> </table> <table width="769" border="0" cellspacing="2" cellpadding="2"> <tr> <td width="91"><div align="center"><strong>แกไขขอมล</strong></div></td> <td width="158" valign="middle"><div align="left"><strong><br /> </strong><br /> <br /> </div></td> <td width="286">&nbsp;</td> <td width="208">&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><div align="left">รหสวชา :</div></td> <td><label> <input name="t_id" type="text" id="t_id" size="12" value="<?= $data3[sub_id];?>" /> </label></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><div align="left">ชอวชาภาษาไทย :</div></td> <td><label> <input type="text" name="t_th" id="t_th" value="<?= $data3[name_th];?>" /> </label></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><div align="left">ชอวชาภาษาองกฤษ :</div></td> <td><label> <input type="text" name="t_en" id="t_en" value="<?= $data3[name_en];?>" /> </label></td> <td>&nbsp;</td> </tr> <tr> <td height="27">&nbsp;</td> <td><div align="left">ประเภทรายวชา :</div></td> <td><label> <? $type =$data3["type_sub"]; ?> <select name="type" id="type"> <option value="เลอกประเภทรายวชา"<? if ($type == "เลอกประเภทรายวชา") {echo "selected";}?>>---เลอกประเภทรายวชา ---</option> <option value="วชาแกน"<? if ($type == "วชาแกน") {echo "selected";}?>>วชาแกน</option> <option value="วชาเอก"<? if ($type == "วชาเอก") {echo "selected";}?>>วชาเอก</option> <option value="วชาเลอก"<? if ($type == "วชาเลอก") {echo "selected";}?>>วชาเลอก</option> </select> </label></td> <td>&nbsp;</td> </tr>

Page 31: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

145

<tr> <td>&nbsp;</td> <td><div align="left">จ านวนหนวยกต :</div></td> <td><label> <input name="t_unit" type="text" id="t_unit" size="3" value="<?= $data3[unit];?>" /> </label></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><input type="hidden" name="t_id2" id="t_id2" value="<?=$sid;?>"/></td> <td><label> <input type="submit" name="Submit" id="button" value="บนทก" /> <label> <input type="reset" name="Submit22" value="ยกเลก" onclick="location.href='<?=$_SERVER['PHP_SELF']?>?txtFind=<?=$txtFind?>';" /> </label></td> <td>&nbsp;</td> </tr> <tr> <td height="37" colspan="4"><hr/> </td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table> </form> <? if(isset($_POST[Submit])) { $sql3="UPDATE tbl_subject set sub_id='$_POST[t_id]', name_th='$_POST[t_th]', name_en='$_POST[t_en]', type_sub='$_POST[type]', unit='$_POST[t_unit]' where sub_id='$_POST[t_id2]' "; mysql_query($sql3); echo "<B>แกไขขอมลเรยบรอยแลว....</B>"; echo"<meta http-equiv=refresh content=1;url=subject.php />"; } ?> </body> </html>

manage_sub.php

<? include("includes/config.inc.php"); ?> <script language="javascript" src="checkform.js"></script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>จดการรายวชาทเปดสอน</title> <style type="text/css"> <!-- .style3 {font-size: smaller} .style4 { color: #0000FF; font-weight: bold; } body {

Page 32: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

146

background-color: #F5F4F7; } --> </style> <script type="text/JavaScript"> <!-- function MM_Menu(){ page = 'manage_sub2.php?tid='; techid = document.getElementById("inKeyword").value; //alert(techid); location=page+techid; opener.document.location.reload(); } //--> </script> </head> <body> <table width="889" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="358"><span class="style4">จดการรายวชาทเปดสอน</span></td> <td width="96">&nbsp;</td> <td width="496"><div align="right"><span class="style3"><a href="sh_subject.php">ดรายวชาทเปดสอน</a>&nbsp;&nbsp;&nbsp;<a href="index.php">กลบหนาหลก</a></span></div></td> </tr> </table> <p><b>คนหาอาจารยผสอน</b></p> <form id="frmFineTeacher" name="frmFineTeacher" method="post" enctype="multipart/form-data" onsubmit= "return check_search();"> <p>โปรดระบชอทานอาจารย <label> <select name="inKeyword"id="inKeyword" onChange="MM_Menu()"> <option value="0">- - - -เลอกอาจารย - - - -</option> <? $sql = "select * from personal "; $result = mysql_query($sql) or die ("select ไมได"); while ($data = mysql_fetch_array($result) ) { ?> <option value="<?=$data["teacherID"] ;?>"><?=$data["name"] ;?></option> <? }?> </select> </label> &nbsp;&nbsp; <label>คนหาจาก&nbsp; <select name="searchC"> <option value="teacherID ">รหส</option> <option value="name">ชอ</option> </select> &nbsp; <input type="text" name="search" id="search" /> </label> <input type="submit" name="btnFine" id="btnFine" value="คนหา" /> </p> </form> <hr /> <p> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <?php if($_POST[btnFine]) { $keyword = $_POST[search]; $searchC=$_POST[searchC]; $sql_list = "Select * From personal Where ".$searchC." like '".$keyword."%' "; // like '%$keyword%' "; $result_list = mysql_query($sql_list) or die(mysql_error()); $i = 0;

Page 33: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

147

while ($data_list = mysql_fetch_array($result_list)){ if($i%2==0){$rowColor="#E1E0E2"; } else {$rowColor="#CECECE";} ?> <p> <tr ><!-- <td width="9%">$num_list&nbsp;</td> --> <td width="55%" bgcolor=<? echo $rowColor ?>><? echo $data_list[name]?> </td> <td width="45%" align="right" bgcolor=<? echo $rowColor ?> ><a href="fine_subject.php?tid=<?="$data_list[teacherID]";?>">แสดงรายวชา</a>&nbsp;</td> </tr> <? $i++; } //end if } //end while ?></table> </body> </html>

manage_sub2.php

<? session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>จดการรายวชาทเปดสอน</title> <style type="text/css"> <!-- .style1 {font-size: smaller} .style4 { color: #0000FF; font-weight: bold; } body { background-color: #F5F4F7; } --> </style> <script type="text/JavaScript"> <!-- function MM_Menu(){ page = 'manage_sub3.php?'; techid ="tid="+document.getElementById("tid").value; suid ="&suid="+document.getElementById("select").value; //alert(techid); location=page+techid+suid; opener.document.location.reload(); } //--> </script> </head> <body> <table width="938" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="421"><span class="style4">จดการรายวชาทเปดสอน</span></td> <td width="229">&nbsp;</td> <td width="369"><div align="right"><span class="style1"><a href="sh_subject.php">ดรายวชาทเปดสอน</a>&nbsp;&nbsp;&nbsp;<a href="manage_sub.php">ยอนกลบ</a></span></div></td> </tr> </table>

Page 34: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

148

<?php include("includes/config.inc.php"); /*$sql_list = "Select * From personal Where teacherID ='$_GET[tid]' "; //$sql_list = "Select * From personal Where teacherID ='$_POST[tid]' "; $result_list = mysql_query($sql_list) or die(mysql_error()); while ($data_list = mysql_fetch_array($result_list)){ $teacherID = $data_list[teacherID]; $name = $data_list[name]; } //end while*/ $sqlP = "select * from personal where teacherID = '".$_GET['tid']."'"; $resultP = mysql_query($sqlP) ;//or die ("select ไมได"); $dataP = mysql_fetch_array($resultP) ; $_SESSION[name]= $dataP['name']; //echo $sqlP; ?> <p><h1> อาจารย&nbsp;<? echo $dataP['name'] ?></h1></p> <p>คนหารายวชาทเปดสอน</p> <form id="form1" name="form1" method="post" action=""> <input type="hidden" id="tid" value="<? echo $dataP['teacherID'] ?>"> <p>โปรดระบชอรายวชา <select name="select" id="select" onchange="MM_Menu()"> <option value="0">- - - -เลอกรายวชา- - - -</option> <? $sql = "select * from tbl_subject "; $result = mysql_query($sql) or die ("select ไมได"); while ($data = mysql_fetch_array($result) ) { ?> <option value="<?=$data[sub_id] ;?>"><?=$data[name_th] ;?></option> <? }?> </select> <input type="submit" name="btnFine" id="btnFine" value="คนหา" /> </p> </form> <table cellspacing="0" cellpadding="0"> <tr valign="top" bgcolor="#515151"> <td bgcolor="#ffffff"><table cellspacing="0" cellpadding="0" border="0"> <tbody> </tbody> </table> <!-- End Page Detail --></td> </tr> <!-- Footer --> </table> <hr /> <?php if(isset($_POST[btnFine])) { $keyword = $_POST[inKeyword]; $sql= "Select * From tbl_subject Where name_th like '%".$keyword."%' "; // like '%$keyword%' "; $result = mysql_query($sql) or die(mysql_error()); $num= mysql_num_rows($result); while ($data = mysql_fetch_array($result)){ ?> <a href="fine_groupstd.php?suid=<?="$data[sub_id]";?>"> <?=$data[name_th ]?></a> <br/> <? } //end if } //end while ?>

Page 35: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

149

</body> </html>

manage_sub3.php

<? session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>จดการรายวชาทเปดสอน</title> <style type="text/css"> <!-- .style1 {font-size: smaller} .style4 {color: #0000FF; font-weight: bold; } body { background-color: #F5F4F7; } --> </style> <script type="text/JavaScript"> <!-- function MM_Menu(){ var group =document.getElementById("select").value; //จ านวนกลมทจะเปดสอน var termN =document.getElementById("select2").value; //ภาคเรยน+ปการศกษา var insertValue = document.getElementById("form2"); insertValue.group.value=group; insertValue.term.value=termN; } function MM_Check(){ nameteach =document.getElementById("nameteach").value; subject =document.getElementById("subject").value; group =document.getElementById("group").value; //จ านวนกลมทจะเปดสอน term =document.getElementById("term").value; //ภาคเรยน+ปการศกษา if(nameteach==""||subject==""||group==""||term==""){ alert ("กรณากรอกขอมลใหครบถวน!"); return; } var submitform = document.getElementById("form2"); submitform.submit(); } //--> </script> </head> <body> <table width="946" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="359"><span class="style4">จดการรายวชาทเปดสอน</span></td> <td width="193">&nbsp;</td> <td width="519"><div align="right"><span class="style1"><a href="sh_subject.php">ดรายวชาทเปดสอน</a>&nbsp;&nbsp;&nbsp;<a href="manage_sub2.php">ยอนกลบ</a></span></div></td> </tr> </table> <?php include("includes/config.inc.php"); $sql_list = "Select * From tbl_subject Where sub_id ='$_GET[suid]' "; $result_list = mysql_query($sql_list) or die(mysql_error()); while ($data_list = mysql_fetch_array($result_list)){

Page 36: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

150

$sub_id = $data_list[sub_id]; $name_th = $data_list[name_th]; } //end while $sqlS = "select * from tbl_subject where sub_id = '".$_GET['suid']."'"; $resultS = mysql_query($sqlS) ;//or die ("select ไมได"); $dataS = mysql_fetch_array($resultS) ; $subname = $dataS[name_th]."&nbsp;(". $dataS[name_en].")"; $_SESSION[subject]=$subname; ?> <p> <h1>อาจารย<? echo $_SESSION[name] ?></h1> <h1>วชา<? echo $subname ?></h1> <p> <input type="hidden" id="tid" value="<? echo $_GET[tid] ?>"> <input type="hidden" id="suid" value="<? echo $_GET[suid] ?>"> </p> <form id="form1" name="form1" method="get" action="manage_sub3.php"> <p>จ านวนกลมเรยนทจะเปดสอน <label> <select name="select" id="select" ><!--onchange="MM_Menu()"--> <? echo $_GET[group]; $count=1; while($count<=20){ if($_GET[group]==$count){ echo "<option value='$count' selected='selected'>$count</option>"; } else{ echo "<option value='$count' >$count</option>"; } $count++; } ?> </select> </label>ภาคเรยน/ปการศกษา <label> <select name="select2" id="select2" > <? $i=0; $sql = "select * from tbl_term order by currentTerm desc"; $result = mysql_query($sql) or die ("select ไมได"); while ($data = mysql_fetch_array($result) ) { if($i<=0){ echo "<option value='$data[strTerm] ' selected='selected'>$data[strTerm] </option>"; } else { echo "<option value='$data[strTerm] '>$data[strTerm] </option>"; } $i++; } ?> </select> <input type="button" name="Submit2" value="ตกลง" onclick="MM_Menu()"/> </label> </p> </form> <hr /> <a href="fine_room.php?class_name=<?="$data[class_name]";?>"></a> <form id="form2" name="form2" method="post" action="save_subject.php"> <table width="100%" border="0" cellspacing="0"> <tr>

Page 37: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

151

<td width="25%" valign="top"><strong>รายละเอยดการจดการรายวชา</strong></td> <td width="75%" valign="top">&nbsp;</td> </tr> <tr> <td align="right" valign="top">&nbsp;</td> <td valign="top"><input name="teachid" type="hidden" id="teachid" value="<?= $_GET[tid]?>"/> <input name="subid" type="hidden" id="subid" value="<?= $_GET[suid]?>"/></td> </tr> <tr> <td align="right" valign="top">อาจารยผสอน&nbsp;</td> <td valign="top">&nbsp; <label> <input name="nameteach" type="text" id="nameteach" size="30" readonly="true" value="<?= $_SESSION[name] ?>"/> </label> </td> </tr> <tr> <td align="right" valign="top">รายวชาทเปดสอน&nbsp;</td> <td valign="top">&nbsp; <input name="subject" type="text" id="subject" size="30" readonly="true" value="<? echo $subname ?>"/></td> </tr> <tr> <td align="right" valign="top">จ านวนกลมทสอน&nbsp;</td> <td valign="top">&nbsp; <input name="group" type="text" id="group" size="30" readonly="true" value="<? echo $_GET['group'] ?>"/></td> </tr> <tr> <td align="right" valign="top">ภาดเรยน/ปการศกษา&nbsp;</td> <td valign="top">&nbsp; <input name="term" type="text" id="term" size="30" readonly="true" value="<? echo $_GET['termN'] ?>"/></td> </tr> <tr> <td align="right" valign="top">&nbsp;</td> <td valign="top">&nbsp;</td> </tr> <tr> <td align="right" valign="top">&nbsp;</td> <td valign="top">&nbsp; <label> <input type="button" name="Button" value="บนทกขอมล" onclick="MM_Check();"/> </label></td> </tr> </table></form> <br/> </body> </html>

save_subject.php

<?php session_start(); ?> <? include("includes/config.inc.php"); $teachid = $_REQUEST['teachid']; $subid = $_REQUEST['subid']; $group=$_REQUEST['group']; $term=$_REQUEST['term']; $count=1; while($count<=$group){ $sql="insert into tbl_teach_detail (teacherID,sub_id,sec,term,sec_status) values

Page 38: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

152

('$teachid','$subid','$count','$term','no')"; $charset = "set NAMES tis620"; mysql_query($charset) or die('Invalid query: ' . mysql_error()); mysql_query($sql)or die('Invalid query: ' . mysql_error()); $count++; } echo "<br><br>Please wait... saving data!"; ?> <meta http-equiv="Refresh" content="4;URL='sh_subject.php'"> <!----><style type="text/css"> <!-- body { background-color: #F5F4F7; } --> </style>

Page 39: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

153

sh_subject.php

<? include("includes/config.inc.php"); ?> <script language="javascript" src="checkform.js"></script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>จดการรายวชาทเปดสอน</title> <style type="text/css"> <!-- .style3 {font-size: smaller} .style4 { color: #0000FF; font-weight: bold; } .style9 {color: #FFFFFF; font-weight: bold; font-size: 12px; } body { background-color: #F5F4F7; } --> </style> <script type="text/JavaScript"> <!-- function MM_Menu(){ term = document.getElementById("select2").value; var submitform = document.getElementById("form2"); submitform.term.value=term; submitform.submit(); } //--> </script> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td width="150" valign="top"><span class="style4">รายวชาทเปดสอน</span></td> <td width="275" align="left" valign="top"> <form id="form2" name="form2" method="get" action="sh_subject.php"> <input type="hidden" name="term" id="term" > </form> <form id="form1" name="form1" method="get" action="sh_subject.php"> เทอม/ปการศกษา&nbsp; <select name="select2" id="select2" onchange="MM_Menu()"> <option value="" selected='selected' >--เลอก--</option> <? $i=0; $sql = "select * from tbl_term order by currentTerm desc"; $result = mysql_query($sql) or die ("select ไมได"); while ($data = mysql_fetch_array($result) ) { if($i<=0){ echo "<option value='$data[strTerm]' >$data[strTerm] </option>"; } else { echo "<option value='$data[strTerm]'>$data[strTerm] </option>"; } $i++; }?> </select>

Page 40: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

154

</form> </td> <td width="534"><div align="right"><span class="style3"><a href="index.php">กลบหนาหลก</a></span></div></td> </tr> </table> <hr /> <table width="100%" border="0" cellspacing="0"> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td align="center">&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td width="4%">&nbsp;</td> <td width="16%">&nbsp;</td> <td width="66%" align="center"> <? if($_GET[term]!=""){ echo "<font color='blue' size='+2'>เทอม/ปการศกษา : $_GET[term]</font><br><br>"; ?> <table width="90%" border="0" cellspacing="1"> <tr> <td width="6%" align="center" bgcolor="#0099FF"><span class="style9">ล าดบ</span></td> <td width="39%" align="center" bgcolor="#0099FF"><span class="style9">ชอวชา</span></td> <td width="31%" align="center" bgcolor="#0099FF"><span class="style9">อาจารยผสอน</span></td> <td width="9%" align="center" bgcolor="#0099FF"><span class="style9">กลมเรยนทงหมด</span></td> <td width="15%" align="center" bgcolor="#0099FF"><span class="style9">ภาคเรยน/ปการศกษา</span></td> </tr> <? $i=1; $sqlteach="select * from tbl_teach_detail where term='".$_GET[term]."' group by sub_id,teacherID,term order by id"; $resultT = mysql_query($sqlteach)or die(mysql_error()); while($memShow = mysql_fetch_array($resultT)){ if($i%2==0){$rowColor="#E1E0E2"; } else {$rowColor="#FFFFFF";} /////////////////////////////// check status subject ตรวจสอบวารายวชานนๆ ไดจดตารางเรยนครบทกกลมแลว //////////////////////////// $sqlcheck_1 = "select count(sec) as count_sec from tbl_teach_detail where teacherID='".$memShow['teacherID']."' and term='".$memShow['term']."' and sub_id='".$memShow['sub_id']."'"; $resultcheck_1 = mysql_query($sqlcheck_1) or die ("select ไมได"); $countcheck_1 = mysql_fetch_array($resultcheck_1); $sqlcheck_2 = "select count(sec) as count_sec2 from tbl_teach_detail where teacherID='".$memShow['teacherID']."' and term='".$memShow['term']."' and sub_id='".$memShow['sub_id']."' and sec_status='yes'"; $resultcheck_2 = mysql_query($sqlcheck_2) or die ("select ไมได"); $countcheck_2 = mysql_fetch_array($resultcheck_2); if($countcheck_1[count_sec]==$countcheck_2[count_sec2]){$rowColor="#FFCC66"; } /////////////////////////////////////// end check ////////////////////////// $sql2="SELECT * FROM personal where teacherID= '".$memShow['teacherID']."'"; $result2 = mysql_query($sql2)or die(mysql_error()); $memShow2 = mysql_fetch_array($result2); $sql3="SELECT * FROM tbl_subject where sub_id= '".$memShow['sub_id']."'"; $result3= mysql_query($sql3)or die(mysql_error()); $memShow3 = mysql_fetch_array($result3); $sqlsec="SELECT count(sec) as sumsec FROM tbl_teach_detail where sub_id= '".$memShow['sub_id']."' AND teacherID= '".$memShow['teacherID']."' AND term='".$memShow['term']."'"; $resulsec= mysql_query($sqlsec)or die(mysql_error()); $seccount = mysql_fetch_array($resulsec); echo $sql4; echo "<tr> <td bgcolor=".$rowColor." align='center'>".$i."</td> <td

Page 41: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

155

bgcolor=".$rowColor.">&nbsp;&nbsp;".$memShow3['name_th']."&nbsp;&nbsp;".$memShow3['name_en']."</td> <td bgcolor=".$rowColor." >&nbsp;&nbsp;".$memShow2['name']."</td> <td bgcolor=".$rowColor." align='center'>".$seccount['sumsec']."</td> <td bgcolor=".$rowColor." align='center'>".$memShow['term']."</td> </tr>"; $i++; } echo " </table>"; if($i==1){ echo "<center><font color='red' size='+2'><br><br>ไมมรายวชาทเปดสอน!</font></center>"; } } ?> </td> <td width="14%">&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table> <p> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <?php if($_POST[btnFine]) { $keyword = $_POST[search]; $searchC=$_POST[searchC]; $sql_list = "Select * From personal Where ".$searchC." like '".$keyword."%' "; // like '%$keyword%' "; $result_list = mysql_query($sql_list) or die(mysql_error()); $i = 0; while ($data_list = mysql_fetch_array($result_list)){ if($i%2==0){$rowColor="#E1E0E2"; } else {$rowColor="#CECECE";} ?> <p> <tr ><!-- <td width="9%">$num_list&nbsp;</td> --> <td width="55%" bgcolor=<? echo $rowColor ?>><? echo $data_list[name]?> </td> <td width="45%" align="right" bgcolor=<? echo $rowColor ?> ><a href="fine_subject.php?tid=<?="$data_list[teacherID]";?>">แสดงรายวชา</a>&nbsp;</td> </tr> <? $i++; } //end if } //end while ?></table> </body> </html>

fine_teacher.php

<? include("includes/config.inc.php"); ?> <script language="javascript" src="checkform.js"></script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>คนหาอาจารยผสอน</title> <style type="text/css">

Page 42: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

156

<!-- .style3 {font-size: smaller} body { background-color: #F5F4F7; } --> </style> <script type="text/JavaScript"> <!-- function MM_Menu(){ page = 'fine_subject.php?tid='; techid = document.getElementById("inKeyword").value; location=page+techid; opener.document.location.reload(); } //--> </script> </head> <body> <table width="945" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="76">&nbsp;</td> <td width="76">&nbsp;</td> <td width="76">&nbsp;</td> <td width="845" align="right"><span class="style3"><a href="del_teach.php">ยกเลกตารางสอน</a>&nbsp;&nbsp;&nbsp;<a href="index.php">กลบหนาหลก</a>&nbsp;</span></td> </tr> </table> <p><b>คนหาอาจารยผสอน</b></p> <form id="frmFineTeacher" name="frmFineTeacher" method="post" enctype="multipart/form-data" onsubmit= "return check_search();"> <p>โปรดระบชอทานอาจารย <label> <select name="inKeyword"id="inKeyword" onChange="MM_Menu()"> <option value="0">- - - -เลอกอาจารย - - - -</option> <? $sql = "select * from personal where teacherID in( select teacherID from tbl_teach_detail ) "; $result = mysql_query($sql) or die ("select ไมได"); while ($data = mysql_fetch_array($result) ) { ?> <option value="<?=$data["teacherID"] ;?>"><?=$data["name"] ;?></option> <? }?> </select> </label> &nbsp;&nbsp; <label>คนหาจาก&nbsp; <select name="searchC"> <option value="teacherID ">รหส</option> <option value="name">ชอ</option> </select> &nbsp; <input type="text" name="search" id="search" /> </label> <input type="submit" name="btnFine" id="btnFine" value="คนหา" /> </p> </form> <hr /> <p> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <?php

Page 43: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

157

if($_POST[btnFine]) { $keyword = $_POST[search]; $searchC=$_POST[searchC]; //$maxrows=$_POST[maxrows]; 'ถาก าหนดจ านวนแถวทจะแสดง $sql_list = "Select * From personal Where ".$searchC." like '".$keyword."%' "; // like '%$keyword%' "; //echo $sql_list; // $sql_list = "Select * From personal Where name like '%".$keyword."%' limit 0,' ".$maxrows." ' "; ; 'ถาก าหนดจ านวนแถวทจะแสดง $result_list = mysql_query($sql_list) or die(mysql_error()); //$num_list = mysql_num_rows($result_list); $i = 0; while ($data_list = mysql_fetch_array($result_list)){ if($i%2==0){$rowColor="#E1E0E2"; } else {$rowColor="#CECECE";} ?> <p> <tr ><!-- <td width="9%">$num_list&nbsp;</td> --> <td width="55%" bgcolor=<? echo $rowColor ?>><? echo $data_list[name]?> </td> <td width="45%" align="right" bgcolor=<? echo $rowColor ?> ><a href="fine_subject.php?tid=<?="$data_list[teacherID]";?>">แสดงรายวชา</a>&nbsp;</td> </tr> <? $i++; } //end if } //end while ?></table> </body> </html>

fine_subject.php

<? session_start(); $term = $_SESSION["term_id"]; include("includes/config.inc.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>คนหารายวชาทเปดสอน</title> <style type="text/css"> <!-- .style1 {font-size: smaller} body { background-color: #F5F4F7; } --> </style> <script type="text/JavaScript"> <!-- function MM_Menu(){ page = 'fine_groupstd.php?'; techid ="tid="+document.getElementById("tid").value; suid ="&suid="+document.getElementById("select").value; //alert(techid); location=page+techid+suid; opener.document.location.reload(); } //-->

Page 44: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

158

</script> </head> <body> <table width="932" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="178">&nbsp;</td> <td width="178">&nbsp;</td> <td width="178">&nbsp;</td> <td width="406"><div align="right"><span class="style1"><a href="fine_teacher.php">ยอนกลบ</a></span></div></td> </tr> </table> <?php $result_list = mysql_query($sql_list) or die(mysql_error()); while ($data_list = mysql_fetch_array($result_list)){ $teacherID = $data_list[teacherID]; $name = $data_list[name]; } //end while*/ $sqlP = "select * from personal where teacherID = '".$_GET['tid']."'"; $resultP = mysql_query($sqlP) ;//or die ("select ไมได"); $dataP = mysql_fetch_array($resultP) ; $_SESSION[name]= $dataP['name']; $_SESSION[teach_id] = $_GET[tid]; ?> <p><h1> อาจารย&nbsp;<? echo $dataP['name'] ?></h1></p> <p>คนหารายวชาทเปดสอน</p> <form id="form1" name="form1" method="post" action=""> <input type="hidden" id="tid" value="<? echo $dataP['teacherID'] ?>"> <p>โปรดระบชอรายวชา <select name="select" id="select" onchange="MM_Menu()"> <option value="0">- - - -เลอกรายวชา- - - -</option> <? $sql = "select distinct sub_id from tbl_teach_detail where teacherID='".$_GET['tid']."' and term=".$term; $result = mysql_query($sql) or die ("select ไมได"); //echo $sql ; while ($data = mysql_fetch_array($result) ) { $sql2 = "select * from tbl_subject where sub_id = '".$data['sub_id']."' "; $result2 = mysql_query($sql2) or die ("select ไมได"); $data2 = mysql_fetch_array($result2); $sqlcheck_1 = "select count(sec) as count_sec from tbl_teach_detail where teacherID='".$_GET['tid']."' and term=".$term." and sub_id='".$data['sub_id']."'"; $resultcheck_1 = mysql_query($sqlcheck_1) or die ("select ไมได"); $countcheck_1 = mysql_fetch_array($resultcheck_1); $sqlcheck_2 = "select count(sec) as count_sec2 from tbl_teach_detail where teacherID='".$_GET['tid']."' and term=".$term." and sub_id='".$data['sub_id']."' and sec_status='yes'"; $resultcheck_2 = mysql_query($sqlcheck_2) or die ("select ไมได"); $countcheck_2 = mysql_fetch_array($resultcheck_2); if($countcheck_1[count_sec]!=$countcheck_2[count_sec2]){ ?> <option value="<?=$data2[sub_id] ;?>"><?=$data2[name_th] ;?></option> <? } }?> </select> <input type="submit" name="btnFine" id="btnFine" value="คนหา" /> </p> </form> <table cellspacing="0" cellpadding="0"> <tr valign="top" bgcolor="#515151">

Page 45: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

159

<td bgcolor="#ffffff"><table cellspacing="0" cellpadding="0" border="0"> <tbody> </tbody> </table> <!-- End Page Detail --></td> </tr> <!-- Footer --> </table> <hr /> <?php if(isset($_POST[btnFine])) { $keyword = $_POST[inKeyword]; $sql= "Select * From tbl_subject Where name_th like '%".$keyword."%' "; // like '%$keyword%' "; $result = mysql_query($sql) or die(mysql_error()); $num= mysql_num_rows($result); while ($data = mysql_fetch_array($result)){ ?> <a href="fine_groupstd.php?suid=<?="$data[sub_id]";?>"> <?=$data[name_th ]?></a> <br/> <? } //end if } //end while ?> </body> </html>

fine_groupstd.php

<? session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>คนหากลมเรยนนสต</title> <style type="text/css"> <!-- .style1 {font-size: smaller} body { background-color: #F5F4F7; } --> </style> <script type="text/JavaScript"> <!-- function MM_Menu(){ page = 'fine_room.php?'; techid ="tid="+document.getElementById("tid").value; suid ="&suid="+document.getElementById("suid").value; gid ="&class_name="+document.getElementById("select").value; location=page+techid+suid+gid; opener.document.location.reload(); } //--> </script> </head> <body> <table width="924" border="0" cellspacing="0" cellpadding="0"> <tr>

Page 46: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

160

<td width="178">&nbsp;</td> <td width="178">&nbsp;</td> <td width="178">&nbsp;</td> <td width="529"><div align="right"><span class="style1"><a href="fine_subject.php">ยอนกลบ</a></span></div></td> </tr> </table> <?php include("includes/config.inc.php"); $sql_list = "Select * From tbl_subject Where sub_id ='$_GET[suid]' "; $result_list = mysql_query($sql_list) or die(mysql_error()); while ($data_list = mysql_fetch_array($result_list)){ $sub_id = $data_list[sub_id]; $name_th = $data_list[name_th]; } //end while $sqlS = "select * from tbl_subject where sub_id = '".$_GET['suid']."'"; $resultS = mysql_query($sqlS) ;//or die ("select ไมได"); $dataS = mysql_fetch_array($resultS) ; $subname = $dataS[name_th]."&nbsp;(". $dataS[name_en].")"; $_SESSION[subject]=$subname; ?> <p> <h1>อาจารย<? echo $_SESSION[name] ?></h1> <h1>วชา<? echo $subname ?></h1> <p>คนหากลมเรยนนสต</p> <form id="form1" name="form1" method="post" action=""> <input type="hidden" id="tid" value="<? echo $_GET[tid] ?>"> <input type="hidden" id="suid" value="<? echo $_GET[suid] ?>"> <p>โปรดระบชอกลมเรยน <label> <select name="select" id="select" onchange="MM_Menu()"> <option value="0">- - - -เลอกกลมเรยน - - - -</option> <? $sql = "select * from tbl_student "; $result = mysql_query($sql) or die ("select ไมได"); while ($data = mysql_fetch_array($result) ) { ?> <option value="<?=$data[number_std] ;?>"><?=$data[class_name] ;?></option> <? }?> </select> </label> <input type="submit" name="btnFine" id="btnFine" value="คนหา" /> </p> </form> <hr /> <?php if(isset($_POST[btnFine])) { $keyword = $_POST[inKeyword]; $sql= "Select * From tbl_student Where class_name like '%".$keyword."%' "; // like '%$keyword%' "; $result = mysql_query($sql) or die(mysql_error()); $num= mysql_num_rows($result); while ($data = mysql_fetch_array($result)){ ?> <a href="fine_room.php?class_name=<?="$data[class_name]";?>"><?=$data[class_name ]?></a> <br/> <? } //end if } //end while ?>

Page 47: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

161

</body> </html>

fine_room.php

<? session_start(); <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>คนหาหองเรยน</title> <style type="text/css"> <!-- .style1 {font-size: smaller} body { background-color: #F5F4F7; } --> </style> <script type="text/JavaScript"> <!-- function MM_Menu(){ page = 'time_table.php?'; techid ="tid="+document.getElementById("tid").value; suid ="&suid="+document.getElementById("suid").value; gid ="&class_name="+document.getElementById("class_name").value; rid="&r_id="+document.getElementById("select").value; location=page+techid+suid+gid+rid; opener.document.location.reload(); } //--> </script> </head> <body> <table width="934" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="178">&nbsp;</td> <td width="178">&nbsp;</td> <td width="178">&nbsp;</td> <td width="537"><div align="right"><span class="style1"><a href="fine_groupstd.php">ยอนกลบ</a></span></div></td> </tr> </table> <?php include("includes/config.inc.php"); $sql_list = "Select * From tbl_student Where class_name ='$_GET[class_name]' "; $result_list = mysql_query($sql_list) or die(mysql_error()); while ($data_list = mysql_fetch_array($result_list)){ $class_name = $data_list[class_name]; $number_std = $data_list[number_std]; } //end while $sqlC = "select * from tbl_student where number_std = '".$_GET['class_name']."'"; $resultC = mysql_query($sqlC) ;//or die ("select ไมได"); $dataC = mysql_fetch_array($resultC) ; $_SESSION[class_name]=$dataC['class_name']; ?> <h1>อาจารย<? echo"$_SESSION[name]"?></h1> <h1>วชา<? echo"$_SESSION[subject]"?></h1> <h1>กลมเรยนนสต <? echo $dataC['class_name'] ?></h1> <p>คนหาหองเรยน</p>

Page 48: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

162

<form id="form1" name="form1" method="post" action=""> <input type="hidden" id="tid" value="<? echo $_GET[tid] ?>"> <input type="hidden" id="suid" value="<? echo $_GET[suid] ?>"> <input type="hidden" id="class_name" value="<? echo $_GET[class_name] ?>"> <p>โปรดระบชอหองเรยน <label> <select name="select" id="select" onchange="MM_Menu()"> <option value="0">- - - -เลอกหองเรยน- - - -</option> <? $sql = "select * from tbl_room_reserv "; $result = mysql_query($sql) or die ("select ไมได"); while ($data = mysql_fetch_array($result) ) { ?> <option value="<?=$data[r_id] ;?>"><?=$data[room] ;?></option> <? }?> </select> </label> </p> </form> <hr /> <?php if(isset($_POST[btnFine])) { $keyword = $_POST[inKeyword]; $sql= "Select * From tbl_room_reserv Where room like '%".$keyword."%' "; // like '%$keyword%' "; $result = mysql_query($sql) or die(mysql_error()); $num= mysql_num_rows($result); while ($data = mysql_fetch_array($result)){ ?> <a href="time_table.php?r_id=<?="$data[r_id]";?>"> <?=$data[room ]?> </a> <br/> <? } //end if } //end while ?> <p>&nbsp;</p> </body> </html>

time_table.php

<? session_start();?> <? $strAction = $_GET["strAction"]; $strPrint = $_GET["strPrint"]; if (empty($term)) { $term = $_SESSION["term_id"]; } //end if $startDate = $_GET["startDate"]; $endDate = $_GET["endDate"]; if ($strPrint == "1") { $strLoad = "onLoad=cmd_print();"; } //end if ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>ก าหนดเวลาเรยน</title> <style type="text/css"> <!--

Page 49: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

163

body{ font-family: Arial, Helvetica, sans-serif; font-size:12px; color:blue; background-color: #F5F4F7; } .style1 {font-size: smaller} .style7 {font-size: 18px} --> </style> <script language="javascript"> function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } function chk_print(room,strPrint) { var url = "<?=$_SERVER['PHP_SELF'];?>?strAction=export&strPrint="+strPrint+"&room="+room; mywin = window.open(url,"winSTMT",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=790,height=590,left=0,top=0'); } //end function function cmd_print() { document.all.divprint.style.display = 'none'; window.print(); document.all.divprint.style.display = ''; } //endfunction function change_bg(obj,id) { var frm = document.forms[0]; var message = ""; var objID = ""; var chkRow = obj.value; chkRow = chkRow.substr(0,2); var chkDiff = 0; var loop = 0; var chkOver = 0; for (i = 0; i < frm.elements['set_reserv[]'].length; i++) { objID = frm.elements['set_reserv[]'][i].id; if (frm.elements['set_reserv[]'][i].checked){ message = frm.elements['set_reserv[]'][i].value; loop++; } message = message.substr(0,2); if (message == chkRow) { if (loop > 5) { chkOver = 1; } //end if } else { (loop > 0) { chkDiff = 1; } //end if } //end if } //end for //alert(objID); if (chkDiff == 1) { alert('กรณาเลอกในวนเดยวกน หรอแถวเดยวกนเทานน'); obj.checked = false; } //endif

Page 50: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

164

if (chkOver == 1) { alert('กรณาเลอกจ านวนชวโมงไมเกน 5 ชวโมงตดตอกน'); obj.checked = false; } //endif var color; if (obj.checked) { = "#FF9900"; //สสม } else { color = "#339900"; // สเขยว } //end if if (document.getElementById) { var thestyle= eval ('document.getElementById("'+id+'").style'); thestyle.backgroundColor=color; } } //end function </script> </head> <body> <table width="936" border="0" cellspacing="0" cellpadding="0"> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td><div align="right"> <p class="style1"><a href="fine_room.php">ยอนกลบ</a></p> </div></td> </tr> </table> <?php include("includes/config.inc.php"); /*$sql_list = "Select * From tbl_room_reserv Where r_id ='$_GET[r_id]' "; $result_list = mysql_query($sql_list) or die(mysql_error()); while ($data_list = mysql_fetch_array($result_list)){ $r_id = $data_list[r_id ]; $room = $data_list[room]; //session_register("r_id", "room"); } //end while */ $sqlR = "select * from tbl_room_reserv where r_id = '".$_GET['r_id']."'"; $resultR = mysql_query($sqlR) ;//or die ("select ไมได"); $dataR = mysql_fetch_array($resultR) ; $_SESSION[room]=$dataR['room']; $room = $dataR['room']; ?> <? /* $arrDay[1] = "จนทร"; $arrDay[2] = "องคาร"; $arrDay[3] = "พธ"; $arrDay[4] = "พฤหสฯ"; $arrDay[5] = "ศกร"; $arrDay[6] = "เสาร"; $arrDay[7] = "อาทตย"; */

Page 51: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

165

$arrDay[1] = "01.Mon"; $arrDay[2] = "02.Tue"; $arrDay[3] = "03.Wed"; $arrDay[4] = "04.Thu"; $arrDay[5] = "05.Fri"; $arrDay[6] = "06.Sat"; $arrDay[7] = "07.Sun"; $arrayFullTime = array(8,9,10,11,12,13,14,15,16,17,18,19,20,21); //$arrayFullTime = array(8,8.5,9,9.5,10,10.5,11,11.5,12,12.5,13,13.5,14,14.5,15,15.5,16,16.6,17,17.5,18,18.5,19,19.5,20,20.5,21,21.5,22,22.5); include("function.php"); $sql_list = "Select * From tbl_config Where strConfig = 'acc1' " ; $result = mysql_query($sql_list,$connect); $rs1 = mysql_fetch_array($result); $reserv_over30day = $rs1["reserv_over30day"]; if ($room) { $strWhere = " AND room = '".$room."' "; } //end if $sql_list = "Select * From tbl_teaching Where 1".$strWhere." AND term in (".$term.") order by day_teaching,time_teaching " ; $result_content = mysql_query($sql_list,$connect); $intRow_content = mysql_num_rows($result_content); if ($intRow_content != 0 ) { while ($rs = mysql_fetch_array($result_content)) { $std_group = $rs["std_group"]; $subject_id = $rs["subject_id"]; $section = $rs["section"]; $subject_name = $rs["subject_name"]; $unit = $rs["unit"]; $day_teaching = $rs["day_teaching"]; $time_teaching = $rs["time_teaching"]; $room = $rs["room"]; $std_type = $rs["std_type"]; $teacher_name = $rs["teacher_name"]; $arrTime = split("-",$time_teaching); $T1 = floatval(substr(trim($arrTime[0]),0,5)); $T2 = floatval(substr(trim($arrTime[1]),0,5)); if (substr($T1, -2) == ".3") { $T1 = $T1+0.2; } //end if if (substr($T2, -2) == ".3") { $T2 = $T2+0.2; } //end if $len = $T2 - $T1; for ($x = $T1;$x<=$T2;$x++) { $arrHaveTeacher[$day_teaching][$std_group.$subject_id."n".$section] = $T1."##".$len."##".$std_type."##".$subject_name."##".$std_group."##".$time_teaching."##".$teacher_name."##0##".$subject_id."##status_approve"; $old_day = $day_teaching; if ($day_teaching == $old_day) { $day[$day_teaching] .= $x.","; } //end if

Page 52: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

166

} //end for } //end if } //end if $sql = "SELECT * FROM tbl_term Where strTerm in (".$term.")"; $result = mysql_query($sql,$connect)or die(mysql_error()); $Row = mysql_num_rows($result); if ($Row > 0 ) { while ($row = mysql_fetch_array($result)) { $startTerm= $row["startTerm"]; $endTerm= $row["endTerm"]; } //end if } //end if row if($currentDay == 0) { $currentDay = 7; } //end if if ($currentDay != 1) { $dropDay = 1 - $currentDay; } else { $dropDay = 0; } //end if if (empty($startDate)) { //$startDate = $startTerm; $startDate = dateAdd("d",$dropDay,date("Y-m-d")); //$endDate = dateAdd("d",6,$startTerm); $endDate = dateAdd("d",6,$startDate); } else { //$startDate = $startTerm; $endDate = dateAdd("d",6,$startDate); } //end if $strWhere = " AND change_to_date between '$startDate' AND '$endDate' "; $sql_list = "Select * From tbl_reserv Where 1".$strWhere." AND room = '".$room."' AND strTerm in (".$term.") AND (status_approve != '0' AND status_approve != '2') order by change_to_time,change_to_date " ; $result_content = mysql_query($sql_list,$connect); $intRow_content = mysql_num_rows($result_content); if ($intRow_content != 0 ) { while ($rs = mysql_fetch_array($result_content)) { $change_to_time = $rs["change_to_time"]; $reserv_id = $rs["reserv_id"]; $teacher_id = $rs["teacher_id"]; $teacher_name = $rs["teacher_name"]; $subject_id = $rs["subject_id"]; $subject_name = $rs["subject_name"]; $change_from_day = $rs["change_from_day"]; $change_from_time = $rs["change_from_time"]; $change_from_date = $rs["change_from_date"]; $change_to_day = $rs["change_to_day"]; $change_to_time = $rs["change_to_time"]; $change_to_date = $rs["change_to_date"]; $change_note = $rs["change_note"]; $reserv_type = $rs["reserv_type"]; $status_approve = $rs["status_approve"]; if ($reserv_type == "1") { $subject_name = $change_note; } //end if $reserv_type = $rs["reserv_type"]; $reserv_by = $rs["reserv_by"];

Page 53: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

167

$sql = "select * from tbl_reserv_std Where reserv_id = '".$reserv_id."' order by std_group "; $result= mysql_query($sql,$connect); $intRow = mysql_num_rows($result); if ($intRow != 0 ) { $std_group= ""; while ($rs2 = mysql_fetch_array($result)) { $std_group .= $rs2["std_group"].", "; } //end while loop } //end if $std_type = ""; $std_group = substr($std_group,0,-2); $arrTime = split("-",$change_to_time); $T1 = floatval(substr(trim($arrTime[0]),0,5)); $T2 = floatval(substr(trim($arrTime[1]),0,5)); if (substr($T1, -2) == ".3") { $T1 = $T1+0.2; } //end if if (substr($T2, -2) == ".3") { $T2 = $T2+0.2; } //end if $len = $T2 - $T1; for ($x = $T1;$x<=$T2;$x++) { $arrHaveTeacher[$change_to_day][$std_group.$subject_id."r".$reserv_id] = $T1."##".$len."##".$std_type."##".$subject_name."##".$std_group."##".$change_to_time."##".$teacher_name."##".$reserv_type."##".$subject_id."##".$status_approve; $old_day = $change_to_day; if ($change_to_day == $old_day) { $day[$change_to_day] .= $x.","; } //end if } //end for } //end while } //end if row //echo "<hr><pre>"; ?> <h1><font color='black'>อาจารย<? echo"$_SESSION[name]" ?></h1> <h1>วชา<? echo"$_SESSION[subject]"?></h1> <h1>กลมเรยนนสต <? echo"$_SESSION[class_name]"?></h1> <h1>หองเรยน <? echo $dataR['room']."</font>"?></h1> <font size="+2" color="#FF0000">ก าหนดเวลาเรยน</font> <form action="save_classroom_2.php" method="post" name="frm_reserv" > <table width="100%" border="0" cellspacing="0" cellpadding="0" > <tr> <td width="100%">&nbsp;</td> </tr> <tr> <td><span class="style7">สรปวนเวลาวางของหอง <strong> <?=$room?> <!-- </strong> แสดงระหวาง<strong> <? //echo $startDate."<br>".$endDate."<br>"; $arrDateS = split("-",$startDate);

Page 54: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

168

$sdd = $arrDateS[2]; $smm = $arrDateS[1]; $syy = $arrDateS[0]; $arrDateE = split("-",$endDate); $edd = $arrDateE[2]; $emm = $arrDateE[1]; $eyy = $arrDateE[0]; echo ThaiDate($sdd,floatval($smm),$syy)." - ".ThaiDate($edd,floatval($emm),$eyy);?> -- > &nbsp;มความจ<strong> <?=getQtyRoom($room)?> </strong> ทนง&nbsp;</strong></span>&nbsp;&nbsp;กลมเรยนท :&nbsp; <? $sql2 = "select * from tbl_teach_detail where teacherID='".$_GET['tid']."' and sub_id = '".$_GET['suid']."' and sec_status='no'"; $result2 = mysql_query($sql2) or die ("select ไมได"); ?> <select name="select" id="select" > <? while ($data = mysql_fetch_array($result2) ) { echo "<option value='".$data['sec']."'>".$data['sec']."</option>" ; } ?> </select> </td> </tr> <tr> <td height="1" bgcolor="#FF9900"></td> </tr> </table> <? $chk_room = chk_room_not_reserv($room); if ($chk_room == "10"){ ?> <!-- <table width="718" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000"> <tr> <td bgcolor="#CCCCCC"><div align="center" class="style7"><font size="5"><br /> ขออภย!! หองนไมสามารถใหจองได <br />เนองจากวาไมอยในการดแลของคณะฯ / หรอเปนหองเรยนพเศษ <br /> กรณาเลอกหองเรยนอน ๆ <br /> <br /> </font></div></td> </tr> </table>--> <? }else{ ?> <br><br> <table width="85%" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="48" bgcolor="#CCCCCC">Date/Time</td> <? $loop = 0; for ($t = 8;$t<=20;$t++) { $loop++; if (strlen($t) == 1) { $showTime = "0".$t.":00"; } else {

Page 55: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

169

$showTime = $t.":00"; } //end if $finish = $t+1; if ($t==8) { $intLeft = 150; } else { $intLeft = 150*$loop; } //end if if (strlen($finish) == 1) { $showTimeFinish = "0".$finish.":00"; } else { $showTimeFinish = $finish.":00"; } //end if ?> <td width="48" colspan="2" align="center" bgcolor="#CCCCCC" ><?= "<br>".$showTime." - ".$showTimeFinish."<br><br>";?></td> <? } //end for loop ?> </tr> <? $ThDay = array ( "จนทร", "องคาร", "พธ", "พฤหส", "ศกร", "เสาร", "อาทตย"); for ($d = 1;$d<=7;$d++) { $fixDate = dateAdd("d",($d-1),$startDate); $intDay = (date("w",strtotime($fixDate)))-1; $Day = (date("d",strtotime($fixDate))); if ($intDay == -1) { $intDay = 6; } //end if ?> <tr bgcolor="#339900"> <!-- <td bgcolor="#999999"><?=$arrDay[$d];?></td> --> <td bgcolor="#CCCCCC" align="center"><br>วน<?=$ThDay[$intDay];?><br><br></td> <? $strDateDiff = datediff("d",date("Y-m-d"),$fixDate); //var_dump($strDateDiff); for ($t = 8;$t<=20;$t++) { // $chkCancel = 0; if (strlen($t) == 1) { $showTime = "0".$t.":00"; } else { $showTime = $t.":00"; } //end if $finish = $t+1; if (strlen($t) == 1) { $showTimeFinish = "0".$finish.":00"; } else { $showTimeFinish = $finish.":00"; } //end if if (($strDateDiff <= $reserv_over30day) || ($reserv_over30day <= 0)) { $strCol = "colspan='2'"; } else { $strCol = "colspan='28'"; } //end if echo "<td ".$strCol." align='center' id='".$arrDay[$d].$t."' "; $have_td = 0;

Page 56: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

170

$aDataNormal = getClass($arrDay[$d],$room,$term); $aDataReserv = getClassReserv($arrDay[$d],$room,$startDate,$endDate,$term); $aData = array_merge($aDataNormal, $aDataReserv); $setTd = 0; foreach ($aData as $k => $v) { $arrData = split("##",$v); $subject_name = $arrData[0]; $std_group = $arrData[1]; $T1 = $arrData[2]; $len = $arrData[3]; $reserv_type = $arrData[4]; $subject_id = $arrData[5]; $teacher_name = $arrData[6]; $getlen = $T1+$len; //if ($T1 == $t) { ?> <? if (($T1 <= $t) && ($t < $getlen)) { if (strlen($T1) == 1) { $T1 = "0".$T1; chkCancel = getCancel($T1,$getlen,$subject_id,$fixDate,$arrDay[$d],$term,$teacher_name,trim($room)); if ($reserv_type == "reserv") { $have_td = 2; } else { $have_td = 1; } //end if } //end if } //end for if (($strDateDiff > $reserv_over30day) && ($reserv_over30day >0)) { echo " bgcolor='#EFEFEF' "; //ไมอนญาตใหจองเกนวนทก าหนด } elseif ($have_td == 1) { if ($chkCancel >= 1) { echo " bgcolor='#FF0099' "; //เวลาสอนปกต แตอาจารยไดยกเลกไปสอนในเวลาอน } else { echo " bgcolor='#6699FF' "; //สอนปกต } //end if } elseif ($have_td == 2) { echo " bgcolor='#FF9900' "; //จอง หรอสอนชดเชย } //end if ?> > <? if (($strDateDiff <= $reserv_over30day) || ($reserv_over30day <= 0)) { if (($have_td != 1) && ($have_td != 2) || ($chkCancel >= 1)) { ?><input name="set_reserv[]" type="checkbox" value="<?=$arrDay[$d]."##".$t."##".$fixDate;?>" id="<?=$arrDay[$d]."##".$t;?>" onclick="change_bg(this,'<?=$arrDay[$d].$t;?>')" /><? } //end if } else { echo "ระบบไมอนญาตใหจองลวงหนาเกน ".$reserv_over30day." วน (<strong> ".$strDateDiff."</strong> วน) "; break; } //end if ?></td> <? } //end for loop ?> <!--</td> --></tr>

Page 57: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

171

<? } //end for ?> </table> <? }//end if chk_room ?> <br /><br /><br /> <table width="548" border="0" cellspacing="1" cellpadding="1"> <tr> <td width="64" bgcolor="#339900">&nbsp;</td> <td width="477">เวลาวาง (เลอกเพอท าการจดตารางสอน) </td> </tr> <tr> <td bgcolor="#6699FF">&nbsp;</td> <td>เวลาทไดมการเรยนจดตารางสอนไปแลว</td> </tr> </table> <? if ($chk_room == "10"){ }else{ ?> <div align="center"> <input name="startDate" type="hidden" id="startDate" value="<?=$startDate?>" /> <input name="room" type="hidden" id="room" value="<?=$room?>" /> <input name="term" type="hidden" id="term" value="<?=$term?>" /> <input name="teacher" type="hidden" id="teacher" value="<?=$_SESSION[name]?>" /> <input name="subject_name" type="hidden" id="subject_name" value="<?=$_SESSION[subject]?>" /> <input name="student" type="hidden" id="student" value="<?=$_SESSION[class_name]?>" /> <input name="subject_id" type="hidden" id="subject_id" value="<?=$_GET[suid]?>" /> <input type="submit" name="Submit" value="จดตารางสอน" /> </div> <? }//end if ?> </form> </body> </html>

Page 58: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

172

save_classroom_2.php

<? session_start();?> <? include("includes/config.inc.php"); include("function.php"); $arrDay[0] = "07.Sun"; $arrDay[1] = "01.Mon"; $arrDay[2] = "02.Tue"; $arrDay[3] = "03.Wed"; $arrDay[4] = "04.Thu"; $arrDay[5] = "05.Fri"; $arrDay[6] = "06.Sat"; $term = $_SESSION["term_id"]; $room= $_REQUEST["room"]; $select_time = $_REQUEST["set_reserv"]; $teacher = $_REQUEST["teacher"]; $subject_name= $_REQUEST["subject_name"]; $subject_id = $_REQUEST["subject_id"]; $sec = $_REQUEST["select"]; $student = $_REQUEST["student"]; $arrCount = count($select_time); if ($arrCount == 0) { if ($_POST["search_room"] == "1") { echo "<meta http-equiv='refresh' content='0;URL=fine_teacher.php >"; } else { echo "<meta http-equiv='refresh' content='0;URL=fine_teacher.php />"; } //end if } //end if foreach ($select_time as $key => $value) { $arr = split("##",$value); if ($_SESSION["session_search_room"] == "1") { $search_date = $arr[2]; $arrD = split("-",$search_date); $intD = $arrD[2]; $intM = $arrD[1]; $intY = $arrD[0]; $value_w = date("w", mktime(0, 0, 0, $intM, $intD, $intY)); if ($value_w == "0") { $valueDay = "07.".date("D", mktime(0, 0, 0, $intM, $intD, $intY)); } else { $valueDay = "0".$value_w.".".date("D", mktime(0, 0, 0, $intM, $intD, $intY)); } //end if $change_to_day = $valueDay; } else { $change_to_day = $arr[0]; } //end if $time = $arr[1]; $fixDate = $arr[2]; if (strlen($time) == 1) { $time = "0".$time; } //en dif $v = $v.$time.".00 - ".($time+1).".00, "; } //end foreach

Page 59: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

173

$v1 = substr($v,0,-2); $v2 = substr($v1,0,5); $v3 = substr($v1,-5); $reserv_time = $v2." - ".$v3; $tid = $_SESSION[teach_id]; $sqlSubdetail = "update tbl_teach_detail SET sec_status ='yes' where sub_id ='".$subject_id."' and teacherID = '".$tid."' and sec ='".$sec."' and term = ".$term; mysql_query($sqlSubdetail)or die('Invalid query: ' . mysql_error()); $sql = "insert into tbl_teaching (std_group,subject_id,section,subject_name,unit, teacher_name,day_teaching,time_teaching,room ,std_type,term) values ( '$student','$subject_id','$sec','$subject_name','','$teacher','$change_to_day','$reserv_time','$room','',$term )"; $charset = "set NAMES tis620"; mysql_query($charset) or die('Invalid query: ' . mysql_error()); mysql_query($sql)or die('Invalid query: ' . mysql_error()); echo "<br><br>Please wait... saving data!"; ?> <meta http-equiv="Refresh" content="3;URL='show_table_2.php?room=<? echo $room ?>&teachname=<? echo $teacher?>'"> <!----><style type="text/css"> <!-- body { background-color: #F5F4F7; } --> </style>

show_table_2.php

<? session_start(); unset($_SESSION["session_search_room"]); $strAction = $_GET["strAction"]; $strPrint = $_GET["strPrint"]; $room = $_GET["room"]; $term = stripslashes($_GET["term"]); if (empty($term)) { $term = $_SESSION["term_id"]; } //end if $startDate = $_GET["startDate"]; $endDate = $_GET["endDate"]; if ($strPrint == "1") { $strLoad = "onLoad=cmd_print();"; } //end if ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>List room <?=$room?></title> <link href="css/stylesheet.css" rel="stylesheet" type="text/css" /> <style type="text/css">

Page 60: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

174

<!-- .style6 {color: #000000} .style7 {color: #FF0000} .style10 {color: #FFFFFF; font-weight: bold; } .style11 { font-size: 18px; font-weight: bold; } body { background-color: #F5F4F7; } --> </style> </head> <script src="help_overlib.js" language="javascript"> <!-- --> </script> <script language="javascript"> function chkWidth() { } //end function function chk_print(room,strPrint) { var url = "<?=$_SERVER['PHP_SELF'];?>?strAction=export&strPrint="+strPrint+"&room="+room; mywin = window.open(url,"winSTMT",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=790,height=590,left=0,top=0'); } //end function function cmd_print() { document.all.divprint.style.display = 'none'; window.print(); document.all.divprint.style.display = ''; } //endfunction function change_bg(obj,id) { var frm = document.forms[0]; var message = ""; var objID = ""; var chkRow = obj.value; chkRow = chkRow.substr(0,2); var chkDiff = 0; var loop = 0; var chkOver = 0; for (i = 0; i < frm.elements['set_reserv[]'].length; i++) { objID = frm.elements['set_reserv[]'][i].id; if (frm.elements['set_reserv[]'][i].checked){ message = frm.elements['set_reserv[]'][i].value; loop++; } message = message.substr(0,2); if (message == chkRow) { if (loop > 5) { chkOver = 1; } //end if } else { if (loop > 0) { chkDiff = 1; } //end if } //end if

Page 61: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

175

} //end for //alert(objID); if (chkDiff == 1) { alert('กรณาเลอกในวนเดยวกน หรอแถวเดยวกนเทานน'); obj.checked = false; } //endif if (chkOver == 1) { alert('กรณาเลอกจ านวนชวโมงไมเกน 5 ชวโมงตดตอกน'); obj.checked = false; } //endif var color; if (obj.checked) { color = "#FF9900"; //สสม } else { color = "#339900"; // สเขยว } //end if if (document.getElementById) {var thestyle= eval ('document.all.'+id+'.style'); var thestyle= eval ('document.getElementById("'+id+'").style'); thestyle.backgroundColor=color; } } //end function </script> <body <?=$strLoad;?>> <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div> <? $arrDay[1] = "01.Mon"; $arrDay[2] = "02.Tue"; $arrDay[3] = "03.Wed"; $arrDay[4] = "04.Thu"; $arrDay[5] = "05.Fri"; $arrDay[6] = "06.Sat"; $arrDay[7] = "07.Sun"; $arrayFullTime = array(8,9,10,11,12,13,14,15,16,17,18,19,20,21); //$arrayFullTime = array(8,8.5,9,9.5,10,10.5,11,11.5,12,12.5,13,13.5,14,14.5,15,15.5,16,16.6,17,17.5,18,18.5,19,19.5,20,20.5,21,21.5,22,22.5); include("includes/config.inc.php"); include("function.php"); $sql_list = "Select * From tbl_config Where strConfig = 'acc1' " ; $result = mysql_query($sql_list,$connect); $rs1 = mysql_fetch_array($result); $reserv_over30day = $rs1["reserv_over30day"]; $teachname = $_GET[teachname]; if ($room) { $strWhere = " AND room = '".$room."' "; } //end if $sql_list = "Select * From tbl_teaching Where 1".$strWhere." AND term in (".$term.") AND teacher_name = '".$teachname."' order by day_teaching,time_teaching " ;

Page 62: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

176

//echo $sql_list; $result_content = mysql_query($sql_list,$connect); $intRow_content = mysql_num_rows($result_content); if ($intRow_content != 0 ) { while ($rs = mysql_fetch_array($result_content)) { $std_group = $rs["std_group"]; $subject_id = $rs["subject_id"]; $section = $rs["section"]; $subject_name = $rs["subject_name"]; $unit = $rs["unit"]; $day_teaching = $rs["day_teaching"]; $time_teaching = $rs["time_teaching"]; $room = $rs["room"]; $std_type = $rs["std_type"]; $teacher_name = $rs["teacher_name"]; $arrTime = split("-",$time_teaching); $T1 = floatval(substr(trim($arrTime[0]),0,5)); $T2 = floatval(substr(trim($arrTime[1]),0,5)); if (substr($T1, -2) == ".3") { $T1 = $T1+0.2; //end if if (substr($T2, -2) == ".3") { $T2 = $T2+0.2; } //end if $len = $T2 - $T1; for ($x = $T1;$x<=$T2;$x++) { $arrHaveTeacher[$day_teaching][$std_group.$subject_id."n".$section] = $T1."##".$len."##".$std_type."##".$subject_name."##".$std_group."##".$time_teaching."##".$teacher_name."##0##".$subject_id."##status_approve"; $old_day = $day_teaching; if ($day_teaching == $old_day) { $day[$day_teaching] .= $x.","; } //end if } //end for } //end if } //end if $sql = "SELECT * FROM tbl_term Where strTerm in (".$term.")"; $result = mysql_query($sql,$connect)or die(mysql_error()); $Row = mysql_num_rows($result); if ($Row > 0 ) { while ($row = mysql_fetch_array($result)) { $startTerm= $row["startTerm"]; $endTerm= $row["endTerm"]; } //end if } //end if row $currentDay = date("w"); if($currentDay == 0) { $currentDay = 7; } //end if if ($currentDay != 1) { $dropDay = 1 - $currentDay;

Page 63: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

177

} else { $dropDay = 0; } //end if if (empty($startDate)) { //$startDate = $startTerm; $startDate = dateAdd("d",$dropDay,date("Y-m-d")); //$endDate = dateAdd("d",6,$startTerm); $endDate = dateAdd("d",6,$startDate); } else { //$startDate = $startTerm; $endDate = dateAdd("d",6,$startDate); } //end if $strWhere = " AND change_to_date between '$startDate' AND '$endDate' "; $sql_list = "Select * From tbl_reserv Where 1".$strWhere." AND room = '".$room."' AND strTerm in (".$term.") AND (status_approve != '0' AND status_approve != '2') order by change_to_time,change_to_date " ; $result_content = mysql_query($sql_list,$connect); $intRow_content = mysql_num_rows($result_content); if ($intRow_content != 0 ) { while ($rs = mysql_fetch_array($result_content)) { $change_to_time = $rs["change_to_time"]; $reserv_id = $rs["reserv_id"]; $teacher_id = $rs["teacher_id"]; $teacher_name = $rs["teacher_name"]; $subject_id = $rs["subject_id"]; $subject_name = $rs["subject_name"]; $change_from_day = $rs["change_from_day"]; $change_from_time = $rs["change_from_time"]; $change_from_date = $rs["change_from_date"]; $change_to_day = $rs["change_to_day"]; $change_to_time = $rs["change_to_time"]; $change_to_date = $rs["change_to_date"]; $change_note = $rs["change_note"]; $reserv_type = $rs["reserv_type"]; $status_approve = $rs["status_approve"]; if ($reserv_type == "1") { $subject_name = $change_note; } //end if $reserv_type = $rs["reserv_type"]; $reserv_by = $rs["reserv_by"]; $sql = "select * from tbl_reserv_std Where reserv_id = '".$reserv_id."' order by std_group "; $result= mysql_query($sql,$connect); $intRow = mysql_num_rows($result); if ($intRow != 0 ) { $std_group= ""; while ($rs2 = mysql_fetch_array($result)) { $std_group .= $rs2["std_group"].", "; } //end while loop } //end if $std_type = ""; $std_group = substr($std_group,0,-2); $arrTime = split("-",$change_to_time); $T1 = floatval(substr(trim($arrTime[0]),0,5)); $T2 = floatval(substr(trim($arrTime[1]),0,5)); if (substr($T1, -2) == ".3") {

Page 64: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

178

$T1 = $T1+0.2; } //end if if (substr($T2, -2) == ".3") { $T2 = $T2+0.2; } //end if $len = $T2 - $T1; for ($x = $T1;$x<=$T2;$x++) { $arrHaveTeacher[$change_to_day][$std_group.$subject_id."r".$reserv_id] = $T1."##".$len."##".$std_type."##".$subject_name."##".$std_group."##".$change_to_time."##".$teacher_name."##".$reserv_type."##".$subject_id."##".$status_approve; $old_day = $change_to_day; if ($change_to_day == $old_day) { $day[$change_to_day] .= $x.","; } //end if } //end for } //end while } //end if row ?> <br /> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2"><p class="style11">คณะการบญชและการจดการ มหาวทยาลยมหาสารคาม </p> <p class="style11">ตารางสอน : <? echo $_GET[teachname];?></p></td> </tr> <tr> <td width="71%"><strong>&nbsp;&nbsp; <!--<?=$room?> --> </strong>มความจ <font size="+1" color="#0000FF"><strong><?=getQtyRoom($room)?></strong></font> ทนง&nbsp;&nbsp;&nbsp; ภาคเรยนท <strong> <?=$term?></strong> </td> <td width="29%" align="right"> <div id="divprint"><a href="fine_teacher.php">กลบไปหนาจดตารางสอน</a>&nbsp; <? //if ($strAction != "export") { ?> <a href="#" onclick="cmd_print();"><img src="images/b_print.png" width="16" height="16" border="0" align="absmiddle" />Print</a>&nbsp;<? //} //end if ?></div> </td> </tr> </table> <br /> <span class="style7"> <? if ($_GET["error"] == "select") { echo "<strong>กรณาเลอกเวลาทตองการจอง &darr; ดานลาง</strong>"; } //end if ?> </span><br /> <table width="85%" border="1" align="center" cellspacing="0" bordercolor="#FFFFFF"> <tr> <td width="48" align="center" bgcolor="#0C92B8" ><span class="style10"><br> Date/Time<br> <br> <br> </span></td> <? $loop = 0; for ($t = 8;$t<=21;$t++) { $loop++;

Page 65: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

179

if (strlen($t) == 1) { $showTime = "0".$t.":00"; } else { $showTime = $t.":00"; } //end if $finish = $t+1; if (strlen($finish) == 1) { $showTimeFinish = "0".$finish.":00"; } else { $showTimeFinish = $finish.":00"; } //end if ?> <td width="48" colspan="2" align="center" bgcolor="#0C92B8" ><span class="style10"> <?=$showTime;?> </div> </span></td> <? } //end for loop ?> </tr> <? $ThDay = array ( "จนทร", "องคาร", "พธ", "พฤหส", "ศกร", "เสาร", "อาทตย"); for ($d = 1;$d<=7;$d++) { $fixDate = dateAdd("d",($d-1),$startDate); $intDay = (date("w",strtotime($fixDate)))-1; $Day = (date("d",strtotime($fixDate))); if ($intDay == -1) { $intDay = 6; } //end if ?> <tr> <!--<td bgcolor="#999999"><?=$arrDay[$d];?></td> --> <td bgcolor="#BCBCBC" align="center"><span class="style3 style6"><strong>วน <?=$ThDay[$intDay];?> </strong></span></td> <td colspan="28" bgcolor="#E9E9E9" id="td_<?=$d;?>"> <? if ($intLoop == $d) { $havedata = 1; $intData=0; $chkShowCancel = 0; foreach($arrHaveTeacher[$arrDay[$d]] as $key2 => $value2) { $arrData = split("##",$value2); $intData ++; $sTime = $arrData[0]; $len = $arrData[1]; $std_type = $arrData[2]; $subect_name = $arrData[3]; $std_group = $arrData[4]; $timeTeaching = $arrData[5]; $teacher_name = $arrData[6]; $reserv_type = $arrData[7]; $subject_id = $arrData[8]; $status_approve = $arrData[9]; if (strlen($sTime) == 1) { $sTime = "0".$sTime; } //end if $chkShowCancel = getCancel($sTime,$len,$subject_id,$fixDate,$arrDay[$d],$term,$teacher_name,trim($room));

Page 66: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

180

if (strlen($subect_name)>25) { $subect_name = substr($subect_name,0,25)."..."; } //end if $fixW =60; if ($sTime == 8) { $intLeft = 0; } elseif ($sTime == 9) { $intLeft =$fixW; } else { $intLeft = $fixW*($sTime-8)-($sTime-3); } //en dif $intWidht = $fixW*$len; if ($reserv_type == "1") { $strBG = "#FF9900"; $std_group = ""; $teacher_name = "ผจอง: ".$teacher_name; } elseif ($reserv_type == "2") { $strBG = "#FF9900"; $teacher_name = "ผสอน: ".$teacher_name; } elseif ($chkShowCancel >= 1) { $strBG = "#FF0099"; //ตารางสอนปกตแตไดยกเลกไป $teacher_name = $teacher_name." (ยกเลกการสอน)"; } else { $strBG = "#6699FF"; //ตารางสอนปกต } //end if if ($status_approve == "") { $strStatusName = "&nbsp;&nbsp;<span style='background-color:#FF0000'>(รอการอนมต)</span>"; } elseif ($status_approve == "1") { $strStatusName = "&nbsp;&nbsp;<span style='background-color:#1DF12D'>(อนมตแลว)</span>"; } else { $strStatusName = ""; } //end if ?> <div style="width:<?=$intWidht;?>px; left:<?=$intLeft;?>px; position:relative" > <table width="100%" border="1" cellpadding="0" cellspacing="1" bordercolor="#6699FF" > <tr> <td bgcolor="<?=$strBG?>"><span class="style6"><?=$subect_name."<br>".$timeTeaching.$strStatusName." ".$std_type."<br>".$std_group." ".$teacher_name;?></span> </td> </tr> </table> </div> <? } //echo for eacho } //end if } //end foreach ?> <? ?> </td></tr> <? } //end for ?> </table> <p>&nbsp;</p><hr> <p>&nbsp;</p> </body> </html>

del_teach.php

<?

Page 67: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

181

include("includes/config.inc.php"); ?> <script language="javascript" src="checkform.js"></script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>คนหาอาจารยผสอน</title> <style type="text/css"> <!-- .style3 {font-size: smaller} body { background-color: #F5F4F7; } --> </style> <script type="text/JavaScript"> <!-- function MM_Menu(){ page = 'del_teach2.php?term='; techid = document.getElementById("select2").value; //alert(techid); location=page+techid; opener.document.location.reload(); } //--> </script> </head> <body> <table width="941" border="0" cellspacing="0" cellpadding="0"> <tr> <td>&nbsp;</td> <td align="right">&nbsp;</td> </tr> <tr> <td width="459"><font color="#FF0000" size="+2"><strong>ยกเลกตารางสอน</strong></font></td> <td width="612" align="right"><span class="style3"><a href="fine_teacher.php">จดตารางสอน</a>&nbsp;&nbsp;&nbsp;<a href="index.php">กลบหนาหลก</a>&nbsp;</span></td> </tr> </table> <p><b><br /> ปการศกษา </b></p> <form id="frmFineTeacher" name="frmFineTeacher" method="post" enctype="multipart/form-data" onsubmit= "return check_search();"> </label> &nbsp;&nbsp;&nbsp;&nbsp;ภาคเรยน/ปการศกษา&nbsp; <label> <select name="select2" id="select2" onchange="MM_Menu()"> <option value="" selected='selected' >--เลอก--</option> <? $i=0; $sql = "select * from tbl_term order by currentTerm desc"; $result = mysql_query($sql) or die ("select ไมได"); while ($data = mysql_fetch_array($result) ) { if($i<=0){ echo "<option value='$data[strTerm] ' >$data[strTerm] </option>"; } else { echo "<option value='$data[strTerm] '>$data[strTerm] </option>"; }

Page 68: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

182

$i++; }?> </select> </label> </form> <hr /> <p> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <?php if($_POST[btnFine]) { $keyword = $_POST[search]; $searchC=$_POST[searchC]; $sql_list = "Select * From personal Where ".$searchC." like '".$keyword."%' "; // like '%$keyword%' "; $result_list = mysql_query($sql_list) or die(mysql_error()); $i = 0; while ($data_list = mysql_fetch_array($result_list)){ if($i%2==0){$rowColor="#E1E0E2"; } else {$rowColor="#CECECE";} ?> <p> <tr ><!-- <td width="9%">$num_list&nbsp;</td> --> <td width="55%" bgcolor=<? echo $rowColor ?>><? echo $data_list[name]?> </td> <td width="45%" align="right" bgcolor=<? echo $rowColor ?> ><a href="fine_subject.php?tid=<?="$data_list[teacherID]";?>">แสดงรายวชา</a>&nbsp;</td> </tr> <? $i++; } //end if } //end while ?></table> </body> </html>

del_teach2.php

<? session_start(); $term = $_SESSION["term_id"]; include("includes/config.inc.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>คนหารายวชาทเปดสอน</title> <style type="text/css"> <!-- .style1 {font-size: smaller} body { background-color: #F5F4F7; } --> </style> <script type="text/JavaScript"> <!-- function MM_Menu(){ suid =document.getElementById("select").value; //alert(techid); var form2 = document.getElementById("form2");

Page 69: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

183

form2.su_id.value=suid; form2.submit(); } function checkselect(selectCheck,loop){ var i=1; var form1 = document.getElementById("form1"); if(selectCheck=="All"){ while(i<loop){ ///alert("check_"+i); document.getElementById("id_"+i).disabled=false; document.getElementById("check_"+i).checked=true; var point=""; for(i2=0;i2<8;i2++){ for(j=0;j<=i2;j++){ point +=i; if(i2==j){ var obj = document.all?document.all["colorT_"+point]:document.getElementById("colorT_"+point); obj.style.backgroundColor = "#FFCC66"; point=""; } } i++; } } else{ while(i<loop){ document.getElementById("id_"+i).disabled=true; document.getElementById("check_"+i).checked=false; if(i%2==0){rowColor="#E1E0E2"; } else {rowColor="#FFFFFF";} var point=""; for(i2=0;i2<8;i2++){ for(j=0;j<=i2;j++){ point +=i; if(i2==j){ var obj = document.all?document.all["colorT_"+point]:document.getElementById("colorT_"+point); obj.style.backgroundColor = rowColor; point=""; } } } i++; } } } function showlist(memid,checkbox,colorS){ if (document.getElementById(checkbox).checked) { document.getElementById("id_"+memid).disabled=false; var point=""; for(i=0;i<8;i++){ for(j=0;j<=i;j++){ point +=memid; if(i==j){

Page 70: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

184

var obj = document.all?document.all["colorT_"+point]:document.getElementById("colorT_"+point); obj.style.backgroundColor = "#FFCC66"; point=""; } } } }else{ document.getElementById("id_"+memid).disabled=true; var point=""; for(i=0;i<8;i++){ for(j=0;j<=i;j++){ point +=memid; if(i==j){ var obj = document.all?document.all["colorT_"+point]:document.getElementById("colorT_"+point); obj.style.backgroundColor = colorS; point=""; } } } } } //--> </script> </head> <body> <form id="form2" name="form2" method="get" action="del_teach2.php"> <input type="hidden" name="term" id="term" value="<?= $_GET['term'];?>"> <input type="hidden" name="su_id" id="su_id" > </form> <table width="944" border="0" cellspacing="0" cellpadding="0"> <tr> <td>&nbsp;</td> <td align="right">&nbsp;</td> </tr> <tr> <td width="459"><font color="#FF0000" size="+2"><strong>ยกเลกตารางสอน</strong></font></td> <td width="612" align="right"><span class="style1"><a href="fine_teacher.php"></a>&nbsp;&nbsp;&nbsp;<a href="del_teach.php">ยอนกลบ</a>&nbsp;</span></td> </tr> </table> <?php $_SESSION[term] = $_GET[term]; $term = $_GET[term]; ?> <p> <h2>เทอม/ปการศกษา&nbsp;:&nbsp;<font color="#0000FF"><? echo $_GET[term] ?></font></h2> </p> <p>คนหารายวชาทเปดสอน</p> <form id="form1" name="form1" method="post" action=""> <p>โปรดระบชอรายวชา <select name="select" id="select" onchange="MM_Menu()"> <option value="0">- - - -เลอกรายวชา- - - -</option> <? $sql = "select distinct sub_id from tbl_teach_detail where term='".$term."'"; $result = mysql_query($sql) or die ("select ไมได"); //echo $sql ; while ($data = mysql_fetch_array($result) ) {

Page 71: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

185

$sql2 = "select * from tbl_subject where sub_id = '".$data['sub_id']."' "; $result2 = mysql_query($sql2) or die ("select ไมได"); $data2 = mysql_fetch_array($result2); echo "<option value=".$data2[sub_id] .">".$data2[name_th]."&nbsp;(".$data2[name_en].")</option>"; }?> </select> </p> </form> <h2> <? if($_GET['su_id']!=0||$_GET['su_id']!=""){ $term = $_GET[term]; $su_id = $_GET[su_id]; echo "วชา : "; $sqlSub= "Select * From tbl_teaching Where term ='".$term."' and subject_id = '".$su_id."'"; $charset = "SET character_set_results=tis620"; mysql_query($charset) or die('Invalid query: ' . mysql_error()); $resultSub= mysql_query($sqlSub) or die(mysql_error()); $dataSub = mysql_fetch_array($resultSub); echo $dataSub[subject_name]; } ?></h2> <hr /> <form id='form2' name='form2' method='post' action='del_teach_query.php'> <?php if($_GET[term]!=""&&($_GET[su_id]!=""||$_GET[su_id]!=0)) { $term = $_GET[term]; $su_id = $_GET[su_id]; $sql= "Select * From tbl_teaching Where term ='".$term."' and subject_id = '".$su_id."'"; $result = mysql_query($sql) or die(mysql_error()); echo "<table width='80%' border='1' bordercolor='#FFFFFF' cellspacing='0' align='center'>"; echo " <tr> <td align='center' bgcolor='#5889E5'><font color='white'><strong>เลอก</strong></font></td> <td align='center' bgcolor='#5889E5'><font color='white'><strong>รหสวชา</strong></font></td> <td align='center' bgcolor='#5889E5'><font color='white'><strong>ผสอน</strong></font></td> <td align='center' bgcolor='#5889E5'><font color='white'><strong>ผเรยน</strong></font></td> <td align='center' bgcolor='#5889E5'><font color='white'><strong>กลมเรยน</strong></font></td> <td align='center' bgcolor='#5889E5'><font color='white'><strong>วนทเรยน</strong></font></td> <td align='center' bgcolor='#5889E5'><font color='white'><strong>เวลา</strong></font></td> <td align='center' bgcolor='#5889E5'><font color='white'><strong>หอง</strong></font></td> </tr>"; $i=1; while ($data = mysql_fetch_array($result)){ if($i%2==0){$rowColor="#E1E0E2"; } else {$rowColor="#FFFFFF";} echo "<tr> <td align='center' bgcolor=".$rowColor." id='colorT_".$i.$i.$i.$i.$i.$i.$i."'> <input type=\"hidden\" name='id_".$i."' id='id_".$i."' value=".$data[id]." disabled='true'> <input type=\"hidden\" name='sec_".$i."' id='sec_".$i."' value=".$data[section]." > <input type='checkbox' name='check_".$i."' id='check_".$i."' value='checkbox' onclick=\"showlist('".$i."','check_".$i."','".$rowColor."')\"> </td> <td align='center' bgcolor=".$rowColor." id='colorT_".$i."'>&nbsp;".$data[subject_id]."</td>

Page 72: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

186

<td bgcolor=".$rowColor." id='colorT_".$i.$i."'>&nbsp;&nbsp;&nbsp;".$data[teacher_name]."</td> <td align='center' bgcolor=".$rowColor." id='colorT_".$i.$i.$i."'>&nbsp;".$data[std_group]."</td> <td align='center' bgcolor=".$rowColor." id='colorT_".$i.$i.$i.$i.$i.$i.$i.$i."'>".$data[section]."</td> <td align='center' bgcolor=".$rowColor." id='colorT_".$i.$i.$i.$i."'>&nbsp;".$data[day_teaching]."</td> <td align='center' bgcolor=".$rowColor." id='colorT_".$i.$i.$i.$i.$i."'>&nbsp;".$data[time_teaching]."</td> <td align='center' bgcolor=".$rowColor." id='colorT_".$i.$i.$i.$i.$i.$i."'>".$data[room]."</td> </tr>"; $i++; } echo "<tr><td align='left' colspan = '7'><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/arrow.png'>&nbsp;<a href='#:P' onclick=checkselect('All',".$i.");>เลอกทงหมด</a>&nbsp;/&nbsp;<a href=\"#:P\" onclick=\"checkselect('NAll',".$i.")\">ไมเลอกเลย</a>&nbsp;&nbsp;<em>ท ากบทเลอก : </em><input type='submit' name='Submit' value='ลบ' /></td></tr>"; echo "</table>"; } ?> <input type="hidden" name='countAll' id='countAll' value="<? echo ($i-1)?>"> <input type="hidden" name='term' id='term' value="<? echo $_GET[term]; ?>"> <input type="hidden" name='subject_id' id='subject_id' value="<? echo $_GET[su_id];?>"> </form> </body> </html>

Del_teach_query.php (ยกเลกตารางสอน-3ลบขอมล)

<?php session_start(); ?> <? include("includes/config.inc.php"); $countAll = $_REQUEST['countAll']; $term = $_REQUEST['term']; $subject_id = $_REQUEST['subject_id']; $count=1; while($count<=$countAll){ $sub_id = $_REQUEST['id_'.$count]; if($sub_id!=""){ $sql="delete from tbl_teaching where id = '$sub_id'"; $charset = "set NAMES tis620"; mysql_query($charset) or die('Invalid query: ' . mysql_error()); mysql_query($sql)or die('Invalid query: ' . mysql_error()); $section = $_REQUEST['sec_'.$count]; $sqlUpdate = "update tbl_teach_detail set sec_status = 'no' where sub_id = '$subject_id' and sec = '$section'"; mysql_query($sqlUpdate)or die('Invalid query: ' . mysql_error()); } $count++;

Page 73: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

187

} echo "<br><br>Please wait... saving data!"; ?> <meta http-equiv="Refresh" content="3;URL='del_teach2.php?term=<?= $term?>&su_id=<?= $subject_id?>'"> <!----><style type="text/css"> <!-- body { background-color: #F5F4F7; } --> </style>

Page 74: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

188

ภาคผนวก ค บทน าเสนอโครงงานเทคโนโลยสารสนเทศธรกจ

Page 75: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

189

บทน าเสนอโครงงานเทคโนโลยสารสนเทศธรกจ ประจ าภาคเรยนท 2/2552

วชา : 0904403 โครงงานเทคโนโลยสารสนเทศธรกจ 2 จ านวน 2 หนวยกต (0-4-0) ชอโครงงาน : ระบบสารสนเทศการจดการเรยนการสอน กรณศกษาคณะการบญชและการจดการ มหาวทยาลยมหาสารคาม รายชอผศกษาโครงงาน :

1. ชอ-สกล นางสาวกฤตยาณ บณยเพญ รหสประจ าตว 49010911227 2. ชอ-สกล นางสาวรงทวา แกววเศษ รหสประจ าตว 49010911811

อาจารยทปรกษาโครงงาน :

อาจารย.......................................................(อาจารยเกรยงศกด จนทนอก)

(....................................................) กรรมการทปรกษา วนท ............/ ................/ ..............

(....................................................) กรรมการคนท 1 วนท ............/ ................/ ..............

(....................................................) กรรมการคนท 2 วนท ............/ ................/ ..............

Page 76: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

190

บทน าเสนอโครงงานเทคโนโลยสารสนเทศธรกจ

1. 1 ความเปนมาและความส าคญ ในยคสมยทเทคโนโลยเขามามบทบาทในการด ารงชวตของมนษย เทคโนโลยไดสรางสงอ านวยความสะดวกมากมายทางดานตางๆเชน การพฒนาระบบสอสารทางโทรคมนาคม ระบบการลงทะเบยนเรยนในมหาวทยาลย สารสนเทศกบการเรยนการสอน เปนตน ซงปจจบนการเรยนการสอนในมหาวทยาลยไดมการน าคอมพวเตอรและเครองมอประกอบชวยในการเรยนร เชน วดทศน เครองฉายภาพ คอมพวเตอรชวยสอน คอมพวเตอรชวยจดการศกษา ค านวณระดบคะแนน จดชนเรยน และการจดตารางสอน เปนตน

สถาบนการศกษาเปนองคประกอบทประกอบดวยทรพยากรและปจจยตางๆหลายประ เภททส าคญไดแก นกศกษา อาจารยสอน หลกสตร อาคารสถานท และการจดการเรยนการสอน ซงการทจะจดการเรยนการสอนทมงเนนใหผเรยนเกดการเรยนรไดอยางมประสทธภาพไดนน ตองอาศยระบบการบรหารทรพยากรและปจจยตางๆอยางเหมาะสม ปจจยอกอยางหนง ทจะท าใหการจดการเรยนการสอนเปนไปอยางมประสทธภาพ คอ การจดตารางสอน เพราะตารางสอนเปนตารางทก าหนดรายวชา อาจารย กลมผเรยน คาบเวลาของหองเรยน เพอใหเกดการเรยนรมากทสด โดยทการจดตารางสอนตองพจารณาถงตวแปร ดานกลมผเรยน อาจารยผ สอน หองเรยน และรายวชาในหลกสตร ซงเกยวของกบการขอมลจ านวนมาก ท าใหขบวนการจดตารางสอนมความยงยากซบซอนขนเสมอๆโดยเฉพาะในสถาบนศกษาทมจ านวนนสตนกศกษา อาจารย และรายวชาทเปดสอนจ านวนมาก ดงนนสถาบนตางๆจงแสวงหาระบบการจดการในรปแบบใหม ททนสมย เพอน ามาใชในการจดตารางสอนใหเปนไปอยางมระบบ สะดวก รวดเรวและถกตองแมนย ามากยงขน

การบญชและการจดการ เปนหนวยงานหนงของมหาวทยาลยมหาสารคาม ซงจดตงขนภายใต ระเบยบมหาวทยาลยมหาสารคาม วาดวยคณะการบญชและการจดการ ตงแตวนท 19 กรกฎาคม 2541 มลกษณะของการด าเนนงานและรปแบบของการบรหารงานแบบนอกระบบราชการ เปนคณะทมสาขาวชา นกศกษา อาจารย และรายวชาทเปดสอนจ านวนมาก คณะการบญชและการจดการ จงเปนอกหนงกรณศกษาทยงมปญหาเกยวกบระบบการจดการเรยนการสอน คอใชรปแบบเอกสารเขามาชวยในการจดตารางเรยนของทางคณะอย ซงการใชเอกสารในการจดการตารางเรยนท าใหเกดความยงยาก ขอมลอาจมความผดพลาดบอย ซงถาใชการจดตารางสอนแบบปกตนน ผจดตารางสอนตองใชความพยายามและเวลาเปนอยางมาก ใน

Page 77: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

191

การจดตวแปรทงหมดตามเงอนไขทมอยใหเปนระเบยบไดอยางเหมาะสม จงท าใหมความจ าเปนในการน าระบบเขามาชวยในการจดการและด าเนนงานดานตางๆของคณะเอง

ถงแมวาปจจบนคณะการบญชและการจดการ จะมระบบสารสนเทศในการจดสอการเรยนการสอนททนสมย แตยงไมสามารถจดการกบระบบตารางสอนได ดงนนขาพเจาจงมความสนใจทจะน าระบบสารสนเทศการจดการเรยนการสอน เขามาชวยจดการเพอใหเกดความสะดวกและรวดเรวเพมยงขนซงนอกจากจะสามารถชวยลดความยงยากซบซอนแลว ยงชวยลดเวลาและบคลากรในการจดการไดอกดวย 1.2 วตถประสงคของการศกษา เพอพฒนาระบบการจดการสารสนเทศการจดการเรยนการสอนกรณศกษาคณะการบญชและการจดการ มหาวทยาลยมหาสารคาม

1.3 ขอบเขตการด าเนนงาน เพอใหการศกษาในครงนเปนไปดวยความเรยบรอยและเหมาะสมกบเวลาทก าหนด ผศกษาจงไดก าหนดขอบเขตของการออกแบบและพฒนาระบบงานไว ดงน 1.3.1 ระบบจดการหองเรยน 1.3.2 ระบบจดการรายวชา 1.3.3 ระบบจดการขอมลอาจารยผสอน 1.3.4 ระบบจดการขอมลกลมนสต 1.3.5 ระบบจดการตารางสอน

1.3.6 ผศกษาไดแบงกลมผใชออกเปน 2 กลมดงน 1. เจาหนาทฝายวชาการ 1.สามารถเพม ลบ แกไขและตรวจสอบขอมลการจดการหองเรยนได 2.สามารถเพม ลบ แกไขและตรวจสอบขอมลการจดรายวชาได 3.สามารถเพม ลบ แกไขและตรวจสอบขอมลอาจารยผสอนได

4.สามารถเพม ลบ แกไขและตรวจสอบขอมลกลมนสตได 5.สามารถเพม ลบ แกไขการจดตารางสอนได

2. อาจารยคณะการบญชและการจดการ 1.เขาสระบบโดยการลอกอนเขาใชในสวนของ User แลวท าการเรยกดขอมลตารางสอนของอาจารย ตารางเรยนนสตและ ตารางการใชหองเรยนได

1.3.7 ออกรายงาน 1. รายงานตารางสอนอาจารย 2. รายงานตารางเรยนนสต

Page 78: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

192

3. รายงานตารางการใชหองเรยน

1.4 อปกรณและเครองมอในการด าเนนงาน

1.4.1 ฮารดแวร

เครองคอมพวเตอรจ านวน 1 เครอง

1.4.1 CPU Intel Celeron processor 530 (1.73 GHz.)

1.4.2 DDR2 RAM 512 MB.

1.4.3 Hard disk 120 GHz.

1.4.4 DVD Super Multi DL

1.4.5 Printer HP

1.4.2 ซอฟตแวร

1.4.1 ระบบปฏบตการ Microsoft Windows XP 2006 Professional

1.4.2 ภาษา PHP เพอใชในการเขยนค าสง

1.4.3 โปรแกรม mySQL เพอใชในการจดการระบบฐานขอมล

1.4.4 โปรแกรม Adobe Dreamweaver CS3 เพอใชในการพฒนาโปรแกรม

1.5 ขนตอนการด าเนนงาน 1.5.1 น าเสนอหวขอตออาจารยทปรกษา (ศกษาทฤษฏและเทคโนโลยทใช) ขอค าแนะน า รวมถงก าหนดขอบเขตในการท าโครงงาน 1.5.2 ศกษาและเกบรวบรวมขอมล

โดยการสบคนและรวบรวมขอมลทเกยวของผานทางระบบ Internet และสอบถามจากเจาหนาทคณะการบญชและการจดการ มหาวทยาลยมหาสารคาม 1.5.3 ขนตอนวเคราะหขอมล ประกอบดวยรายละเอยดดงน

1.5.1 วเคราะหระบบงานเกา 1.5.2 วเคราะหระบบงานใหม 1.5.3 ก าหนดความตองการของระบบงานใหม 1.5.4 สรางแบบจ าลอง (Logical Model) ซงประกอบดวย Data Flow Diagram,

Page 79: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

193

ER-Diagram เปนตน 1.5.5 ขนตอนออกแบบโปรแกรม ประกอบดวยรายละเอยดดงน 1. การออกแบบการน าเขา-น าออกของขอมล 2. การออกแบบจอภาพ 3. การออกแบบรายงาน

4. การออกแบบฐานขอมล 1.5.6 ขนตอนพฒนา – ทดสอบ

1. เขยนโปรแกรม พฒนาโปรแกรมตามทไดท าการวเคราะหและออกแบบไว 2. ตรวจสอบวตถประสงคของงานวาตรงตามความตองการของผใชหรอไม 3. ทดสอบยอย 4. ทดสอบรวม 5. ทดสอบตดตงระบบ

1.5.7 ขนตอนการน าไปใช เปนการน าระบบทพฒนาขนไปใชงาน เพอทราบวาระบบมขอบกพรองตรงจดไหน

ตรงตามความตองการของผใชหรอไม และมประสทธภาพในการใชงานมากนอยเพยงใด 1.5.8 จดท าเอกสาร

การจดท าเอกสารคมอนนจะแสดงรายละเอยดตางๆ ของโปรแกรม รวมถงวธการและ ขนตอนการใชงานโปรแกรม เพอทผใชงานจะไดใชงานระบบไดอยางถกตองเหมาะสมและเกดขอผดพลาดนอยทสด เพอใหเกดประสทธภาพสงสดในการใชงาน

1.6 ระยะเวลาในการด าเนนงาน

ตารางท 1-1 ตารางระยะเวลาในการปฏบตงาน กจกรรม พ.ศ. 2552 พ.ศ. 2553

ม.ย. ก.ค. ส.ค. ก.ย. ต.ค. พ.ย. ธ.ค. ม.ค. ก.พ. ม.ค.

น าเสนอหวขอตออาจารยทปรกษา

ศกษาและรวบรวมขอมล

วเคราะหและออกแบบระบบงาน

พฒนาระบบ

ทดสอบและปรบปรงระบบ

น าเสนอผลงานตอคณะกรรมการ

จดท าคมอ

Page 80: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

194

1.7 ผลทคาดวาจะไดรบ

1.7.1 สามารถใชระบบสารสนเทศการจดการเรยนการสอนไดจรง 1.7.2 เพมความสะดวก รวดเรวในการจดตารางสอนใหกบคณะการบญชและการจดการ 1.7.3 ลดความผดพลาดในการปฏบตงานของเจาหนาท

1.7.4 สามารถน าเอาขอมลจากระบบมาใชในการวเคราะห และบรหารจดการไดอยางม ประสทธภาพ

Page 81: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

195

ภาคผนวก ง รายงานการพบทปรกษา

Page 82: ภาคผนวก - Mahasarakham University93).pdf · 2010-03-10 · 118 2.การติดตั้งโปรแกรมที่ดาวน์โหลดมาโดยการ

196

รายงานการพบทปรกษา

ชอเรอง ระบบสารสนเทศการจดการเรยนการสอน กรณศกษาคณะการบญชและการ

จดการ มหาวทยาลยมหาสารคาม ผศกษา นางสาวรงทวา แกววเศษ 49010911811 BC492 นางสาวกฤตยาณ บณยเพญ 49010911227 BC 496 ทปรกษา อาจารยเกรยงศกด จนทนอก

วน เดอน ป รายงานความคบหนา / การใหค าปรกษา ลายมอชอทปรกษา 28 ตลาคม 2552 เขาพบขอค าแนะน าในการด าเนนการในการเรม

ลงมอปฎบตในภาคเรยนท 2

18 พ.ย. 2552 น างานในสวนทไดลงมอปฎบตไปใหอาจารยดและขอค าปรกษาในการลงโคดและน าสวนทตดขดไปขอค าแนะน าจากอาจารย

25 พ.ย. 2552 น างานทไดท าไปใหอาจารยดขอรบค าแนะน าและขอแนวทางในการท างานขนตอนตอไป

30 พ.ย. 2552 น างานสวนทไดขอค าแนะน าและน ามาเพม ปรบปรง แกไข ไปใหอาจารยด และขอค าแนะน าในการลงมอท าขนตอไป

14 ธ.ค. 2552 น างานสวนทไดรบมอบหมายเพมเขาพบอาจารยเพอใหอาจารยตรวจด และรบค าแนะน าในการท าขนตอไป

11 ม.ค. 2553 น างานสวนทตองแกไขเขาพบขอรบค าปรกษาจากอาจารย

25 ม.ค.2553 น าโปรแกรมสวนทแกไข เพมเตม มาใหอาจารยดขอค าแนะน าและขอความชวยเหลอในสวนทคดไมออก

และรบทราบวนทสอบจากอาจารย สอบถามรายละเอยดในการขนสอบ