ภาคผนวก - mahasarakham...

242
ภาคผนวก

Upload: others

Post on 13-Oct-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

ภาคผนวก

Page 2: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

ภาคผนวก ก. การตดตงโปรแกรม

Page 3: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

170

โปรแกรม AppServ

โปรแกรม AppServ เปนโปรแกรมทรวบรวมโปรแกรม Open Source Software หลายๆ อยางเขาดวยกน โดยภายในโปรแกรม AppServ ประกอบดวยโปรแกรมตางๆ ดงน

1. Apache Web Server V1.3.27 เปนโปรแกรมส าหรบใชในการท าเวบเซรฟเวอร 2. PHP V4.3.0 เปนโปรแกรมภาษา PHP 3. MySQL V3.23.54 เปนโปรแกรมฐานขอมล MySQL 4. phpMyAdmin V2.3.3p1 เปนโปรแกรมชวยในการจดการฐานขอมล MySQL

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

1. ท าการดาวนโหลดตวตดตงไดท www.appservnetwork.com

Page 4: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

171 2. ท าการตดตงโปรแกรมทดาวนโหลดมาโดยการ Double Click ทไอคอน appserv-

win.xxx.exe เพอท าการตดตงโปรแกรม Apace Web Server, โปรแกรมภาษา PHP, โปรแกรม MySQL และโปรแกรม phpMyAdmin

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

Page 5: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

ภาคผนวก ข. Source Code

Page 6: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

173 Source Code ชอ config.inc <?php session_start(); // ตงคาชอคกกส าหรบระบบจ าคา Login , password ไวในเครองคอมฯผใช $cook_nm = 'login_26br'; //ตงช อคกก ส าหรบจ าคา Login User ไวในเครอง $cook_pw = 'log_65pw'; //ตงชอคกกส าหรบจะคา login password $cook_time = 3600 * 24 * 2; // ระยะเวลาเกบคกก $dbhost="127.0.0.1"; // Database server $dbuser = "root"; $dbpass = "1704"; $dbname = "management"; mysql_connect($dbhost,$dbuser,$dbpass) or die ("ตดตอ Host ไมได"); mysql_query("SET NAMES UTF8"); mysql_select_db($dbname) or die ("ตดตอฐานขอมลไมได"); // ตงคาวนทและเวลาส าหรบบนทกเขาระ เชน วนเวลาทลอคอน วนเวลาทมผบกรก $bkk= mktime(gmdate("H")+7,gmdate("i")+0,gmdate("s"),gmdate("m") ,gmdate("d"),gmdate("Y")); $datetimeformat="j/m/y - H:i";// รปแบบวนเวลา (วน/เดอน/ป ชม:นาท $now = date($datetimeformat,$bkk) ; // คาวนเวลาปจจบนในเครองเซฟเวอร ?>

Page 7: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

174 Source Code ชอ Default <? require("config.inc.php") ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>::: เขาสระบบ :::</title> <script language="javascript"> // เปดหนา page admin function open_admin(){ myWindow=window.open('admin/index.php','','width=990,height=800,scrollbare=yes') myWindow.focus() } </script> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> </head> <Body > <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="3" align="center"><? require "mnu_index.php";?></td> </tr>

Page 8: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<tr> <td colspan="3" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"><?php require "mnu_login.php"; ?></td> <td width="41%" height="104" align="left" valign="top" bgcolor="f6f7f8"><div align="center"></div> <embed src="http://widget.sanook.com/swf/main.swf" flashvars="xmlPath=http://widget.sanook.com/rss-diy/rss_xml.php?NDUzMzg=" width="400" height="600" bgcolor="#FFFFFF" wmode="transparent"></embed></td> <td width="35%" align="left" valign="top" bgcolor="f6f7f8"><div align="center"><embed src="http://widget.sanook.com/swf/main.swf" flashvars="xmlPath=http://widget.sanook.com/rss-diy/rss_xml.php?NDUzNDA=" width="400" height="600" bgcolor="#FFFFFF" wmode="transparent"></embed></div> </td> </tr> <tr> <td colspan="3" align="left" height="1"></td> </tr> <tr> <td width="24%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td colspan="2" align="left" valign="top" bgcolor="f6f7f8"> </td> </tr> </table> <p>&nbsp;</p> </tr> </table> </body> </html>

Page 9: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

176 Source Code ชอ register <?php require("check_type.php"); session_start(); // ฟงกชนสมรหสผาน function passwdgen( $len ) { $code = "abcdefghijkmnpqrstuvwxy123456789"; srand((double)microtime()*1000000); for($i=0 ; $i < $len ; $i++) { $password .= $code[rand()%strlen($code)]; } return $password; } $_SESSION['ses_code'] = passwdgen(5) ; // สราง code รหสสม 5 หลก ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>สมครสมาชก</title> <!-- ค าสงจาวาสครป --> <script language="javascript"> <!-- ฟงกชนตวสอบการปอนขอมล --> // ตรวจสอบการปอนคา ชอผใชงาน function check_form_register() { var username=document.form_register.username; if (username.value==""){ // ถาชอผใชไมมการกรอกขอมล จะแสดงขอมลวา กรณากรอกชอผใชดวยคะ alert("กรณากรอกชอผใชดวยคะ"); username.focus(); // ก าหนดเคอรเซอรแสดงทชอง ชอผใช return false; } // ตรวจสอบใหกรอกได เฉพาะภาษาองกฤษ ชอผใชงาน var user_eng=document.form_register.username; // ตรวจสอบชอผใชใหกรอกเฉพาะภาษาองกฤษ var str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" //ก าหนดอกษรองกฤษสวนนครบ var val=user_eng.value; var valOK = true; for (i=0; i<val.length & valOK; i++){ valOK = (str.indexOf(val.charAt(i))!= -1) }

Page 10: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

if (!valOK) { alert("ภาษาองกฤษเทานน !!! ") user_eng.focus(); return false; } // ตรวจสอบรหสผาน var password1=document.form_register.password1; var password2=document.form_register.password2; if (password1.value==""||password2.value==""){ alert("กรณากรอกรหสผานดวยคะ"); password1.value==""? password1.focus():password2.focus();// แสดงเคอรเซอรในชองทยงไมไดปอนขอมล return false; } // ตรวจสอบรหสตรงกนหรอไม if (password1.value != password2.value){ alert("รหสผาน 2 ชองไมหมอนกนคะ"); password2.focus(); return false; } var StudentID=document.form_register.StudentID; if (StudentID.value==""){ alert("กรณากรอกรหสนสต"); StudentID.focus(); return false; } var Board=document.form_register.Board; if (Board.value==""){ alert("กรณากรอกคณะ"); Board.focus(); return false; } var Grade=document.form_register.Grade; if (Grade.value==""){ alert("กรณากรอกชนป"); Grade.focus(); return false; } // ตรวจสอบการกรอกชอ var name=document.form_register.name; // ตรวจสอบการปอนคา ชอ-สกล if (name.value==""){ // ถาชอผใชไมมการกรอกขอมล จะแสดงขอมลวา กรณากรอกชอผใชดวยคะ alert("กรณากรอกชอ-สกลดวยคะ");

Page 11: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

name.focus(); // ก าหนดเคอรเซอรแสดงทชอง ชอ-สกล return false; } // ตรวจสอบ email วามการปอนขอมลหรอเปลา var email=document.form_register.email; if (email.value==""){ // ถาชอผใชไมมการกรอกขอมล alert("กรณากรอกอเมลดวยคะ"); email.focus(); // ก าหนดเคอรเซอรแสดงทชอง email return false; } // ตรวจสอบรปแบบอเมล var emailFilter=/^([a-zA-Z0-9_\.\-)+\@(([a-zA-Z0-9\-])+\.([a-zA-Z\.]{2,6})$/ var email_chk=document.form_register.email.value; // ตรวจสอบการปอนคา email if(!(emailFilter.test(email_chk))) { alert("รปแบบอเมลไมถกตองคะ"); return false; } // ตรวจสอบ เบอรโทร วามการปอนขอมลหรอเปลา var phone=document.form_register.phone; if (phone.value==""){ // ถาชอผใชไมมการกรอกขอมล alert("กรณากรอกเบอรโทรดวยคะ"); phone.focus(); // ก าหนดเคอรเซอรแสดงทชอง เบอรโทร return false; } // ตรวจสอบรปแบบอเมล var phoneFilter=/^0[0-9]{9}$/ var phone_chk=document.form_register.phone.value; // ตรวจสอบการปอนคา email if(!(phoneFilter.test(phone_chk))) { alert("รปแบบหมายเลขโทรศพทไมถกตองคะ"); return false; } // ตรวจสอบ รหสภาพ วามการปอนขอมลหรอเปลา var code=document.form_register.code; if (code.value==""){ // ถาชอผใชไมมการกรอกขอมล alert("กรณากรอกรหสภาพดวยคะ"); code.focus(); // ก าหนดเคอรเซอรแสดงทชอง รหสภาพ return false; } } // ฟงกชนรเซสฟอรม function reset_form(){ window.location.reload(); } </script>

Page 12: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<script language="javascript"> // เปดหนา page admin function open_admin(){ myWindow=window.open('admin/index.php','','width=990,height=800,scrollbare=yes') myWindow.focus() } </script> <style type="text/css"> <!-- a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: underline; } a:active { text-decoration: none; } .style1 {color: #FF0000} body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-image: url(images/bg_hexa.gif); background-repeat: repeat; } --> </style> </head> <body onLoad="document.form_register.username.focus();"> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr>

Page 13: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td colspan="2" align="center"><? require "mnu_index.php";?> <?php if($type=="Student"){ echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; }?> </td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"> <?php if($type=="Student"){ require "mnu_member.php"; }else{ require "mnu_login.php"; } ?></td> <td height="104" align="left" bgcolor="f6f7f8"><table width="700" height="77" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="4" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="25" background="images/register_02.png">&nbsp;</td> <td width="32" bgcolor="#F6F6F6">&nbsp;</td> <td width="621" bgcolor="#F6F6F6"><font face="MS Sans Serif" color="#FF0000"><b>ลงทะเบยนส าหรบนสต</b></font> <form action="register_add.php" method="POST" name="form_register" onsubmit="return check_form_register()" autocomplete="off"> <table border="0" cellpadding="1" cellspacing="0" > <tr> <td width="79"><font color="#666666" size="2">ชอผใชงาน</font><font color="red" size="2">*</font></td> <td width="378"><input type="text" size="30" name="username"></td> </tr> <tr> <td><font color="#666666" size="2">รหสผาน</font><font color="red" size="2">*</font></td> <td><input name="password1" type="password" size="30" maxlength="15" ></td> </tr> <tr>

Page 14: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td><font color="#666666" size="2">ทวนรหสผาน</font><font color="red" size="2">*</font></td> <td><input name="password2" type="password" size="30" maxlength="15"></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td><font color="#666666" size="2">รหสนสต</font><font color="red" size="2">*</font></td> <td><input type="text" size="30" name="StudentID" ></td> </tr> <tr> <td><font color="#666666" size="2">คณะ</font><font color="red" size="2">*</font></td> <td><input type="text" size="30" name="Board" ></td> </tr> <tr> <td><font color="#666666" size="2">ชนป</font><font color="red" size="2">*</font></td> <td><input type="text" size="5" name="Grade" ></td> </tr> <tr> <td><font color="#666666" size="2">ชอ-สกล</font><font color="red" size="2">*</font></td> <td><input type="text" size="30" name="name" ></td> </tr> <tr> <td><font color="#666666" size="2">เพศ </font> </td> <td><input type="radio" name="gender" value="ชาย" checked> <font color="#666666" size="2">ชาย</font> <input type="radio" name="gender" value="หญง"> <font color="#666666" size="2">หญง</font></td> </tr> <tr> <td><font color="#666666" size="2">ทอย</font> </td> <td><textarea name="address" cols="40" rows="5" ></textarea></td> </tr> <tr> <td><font color="#666666" size="2">อเมล</font><font color="red" size="2">*</font> </td> <td><input type="text" size="30" name="email"></td> </tr> <tr> <td><font color="#666666" size="2">โทรศพท</font><font color="red" size="2">*</font></td> <td><input name="phone" type="text" size="20" maxlength="10"></td>

Page 15: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</tr> <tr> <td>&nbsp;</td> <td><font color="gray" size="-1">ปอนเฉพาะตวเลข 10 หลก)</font></td> </tr> <tr> <td>&nbsp;</td> <td><font color="gray" size="-1">คอฟลดทตองปอนขอมล หามปลอยวาง</font></td> </tr> <tr> <td><font color="#666666" size="-1">ใสรหสภาพ</font><font size="2" color="red">*</font></td> <td><input type="text" name="code" size="8" > &nbsp;<a href=register.php><font color="#0066FF"size="2">คลกขอรหสใหม</font></a> </td> </tr> <tr> <td>&nbsp;</td> <td><img src=imagettf.php></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><input type="image" src="images/bg_register.gif" name="send" value="ลงทะเบยน" > <a href="#" onClick="javascript: reset_form()"><img src="images/bg_cancel.gif" border="0"></a></td> </tr> </table> </form></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="33" colspan="4" background="images/register_05.png">&nbsp;</td> </tr> </table></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="24%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="76%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table>

Page 16: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<p>&nbsp;</p> </tr> </table> </center> </body> </html>

Page 17: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

184 Source Code ชอ officer <?php require("check_type.php"); session_start(); // ฟงกชนสมรหสผาน function passwdgen( $len ) { $code = "abcdefghijkmnpqrstuvwxy123456789"; srand((double)microtime()*1000000); for($i=0 ; $i < $len ; $i++) { $password .= $code[rand()%strlen($code)]; } return $password; } $_SESSION['ses_code'] = passwdgen(5) ; // สราง code รหสสม 5 หลก ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>ลงทะเบยนเจาหนาท</title> <!-- ค าสงจาวาสครป --> <script language="javascript"> <!-- ฟงกชนตวสอบการปอนขอมล --> // ตรวจสอบการปอนคา ชอผใชงาน function check_form_register() { var username=document.form_register.username; if (username.value==""){ // ถาชอผใชไมมการกรอกขอมล จะแสดงขอมลวา กรณากรอกชอผใชดวยคะ alert("กรณากรอกชอผใชดวยคะ"); username.focus(); // ก าหนดเคอรเซอรแสดงทชอง ชอผใช return false; } // ตรวจสอบใหกรอกได เฉพาะภาษาองกฤษ ชอผใชงาน var user_eng=document.form_register.username; // ตรวจสอบชอผใชใหกรอกเฉพาะภาษาองกฤษ var str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" //ก าหนดอกษรองกฤษสวนนครบ var val=user_eng.value; var valOK = true; for (i=0; i<val.length & valOK; i++){ valOK = (str.indexOf(val.charAt(i))!= -1)

Page 18: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

} if (!valOK) { alert("ภาษาองกฤษเทานน !!! ") user_eng.focus(); return false; } // ตรวจสอบรหสผาน var password=document.form_register.password; if (password.value==""){ alert("กรณากรอกรหสผานดวยคะ"); password.focus();// แสดงเคอรเซอรในชองทยงไมไดปอนขอมล return false; } var EmployeeID=document.form_register.EmployeeID; if (EmployeeID.value==""){ alert("กรณากรอกรหสพนกงาน"); EmployeeID.focus(); return false; } // ตรวจสอบการกรอกชอ var name=document.form_register.FullName; // ตรวจสอบการปอนคา ชอ-สกล if (name.value==""){ // ถาชอผใชไมมการกรอกขอมล จะแสดงขอมลวา กรณากรอกชอผใชดวยคะ alert("กรณากรอกชอ-สกลดวยคะ"); name.focus(); // ก าหนดเคอรเซอรแสดงทชอง ชอ-สกล return false; } // ตรวจสอบ รหสภาพ วามการปอนขอมลหรอเปลา var code=document.form_register.code; if (code.value==""){ // ถาชอผใชไมมการกรอกขอมล alert("กรณากรอกรหสภาพดวยคะ"); code.focus(); // ก าหนดเคอรเซอรแสดงทชอง รหสภาพ return false; } } // ฟงกชนรเซสฟอรม function reset_form(){ window.location.reload(); } </script> <script language="javascript">

Page 19: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

// เปดหนา page admin function open_admin(){ myWindow=window.open('admin/index.php','','width=990,height=800,scrollbare=yes') myWindow.focus() } </script> <style type="text/css"> <!-- a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: underline; } a:active { text-decoration: none; } body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-image: url(images/bg_hexa.gif); background-repeat: repeat; } --> </style> </head> <body onLoad="document.form_register.username.focus();"> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php

Page 20: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

if($type=="Employees"){ echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; }?> </td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"> <?php if($type=="Employees"){ require "mnu_member.php"; }else{ require "mnu_login_officer.php"; } ?> </td> <td height="104" align="left" bgcolor="f6f7f8"><table width="700" height="77" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="4" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="25" background="images/register_02.png">&nbsp;</td> <td width="32" bgcolor="#F6F6F6">&nbsp;</td> <td width="621" bgcolor="#F6F6F6"><font face="MS Sans Serif" color="#FF0000"><b>ลงทะเบยนส าหรบเจาหนาท</b></font> <form action="register_add_officer.php" method="POST" name="form_register" onsubmit="return check_form_register()" autocomplete="off"> <table border="0" cellpadding="1" cellspacing="0" > <tr> <td width="79"><font color="#666666" size="2">ชอผใชงาน</font><font color="red" size="2">*</font></td> <td width="378"><input type="text" size="20" name="username"></td> </tr> <tr> <td><font color="#666666" size="2">รหสผาน</font><font color="red" size="2">*</font></td> <td><input name="password" type="password" size="20" maxlength="15" id="password" ></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td>

Page 21: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</tr> <tr> <td><font color="#666666" size="2">ชอ-สกล</font><font color="red" size="2">*</font></td> <td><input type="text" size="43" name="FullName" id="FullName" ></td> </tr> <tr> <td><font color="#666666" size="2">ทอย</font> </td> <td><textarea name="address" cols="40" rows="5" ></textarea></td> </tr> <tr> <td><font color="#666666" size="2">อเมล</font></td> <td><input type="text" size="30" name="email"></td> </tr> <tr> <td><font color="#666666" size="2">โทรศพท</font></td> <td><input name="phone" type="text" size="20" maxlength="10"></td> </tr> <tr> <td><font color="#666666" size="-1">ใสรหสภาพ</font><font size="2" color="red">*</font></td> <td><input type="text" name="code" size="8" > &nbsp;<a href=officer.php><font color="#0066FF"size="2">คลกขอรหสใหม</font></a> </td> </tr> <tr> <td>&nbsp;</td> <td><img src=imagettf.php></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><input type="image" src="images/bg_register.gif" name="send" value="ลงทะเบยน" > <a href="#" onClick="javascript: reset_form()"><img src="images/bg_cancel.gif" border="0"></a></td> </tr> </table> </form></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="33" colspan="4" background="images/register_05.png">&nbsp;</td>

Page 22: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</tr> </table></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="24%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="76%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> </body> </html>

Page 23: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

190 Source Code ชอ endorsee <?php require("check_type.php"); session_start(); // ฟงกชนสมรหสผาน function passwdgen( $len ) { $code = "abcdefghijkmnpqrstuvwxy123456789"; srand((double)microtime()*1000000); for($i=0 ; $i < $len ; $i++) { $password .= $code[rand()%strlen($code)]; } return $password; } $_SESSION['ses_code'] = passwdgen(5) ; // สราง code รหสสม 5 หลก ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>ลงทะเบยนผพจารณาโครงการ</title> <!-- ค าสงจาวาสครป --> <script language="javascript"> <!-- ฟงกชนตวสอบการปอนขอมล --> // ตรวจสอบการปอนคา ชอผใชงาน function check_form_register() { var username=document.form_register.username; if (username.value==""){ // ถาชอผใชไมมการกรอกขอมล จะแสดงขอมลวา กรณากรอกชอผใชดวยคะ alert("กรณากรอกชอผใชดวยคะ"); username.focus(); // ก าหนดเคอรเซอรแสดงทชอง ชอผใช return false; } // ตรวจสอบใหกรอกได เฉพาะภาษาองกฤษ ชอผใชงาน var user_eng=document.form_register.username; // ตรวจสอบชอผใชใหกรอกเฉพาะภาษาองกฤษ var str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" //ก าหนดอกษรองกฤษสวนนครบ var val=user_eng.value; var valOK = true; for (i=0; i<val.length & valOK; i++){ valOK = (str.indexOf(val.charAt(i))!= -1) }

Page 24: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

if (!valOK) { alert("ภาษาองกฤษเทานน !!! ") user_eng.focus(); return false; } // ตรวจสอบรหสผาน var password=document.form_register.password; if (password.value==""){ alert("กรณากรอกรหสผานดวยคะ"); password.focus();// แสดงเคอรเซอรในชองทยงไมไดปอนขอมล return false; } var EndorseeID=document.form_register.EndorseeID; if (EndorseeID.value==""){ alert("กรณากรอกรหสผอนมต"); EndorseeID.focus(); return false; } // ตรวจสอบการกรอกชอ var name=document.form_register.FullName; // ตรวจสอบการปอนคา ชอ-สกล if (name.value==""){ // ถาชอผใชไมมการกรอกขอมล จะแสดงขอมลวา กรณากรอกชอผใชดวยคะ alert("กรณากรอกชอ-สกลดวยคะ"); name.focus(); // ก าหนดเคอรเซอรแสดงทชอง ชอ-สกล return false; } // ตรวจสอบ รหสภาพ วามการปอนขอมลหรอเปลา var code=document.form_register.code; if (code.value==""){ // ถาชอผใชไมมการกรอกขอมล alert("กรณากรอกรหสภาพดวยคะ"); code.focus(); // ก าหนดเคอรเซอรแสดงทชอง รหสภาพ return false; } } // ฟงกชนรเซสฟอรม function reset_form(){ window.location.reload(); } // เปดหนา page function open_position(){ myWindow=window.open('add_type_position.php','','width=500,height=300,scrollbare=yes')

Page 25: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

myWindow.focus() } </script> <script language="javascript"> // เปดหนา page admin function open_admin(){ myWindow=window.open('admin/index.php','','width=990,height=800,scrollbare=yes') myWindow.focus() } </script> <style type="text/css"> <!-- a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: underline; } a:active { text-decoration: none; } body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-image: url(images/bg_hexa.gif); background-repeat: repeat; } --> </style> </head> <body onLoad="document.form_register.username.focus();"> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table>

Page 26: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php if($type=="endorsee"){ echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; }?> </td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"> <?php if($type=="endorsee"){ require "mnu_member.php"; }else{ require "mnu_login_endorsee.php"; } ?></td> <td height="104" align="left" bgcolor="f6f7f8"><table width="700" height="77" border="0" align="left" cellpadding="0" cellspacing="0"> <tr> <td colspan="4" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="25" background="images/register_02.png">&nbsp;</td> <td width="32" bgcolor="#F6F6F6">&nbsp;</td> <td width="621" bgcolor="#F6F6F6"><font face="MS Sans Serif" color="#FF0000"><b>ลงทะเบยนส าหรบผพจารณาโครงการ</b></font> <form action="register_add_endorsee.php" method="POST" name="form_register" onsubmit="return check_form_register()" autocomplete="off"> <table border="0" cellpadding="1" cellspacing="0" > <tr> <td width="79"><font color="#666666" size="2">ชอผใชงาน</font><font color="red" size="2">*</font></td> <td width="378"><input type="text" size="20" name="username"></td> </tr> <tr> <td><font color="#666666" size="2">รหสผาน</font><font color="red" size="2">*</font></td>

Page 27: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td><input name="password" type="password" size="20" maxlength="15" id="password" ></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td><font color="#666666" size="2">ชอ-สกล</font><font color="red" size="2">*</font></td> <td><input type="text" size="43" name="FullName" id="FullName" ></td> </tr> <tr> <td><font color="#666666" size="2">ต าแหนง</font></td> <td><select name="type" id="type"> <option value="1">เจาหนาทกจกรรมคณะการบญชและการจดการ </option> <option value="2">ผอ านวยการส านกบรหารกจการนสต </option> <option value="3">รองคณะบดฝายพฒนานสต และอาคารสถานท</option> <option value="4">เลขานการคณะการบญชและการจดการ</option> <option value="5">รองคณบดฝายการเงนและบญช</option> <option value="6">คณบดคณะการบญชและการจดการ</option> </select> </td> </tr> <tr> <td><font color="#666666" size="2">ทอย</font> </td> <td><textarea name="address" cols="40" rows="5" ></textarea></td> </tr> <tr> <td><font color="#666666" size="2">อเมล</font></td> <td><input type="text" size="30" name="email"></td> </tr> <tr> <td><font color="#666666" size="2">โทรศพท</font></td> <td><input name="phone" type="text" size="20" maxlength="10"></td> </tr> <tr> <td><font color="#666666" size="-1">ใสรหสภาพ</font><font size="2" color="red">*</font></td> <td><input type="text" name="code" size="8" > &nbsp;<a href=endorsee.php><font color="#0066FF"size="2">คลกขอรหสใหม</font></a> </td> </tr> <tr> <td>&nbsp;</td> <td><img src=imagettf.php></td> </tr>

Page 28: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><input type="image" src="images/bg_register.gif" name="send" value="ลงทะเบยน" > <a href="#" onClick="javascript: reset_form()"><img src="images/bg_cancel.gif" border="0"></a></td> </tr> </table> </form></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="33" colspan="4" background="images/register_05.png">&nbsp;</td> </tr> </table></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="24%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="76%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> </body> </html>

Page 29: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

196 Source Code ชอ conideration <?php require("check_type.php"); session_start(); // ฟงกชนสมรหสผาน function passwdgen( $len ) { $code = "abcdefghijkmnpqrstuvwxy123456789"; srand((double)microtime()*1000000); for($i=0 ; $i < $len ; $i++) { $password .= $code[rand()%strlen($code)]; } return $password; } $_SESSION['ses_code'] = passwdgen(5) ; // สราง code รหสสม 5 หลก ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>ผอนมต</title> <style type="text/css"> <!-- a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: underline; } a:active { text-decoration: none; } body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-image: url(images/bg_hexa.gif); background-repeat: repeat; } --> </style> </head>

Page 30: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<body onLoad="document.form_register.username.focus();"> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php if($type=="consideration"){ echo "<font color='#964408' face='tahoma' size=2>".$_SESSION["name"]."</font><br/>"; ?> <font face="tahoma" color="#964408" size="2">ต าแหนง : </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION["type2"] ."</font>"; }?> </td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"> <?php if($type=="consideration"){ require "mnu_member.php"; }else{ require "mnu_login_consideration.php"; } ?></td> <td height="104" align="left" bgcolor="f6f7f8"><table width="700" height="77" border="0" align="left" cellpadding="0" cellspacing="0"> <tr> <td colspan="4" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="25" background="images/register_02.png">&nbsp;</td> <td width="32" bgcolor="#F6F6F6">&nbsp;</td> <td width="621" bgcolor="#F6F6F6"><font face="MS Sans Serif" color="#FF0000"><b>ลงทะเบยนส าหรบอนมต</b></font> <form action="save_consideration.php" method="POST" name="form_register" autocomplete="off">

Page 31: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<table border="0" cellpadding="1" cellspacing="0" > <tr> <td width="79"><font color="#666666" size="2">ชอผใชงาน</font><font color="red" size="2">*</font></td> <td width="378"><input type="text" size="20" name="username"></td> </tr> <tr> <td><font color="#666666" size="2">รหสผาน</font><font color="red" size="2">*</font></td> <td><input name="password" type="password" size="20" maxlength="15" id="password" ></td> </tr> <tr> <td><font color="#666666" size="2">ชอ-สกล</font><font color="red" size="2">*</font></td> <td><input type="text" size="43" name="FullName" id="FullName" ></td> </tr> <tr> <td><font color="#666666" size="2">ต าแหนง</font></td> <td><select name="type" id="type"> <option value="1">เจาหนาทกจกรรมคณะการบญชและการจดการ </option> <option value="2">ผอ านวยการส านกบรหารกจการนสต </option> <option value="3">รองคณะบดฝายพฒนานสต และอาคารสถานท</option> <option value="4">เลขานการคณะการบญชและการจดการ</option> <option value="5">รองคณบดฝายการเงนและบญช</option> <option value="6">คณบดคณะการบญชและการจดการ</option> </select> </td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><input type="image" src="images/bg_register.gif" name="send" value="ลงทะเบยน" > <a href="#" onClick="javascript: reset_form()"><img src="images/bg_cancel.gif" border="0"></a></td> </tr> </table> </form></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr>

Page 32: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td height="33" colspan="4" background="images/register_05.png">&nbsp;</td> </tr> </table></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="24%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="76%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> </body> </html>

Page 33: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

200 Source Code ชอ add_finance <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>:: รายละเอยดโครงการ</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> <script language="javascript"> function open_facttype(){ myWindow=window.open('facttype.php','','width=500,height=500,scrollbare=yes') myWindow.focus() } function open_building(){ myWindow=window.open('building.php','','width=500,height=500,scrollbare=yes') myWindow.focus() } </script> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%">

Page 34: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="0%" bgcolor="#f1f3f5"></td> <td width="50%" align="center"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font> <? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?> </td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" bgcolor="f6f7f8" valign="top"><? require "mnu_member.php"; ?></td> <td height="104" align="left" valign="top" bgcolor="f6f7f8"> <? $sql_select = "SELECT * FROM project WHERE Project_ID='$_GET[Project_ID]'"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC"> <? while($fetch=mysql_fetch_array($result)){ $Project_ID=$fetch["Project_ID"]; $Project_Name=$fetch["Project_Name"]; $Project_Date=$fetch["Project_Date"]; $file=$fetch["file"]; $Fact1=$fetch["Fact1"]; $Proposer=$fetch["Proposer"]; ?> <tr><td align="left" ><font face="Tahoma" size="2" color="#333333"><b><u><?=$Project_Name?></u></b></font></td> </tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666">

Page 35: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

รหสโครงการ : <?=$Project_ID?> <br/> </font></td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666"> รายละเอยดโครงการ : <? echo "<a href='file/$file' target='_blank'><font face='tahoma' size='2' color='#0066FF'>$file</font></a>"; ?> <br/> </font></td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666"> วนทเรมจดโครงการ : <?=$Project_Date?> <br/> </font></td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666"> ระยะเวลา : <?=$Fact1?> <br/> </font></td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666"> ผรบผดชอบโครงการ : <?=$Proposer?> <br/> </font></td></tr> </td> </tr> <? } ?></table> <br> <form action="" method="post"> <table width="95%" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left" ><font face="Tahoma" size="2" color="#333333"><b><u>หมวดงบประมาณ</u></b></font></td> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> ประเภทโครงการ : </font><select name="Project_Type"> <? mysql_connect($dbhost,$dbuser,$dbpass) or die("connect mysql ไมได"); mysql_query("SET NAMES UTF8"); mysql_select_db($dbname); $sql="SELECT facttype_id,facttype_name FROM facttype"; $result=mysql_query($sql); while($rs=mysql_fetch_array($result)){ $facttype_name=$rs["facttype_name"]; $facttype_id=$rs["facttype_id"];

Page 36: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

echo "<option value='$facttype_id'>$facttype_name</option>"; } ?></select> <input name="btnAddfacttype" type="button" onClick="open_facttype()" value="เพมประเภทโครงการ" ></td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> งบประมาณทใชในการด าเนนโครงการ : <input name="budget" type="text"> บาท </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คาอาหาร : <input name="Board" type="text" size="15"> บาท </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คารถเดนทาง : <input name="Carfare" type="text" size="15"> บาท </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คาเบยเลยง : <input name="Food" type="text" size="15"> บาท </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คาเครองเดม : <input name="Drink" type="text" size="15"> บาท </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คาเจาหนาทดแลความปลอดภย : <input name="security_officer" type="text" size="15"> บาท </font> </td></tr> </table> <br> <table width="95%" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left" ><font face="Tahoma" size="2" color="#333333"><b><u>รายการวสด - อปกรณโสดทศนศกษา</u></b></font></td> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8">

Page 37: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<font face="Tahoma" size="2" color="#333333"> คอมพวเตอร จ านวน : <input name="Computer" type="text"> ชด </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> เครองเสยงจ านวน จ านวน: <input name="Audio" type="text" size="15"> ชด </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> ล าโพง จ านวน : <input name="Speaker" type="text" size="15"> ชด </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> โตะ + เกาอ จ านวน : <input name="Table" type="text" size="15"> ชด </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> หอง จ านวน : <input name="Room" type="text" size="15"> หอง </font> </td></tr> </table> <br> <table width="95%" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left" ><font face="Tahoma" size="2" color="#333333"><b><u>รายการอาคารสถานท</u></b></font></td> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> อาคารสถานท : <select name="buiding_Type"> <? mysql_connect($dbhost,$dbuser,$dbpass) or die("connect mysql ไมได"); mysql_query("SET NAMES UTF8"); mysql_select_db($dbname); $sql="SELECT building_id,building_name FROM building"; $result=mysql_query($sql); while($rs=mysql_fetch_array($result)){ $building_name=$rs["building_name"]; $building_id=$rs["building_id"]; echo "<option value='$building_id'>$building_name</option>"; }

Page 38: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

?></select> <input name="btnAddbuilding" type="button" onClick="open_building()" value="เพมอาคารสถานท" > </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> จ านวนผเขารวมโครงการ : <input name="number" type="text" size="15"> คน </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> <input name="btnSave" type="submit" value="บนทก"> <input name="btnCancle" type="reset" value="ยกเลก"> </font> </td></tr> </table> </form> </td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="23%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="77%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> <? if($_POST["btnSave"]){ //if(($_POST["budget"]<>"") AND ($_POST["Board"]<>"")){ $sql_add="INSERT INTO budget VALUES ('','$Project_ID','$Project_Type','$_POST[budget]','$_POST[Board]','$_POST[Carfare]','$_POST[Food]','$_POST[Drink]','$_POST[security_officer]')"; mysql_query($sql_add); $sql_add_place="INSERT INTO place VALUES ('','$Project_ID','$buiding_Type','$_POST[number]')"; mysql_query($sql_add_place); $sql_add_object="INSERT INTO object VALUES ('','$Project_ID','$_POST[Computer]','$_POST[Audio]','$_POST[Speaker]','$_POST[Table]','$_POST[Room]')"; mysql_query($sql_add_object);

Page 39: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

$sql_update_status="UPDATE project SET Project_Status='Y' WHERE Project_ID=$Project_ID"; mysql_query($sql_update_status); ?> <script language="javascript"> alert("บนทกขอมลเรยบรอยแลว"); window.location="finance.php"; </script> <? //} } ?> </center> </body> </html>

Page 40: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

207 Source Code ชอ add_news <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>:: เพมขาว</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php

Page 41: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" valign="top" bgcolor="f6f7f8"><table width="700" height="77" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="4" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="25" background="images/register_02.png">&nbsp;</td> <td width="32" bgcolor="#F6F6F6">&nbsp;</td> <td width="621" bgcolor="#F6F6F6"><font face="tahoma" color="#0033FF" size="2"><b>กรณากรอกรายละเอยดขาว</b></font> <form action="" method="POST" name="form_register" onsubmit="return check_form_register()" autocomplete="off"> <table border="0" cellpadding="1" cellspacing="0" > <tr> <td width="104" align="right"><font color="#666666" size="2">ชอขาว :</font></td> <td width="486" align="left"><input type="text" size="60" name="News_Name" id="News_Name" > <font color="red" size="2">*</font></td> </tr> <tr> <td align="right" valign="top"><font color="#666666" size="2">รายละเอยดขาว :&nbsp;</font></td> <td align="left"><textarea name="News_Detail" id="News_Detail" cols="55" rows="5"></textarea></td> </tr> <tr> <td align="right"><font color="#666666" size="2">วน/เดอน/ป :&nbsp;</font></td> <?php function DateThai($strDate) { $strYear = date("Y",strtotime($strDate))+543; $strMonth= date("n",strtotime($strDate)); $strDay= date("j",strtotime($strDate)); $strHour= date("H",strtotime($strDate));

Page 42: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

$strMinute= date("i",strtotime($strDate)); $strSeconds= date("s",strtotime($strDate)); $strMonthCut = Array("","ม.ค.","ก.พ.","ม.ค.","เม.ย.","พ.ค.","ม.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."); $strMonthThai=$strMonthCut[$strMonth]; return "$strDay $strMonthThai $strYear"; } $strDate = date("Y-m-d"); ?> <td align="left"><input type="text" size="20" name="News_Date" id="News_Date" value="<?=DateThai($strDate)?>" > &nbsp;<font color="red" size="2">*</font></td> </tr> <tr> <td align="right">&nbsp;</td> <td align="left"><font color="red" size="2">* กรอกขอความหามวาง</font></td> </tr> <tr> <td align="right">&nbsp;</td> <td align="left"><input type="submit" name="btnSave" id="btnSave" value="บนทกขาว"> <input type="reset" name="btnCancel" id="btnCancel" value="ยกเลก"></td> </tr> </table> </form></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="33" colspan="4" background="images/register_05.png">&nbsp;</td> </tr> </table></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="20%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="80%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> <? if($_POST["btnSave"]){ if((!empty($_POST["News_Name"])) and (!empty($_POST["News_Date"]))){

Page 43: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

$sql="INSERT INTO news VALUES ('','$_POST[News_Name]','$_POST[News_Detail]','$_POST[News_Date]')"; $result=mysql_db_query($dbname,$sql); if($result){ ?> <script language="javascript"> alert("บนทกขาวเรยบรอยแลว"); window.location="view_news.php"; </script> <? }else{ ?> <script language="javascript"> alert("ไมสามารถบนทกขาวไดคะ"); window.location="add_news.php"; </script> <? exit(); } mysql_close(); } } ?> </body> </html>

Page 44: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

211 Source Code ชอ add_type_position <?php require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>เพมต าแหนงผอนมต</title> </head> <body bgcolor="f6f7f8"> <form name="form1" method="post" action=""> <div align="center"><font color="#666666" size="2">ต าแหนงผอนมต : <input name="Position_Name" type="text" id="Position_Name" size="40"> </font> <input type="submit" name="Submit" id="button" value="บนทก"> </div> </form> <? $sql_select = "SELECT * FROM position"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC"> <tr><td width="10"><font face="Tahoma" size="2" color="#333333"><b>ล าดบ</b></font></td><td><font face="Tahoma" size="2" color="#333333"><b>ต าแหนง</b></font></tr> <? while($fetch=mysql_fetch_array($result)){ $Position_ID=$fetch["Position_ID"]; $Position_Name=$fetch["Position_Name"]; ?> <tr bgcolor="#f6f7f8"><td align="center"><font face="Tahoma" size="2" color="#333333"><?=$Position_ID?></font></td><td><font face="Tahoma" size="2" color="#333333"><?=$Position_Name?></font></tr> <? } echo "</table>"; if($_POST["Position_Name"]<>""){ $sql="INSERT INTO position VALUES ('','$_POST[Position_Name]')";

Page 45: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

mysql_db_query($dbname,$sql); } mysql_close(); ?> </body> </html>

Page 46: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

213 Source Code ชอ answer_save <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <? $detail_ans=$_POST[detail_ans]; $name_ans=$_POST[name_ans]; $email_ans=$_POST[email_ans]; $ref_id=$_POST[ref_id]; $date_ans=date("Y-m-d"); include "function.php"; include "connect.php"; $sql="insert into tb_answer values('','$detail_ans','$name_ans','$email_ans','$date_ans','$ref_id')"; $result=mysql_db_query($dbname,$sql); if ($result) { ?> <script language="javascript"> alert("บนทกค าตอบเรยบรอยแลวคะ"); window.location="question_view.php"; </script> <? } else { ?> <script language="javascript"> alert("ไมสามารถตงค าถามไดคะ"); window.location="question_view.php"; </script> <? } ?> </body> </html>

Page 47: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

214 Source Code ชอ answer_view <? session_start(); require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>กระดานสนทนา</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } a:link { color: #999999; text-decoration: none; } a:visited { color: #999999; text-decoration: none; } a:hover { color: #666666; text-decoration: none; } a:active { color: #999999; text-decoration: none; } --> </style> <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script> <script language="javascript"> function check_form(){ var detail = document.main.detail_ans; if (detail.value==""){ alert("กรณากรอก รายละเอยด ดวยคะ");

Page 48: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

detail.focus(); return false; } var name = document.main.name_ans; if (name.value==""){ alert("กรณากรอก ชอผตอบ ดวยคะ"); name.focus(); return false; } var email = document.main.email_ans; if (email.value==""){ alert("กรณากรอก อเมล ดวยคะ"); email.focus(); return false; } // ตรวจสอบรปแบบอเมล var emailFilter=/^([a-zA-Z0-9_\.\-)+\@(([a-zA-Z0-9\-])+\.([a-zA-Z\.]{2,6})$/ var email_chk=document.main.email_ans.value; // ตรวจสอบการปอนคา email if(!(emailFilter.test(email_chk))) { alert("รปแบบอเมลไมถกตองคะ"); return false; } } </script> </head> <body> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php

Page 49: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td width="24%" height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td width="76%" height="104" bgcolor="f6f7f8"><? include "connect.php"; include "function.php"; $id_ques=$_GET[id_ques]; $sql="select * from tb_question where id_ques='$id_ques' "; $result=mysql_db_query($dbname,$sql); $record=mysql_fetch_array($result); $id_ques=$record[id_ques]; $title_ques=$record[title_ques]; $detail_ques=$record[detail_ques]; $name_ques=$record[name_ques]; $email_ques=$record[email_ques]; $date_ques=$record[date_ques]; $title_ques=htmlspecialchars($title_ques); $detail_ques=nl2br(htmlspecialchars($detail_ques)); $name_ques=htmlspecialchars($name_ques); $email_ques=htmlspecialchars($email_ques); $date_ques=displaydate($date_ques); echo " <font face='tahoma' size=2 color='#FF3300'><b>$title_ques</b></font> <table width='100%' border='0' cellpadding=10 cellspacing=1 bgcolor='#cccccc'> <tr> <td bgcolor='#D2E9FF'> <font size='2' face='tahoma' color='#666666'> $detail_ques <p><b>โดย :</b> $name_ques <b>อเมล :</b> $email_ques <b>เมอ :</b> $date_ques </p></font></td> </tr> </table><BR>";

Page 50: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

$sql="select * from tb_answer where ref_id='$id_ques' order by id_ans"; $result=mysql_db_query($dbname,$sql); while($record=mysql_fetch_array($result)) { $id_ans=$record[id_ans]; $detail_ans=$record[detail_ans]; $name_ans=$record[name_ans]; $email_ans=$record[email_ans]; $date_ans=$record[date_ans]; $ref_id=$record[ref_id]; $detail_ans=nl2br(htmlspecialchars($detail_ans)); $name_ans=htmlspecialchars($name_ans); $email_ans=htmlspecialchars($email_ans); $date_ans=displaydate($date_ans); echo " <table width='100%' border='0' cellpadding=8 cellspacing=1 bgcolor='#cccccc'> <tr> <td bgcolor='#eff39e'><font size='2' face='tahoma' color='#666666'>$detail_ans</font></td> </tr> <tr> <td bgcolor='#D2E9FF'><font size='2' face='tahoma' color='#666666'> <b>โดย : </b> $name_ans <b>อเมล : </b> $email_ans <b>เมอ : </b>$date_ans </font></td> </tr> </table><BR>"; } //end while mysql_close($c); ?></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td colspan="2" align="left" valign="top" bgcolor="f6f7f8"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="100%"><table width="100%" border="0" align="left" cellpadding="0" cellspacing="0"> <tr>

Page 51: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td ><FORM name="main" METHOD=POST ACTION="answer_save.php" onSubmit="Javascript: return check_form();"> <table width="100%" border="0" cellpadding="0" cellspacing="0" align="left"> <tr> <td>&nbsp;</td> <td><img src="images/bg_ans_webboard.gif" width="200" height="50"></td> </tr> <tr> <td width="496">&nbsp;</td> <td width="494">&nbsp;</td> </tr> <tr> <td valign="middle" align="right"><font face="Tahoma" color="#666666" size="2">รายละเอยด :&nbsp;</font></td> <td><textarea name="detail_ans" rows="5" cols="40" id="detail_ans" style=" color:#FF6600;border: double 1px #CCCCCC; "></textarea></td> </tr> <tr> <td valign="top" align="right"><font face="Tahoma" color="#666666" size="2">ชอผตอบ :&nbsp;</font></td> <td><input name="name_ans" type="text" id="name_ans" style=" color:#FF6600;border: double 1px #CCCCCC; " value="<?=$name?>" size="30" ></td> </tr> <tr> <td valign="top" align="right"><font face="Tahoma" color="#666666" size="2">อเมล :&nbsp;</font></td> <td><input name="email_ans" type="text" size="30" id="email_ans" style=" color:#FF6600;border: double 1px #CCCCCC; "></td> </tr> <tr> <td height="5"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td><input type="submit" value="ตกลง" style="cursor:hand"> <input type="reset" value="ยกเลก" style="cursor:hand"></td> </tr> </table> <input type="hidden" name="ref_id" value="<?=$id_ques;?>"><BR> </FORM></td> </tr> </table></td> </tr> </table> </td> </tr> </table> <p>&nbsp;</p>

Page 52: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</tr> </table> <p align="center">&nbsp;</p> </body> </html>

Page 53: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

220 Source Code ชอ approval_project <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>:: อนมตโครงการ</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="0%" bgcolor="#f1f3f5"></td> <td width="50%" align="center"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?>

Page 54: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<?php echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" align="left" valign="top" bgcolor="f6f7f8"> <font face="Tahoma" size="2" color="#666666"><b><u>รายการโครงการ</u></b></font><br> <? $sql_select = "SELECT * FROM project WHERE Project_Status='Y'"; $result=mysql_db_query($dbname,$sql_select); ?> <form action="" method="post"> <table width="95%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"> <tr><td width="90"><font face="Tahoma" size="2" color="#666666"><b>รหสโครงการ</b></font></td><td align="left"><font face="Tahoma" size="2" color="#666666"><b>ชอโครงการ</b></font></td> <td width="120"><font face="Tahoma" size="2" color="#666666"><b>วนทยนโครงการ</b></font></td> <td width="120"><font face="Tahoma" size="2" color="#666666"><b>อนมตโครงการ</b></font></td> </tr> <? $i=1; while($fetch=mysql_fetch_array($result)){ $Project_ID=$fetch["Project_ID"]; $Project_Name=$fetch["Project_Name"]; $Project_Date=$fetch["Project_Date"]; ?> <tr bgcolor="#f6f7f8"> <td align="center"> <font face="Tahoma" size="2" color="#666666"><?=$Project_ID?></font></td> <td align="left"><a href="show_project.php?Project_ID=<?=$Project_ID?>"><font face="Tahoma" size="2" color="#666666"><?=$Project_Name?></font></a></td> <td><font face="Tahoma" size="2" color="#666666"><?=$Project_Date?></font></td>

Page 55: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td width="150"><input type="checkbox" name="chkApprove[]" value="<?=$Project_ID?>"><font face="Tahoma" size="2" color="#666666">อนมต</font> <input type="checkbox" name="chkDisapproval[]" value="<?=$Project_ID?>"><font face="Tahoma" size="2" color="#666666">ไมอนมต</font> <font face="Tahoma" size="2" color="#666666"><textarea name="comment[]" cols="20" rows="4"></textarea></font> </td></td> </tr> <? $i++; } ?><tr bgcolor="#f6f7f8"><td colspan="4"><input type="submit" value="บนทก" name="btnSave"><input type="reset" value="ยกเลก"></td></tr> </table></form> </td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="23%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="77%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> <? if($_POST["btnSave"]){ for($i=0;$i<count($_POST["chkApprove"]);$i++) { $Project_ID=$_POST["chkApprove"][$i]; $comment=$_POST["comment"][$i]; $sql="UPDATE Project SET Project_Status='1',Approval='$name',comment='$comment' WHERE Project_ID='$Project_ID'"; mysql_db_query($dbname,$sql); } for($i=0;$i<count($_POST["chkDisapproval"]);$i++) { $Project_ID=$_POST["chkDisapproval"][$i]; $comment=$_POST["comment"][$i];

Page 56: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

$sql="UPDATE Project SET Project_Status='2',Approval='$name',comment='$comment' WHERE Project_ID='$Project_ID'"; mysql_db_query($dbname,$sql); } ?> <script language="javascript"> window.location="approval_project.php"; </script> <? } ?> </center> </body> </html>

Page 57: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

224 Source Code ชอ approval_view <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>:: รายการอนมต</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="0%" bgcolor="#f1f3f5"></td> <td width="50%" align="center"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr>

Page 58: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td colspan="2" align="center"><? require "mnu_index.php";?> <?php echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" valign="top" bgcolor="f6f7f8"> <? $sql_select = "SELECT * FROM project WHERE Approval='$name'"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left"><font face="Tahoma" size="2" color="#333333"><b>ชอโครงการ</b></font></td> <td><font face="Tahoma" size="2" color="#333333"><b>วนทยนเสนอ</b></td> <td><font face="Tahoma" size="2" color="#333333"><b>ผรบผดชอบ</b></td> <td><font face="Tahoma" size="2" color="#333333"><b>สถานะ</b></td></tr> <? while($fetch=mysql_fetch_array($result)){ $Project_ID=$fetch["Project_ID"]; $Project_Name=$fetch["Project_Name"]; $Project_Status=$fetch["Project_Status"]; $Project_Date=$fetch["Project_Date"]; $Proposer=$fetch["Proposer"]; if($Project_Status=="0"){ $Status="รอพจารณาการอนมต"; } if($Project_Status=="1"){ $Status="ผานการอนมต"; } if($Project_Status=="2"){ $Status="ไมผานการอนมต"; } if($Project_Status=="3"){ $Status="ปรบปรง/แกไขโครงการ"; } ?>

Page 59: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<tr bgcolor="#f6f7f8"><td align="left"><font face="Tahoma" size="2" color="#333333"><?=$Project_Name?></font></td> <td><font face="Tahoma" size="2" color="#333333"><?=$Project_Date?></font></td> <td><font face="Tahoma" size="2" color="#333333"><?=$Proposer?></font></td> <td><font face="Tahoma" size="2" color="#333333"><?=$Status?></font></td> </tr> <? } ?></table> </td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="20%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="80%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> </body> </html>

Page 60: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

227 Source Code ชอ approval_summary <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <? $sql="UPDATE summary SET Status='1' WHERE summary_id='$_GET[summary_id]'"; mysql_query($sql); ?> <script language="javascript"> alert("อนมตเรยบรอยแลว"); window.location="summary_view_employees.php"; </script> </body> </html>

Page 61: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

228 Source Code ชอ auth.inc <? require("config.inc.php"); // เรยกแทรกไฟลคอนฟกตงระบบ // เชความคาใน session['ses_user'] หรอไม ถาไมมแสดงวายงไมไดผานระบบ Login // ใหกระโดดไปท างาน ทหนาเวบลอคอน Default.php if (!isset($_SESSION['ses_user'] )) { // ถาไมมชอ user ในเซสชน ใหเชคในคกก if (!isset($_REQUEST[$cook_nm] ) ) { // ถาในคกกกไมมชอ user header("Location: Default.php"); // ใหกระโดดไปหนาลอคอน exit; } else { // ถามชอ user ในคกก ใหเชคกบฐานขอมลวามชอ user ใน DB หรอไม mysql_connect($dbhost,$dbuser,$dbpass) or die("เชอมตอ Mysql ไมได!!! "); mysql_select_db($dbname); $dbquery = mysql_query("SELECT user, passwd, lastlog from tblmember WHERE user='$_COOKIE[$cook_nm]'"); $result = mysql_fetch_array($dbquery); if (!$result) { // ถาไมม username นใหกระโดดไปหนาลอคอน header("Location: Default.php"); exit; } // ถาคกกเกบ password ไมตรงกบ password ในฐานขอมล ใหกระโดดไปหนาลอคอน if ($_COOKIE[$cook_pw] != $result['passwd']) { header("Location: Default.php"); exit; } $_SESSION['ses_user'] = $_COOKIE[$cook_nm]; $_SESSION['last_log'] = $result['lastlog']; } } ?>

Page 62: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

229 Source Code ชอ building <? require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>ขอมลอาคาร-สถานท</title> <style type="text/css"> <!-- body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #666666; } a:link { color: #666666; text-decoration: none; } a:visited { text-decoration: none; color: #666666; } a:hover { text-decoration: none; color: #333333; } a:active { text-decoration: none; color: #666666; } --> </style></head> <body><br> <form name="form1" method="post" action=""> <div align="center">เพมอาคาร-สถานท : <input name="txtbuilding" type="text" size="40"> <input name="btnSave" type="submit" id="btnSave" value="บนทก" style=" font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#666666; cursor: pointer;"> </div> </form>

Page 63: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<table border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC" width="90%" align="center"> <tr bgcolor="#dedddd"> <td width="20" align="center"><b>ล าดบ</b></td> <td><b>อาคาร-สถานท</b></td> <td width="30"><b>แกไข</b></td> <td width="30"><b>ลบ</b></td> </tr> <? mysql_connect($dbhost,$dbuser,$dbpass) or die("connect mysql ไมได"); mysql_query("SET NAMES UTF8"); mysql_select_db($dbname); $sql_select="SELECT * FROM building"; $result=mysql_query($sql_select); $i=0; while($rs=mysql_fetch_array($result)){ $id=$rs["building_id"]; $building_name=$rs["building_name"]; $i++; echo "<tr bgcolor=#FFFFFF> <td align='center'>$i</td> <td>$building_name</td> <td align='center'><a href=edit_building.php?id=$id>แกไข</a></td> <td align='center'><a href=delete_building.php?id=$id>ลบ</a></td> </tr>"; } if($_POST["txtbuilding"]<>""){ $sql="INSERT INTO building VALUES ('','$_POST[txtbuilding]')"; $result=mysql_query($sql); ?> <script language="javascript"> window.location="building.php"; </script> <? } mysql_close(); ?> </table> </body> </html>

Page 64: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

231 Source Code ชอ changepassword <?php require("auth.inc.php"); // เรยกแทรกสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"; charset="utf-8"> <title>::: เปลยนรหสผาน :::</title> </head> <script language="javascript"> // เปดหนา page admin function open_admin(){ myWindow=window.open('admin/index.php','','width=990,height=800,scrollbare=yes') myWindow.focus() } </script> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> <body onLoad="document.form_changpass.oldpass.focus();"> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td>

Page 65: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td width="19%" height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td width="81%" height="104" bgcolor="f6f7f8"><table width="700" height="355" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="25" colspan="3" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="24" background="images/register_02.png">&nbsp;</td> <td height="292" align="center" valign="middle" bgcolor="#F6F6F6"><form action="<? $_SERVER['PHP_SELF']?>" method="POST" name="form_changpass" onsubmit="return check_form_changpass()"> <table cellspacing="2"> <tr> <td align="left"><h5><font color="#FF6600" face="tahoma">เปลยนรหสผาน</font></h5></td> <td align="left">&nbsp;</td> </tr> <tr> <td width="100" align="left"><font color="#666666" size="2" face="tahoma">ชอผใช :</font></td> <td width="166" align="left"><font color="#0066FF" size="2" face="tahoma"> <?=$username ?> </font></td> </tr> <tr> <td align="left"><font color="#666666" size="2" face="tahoma">รหสผานเดม :</font></td>

Page 66: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td align="left"><input name="oldpass" type="password" maxlength="13"> <font color="#FF0000" size="2">*</font></td> </tr> <tr> <td align="left"><font color="#666666" size="2" face="tahoma">รหสผานใหม :</font></td> <td align="left"><input name="newpass" type="password" maxlength="13"> <font color="#FF0000" size="2">*</font></td> </tr> <tr> <td align="left"><font color="#666666" size="2" face="tahoma">ยนยนรหสผานใหม :</font></td> <td align="left"><input name="newpass2" type="password" maxlength="13"> <font color="#FF0000" size="2">*</font></td> </tr> <tr> <td>&nbsp;</td> <td align="left"><input name="send" type="submit" value="เปลยนรหสผาน" style="cursor:hand; color: #990000;font:tahoma; border: dotted #FF9900 ; background:#FF9900"></td> </tr> </table> </form></td> <script language="javascript"> <!--ค าสงตรวจสอบการกรอกขอมล ชองรหสผานเดม --> function check_form_changpass() { var oldpass=document.form_changpass.oldpass; // ตรวจสอบการปอนคา if (oldpass.value==""){ // ถาชอผใชไมมการกรอกขอมล จะแสดงขอมล alert("กรณากรอกรหสผานเดมดวยคะ"); oldpass.focus(); // ก าหนดเคอรเซอรแสดงทชอง รหสผานเดม return false; } var newpass=document.form_changpass.newpass; // ตรวจสอบการปอนคา รหสผานใหม if (newpass.value==""){ // ถาชอผใชไมมการกรอกขอมล จะแสดงขอมล alert("กรณากรอกรหสผานใหมดวยคะ"); newpass.focus(); // ก าหนดเคอรเซอรแสดงทชอง หรสผานใหม return false; } var newpass2=document.form_changpass.newpass2; // ตรวจสอบการปอนคา รหสผานใหม if (newpass2.value==""){ // ถาชอผใชไมมการกรอกขอมล จะแสดงขอมล alert("กรณากรอกยนยนรหสผานใหมดวยคะ"); newpass2.focus(); // ก าหนดเคอรเซอรแสดงทชอง หรสผานใหม return false; }

Page 67: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

if(newpass.value != newpass2.value){ alert("รหสผานใหมและยนยนรหสผานใหม ไมตรงกนคะ"); return false; } } </script> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="33" colspan="3" background="images/register_05.png">&nbsp;</td> </tr> </table></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td colspan="2" align="left" valign="top" bgcolor="f6f7f8"> <p>&nbsp;</p> </td> </tr> </table></td> </tr> </table> <p>&nbsp;</p> </tr> </table> <? if (isset($_POST["send"])) { $oldpass=$_POST['oldpass']; $newpass=$_POST['newpass']; $newpass2=$_POST['newpass2']; $encpwd = md5($oldpass); if ($type=="Employees"){ $sql = "select * from Employees where Username='$username' and Password='$encpwd' "; $result = mysql_db_query($dbname,$sql); $num=mysql_num_rows($result); } if ($type=="Student"){ $sql = "select * from tblmember where user='$username' and passwd='$encpwd' "; $result = mysql_db_query($dbname,$sql); $num=mysql_num_rows($result); } if ($type=="endorsee"){

Page 68: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

$sql = "select * from endorsee where Username='$username' and Password='$encpwd' "; $result = mysql_db_query($dbname,$sql); $num=mysql_num_rows($result); } if($num<1) { ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("รหสผานเดมไมถกตองคะ"); </script> <meta Http-equiv="refresh" Content="1; Url=changepassword.php"> <? exit(); } $newpassword = md5($newpass); if ($type=="Employees"){ $sql = "UPDATE Employees set Password='$newpassword' where Username='$username' "; $result=mysql_db_query($dbname,$sql); } if ($type=="Student"){ $sql = "UPDATE tblmember set passwd='$newpassword' where user='$username' "; $result=mysql_db_query($dbname,$sql); } if ($type=="endorsee"){ $sql = "UPDATE endorsee set Password='$newpassword' where Username='$username' "; $result=mysql_db_query($dbname,$sql); } if ($result) { ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("ระบบไดเปลยนรหสผานใหคณแลวคะ"); </script> <meta Http-equiv="refresh" Content="1; Url=main.php"> <? }else{

Page 69: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("ไมสามารถเปลยนรหสผานไดคะ"); </script> <meta Http-equiv="refresh" Content="1; Url=changepassword.php"> <? } } mysql_close(); ?> </body> </html>

Page 70: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

237 Source Code ชอ check_type <? session_start(); require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ $username = $_SESSION['ses_user']; // Username ทลอคอนเขามาในระบบขณะน $type=$_SESSION['type']; if($type=="Employees"){ $sql = "SELECT * From employees WHERE Username='$username' "; $result = mysql_query($sql); $fetcharr = mysql_fetch_array($result); $name = $fetcharr["FullName"]; } if($type=="Student"){ $sql = "SELECT * From tblmember WHERE user='$username' "; $result = mysql_query($sql); $fetcharr = mysql_fetch_array($result); $name = $fetcharr["name"]; } if($type=="endorsee"){ $sql = "SELECT * From endorsee WHERE Username='$username' "; $result = mysql_query($sql); $fetcharr = mysql_fetch_array($result); $name = $fetcharr["FullName"]; } ?>

Page 71: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

238 Source Code ชอ connect <? $host="localhost"; $user="root"; $pw="1704"; $dbname="db_webboard"; $c = mysql_connect($host,$user,$pw); mysql_query("SET NAMES UTF8"); if (!$c) { echo "<h3>ERROR : ไมสามารถตดตอฐานขอมลไดคะ</h3>"; exit(); } ?>

Page 72: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

239 Source Code ชอ datetime <? require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>ขอมลระยะเวลา</title> <style type="text/css"> <!-- body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #666666; } a:link { color: #666666; text-decoration: none; } a:visited { text-decoration: none; color: #666666; } a:hover { text-decoration: none; color: #333333; } a:active { text-decoration: none; color: #666666; } --> </style></head> <body><br> <form name="form1" method="post" action=""> <div align="center">ระยะเวลา : <input name="txtperiod" type="text" id="txtperiod"> <input name="btnSave" type="submit" id="btnSave" value="บนทก" style=" font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#666666; cursor: pointer;"> </div> </form> <br>

Page 73: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<br> <table border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC" width="90%" align="center"> <tr bgcolor="#dedddd"> <td width="20" align="center"><b>ล าดบ</b></td> <td><b>ระยะเวลา</b></td> <td width="30"><b>แกไข</b></td> <td width="30"><b>ลบ</b></td> </tr> <? mysql_connect($dbhost,$dbuser,$dbpass) or die("connect mysql ไมได"); mysql_query("SET NAMES UTF8"); mysql_select_db($dbname); $sql_select="SELECT * FROM period"; $result=mysql_query($sql_select); $i=0; while($rs=mysql_fetch_array($result)){ $id=$rs["id"]; $period_name=$rs["period_name"]; $i++; echo "<tr bgcolor=#FFFFFF> <td align='center'>$i</td> <td>$period_name</td> <td align='center'><a href=edit_period.php?id=$id>แกไข</a></td> <td align='center'><a href=delete_period.php?id=$id>ลบ</a></td> </tr>"; } if($_POST["txtperiod"]<>""){ $sql="INSERT INTO period VALUES ('','$_POST[txtperiod]')"; $result=mysql_query($sql); ?> <script language="javascript"> window.location="DateTime.php"; </script> <? } mysql_close(); ?> </table> </body> </html>

Page 74: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

241 Source Code ชอ delete_building <? require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); mysql_connect($dbhost,$dbuser,$dbpass) or die("connect mysql ไมได"); mysql_query("SET NAMES UTF8"); mysql_select_db($dbname); $sql_select="DELETE FROM building WHERE building_id=$_GET[id]"; $result=mysql_query($sql_select); ?> <script language="javascript"> window.location="building.php"; </script> <? mysql_close(); ?>

Page 75: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

242 Source Code ชอ delete_facttype <? require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); mysql_connect($dbhost,$dbuser,$dbpass) or die("connect mysql ไมได"); mysql_query("SET NAMES UTF8"); mysql_select_db($dbname); $sql_select="DELETE FROM facttype WHERE facttype_id=$_GET[id]"; $result=mysql_query($sql_select); ?> <script language="javascript"> window.location="facttype.php"; </script> <? mysql_close(); ?>

Page 76: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

243 Source Code ชอ delete_news <? require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <? $sql="DELETE FROM news WHERE news_ID='$_GET[News_ID]'"; $result=mysql_db_query($dbname,$sql); if($result){ ?> <script language="javascript"> alert("ลบขอมลเรยบรอยแลว"); window.location="view_news.php"; </script> <? } ?> </body> </html>

Page 77: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

244 Source Code ชอ detele_period <? require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); mysql_connect($dbhost,$dbuser,$dbpass) or die("connect mysql ไมได"); mysql_query("SET NAMES UTF8"); mysql_select_db($dbname); $sql_select="DELETE FROM period WHERE id=$_GET[id]"; $result=mysql_query($sql_select); ?> <script language="javascript"> window.location="DateTime.php"; </script> <? mysql_close(); ?>

Page 78: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

245 Source Code ชอ delete_project <? require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <? $sql="DELETE FROM project WHERE Project_ID='$_GET[Project_ID]'"; $result=mysql_db_query($dbname,$sql); if($result){ ?> <script language="javascript"> alert("ลบขอมลเรยบรอยแลว"); window.location="project_view.php"; </script> <? } ?> </body> </html>

Page 79: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

246 Source Code ชอ delete_summary <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <? $sql="DELETE FROM summary WHERE summary_id='$_GET[summary_id]'"; mysql_query($sql); ?> <script language="javascript"> alert("ไมอนมตเรยบรอยแลว"); window.location="summary_view_employees.php"; </script> </body> </html>

Page 80: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

247 Source Code ชอ edit_building <? require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>แกไขขอมลอาคาร-สถานท</title> <style type="text/css"> <!-- body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #666666; } --> </style></head> <body> <? mysql_connect($dbhost,$dbuser,$dbpass) or die("connect mysql ไมได"); mysql_query("SET NAMES UTF8"); mysql_select_db($dbname); $sql_select="SELECT * FROM building WHERE building_id=$_GET[id]"; $result=mysql_query($sql_select); $rs=mysql_fetch_array($result); $building_name=$rs["building_name"]; ?><br> <br> <form name="form1" method="post" action=""> <div align="center">ประเภทโครงการ : <input name="txtbuilding" type="text" id="txtbuilding" size="45" value="<?=$building_name?>"> <input name="btnSave" type="submit" id="btnSave" value="บนทก" style=" font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#666666; cursor: pointer;"> </div> </form> <? if($_POST["txtbuilding"]<>""){ $sql="UPDATE building SET building_name='$_POST[txtbuilding]' WHERE building_id=$_GET[id]"; $result=mysql_query($sql); if($result){

Page 81: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

?> <script language="javascript"> window.location="building.php"; </script> <? } } mysql_close(); ?> </body> </html>

Page 82: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

249 Source Code ชอ edit_employees <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ $username = $_SESSION['ses_user']; // Username ทลอคอนเขามาในระบบขณะน // เปดขอมลของ User $sql = "select * from employees where Username='$username' "; $resutl=mysql_db_query($dbname,$sql); $record=mysql_fetch_array($resutl); $username=$record[Username]; $EmployeesID=$record[EmployeesID]; $name=$record[FullName]; $address=$record[Address]; $email=$record[Email]; $phone=$record[Phone]; if (isset($_POST["update"]) ){ $name=$_POST['name']; $gender=$_POST['gender']; $address_edit=$_POST['address']; $email_edit=$_POST['email']; $phone_edit=$_POST['phone']; $sql = "UPDATE employees SET FullName='$name',Address='$address_edit',Email='$email_edit',Phone='$phone_edit' WHERE UserName='$username'"; $result=mysql_db_query($dbname,$sql); if($result){ ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("แกไขมลสวนตวเรยบรอยแลว"); window.location="main.php"; </script> <? } mysql_close(); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Page 83: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>::: แกไขขอมลสวนตว :::</title> </head> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> <body> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td width="20%" height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td>

Page 84: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td width="80%" height="104" bgcolor="f6f7f8"><table width="700" height="355" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="29" colspan="4" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="24" background="images/register_02.png">&nbsp;</td> <td width="48" height="292" valign="top" bgcolor="#F6F6F6">&nbsp;</td> <td width="602" valign="top" bgcolor="#F6F6F6"><h5><font color="#FF6600" face="tahoma">แกไขขอมลสวนตว</font></h5> <form name="form_update_register" method="post" action="<? $_SERVER['PHP_SELF']?>" onsubmit="return check_form_update_register()" autocomplete="off"> <table width="555" border="0" cellpadding="0" cellspacing="2" bgcolor="#F6F6F6"> <tr> <td width="104"><font color="#666666" size="2" face="tahoma">ชอผใช :</font></td> <td width="445"><input name="username" type="text" value="<?=$username?>" disabled></td> </tr> <tr> <td><font color="#666666" size="2" face="tahoma">ชอ-สกล :</font></td> <td><input name="name" type="text" value="<?=$name?>" size="50" ></td> </tr> <tr> <td><font color="#666666" size="2" face="tahoma">ทอย :</font></td> <td><textarea name="address" id="address" cols="40" rows="5" style="font:tahoma; font-size:13px; color:#333333"><?=$address?> </textarea></td> </tr> <tr> <td><font color="#666666" size="2" face="tahoma">อเมล :</font></td> <td><label> <input name="email" type="text" id="email" value="<?=$email?>" size="30" style="font:tahoma; font-size:13px; color:#333333"> </label></td> </tr> <tr> <td><font color="#666666" size="2" face="tahoma">เบอรโทร :</font></td> <td><label>

Page 85: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<input name="phone" type="text" id="phone" value="<?=$phone?>" maxlength="10" style="font:tahoma; font-size:13px; color:#333333"> </label></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><input type="submit" name="update" value="แกไขขอมล" style="cursor:hand; color: #990000;font:tahoma; border: dotted #FF9900 ; background:#FF9900"></td> </tr> </table> </form></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="33" colspan="4" background="images/register_05.png">&nbsp;</td> </tr> </table></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td colspan="2" align="left" valign="top" bgcolor="f6f7f8"> <p>&nbsp;</p> <p>&nbsp;</p></td> </tr> </table> </td> </tr> </table> <p>&nbsp;</p> </tr> </table> </body> </html>

Page 86: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

253 Source Code ชอ edit_endorsee <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ $username = $_SESSION['ses_user']; // Username ทลอคอนเขามาในระบบขณะน // เปดขอมลของ User $sql = "select * from endorsee where Username='$username' "; $resutl=mysql_db_query($dbname,$sql); $record=mysql_fetch_array($resutl); $username=$record[Username]; $EndorseeID=$record[EndorseeID]; $name=$record[FullName]; $address=$record[Address]; $email=$record[Email]; $phone=$record[Phone]; if (isset($_POST["update"]) ){ $name=$_POST['name']; $gender=$_POST['gender']; $address_edit=$_POST['address']; $email_edit=$_POST['email']; $phone_edit=$_POST['phone']; $position=$_POST["position"]; $sql = "UPDATE endorsee SET FullName='$name',position='$position',Address='$address_edit',Email='$email_edit',Phone='$phone_edit' WHERE Username='$username'"; $result=mysql_db_query($dbname,$sql); if($result){ ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("แกไขมลสวนตวเรยบรอยแลว"); window.location="main.php"; </script> <? } mysql_close(); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Page 87: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>::: แกไขขอมลสวนตว :::</title> </head> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> <body> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center">&nbsp;</td> </tr> <tr> <td width="20%" height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td>

Page 88: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td width="80%" height="104" bgcolor="f6f7f8"><table width="700" height="355" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="29" colspan="4" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="24" background="images/register_02.png">&nbsp;</td> <td width="48" height="292" valign="top" bgcolor="#F6F6F6">&nbsp;</td> <td width="602" valign="top" bgcolor="#F6F6F6"><h5><font color="#FF6600" face="tahoma">แกไขขอมลสวนตว</font></h5> <form name="form_update_register" method="post" action="<? $_SERVER['PHP_SELF']?>" onsubmit="return check_form_update_register()" autocomplete="off"> <table width="555" border="0" cellpadding="0" cellspacing="2" bgcolor="#F6F6F6"> <tr> <td width="104"><font color="#666666" size="2" face="tahoma">ชอผใช :</font></td> <td width="445"><input name="username" type="text" value="<?=$username?>" disabled></td> </tr> <tr> <td><font color="#666666" size="2" face="tahoma">รหสผอนมต</font></td> <td><input name="StudentID" type="text" value="<?=$EndorseeID?>" disabled></td> </tr> <tr> <td><font color="#666666" size="2" face="tahoma">ชอ-สกล :</font></td> <td><input name="name" type="text" value="<?=$name?>" size="50" ></td> </tr> <tr> <td><font color="#666666" size="2">ต าแหนง</font></td> <td><? echo "<select name='position'>"; $sql_select = "SELECT * FROM position"; $result=mysql_db_query($dbname,$sql_select); while($fetch=mysql_fetch_array($result)){ //$Position_ID=$fetch["Position_ID"]; $Position_Name=$fetch["Position_Name"]; echo "<option>$Position_Name</option>"; } echo "</select>"; ?></td> </tr>

Page 89: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<tr> <td><font color="#666666" size="2" face="tahoma">ทอย :</font></td> <td><textarea name="address" id="address" cols="40" rows="5" style="font:tahoma; font-size:13px; color:#333333"><?=$address?> </textarea></td> </tr> <tr> <td><font color="#666666" size="2" face="tahoma">อเมล :</font></td> <td><label> <input name="email" type="text" id="email" value="<?=$email?>" size="30" style="font:tahoma; font-size:13px; color:#333333"> </label></td> </tr> <tr> <td><font color="#666666" size="2" face="tahoma">เบอรโทร :</font></td> <td><label> <input name="phone" type="text" id="phone" value="<?=$phone?>" maxlength="10" style="font:tahoma; font-size:13px; color:#333333"> </label></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><input type="submit" name="update" value="แกไขขอมล" style="cursor:hand; color: #990000;font:tahoma; border: dotted #FF9900 ; background:#FF9900"></td> </tr> </table> </form></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="33" colspan="4" background="images/register_05.png">&nbsp;</td> </tr> </table></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td colspan="2" align="left" valign="top" bgcolor="f6f7f8"> <p>&nbsp;</p>

Page 90: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<p>&nbsp;</p></td> </tr> </table> </td> </tr> </table> <p>&nbsp;</p> </tr> </table> </body> </html>

Page 91: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

258 Source Code ชอ edit_facttype <? require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>แกไขขอมลประเภทโครงการ</title> <style type="text/css"> <!-- body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #666666; } --> </style></head> <body> <? mysql_connect($dbhost,$dbuser,$dbpass) or die("connect mysql ไมได"); mysql_query("SET NAMES UTF8"); mysql_select_db($dbname); $sql_select="SELECT * FROM facttype WHERE facttype_id=$_GET[id]"; $result=mysql_query($sql_select); $rs=mysql_fetch_array($result); $facttype_name=$rs["facttype_name"]; ?><br> <br> <form name="form1" method="post" action=""> <div align="center">ประเภทโครงการ : <input name="txtfacttype" type="text" id="txtfacttype" size="45" value="<?=$facttype_name?>"> <input name="btnSave" type="submit" id="btnSave" value="บนทก" style=" font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#666666; cursor: pointer;"> </div> </form> <? if($_POST["txtfacttype"]<>""){ $sql="UPDATE facttype SET facttype_name='$_POST[txtfacttype]' WHERE facttype_id=$_GET[id]"; $result=mysql_query($sql);

Page 92: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

if($result){ ?> <script language="javascript"> window.location="facttype.php"; </script> <? } } mysql_close(); ?> </body> </html>

Page 93: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

260 Source Code ชอ edit_news <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>แกไขขาว</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <? $sql_select = "SELECT * FROM News WHERE News_ID=$_GET[News_ID]"; $result=mysql_db_query($dbname,$sql_select); $rs=mysql_fetch_array($result); $News_ID=$rs["News_ID"]; $News_Name=$rs["News_Name"]; $News_Detail=$rs["News_Detail"]; $News_Date=$rs["News_Date"]; ?> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">

Page 94: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" valign="top" bgcolor="f6f7f8"><table width="700" height="77" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="4" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="25" background="images/register_02.png">&nbsp;</td> <td width="32" bgcolor="#F6F6F6">&nbsp;</td> <td width="621" bgcolor="#F6F6F6"><font face="tahoma" color="#0033FF" size="2"><b>กรณากรอกรายละเอยดโครงการ</b></font> <form action="" method="POST" name="form_register" onsubmit="return check_form_register()" autocomplete="off"> <table border="0" cellpadding="1" cellspacing="0" > <tr> <td align="right"><font color="#666666" size="2">รหสขาว :&nbsp;</font></td> <td align="left"><input type="text" size="20" name="News_ID" id="News_ID" value="<?=$News_ID?>" disabled > <font color="red" size="2">*</font></td> </tr> <tr> <td width="104" align="right"><font color="#666666" size="2">ชอขาว :</font></td> <td width="486" align="left"><input name="News_Name" type="text" id="News_Name" value="<?=$News_Name?>" size="60" >

Page 95: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<font color="red" size="2">*</font></td> </tr> <tr> <td align="right" valign="top"><font color="#666666" size="2">รายละเอยดขาว :&nbsp;</font></td> <td align="left"><textarea name="News_Detail" id="News_Detail" cols="55" rows="5"><?=$News_Detail?> </textarea></td> </tr> <tr> <td align="right"><font color="#666666" size="2">วนท :&nbsp;</font></td> <?php function DateThai($strDate) { $strYear = date("Y",strtotime($strDate))+543; $strMonth= date("n",strtotime($strDate)); $strDay= date("j",strtotime($strDate)); $strHour= date("H",strtotime($strDate)); $strMinute= date("i",strtotime($strDate)); $strSeconds= date("s",strtotime($strDate)); $strMonthCut = Array("","ม.ค.","ก.พ.","ม.ค.","เม.ย.","พ.ค.","ม.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."); $strMonthThai=$strMonthCut[$strMonth]; return "$strDay $strMonthThai $strYear"; } $strDate = date("Y-m-d"); ?> <td align="left"><input type="text" size="20" name="News_Date" id="News_Date" value="<?=$News_Date?>" > &nbsp;<font color="red" size="2">*</font></td> </tr> <tr> <td align="right">&nbsp;</td> <td align="left"><font color="red" size="2">* กรอกขอความหามวาง</font></td> </tr> <tr> <td align="right">&nbsp;</td> <td align="left"><input type="submit" name="btnEdit" id="btnEdit" value="แกไขโครงการ"> <input type="reset" name="btnCancel" id="btnCancel" value="ยกเลก"></td> </tr> </table> </form></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr>

Page 96: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td height="33" colspan="4" background="images/register_05.png">&nbsp;</td> </tr> </table></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="20%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="80%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> <? if($_POST["btnEdit"]){ $sql="UPDATE News SET News_Name='$_POST[News_Name]', News_Detail='$_POST[News_Detail]',News_Date='$_POST[News_Date]' WHERE News_ID='$_GET[News_ID]'"; $result=mysql_db_query($dbname,$sql); if($result){ ?> <script language="javascript"> alert("แกไขขอมลเรยบรอยแลว"); window.location="view_news.php"; </script> <? mysql_close(); } } ?> </body> </html>

Page 97: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

264 Source Code ชอ edit_period <? require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>แกไขขอมลระยะเวลา</title> <style type="text/css"> <!-- body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #666666; } --> </style></head> <body> <? mysql_connect($dbhost,$dbuser,$dbpass) or die("connect mysql ไมได"); mysql_query("SET NAMES UTF8"); mysql_select_db($dbname); $sql_select="SELECT * FROM period WHERE id=$_GET[id]"; $result=mysql_query($sql_select); $rs=mysql_fetch_array($result); $period_name=$rs["period_name"]; ?><br> <br> <form name="form1" method="post" action=""> <div align="center">ระยะเวลา : <input name="txtperiod" type="text" id="txtperiod" size="45" value="<?=$period_name?>"> <input name="btnSave" type="submit" id="btnSave" value="บนทก" style=" font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#666666; cursor: pointer;"> </div> </form> <? if($_POST["txtperiod"]<>""){ $sql="UPDATE period SET period_name='$_POST[txtperiod]' WHERE id=$_GET[id]"; $result=mysql_query($sql); if($result){

Page 98: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

?> <script language="javascript"> window.location="DateTime.php"; </script> <? } } mysql_close(); ?> </body> </html>

Page 99: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

266 Source Code ชอ edit_project <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>แกไขโครงการ</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <? $sql_select = "SELECT * FROM project WHERE Project_ID=$_GET[Project_ID]"; $result=mysql_db_query($dbname,$sql_select); $rs=mysql_fetch_array($result); $Project_ID=$rs["Project_ID"]; $Project_Name=$rs["Project_Name"]; $Project_Date=$rs["Project_Date"]; $file=$rs["file"]; $Fact1=$rs["Fact1"]; $Proposer=$rs["Proposer"]; ?> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">

Page 100: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" valign="top" bgcolor="f6f7f8"><table width="700" height="77" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="4" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="25" background="images/register_02.png">&nbsp;</td> <td width="32" bgcolor="#F6F6F6">&nbsp;</td> <td width="621" bgcolor="#F6F6F6"><font face="tahoma" color="#0033FF" size="2"><b>กรณากรอกรายละเอยดโครงการ</b></font> <form action="" method="POST" name="form_register" onsubmit="return check_form_register()" autocomplete="off" enctype="multipart/form-data"> <table border="0" cellpadding="1" cellspacing="0" > <tr> <td width="104" align="right"><font color="#666666" size="2">ชอโครงการ :</font></td> <td width="486" align="left"><input name="Project_Name" type="text" id="Project_Name" value="<?=$Project_Name?>" size="60" > <font color="red" size="2">*</font></td> </tr> <tr>

Page 101: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td align="right"><font color="#666666" size="2">วน/เดอน/ป :&nbsp;</font></td> <td align="left"><input type="text" size="20" name="Project_Date" id="Project_Date" value="<?=$Project_Date?>" > &nbsp;<font color="red" size="2">*</font></td> </tr> <tr> <td align="right"><font color="#666666" size="2">ระยะเวลา :&nbsp;</font></td> <td align="left"><select name="Fact1" style="font-family:Tahoma; font-size:12px; color:#333333;" id="Fact1"> <? $sql_period="SELECT period_name FROM period"; $result_period=mysql_query($sql_period); while($rs_period=mysql_fetch_array($result_period)){ $period_name=$rs_period["period_name"]; if($rs["Fact1"]==$period_name){ $se="selected"; }else{ $se=""; } echo "<option $se>$period_name</option>"; } ?> </select></td> </tr> <tr> <td align="right"><font color="#666666" size="2">ไฟลโครงการ :</font>&nbsp;</td> <td align="left"> <? if ($file==""){ echo "<input name=\"filUpload\" type=\"file\" size=\"30\"> <font color=\"red\" size=\"2\">* ชอไฟลภาษาองกฤษเทานน</font>"; }else{ echo "<a href='file/$file' target='_blank'><font face='tahoma' size='2' color='#0066FF'>$file</font></a> <input type='checkbox' name='chkfile' value='1'><font face='tahoma' size='2'> ลบไฟลโครงการ</font>"; } ?> </td> </tr> <tr> <td align="right"><font color="#666666" size="2">ผเสนอ :&nbsp;</font></td> <td align="left"><input type="text" size="30" name="Proposer" id="Proposer" value="<?=$Proposer?>" ></td> </tr> <tr>

Page 102: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td align="right">&nbsp;</td> <td align="left"><font color="red" size="2">* กรอกขอความหามวาง</font></td> </tr> <tr> <td align="right">&nbsp;</td> <td align="left"><input type="submit" name="btnEdit" id="btnEdit" value="แกไขโครงการ"> <input type="reset" name="btnCancel" id="btnCancel" value="ยกเลก"></td> </tr> </table> </form></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="33" colspan="4" background="images/register_05.png">&nbsp;</td> </tr> </table></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="20%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="80%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> <? if($_POST["btnEdit"]){ $sql="UPDATE project SET Project_Name='$_POST[Project_Name]', Project_Date='$_POST[Project_Date]', Fact1='$_POST[Fact1]',Fact1='$_POST[Fact1]' WHERE Project_ID='$_GET[Project_ID]'"; $result=mysql_db_query($dbname,$sql); if($result){ if($_POST["chkfile"]=="1"){ unlink("file/$file"); $sql_up="UPDATE project SET file='' WHERE Project_ID='$_GET[Project_ID]' "; mysql_db_query($dbname,$sql_up); } $file_name=$_FILES["filUpload"]["name"];

Page 103: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

if($file_name<>""){ copy($_FILES["filUpload"]["tmp_name"],"file/".$_FILES["filUpload"]["name"]); $sql_up="UPDATE project SET file='$file_name' WHERE Project_ID='$_GET[Project_ID]' "; mysql_db_query($dbname,$sql_up); } ?> <script language="javascript"> alert("แกไขขอมลเรยบรอยแลว"); window.location="project_view.php"; </script> <? mysql_close(); } } ?> </body> </html>

Page 104: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

271 Source Code ชอ edit_register <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ $username = $_SESSION['ses_user']; // Username ทลอคอนเขามาในระบบขณะน // เปดขอมลของ User $sql = "select * from tblmember where user='$username' "; $resutl=mysql_db_query($dbname,$sql); $record=mysql_fetch_array($resutl); $username=$record[user]; $StudentID=$record[StudentID]; $Board=$record[Board]; $Grade=$record[Grade]; $name=$record[name]; $gender=$record[gender]; $address=$record[address]; $email=$record[email]; $phone=$record[phone]; if (isset($_POST["update"]) ){ $Board=$_POST['Board']; $Grade=$_POST['Grade']; $name=$_POST['name']; $gender=$_POST['gender']; $address_edit=$_POST['address']; $email_edit=$_POST['email']; $phone_edit=$_POST['phone']; $sql = "UPDATE tblmember SET Board='$Board',Grade='$Grade',name='$name',gender='$gender',address='$address_edit',email='$email_edit',phone='$phone_edit' WHERE user='$username'"; $result=mysql_db_query($dbname,$sql); if($result){ ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("แกไขมลสวนตวเรยบรอยแลว"); window.location="main.php"; </script> <? }

Page 105: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

mysql_close(); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script language="javascript"> function check_form_update_register() { // ตรวจสอบรปแบบอเมล var email=document.form_update_register.email; var emailFilter=/^([a-zA-Z0-9_\.\-)+\@(([a-zA-Z0-9\-])+\.([a-zA-Z\.]{2,6})$/ var email_chk=document.form_update_register.email.value; // ตรวจสอบการปอนคา email if(!(emailFilter.test(email_chk))) { alert("รปแบบอเมลไมถกตองคะ"); email.focus(); return false; } var phone=document.form_update_register.phone; var phoneFilter=/^0[0-9]{9}$/ var phone_chk=document.form_update_register.phone.value; // ตรวจสอบการปอนคาเบอรโทรศพท if(!(phoneFilter.test(phone_chk))) { alert("รปแบบหมายเลขโทรศพทไมถกตองคะ"); phone.focus(); return false; } } </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>::: แกไขขอมลสวนตว :::</title> <script language="javascript"> // เปดหนา page admin function open_admin(){ myWindow=window.open('admin/index.php','','width=990,height=800,scrollbare=yes') myWindow.focus() } </script> </head> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif);

Page 106: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> <body> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php $sql = "SELECT name From tblmember WHERE user='$username' "; $result = mysql_query($sql); $fetcharr = mysql_fetch_array($result); $name = $fetcharr["name"]; echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center">&nbsp;</td> </tr> <tr> <td width="20%" height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td width="80%" height="104" bgcolor="f6f7f8"><table width="700" height="355" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="29" colspan="4" background="images/register_01.png">&nbsp;</td> </tr> <tr>

Page 107: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td width="24" background="images/register_02.png">&nbsp;</td> <td width="48" height="292" valign="top" bgcolor="#F6F6F6">&nbsp;</td> <td width="602" valign="top" bgcolor="#F6F6F6"><h5><font color="#FF6600" face="tahoma">แกไขขอมลสวนตว</font></h5> <form name="form_update_register" method="post" action="<? $_SERVER['PHP_SELF']?>" onsubmit="return check_form_update_register()" autocomplete="off"> <table width="419" border="0" cellpadding="0" cellspacing="2" bgcolor="#F6F6F6"> <tr> <td width="58"><font color="#666666" size="2" face="tahoma">ชอผใช :</font></td> <td width="355"><input name="username" type="text" value="<?=$username?>" disabled></td> </tr> <tr> <td><font color="#666666" size="2" face="tahoma">รหสนสต :</font></td> <td><input name="StudentID" type="text" value="<?=$StudentID?>" disabled></td> </tr> <tr> <td><font color="#666666" size="2" face="tahoma">ชอ-สกล :</font></td> <td><input name="name" type="text" value="<?=$name?>" size="50" ></td> </tr> <tr> <td><font color="#666666" size="2" face="tahoma">คณะ :</font></td> <td><input name="Board" type="text" value="<?=$Board?>" size="50"></td> </tr> <tr> <td><font color="#666666" size="2" face="tahoma">ขนป :</font></td> <td><input name="Grade" type="text" value="<?=$Grade?>" size="5"></td> </tr> <tr> <td><font color="#666666" size="2" face="tahoma">เพศ :</font></td> <td><input name="gender" type="text" id="gender" value="<?=$gender?>" size="5"></td> </tr> <tr> <td><font color="#666666" size="2" face="tahoma">ทอย :</font></td> <td><textarea name="address" id="address" cols="40" rows="5" style="font:tahoma; font-size:13px; color:#333333"><?=$address?>

Page 108: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</textarea></td> </tr> <tr> <td><font color="#666666" size="2" face="tahoma">อเมล :</font></td> <td><label> <input name="email" type="text" id="email" value="<?=$email?>" size="30" style="font:tahoma; font-size:13px; color:#333333"> </label></td> </tr> <tr> <td><font color="#666666" size="2" face="tahoma">เบอรโทร :</font></td> <td><label> <input name="phone" type="text" id="phone" value="<?=$phone?>" maxlength="10" style="font:tahoma; font-size:13px; color:#333333"> </label></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><input type="submit" name="update" value="แกไขขอมล" style="cursor:hand; color: #990000;font:tahoma; border: dotted #FF9900 ; background:#FF9900"></td> </tr> </table> </form></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="33" colspan="4" background="images/register_05.png">&nbsp;</td> </tr> </table></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td colspan="2" align="left" valign="top" bgcolor="f6f7f8"> <p>&nbsp;</p> <p>&nbsp;</p></td> </tr> </table> </td>

Page 109: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</tr> </table> <p>&nbsp;</p> </tr> </table> </body> </html>

Page 110: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

277 Source Code ชอ facttype <? require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>ขอมลประเภทโครงการ</title> <style type="text/css"> <!-- body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #666666; } a:link { color: #666666; text-decoration: none; } a:visited { text-decoration: none; color: #666666; } a:hover { text-decoration: none; color: #333333; } a:active { text-decoration: none; color: #666666; } --> </style></head> <body><br> <form name="form1" method="post" action=""> <div align="center">ประเภทโครงการ : <input name="txtfacttype" type="text" size="40"> <input name="btnSave" type="submit" id="btnSave" value="บนทก" style=" font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#666666; cursor: pointer;"> </div> </form>

Page 111: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<table border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC" width="90%" align="center"> <tr bgcolor="#dedddd"> <td width="20" align="center"><b>ล าดบ</b></td> <td><b>ประเภทโครงการ</b></td> <td width="30"><b>แกไข</b></td> <td width="30"><b>ลบ</b></td> </tr> <? mysql_connect($dbhost,$dbuser,$dbpass) or die("connect mysql ไมได"); mysql_query("SET NAMES UTF8"); mysql_select_db($dbname); $sql_select="SELECT * FROM facttype"; $result=mysql_query($sql_select); $i=0; while($rs=mysql_fetch_array($result)){ $id=$rs["facttype_id"]; $facttype_name=$rs["facttype_name"]; $i++; echo "<tr bgcolor=#FFFFFF> <td align='center'>$i</td> <td>$facttype_name</td> <td align='center'><a href=edit_facttype.php?id=$id>แกไข</a></td> <td align='center'><a href=delete_facttype.php?id=$id>ลบ</a></td> </tr>"; } if($_POST["txtfacttype"]<>""){ $sql="INSERT INTO facttype VALUES ('','$_POST[txtfacttype]')"; $result=mysql_query($sql); ?> <script language="javascript"> window.location="facttype.php"; </script> <? } mysql_close(); ?> </table> </body> </html>

Page 112: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

279 Source Code ชอ finance <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>:: หมวดการเงน</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php

Page 113: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" valign="top" bgcolor="f6f7f8"> <? $sql_select = "SELECT * FROM project WHERE Project_Status='0' "; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left"><font face="Tahoma" size="2" color="#333333"><b>ชอโครงการ</b></font></td> </tr> <? while($fetch=mysql_fetch_array($result)){ $Project_ID=$fetch["Project_ID"]; $Project_Name=$fetch["Project_Name"]; ?> <tr bgcolor="#f6f7f8"> <td align="left"><a href="add_finance.php?Project_ID=<?=$Project_ID?>"><font face="Tahoma" size="2" color="#333333"><?=$Project_Name?></font></a></td> </tr> <? } ?></table> <p>&nbsp;</p></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="20%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="80%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p>

Page 114: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</tr> </table> </center> </body> </html>

Page 115: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

282 Source Code ชอ function <? function displaydate($x) { $thai_m=array("มกราคม","กมภาพนธ","มนาคม","เมษายน","พฤษภาคม","มถนายม","กรกฏาคม","สงหาคม","กนยายน","ตลาคม","พฤศจกายน","ธนวาคม"); $date_array=explode("-",$x); $y=$date_array[0]; $m=$date_array[1]-1; $d=$date_array[2]; $m=$thai_m[$m]; $y=$y+543; $displaydate="$d $m $y"; return $displaydate; } // end function displaydate function checkemail($checkemail) { if(ereg( "^[^@ ]+@([a-zA-Z0-9\-]+\.)+([a-zA-Z0-9\-]{2}|net|com|gov|mil|org|edu|int)$",$checkemail) ) { return true; } else { return false; } } // end fuction checkemail ?>

Page 116: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

283 Source Code ชอ imagettf <?php session_start(); header("Content-Type:image/png"); // ก าหนดเฮดเดอรเปนภาพ PNG $im = @imagecreate(110, 36) or die("Cannot Initaialize the GD image.."); $bg_color = imagecolorallocate($im, 230,230,230); //ก าหนดคาส าหรบสพน $text_color = imagecolorallocate($im,155,00,33); //ก าหนดคาส าหรบสอกษร $border_color = imagecolorallocate($im,255,00,00); //ก าหนดสเสนกรอบ $grid_color = imagecolorallocate($im, 210, 190, 210); //คาสเสนกรด (คาดแนวนอน) imageline($im,0,9,109,9,$grid_color); // เขยนเสนกรด (คาด 3 เสน imageline($im,0,18,109,18,$grid_color); imageline($im,0,27,109,27,$grid_color); imageline($im,0,0,110,0,$border_color); imageline($im,109,35,109,0,$border_color); imageline($im,0,0,0,35,$border_color); imageline($im,0,35,109,35,$border_color); // เขยนรหส 5 หลก $font='dsefh___.ttf'; //ก าหนดใชฟอนทแบบ dsefh imageTTFText($im,30,0,15,25,$text_color,$font,$_SESSION['ses_code']); // ถาไมมไฟลฟอนท กใชบรรทดนเขยนรหส 5 หลกแทนได (เปนการใชฟอนทมาตรฐานแทน) #imageString($im,5,10,10, $_SESSION['ses_code'], $text_color); imagepng($im); #เอาพทภาพกราฟค imagedestroy($im); #คนหนวยความจ าใหกบระบบ ?>

Page 117: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

284 Source Code ชอ index <?php require("auth.inc.php"); if (($_SESSION['ses_user']) != '') { header("Location: main.php"); exit; } ?>

Page 118: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

285 Source Code ชอ logoff <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); setcookie($cook_nm,"",time()); setcookie($cook_pw,"",time()); session_destroy (); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-top: 13%; background-image: url(images/bg_hexa.gif); background-repeat: repeat; } --> </style> </head> <body> <meta Http-equiv="refresh" Content="3; Url=index.php"> <center> <table width="700" height="355" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="29" colspan="3" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="24" background="images/register_02.png">&nbsp;</td> <td height="292" align="center" valign="middle" bgcolor="#F6F6F6"><img src="images/loading.gif"><br> <br> <b><font face="tahoma" color="#FF6600" size="2">รอสกคร ก าลงออกจากระบบ...</font></b></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="32" colspan="3" background="images/register_05.png"></td> </tr>

Page 119: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</table> </center> </body> </html>

Page 120: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

287 Source Code ชอ main <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>หนาหลก</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table width="990" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="images/bg_hexa.gif"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php

Page 121: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" align="left" valign="top" bgcolor="f6f7f8"> <font face="Tahoma" size="2" color="#666666"><b><u>กจกรรมโครงการ</u></b></font><br> <? $sql_select = "SELECT * FROM project WHERE Project_Status='Complete'"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"> <tr><td width="90"><font face="Tahoma" size="2" color="#666666"><b>รหสโครงการ</b></font></td><td align="left"><font face="Tahoma" size="2" color="#666666"><b>ชอโครงการ</b></font></td> <td width="120"><font face="Tahoma" size="2" color="#666666"><b>วนทจดโครงการ</b></td> </tr> <? while($fetch=mysql_fetch_array($result)){ $Project_ID=$fetch["Project_ID"]; $Project_Name=$fetch["Project_Name"]; $Project_Date=$fetch["Project_Date"]; ?> <tr bgcolor="#f6f7f8"> <td align="center"> <font face="Tahoma" size="2" color="#666666"><?=$Project_ID?></font></td> <td align="left"><a href="show_project.php?Project_ID=<?=$Project_ID?>"><font face="Tahoma" size="2" color="#666666"><?=$Project_Name?></font></a></td> <td><font face="Tahoma" size="2" color="#666666"><?=$Project_Date?></font></td> </tr> <? }

Page 122: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

?></table> <br> <br> <font face="Tahoma" size="2" color="#666666"><b><u>ขาวประชาสมพนธ</u></b></font><br> <? $sql_select = "SELECT * FROM news"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td align="left"><font face="Tahoma" size="2" color="#666666"><b>หวขอขาว</b></font></td> </tr> <? while($fetch=mysql_fetch_array($result)){ $News_ID=$fetch["News_ID"]; $News_Name=$fetch["News_Name"]; $News_Date=$fetch["News_Date"]; ?> <tr bgcolor="#f6f7f8"> <td align="left"><li><a href="show_news.php?News_ID=<?=$News_ID?>"><font face="Tahoma" size="2" color="#666666"> <?=$News_Name?>&nbsp; (<?=$News_Date?>) </font></a></li></td> </tr> <? } ?> </table></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="23%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="77%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> </body> </html>

Page 123: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

290 Source Code ชอ mnu_index <? session_start(); if (($_SESSION['ses_user']) != '') { $mnu = "<a href='main.php'><font color=#666666>สง sms</font></a>"; }else{ $mnu = "<a href='register.php'><font color=#666666>สมครสมาชก</font></a>"; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> <!-- a:link { text-decoration: none; color: #666666; } a:visited { text-decoration: none; color: #666666; } a:hover { text-decoration: underline; color: #666666; } a:active { text-decoration: none; color: #666666; } a { font-family: tahoma; font-size: 12px; } --> </style> </head> <body>

Page 124: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<table width="652" height="30"border="0" align="left" cellpadding="0" cellspacing="0" > <tr> <td width="12" height="20" background="images/menu_left.gif">&nbsp;&nbsp;</td> <td width="618" align="left" nowrap background="images/bg_mnu.gif"> <div class="menu"> <a href="index.php" ><font color="#666666">หนาหลก</font></a>&nbsp;&nbsp;|&nbsp;&nbsp; <a href="register.php" ><font color="#666666">ส าหรบนสต</font></a>&nbsp;&nbsp;|&nbsp;&nbsp; <a href="officer.php" ><font color="#666666">ส าหรบเจาหนาท</font></a>&nbsp;&nbsp;|&nbsp;&nbsp; <a href="endorsee.php" ><font color="#666666">ส าหรบผพจารณาโครงการ</font></a>&nbsp;&nbsp;|&nbsp;&nbsp; <a href="consideration.php" ><font color="#666666">ส าหรบผอนมต</font></a>&nbsp;&nbsp;|&nbsp;&nbsp; <a href="single.php" target="_blank" ><font color="#666666">ขอมลโสตทศนปกรณหองเรยน</font></a>&nbsp;&nbsp; </div> </td> <td width="22" align="left" nowrap background="images/bg_mnu_right.gif">&nbsp;</td> </tr> </table> </body> </html>

Page 125: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

292 Source Code ชอ mun_login <?php require("config.inc.php"); $username= $_REQUEST['username']; //รบคา username มาจากฟอรม $password= $_REQUEST['password']; //รบคา password มาจากฟอรม if (isset($_REQUEST[$cook_nm] ) ) { // เชคคาในคกก $svusr = 'checked' ; //ส าหรบตกในชองจ า user $focus="document.a.password.focus();"; //ใหเคอรเซอรไปรอทชอง password } else { // ถาคกกไมมขอมล username อย กใหเคอรเซอรไปกระพรบรอทชอง username $focus="document.a.username.focus();"; //เซทโฟกสไปทชอง username } //เชความการกรอกขอมล user และ password เขามาหรอไม ถายง ใหกระโดดขามไปเปดแบบฟอรม ส าหรบ login แตถากรอก ใหท าการตรวจสอบเปรยบเทยบ if ((!empty($username)) And (!empty($password) )) { $username = trim($_POST['username']); //ทรมตดชองวาง $password = trim($_POST['password']); //ทรมตดชองวาง //เลอกเพอเชความ username ซ ากนหรอไม $sql = "SELECT * From tblmember WHERE user='$username' "; $dbquery = mysql_query($sql); $result = mysql_fetch_array($dbquery); if (!$result) { //ถาม username อยแลวในฐานขอมล echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'; ?> <script language="javascript"> alert("ชอผใชหรอรหสผานไมถกตองคะ"); </script> <meta http-equiv="refresh" content="1; url=index.php"> <?php exit; } if (md5(trim($password)) == trim($result['passwd'])) { //ถารหสผานถกตอง $_SESSION['ses_user'] = $username; $_SESSION['type']="Student"; $_SESSION['last_log'] = $result['lastlog']; //เกบคาวนเวลาลอคอนทเขามาลาสด

Page 126: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

//หากผใชตก chekbox ใหจ า user ไวในเครอง กสงใหบนทก username ไวในคกก user ดวย if ($_REQUEST['saveuser']=="on") { setcookie($cook_nm,$username,time()+$cook_time); //บนทกคกก user ฟท า } else { setcookie($cook_nm,"",time()); //เคลยรคาในคกก } //หากผใชตก chekbox ใหจ า password ไวในเครอง กสงใหบนทก password ไวในคกกดวย if ($_REQUEST['savepwd']=="on") { setcookie($cook_pw,md5($password),time()+$cook_time); //เกบ password } else { setcookie($cook_pw,"",time()); } //บนทกวนเวลาทลอคอนเขามา และวนเวลาทลอกอนเขามาครงลาสด mysql_query("UPDATE tblmember SET lastlog= dtnow WHERE user='$username' "); mysql_query("UPDATE tblmember SET dtnow='$now' WHERE user='$username' "); show(); exit; } else { //ถารหสผาานผด ใหบนทก ip และวนเวลาใน DB echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'; ?> <script language="javascript"> alert("รหสผานไมถกตองคะ"); </script> <meta http-equiv="refresh" content="1; url=index.php"> <?php exit; } } ?>

Page 127: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script language="javascript"> function check_form(){ var user = document.a.username; if ( user.value=="" ) { alert ( "กรณากรอกชอผใชดวยคะ" ); user.focus(); return false; } var pass = document.a.password; if ( pass.value == "" ) { alert( "กรณากรอกรหสผานดวยคะ" ); pass.focus(); return false; } } function reset_form(){ window.location.reload(); } </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>::: เขาสระบบ :::</title> </head> <Body background="images/bg_hexa.gif" onload= <?=$focus?> > <Form action="mnu_login.php" method="post" name="a" onSubmit=" return check_form()" autocomplete="off"> <table width="175" height="212" border="0" align="left" cellpadding="0" cellspacing="0" > <tr> <td height="21" colspan="4" align="center" ><font color="#FFFFFF" size="2"><img src="images/h_login.gif" width="176" height="21"></font></td> </tr> <tr> <td width="2" rowspan="7" ></td> <td height="20" colspan="2" ><font face="tahoma" color="#333333" size="-1"><b>ชอผใช:</b></font></td> <td width="2" rowspan="7" ></td> </tr> <tr> <td height="24" colspan="2" ><input name="username" type="text" value="<?=$_REQUEST[$cook_nm]?>" size="22" style=" color: #FF6600;border: double 1px #CCCCCC; height: 18px;"></td> </tr>

Page 128: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<tr> <td height="20" colspan="2" ><font face="tahoma" color="#333333" size="-1"><b>รหสผาน:</b></font></td> </tr> <tr> <td height="22" colspan="2" ><input name="password" type="password" value="" size="22" maxlength="13" style=" color:#FF6600;border: double 1px #CCCCCC; height: 18px;"></td> </tr> <tr> <td height="40" colspan="2"><input type="checkbox" name="saveuser" <?=$svusr?>> <font face="tahoma" color="#999999" size="2">จ าชอผใชไวในเครอง</font><br> <input type="checkbox" name="savepwd"> <font face="tahoma" color="#999999" size="2">จ ารหสผานไวในเครอง</font> </td> </tr> <tr> <td height="39" colspan="2" align="center" ><input type="image" src="images/bg_login.gif" name="login" value="เขาสระบบ" style="cursor:hand;"> <a href="#" onClick="javascript:reset_form(this)"><img src="images/bg_cancel.gif" border="0"></a></td> </tr> <tr> <td width="25" height="20" >&nbsp;</td> <td width="148" ><font face="tahoma" size="-1"> </td> </tr> </table> </form> <?php function show(){ ?> <html> <title> Login</title> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 13%; margin-right: 0px; margin-bottom: 0px; } -->

Page 129: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</style> </head> <meta Http-equiv="refresh" Content="3; Url=index.php"> <center> <table width="700" height="355" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="29" colspan="3" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="24" background="images/register_02.png">&nbsp;</td> <td height="292" align="center" valign="middle" bgcolor="#F6F6F6"><img src="images/loading.gif"><br><br><b><font face="tahoma" color="#FF6600" size="2">รอสกคร ก าลงเขาสระบบ...</font></b></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="33" colspan="3" background="images/register_05.png">&nbsp;</td> </tr> </table> </center> </html> <? } ?> </body> </html>

Page 130: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

297 Source Code ชอ mnu_login_consideration <?php require("config.inc.php"); $username= $_REQUEST['username']; //รบคา username มาจากฟอรม $password= $_REQUEST['password']; //รบคา password มาจากฟอรม if (isset($_REQUEST[$cook_nm] ) ) { // เชคคาในคกก $svusr = 'checked' ; //ส าหรบตกในชองจ า user $focus="document.a.password.focus();"; //ใหเคอรเซอรไปรอทชอง password } else { // ถาคกกไมมขอมล username อย กใหเคอรเซอรไปกระพรบรอทชอง username $focus="document.a.username.focus();"; //เซทโฟกสไปทชอง username } //เชความการกรอกขอมล user และ password เขามาหรอไม ถายง ใหกระโดดขามไปเปดแบบฟอรม ส าหรบ login แตถากรอก ใหท าการตรวจสอบเปรยบเทยบ if ((!empty($username)) And (!empty($password) )) { $username = trim($_POST['username']); //ทรมตดชองวาง $password = trim($_POST['password']); //ทรมตดชองวาง //เลอกเพอเชความ username ซ ากนหรอไม $sql = "SELECT * From consideration WHERE user='$username' "; $dbquery = mysql_query($sql); $result = mysql_fetch_array($dbquery); $_SESSION["name"]=$name=$result["name"]; $_SESSION["type2"]=$type=$result["type"]; if (!$result) { //ถาม username อยแลวในฐานขอมล echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'; ?> <script language="javascript"> alert("ชอผใชหรอรหสผานไมถกตองคะ"); </script> <meta http-equiv="refresh" content="1; url=endorsee.php"> <?php exit; } if (md5(trim($password)) == trim($result['pass'])) { //ถารหสผานถกตอง $_SESSION['ses_user'] = $username;

Page 131: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

$_SESSION['type']="consideration"; $_SESSION['last_log'] = $result['lastlog']; //เกบคาวนเวลาลอคอนทเขามาลาสด //หากผใชตก chekbox ใหจ า user ไวในเครอง กสงใหบนทก username ไวในคกก user ดวย if ($_REQUEST['saveuser']=="on") { setcookie($cook_nm,$username,time()+$cook_time); //บนทกคกก user ฟท า } else { setcookie($cook_nm,"",time()); //เคลยรคาในคกก } //หากผใชตก chekbox ใหจ า password ไวในเครอง กสงใหบนทก password ไวในคกกดวย if ($_REQUEST['savepwd']=="on") { setcookie($cook_pw,md5($password),time()+$cook_time); //เกบ password } else { setcookie($cook_pw,"",time()); } //บนทกวนเวลาทลอคอนเขามา และวนเวลาทลอกอนเขามาครงลาสด mysql_query("UPDATE endorsee SET lastlog= dtnow WHERE Username='$username' "); mysql_query("UPDATE endorsee SET dtnow='$now' WHERE Username='$username' "); show(); exit; } else { //ถารหสผาานผด ใหบนทก ip และวนเวลาใน DB echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'; ?> <script language="javascript"> alert("รหสผานไมถกตองคะ"); </script> <meta http-equiv="refresh" content="1; url=endorsee.php"> <?php exit; }

Page 132: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

} ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script language="javascript"> function check_form(){ var user = document.a.username; if ( user.value=="" ) { alert ( "กรณากรอกชอผใชดวยคะ" ); user.focus(); return false; } var pass = document.a.password; if ( pass.value == "" ) { alert( "กรณากรอกรหสผานดวยคะ" ); pass.focus(); return false; } } function reset_form(){ window.location.reload(); } </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>::: เขาสระบบ :::</title> </head> <Body background="images/bg_hexa.gif" onload= <?=$focus?> > <Form action="mnu_login_consideration.php" method="post" name="a" onSubmit=" return check_form()" autocomplete="off"> <table width="175" height="212" border="0" align="left" cellpadding="0" cellspacing="0" > <tr> <td height="21" colspan="4" align="center" ><font color="#FFFFFF" size="2"><img src="images/h_login.gif" width="176" height="21"></font></td> </tr> <tr> <td width="2" rowspan="7" ></td> <td height="20" colspan="2" ><font face="tahoma" color="#333333" size="-1"><b>ชอผใช:</b></font></td> <td width="2" rowspan="7" ></td> </tr> <tr>

Page 133: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td height="24" colspan="2" ><input name="username" type="text" value="<?=$_REQUEST[$cook_nm]?>" size="22" style=" color: #FF6600;border: double 1px #CCCCCC; height: 18px;"></td> </tr> <tr> <td height="20" colspan="2" ><font face="tahoma" color="#333333" size="-1"><b>รหสผาน:</b></font></td> </tr> <tr> <td height="22" colspan="2" ><input name="password" type="password" value="" size="22" maxlength="13" style=" color:#FF6600;border: double 1px #CCCCCC; height: 18px;"></td> </tr> <tr> <td height="40" colspan="2"><input type="checkbox" name="saveuser" <?=$svusr?>> <font face="tahoma" color="#999999" size="2">จ าชอผใชไวในเครอง</font><br> <input type="checkbox" name="savepwd"> <font face="tahoma" color="#999999" size="2">จ ารหสผานไวในเครอง</font> </td> </tr> <tr> <td height="39" colspan="2" align="center" ><input type="image" src="images/bg_login.gif" name="login" value="เขาสระบบ" style="cursor:hand;"> <a href="#" onClick="javascript:reset_form(this)"><img src="images/bg_cancel.gif" border="0"></a></td> </tr> <tr> <td width="25" height="20" >&nbsp;</td> <td width="148" ><font face="tahoma" size="-1"> </td> </tr> </table> </form> <?php function show(){ ?> <html> <title> Login</title> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 13%; margin-right: 0px;

Page 134: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

margin-bottom: 0px; } --> </style> </head> <meta Http-equiv="refresh" Content="3; Url=consideration.php"> <center> <table width="700" height="355" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="29" colspan="3" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="24" background="images/register_02.png">&nbsp;</td> <td height="292" align="center" valign="middle" bgcolor="#F6F6F6"><img src="images/loading.gif"><br><br><b><font face="tahoma" color="#FF6600" size="2">รอสกคร ก าลงเขาสระบบ...</font></b></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="33" colspan="3" background="images/register_05.png">&nbsp;</td> </tr> </table> </center> </html> <? } ?> </body> </html>

Page 135: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

302 Source Code ชอ mnu_login_edorsee <?php require("config.inc.php"); $username= $_REQUEST['username']; //รบคา username มาจากฟอรม $password= $_REQUEST['password']; //รบคา password มาจากฟอรม if (isset($_REQUEST[$cook_nm] ) ) { // เชคคาในคกก $svusr = 'checked' ; //ส าหรบตกในชองจ า user $focus="document.a.password.focus();"; //ใหเคอรเซอรไปรอทชอง password } else { // ถาคกกไมมขอมล username อย กใหเคอรเซอรไปกระพรบรอทชอง username $focus="document.a.username.focus();"; //เซทโฟกสไปทชอง username } //เชความการกรอกขอมล user และ password เขามาหรอไม ถายง ใหกระโดดขามไปเปดแบบฟอรม ส าหรบ login แตถากรอก ใหท าการตรวจสอบเปรยบเทยบ if ((!empty($username)) And (!empty($password) )) { $username = trim($_POST['username']); //ทรมตดชองวาง $password = trim($_POST['password']); //ทรมตดชองวาง //เลอกเพอเชความ username ซ ากนหรอไม $sql = "SELECT * From endorsee WHERE Username='$username' "; $dbquery = mysql_query($sql); $result = mysql_fetch_array($dbquery); if (!$result) { //ถาม username อยแลวในฐานขอมล echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'; ?> <script language="javascript"> alert("ชอผใชหรอรหสผานไมถกตองคะ"); </script> <meta http-equiv="refresh" content="1; url=endorsee.php"> <?php exit; } if (md5(trim($password)) == trim($result['Password'])) { //ถารหสผานถกตอง $_SESSION['ses_user'] = $username; $_SESSION['type']="endorsee"; $_SESSION['last_log'] = $result['lastlog']; //เกบคาวนเวลาลอคอนทเขามาลาสด

Page 136: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

//หากผใชตก chekbox ใหจ า user ไวในเครอง กสงใหบนทก username ไวในคกก user ดวย if ($_REQUEST['saveuser']=="on") { setcookie($cook_nm,$username,time()+$cook_time); //บนทกคกก user ฟท า } else { setcookie($cook_nm,"",time()); //เคลยรคาในคกก } //หากผใชตก chekbox ใหจ า password ไวในเครอง กสงใหบนทก password ไวในคกกดวย if ($_REQUEST['savepwd']=="on") { setcookie($cook_pw,md5($password),time()+$cook_time); //เกบ password } else { setcookie($cook_pw,"",time()); } //บนทกวนเวลาทลอคอนเขามา และวนเวลาทลอกอนเขามาครงลาสด mysql_query("UPDATE endorsee SET lastlog= dtnow WHERE Username='$username' "); mysql_query("UPDATE endorsee SET dtnow='$now' WHERE Username='$username' "); show(); exit; } else { //ถารหสผาานผด ใหบนทก ip และวนเวลาใน DB echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'; ?> <script language="javascript"> alert("รหสผานไมถกตองคะ"); </script> <meta http-equiv="refresh" content="1; url=endorsee.php"> <?php exit; } }

Page 137: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script language="javascript"> function check_form(){ var user = document.a.username; if ( user.value=="" ) { alert ( "กรณากรอกชอผใชดวยคะ" ); user.focus(); return false; } var pass = document.a.password; if ( pass.value == "" ) { alert( "กรณากรอกรหสผานดวยคะ" ); pass.focus(); return false; } } function reset_form(){ window.location.reload(); } </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>::: เขาสระบบ :::</title> </head> <Body background="images/bg_hexa.gif" onload= <?=$focus?> > <Form action="mnu_login_endorsee.php" method="post" name="a" onSubmit=" return check_form()" autocomplete="off"> <table width="175" height="212" border="0" align="left" cellpadding="0" cellspacing="0" > <tr> <td height="21" colspan="4" align="center" ><font color="#FFFFFF" size="2"><img src="images/h_login.gif" width="176" height="21"></font></td> </tr> <tr> <td width="2" rowspan="7" ></td> <td height="20" colspan="2" ><font face="tahoma" color="#333333" size="-1"><b>ชอผใช:</b></font></td> <td width="2" rowspan="7" ></td> </tr> <tr> <td height="24" colspan="2" ><input name="username" type="text" value="<?=$_REQUEST[$cook_nm]?>" size="22" style=" color: #FF6600;border: double 1px #CCCCCC; height: 18px;"></td>

Page 138: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</tr> <tr> <td height="20" colspan="2" ><font face="tahoma" color="#333333" size="-1"><b>รหสผาน:</b></font></td> </tr> <tr> <td height="22" colspan="2" ><input name="password" type="password" value="" size="22" maxlength="13" style=" color:#FF6600;border: double 1px #CCCCCC; height: 18px;"></td> </tr> <tr> <td height="40" colspan="2"><input type="checkbox" name="saveuser" <?=$svusr?>> <font face="tahoma" color="#999999" size="2">จ าชอผใชไวในเครอง</font><br> <input type="checkbox" name="savepwd"> <font face="tahoma" color="#999999" size="2">จ ารหสผานไวในเครอง</font> </td> </tr> <tr> <td height="39" colspan="2" align="center" ><input type="image" src="images/bg_login.gif" name="login" value="เขาสระบบ" style="cursor:hand;"> <a href="#" onClick="javascript:reset_form(this)"><img src="images/bg_cancel.gif" border="0"></a></td> </tr> <tr> <td width="25" height="20" >&nbsp;</td> <td width="148" ><font face="tahoma" size="-1"> </td> </tr> </table> </form> <?php function show(){ ?> <html> <title> Login</title> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 13%; margin-right: 0px; margin-bottom: 0px; }

Page 139: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

--> </style> </head> <meta Http-equiv="refresh" Content="3; Url=index.php"> <center> <table width="700" height="355" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="29" colspan="3" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="24" background="images/register_02.png">&nbsp;</td> <td height="292" align="center" valign="middle" bgcolor="#F6F6F6"><img src="images/loading.gif"><br><br><b><font face="tahoma" color="#FF6600" size="2">รอสกคร ก าลงเขาสระบบ...</font></b></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="33" colspan="3" background="images/register_05.png">&nbsp;</td> </tr> </table> </center> </html> <? } ?> </body> </html>

Page 140: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

307 Source Code ชอ mnu_login_officer <?php require("config.inc.php"); $username= $_REQUEST['username']; //รบคา username มาจากฟอรม $password= $_REQUEST['password']; //รบคา password มาจากฟอรม if (isset($_REQUEST[$cook_nm] ) ) { // เชคคาในคกก $svusr = 'checked' ; //ส าหรบตกในชองจ า user $focus="document.a.password.focus();"; //ใหเคอรเซอรไปรอทชอง password } else { // ถาคกกไมมขอมล username อย กใหเคอรเซอรไปกระพรบรอทชอง username $focus="document.a.username.focus();"; //เซทโฟกสไปทชอง username } //เชความการกรอกขอมล user และ password เขามาหรอไม ถายง ใหกระโดดขามไปเปดแบบฟอรม ส าหรบ login แตถากรอก ใหท าการตรวจสอบเปรยบเทยบ if ((!empty($username)) And (!empty($password) )) { $username = trim($_POST['username']); //ทรมตดชองวาง $password = trim($_POST['password']); //ทรมตดชองวาง //เลอกเพอเชความ username ซ ากนหรอไม $sql = "SELECT * From employees WHERE Username='$username' "; $dbquery = mysql_query($sql); $result = mysql_fetch_array($dbquery); if (!$result) { //ถาม username อยแลวในฐานขอมล echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'; ?> <script language="javascript"> alert("ชอผใชหรอรหสผานไมถกตองคะ"); </script> <meta http-equiv="refresh" content="1; url=officer.php"> <?php exit; } if (md5(trim($password)) == trim($result['Password'])) { //ถารหสผานถกตอง $_SESSION['ses_user'] = $username; $_SESSION['type']="Employees"; $_SESSION['last_log'] = $result['lastlog']; //เกบคาวนเวลาลอคอนทเขามาลาสด

Page 141: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

//หากผใชตก chekbox ใหจ า user ไวในเครอง กสงใหบนทก username ไวในคกก user ดวย if ($_REQUEST['saveuser']=="on") { setcookie($cook_nm,$username,time()+$cook_time); //บนทกคกก user ฟท า } else { setcookie($cook_nm,"",time()); //เคลยรคาในคกก } //หากผใชตก chekbox ใหจ า password ไวในเครอง กสงใหบนทก password ไวในคกกดวย if ($_REQUEST['savepwd']=="on") { setcookie($cook_pw,md5($password),time()+$cook_time); //เกบ password } else { setcookie($cook_pw,"",time()); } //บนทกวนเวลาทลอคอนเขามา และวนเวลาทลอกอนเขามาครงลาสด mysql_query("UPDATE employees SET lastlog= dtnow WHERE Username='$username' "); mysql_query("UPDATE employees SET dtnow='$now' WHERE Username='$username' "); show(); exit; } else { //ถารหสผาานผด ใหบนทก ip และวนเวลาใน DB echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'; ?> <script language="javascript"> alert("รหสผานไมถกตองคะ"); </script> <meta http-equiv="refresh" content="1; url=officer.php"> <?php exit; } }

Page 142: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script language="javascript"> function check_form(){ var user = document.a.username; if ( user.value=="" ) { alert ( "กรณากรอกชอผใชดวยคะ" ); user.focus(); return false; } var pass = document.a.password; if ( pass.value == "" ) { alert( "กรณากรอกรหสผานดวยคะ" ); pass.focus(); return false; } } function reset_form(){ window.location.reload(); } </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>::: เขาสระบบ :::</title> </head> <Body background="images/bg_hexa.gif" onload= <?=$focus?> > <Form action="mnu_login_officer.php" method="post" name="a" onSubmit=" return check_form()" autocomplete="off"> <table width="175" height="212" border="0" align="left" cellpadding="0" cellspacing="0" > <tr> <td height="21" colspan="4" align="center" ><font color="#FFFFFF" size="2"><img src="images/h_login.gif" width="176" height="21"></font></td> </tr> <tr> <td width="2" rowspan="7" ></td> <td height="20" colspan="2" ><font face="tahoma" color="#333333" size="-1"><b>ชอผใช:</b></font></td> <td width="2" rowspan="7" ></td> </tr> <tr> <td height="24" colspan="2" ><input name="username" type="text" value="<?=$_REQUEST[$cook_nm]?>" size="22" style=" color: #FF6600;border: double 1px #CCCCCC; height: 18px;"></td>

Page 143: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</tr> <tr> <td height="20" colspan="2" ><font face="tahoma" color="#333333" size="-1"><b>รหสผาน:</b></font></td> </tr> <tr> <td height="22" colspan="2" ><input name="password" type="password" value="" size="22" maxlength="13" style=" color:#FF6600;border: double 1px #CCCCCC; height: 18px;"></td> </tr> <tr> <td height="40" colspan="2"><input type="checkbox" name="saveuser" <?=$svusr?>> <font face="tahoma" color="#999999" size="2">จ าชอผใชไวในเครอง</font><br> <input type="checkbox" name="savepwd"> <font face="tahoma" color="#999999" size="2">จ ารหสผานไวในเครอง</font> </td> </tr> <tr> <td height="39" colspan="2" align="center" ><input type="image" src="images/bg_login.gif" name="login" value="เขาสระบบ" style="cursor:hand;"> <a href="#" onClick="javascript:reset_form(this)"><img src="images/bg_cancel.gif" border="0"></a></td> </tr> <tr> <td width="25" height="20" >&nbsp;</td> <td width="148" ><font face="tahoma" size="-1"> </td> </tr> </table> </form> <?php function show(){ ?> <html> <title> Login</title> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 13%; margin-right: 0px; margin-bottom: 0px; }

Page 144: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

--> </style> </head> <meta Http-equiv="refresh" Content="3; Url=index.php"> <center> <table width="700" height="355" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="29" colspan="3" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="24" background="images/register_02.png">&nbsp;</td> <td height="292" align="center" valign="middle" bgcolor="#F6F6F6"><img src="images/loading.gif"><br><br><b><font face="tahoma" color="#FF6600" size="2">รอสกคร ก าลงเขาสระบบ...</font></b></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="33" colspan="3" background="images/register_05.png">&nbsp;</td> </tr> </table> </center> </html> <? } ?> </body> </html>

Page 145: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

312 Source Code ชอ mnu_member <?php require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ $username = $_SESSION['ses_user']; // Username ทลอคอนเขามาในระบบขณะน $type=$_SESSION['type']; if($type=="Employees"){ $link="edit_employees.php"; $mnu_link="<li><a href=\"add_news.php\">เพมขาว</a></li> <li><a href=\"view_news.php\">รายละเอยดขาว</a></li> <li><a href=\"project_view_employees.php\">รายละเอยดโครงทการยนเสนอ</a></li> <li><a href=\"project.php\">เพมโครงการ</a></li> <li><a href=\"progress.php\">ความคบหนาโครงการ</a></li> <li><a href=\"finance.php\">หมวดงบประมาณ วสด อาคาร</a></li> <li><a href=\"single.php\" target='_blank'>ขอมลโสตทศนปกรณหองเรยน</a></li> <li><a href=\"summary_view_employees.php\">ผลสรปโครงการ</a></li> "; } if($type=="Student"){ $link="edit_register.php"; $mnu_link="<li><a href=\"project.php\">เสนอโครงการ</a></li> <li><a href=\"project_view.php\">รายละเอยดโครงการ</a></li> <li><a href=\"project_Status.php\">สถานะโครงการ</a></li> <li><a href=\"news.php\">ขาวประชาสมพนธ</a></li> <li><a href=\"summary.php\">ผลสรปโครงการ</a></li> "; } if($type=="endorsee"){ $link="edit_endorsee.php"; $mnu_link="<li><a href=\"approval_project.php\">อนมตโครงการ</a></li> <li><a href=\"approval_view.php\">รายการโครงการทอนมต</a></li> <li><a href=\"SummaryView.php\">ผลสรปโครงการ</a></li>"; } if($type=="consideration"){ $mnu_link= "<li><a href=\"status_endorsee.php\">พจารณาโครงการ</a></li> <li><a href=\"SummaryView.php\">ผลสรปโครงการ</a></li>"; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Page 146: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <style type="text/css"> ul#navigation { width: 200px; list-style: none; margin: 0; padding: 0; display:table; } #navigation li{ border-bottom: 1px solid #FFFFFF; } #navigation li a{ font-family:tahoma; font-size: 80%; display: block; padding: 5px 5px 5px 5px; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; background-image:url(images/mnu.gif); Color: #666666; text-decoration: none; } #navigation a:hover{ background-image:url(images/over_bg_mnu.gif); color:#000000; } </style> <body> <div class="content-ex"> <ul id="navigation"> <div> <table width="100%" border="00" cellspacing="0" cellpadding="0"> <tr> <td height="30" bgcolor="#CCCCCC" ><div align="center"><font color="#333333" face="tahoma" size="2">เมนผใชงาน</font></div></td> </tr> </table> </div> <? if($type<>"consideration") { ?> <?=$mnu_link?> <li><a href="question_view.php">เวบบอรด</a></li>

Page 147: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<li><a href="<?=$link?>">แกไขขอมลสวนตว</a></li> <li><a href="changepassword.php">เปลยนรหสผาน</a></li> <? }else{ ?> <?=$mnu_link?> <? } ?> <li><a href="logoff.php" onClick="return confirm('คณตองการออกจากระบบใช หรอ ไม?')">ออกจากระบบ</a></li> </ul> </div> </body> </html>

Page 148: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

315 Source Code ชอ news <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>ขาวประชาสมพนธ</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php

Page 149: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" align="left" valign="top" bgcolor="f6f7f8"> <font face="Tahoma" size="2" color="#666666"><b><u>กจกรรมโครงการ</u></b></font><br> <? $sql_select = "SELECT * FROM project WHERE Project_Status='1'"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"> <tr><td width="90"><font face="Tahoma" size="2" color="#666666"><b>รหสโครงการ</b></font></td><td align="left"><font face="Tahoma" size="2" color="#666666"><b>ชอโครงการ</b></font></td> <td width="120"><font face="Tahoma" size="2" color="#666666"><b>วนทจดโครงการ</b></td> </tr> <? while($fetch=mysql_fetch_array($result)){ $Project_ID=$fetch["Project_ID"]; $Project_Name=$fetch["Project_Name"]; $Project_Date=$fetch["Project_Date"]; ?> <tr bgcolor="#f6f7f8"> <td align="center"> <font face="Tahoma" size="2" color="#666666"><?=$Project_ID?></font></td> <td align="left"><a href="show_project.php?Project_ID=<?=$Project_ID?>"><font face="Tahoma" size="2" color="#666666"><?=$Project_Name?></font></a></td> <td><font face="Tahoma" size="2" color="#666666"><?=$Project_Date?></font></td> </tr> <? }

Page 150: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

?></table> <br> <br> <font face="Tahoma" size="2" color="#666666"><b><u>ขาวประชาสมพนธ</u></b></font><br> <? $sql_select = "SELECT * FROM news"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td align="left"><font face="Tahoma" size="2" color="#666666"><b>หวขอขาว</b></font></td> </tr> <? while($fetch=mysql_fetch_array($result)){ $News_ID=$fetch["News_ID"]; $News_Name=$fetch["News_Name"]; $News_Date=$fetch["News_Date"]; ?> <tr bgcolor="#f6f7f8"> <td align="left"><li><a href="show_news.php?News_ID=<?=$News_ID?>"><font face="Tahoma" size="2" color="#666666"> <?=$News_Name?>&nbsp; (<?=$News_Date?>) </font></a></li></td> </tr> <? } ?> </table></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="23%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="77%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> </body> </html>

Page 151: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

318 Source Code ชอ progress <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>:: ความคบหนาโครงการ</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php

Page 152: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" valign="top" bgcolor="f6f7f8"> <? $sql_select = "SELECT * FROM project"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left"><font face="Tahoma" size="2" color="#333333"><b>ชอโครงการ</b></font></td> <td><font face="Tahoma" size="2" color="#333333"><b>วนทยนเสนอ</b></td> <td><font face="Tahoma" size="2" color="#333333"><b>สถานะ</b></td></tr> <? while($fetch=mysql_fetch_array($result)){ $Project_ID=$fetch["Project_ID"]; $Project_Name=$fetch["Project_Name"]; $Project_Status=$fetch["Project_Status"]; $Project_Date=$fetch["Project_Date"]; if($Project_Status=="0"){ $Status="รอพจารณาการอนมต"; } if($Project_Status=="1"){ $Status="ผานการอนมต"; } if($Project_Status=="2"){ $Status="ไมผานการอนมต"; } if($Project_Status=="3"){ $Status="ปรบปรง/แกไขโครงการ"; } if($Project_Status=="Y"){ $Status="รอผอนมตโครงการอนมต"; } ?>

Page 153: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<tr bgcolor="#f6f7f8"><td align="left"><font face="Tahoma" size="2" color="#333333"><a href="show_project.php?Project_ID=<?=$Project_ID?>"><font face="Tahoma" size="2" color="#666666"><?=$Project_Name?></font></a></font></td> <td width="120"><font face="Tahoma" size="2" color="#333333"><?=$Project_Date?></font></td> <td width="150"><font face="Tahoma" size="2" color="#333333"><?=$Status?></font></td> </tr> <? } ?></table> </td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="20%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="80%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> </body> </html>

Page 154: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

321 Source Code ชอ project <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>::โครงการ</title> <script src="conversion.js" language="JavaScript1.2" type="text/javascript"></script> <script src="entities.js" language="JavaScript1.2" type="text/javascript"></script> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } input.button {margin: 0; font: tahoma; font-size:12px; border: 1px solid #FF9900; background: #9288be; padding: 2px 3px; color: #ffee00; cursor: pointer; } --> </style> <script language="javascript"> function open_DateTime(){ myWindow=window.open('DateTime.php','','width=500,height=500,scrollbare=yes') myWindow.focus() }

Page 155: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</script> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" valign="top" bgcolor="f6f7f8"><table width="700" height="77" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="4" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="25" background="images/register_02.png">&nbsp;</td> <td width="32" bgcolor="#F6F6F6">&nbsp;</td> <td width="621" bgcolor="#F6F6F6"><font face="tahoma" color="#0033FF" size="2"><b>กรณากรอกรายละเอยดโครงการ</b></font> <form action="" method="POST" name="form_register" onsubmit="return check_form_register()" autocomplete="off" enctype="multipart/form-data"> <table border="0" cellpadding="1" cellspacing="0" > <tr> <td width="104" align="right"><font color="#666666" size="2">ชอโครงการ :</font></td>

Page 156: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td width="486" align="left"><input type="text" size="60" name="Project_Name" id="Project_Name" > <font color="red" size="2">*<a href="file/file.doc"><img src="images/WordIcon.jpg" alt="ตวอยางโครงการ" width="25" height="25" border="0"></a></font></td> </tr> <tr> <td align="right"><font color="#666666" size="2">วน/เดอน/ป :&nbsp;</font></td> <td align="left"> <iframe name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="calendar/popcjs.htm" scrolling="no" frameborder="2" style="border:ridge;visibility:hidden;position:absolute;z-index:65535"></iframe> <input type="text" name="date" readonly="readonly" /> <input type="image" src="images/WebResource.gif" onclick="gfPop.fPopCalendar(this.form.date); return false" alt="เลอกวนท"/> &nbsp;<font color="red" size="2">*</font></td> </tr> <tr> <td align="right"><font color="#666666" size="2">ระยะเวลา :&nbsp;</font></td> <td align="left"><select name="Fact1" id="Fact1"> <? mysql_connect($dbhost,$dbuser,$dbpass) or die("connect mysql ไมได"); mysql_query("SET NAMES UTF8"); mysql_select_db($dbname); $sql="SELECT period_name FROM period"; $result=mysql_query($sql); while($rs=mysql_fetch_array($result)){ $period_name=$rs["period_name"]; echo "<option>$period_name</option>"; } ?> </select> <input name="btnAddDate" type="button" onClick="open_DateTime()" value="เพมระยะเวลา" ></td> </tr> <tr> <td align="right"><font color="#666666" size="2">ไฟลโครงการ :</font>&nbsp;</td> <td align="left"><input name="filUpload" type="file" size="30"> <font color="red" size="2">* ชอไฟลภาษาองกฤษเทานน</font></td> </tr> <tr>

Page 157: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td align="right"><font color="#666666" size="2">ผเสนอ :&nbsp;</font></td> <td align="left"><input type="text" size="30" name="Proposer" id="Proposer" value="<?=$name?>" ></td> </tr> <tr> <td align="right">&nbsp;</td> <td align="left"><font color="red" size="2">* กรอกขอความหามวาง</font></td> </tr> <tr> <td align="right">&nbsp;</td> <td align="left"><input type="submit" name="btnSave" id="btnSave" value="บนทกโครงการ"> <input type="reset" name="btnCancel" id="btnCancel" value="ยกเลก"></td> </tr> </table> </form></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="33" colspan="4" background="images/register_05.png">&nbsp;</td> </tr> </table></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="20%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="80%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> <? if($_POST["btnSave"]){ if((!empty($_POST["Project_Name"])) and (!empty($_POST["date"]))){ $file_name=$_FILES["filUpload"]["name"]; copy($_FILES["filUpload"]["tmp_name"],"file/".$_FILES["filUpload"]["name"]); $sql="INSERT INTO project VALUES ('','$_POST[Project_Name]','$_POST[date]','$_POST[Fact1]','$file_name','$_POST[Proposer]','','','0')"; $result=mysql_db_query($dbname,$sql); if($result){ ?>

Page 158: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<script language="javascript"> alert("บนทกขอมลเรยบรอยแลว"); window.location="project_view.php"; </script> <? }else{ ?> <script language="javascript"> alert("รหสโครงการซ ากนคะ"); window.location="project_view.php"; </script> <? exit(); } mysql_close(); } } ?> </body> </html>

Page 159: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

326 Source Code ชอ project_status <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>::รายละเอยดโครงการ</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php

Page 160: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" valign="top" bgcolor="f6f7f8"> <? $sql_select = "SELECT * FROM project WHERE Proposer='$name'"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"> <tr><td width="100"><font face="Tahoma" size="2" color="#333333"><b>รหสโครงการ</b></font></td><td align="left"><font face="Tahoma" size="2" color="#333333"><b>ชอโครงการ</b></font></td> <td><font face="Tahoma" size="2" color="#333333"><b>วนทยนเสนอ</b></td> <td><font face="Tahoma" size="2" color="#333333"><b>สถานะ</b></td> <td><font face="Tahoma" size="2" color="#333333"><b>หมายเหต</b></td></tr> <? while($fetch=mysql_fetch_array($result)){ $Project_ID=$fetch["Project_ID"]; $Project_Name=$fetch["Project_Name"]; $Project_Status=$fetch["Project_Status"]; $Project_Date=$fetch["Project_Date"]; $comment=$fetch["comment"]; if($Project_Status=="0"){ $Status="รอพจารณาการอนมต"; } if($Project_Status=="1"){ $Status="ผานการอนมตจากผอนมต"; } if($Project_Status=="2"){ $Status="ไมผานการอนมต"; } if($Project_Status=="3"){ $Status="ปรบปรง/แกไขโครงการ"; } if($Project_Status=="Y"){ $Status="รอผอนมตโครงการอนมต"; }

Page 161: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

if($Project_Status=="Complete"){ $Status="การอนมตเสรจสมบรณ"; } ?> <tr bgcolor="#f6f7f8"><td align="center"><font face="Tahoma" size="2" color="#333333"><?=$Project_ID?></font></td><td align="left"><font face="Tahoma" size="2" color="#333333"><a href="show_project.php?Project_ID=<?=$Project_ID?>"><font face="Tahoma" size="2" color="#666666"><?=$Project_Name?></font></a></font></td> <td><font face="Tahoma" size="2" color="#333333"><?=$Project_Date?></font></td> <td><font face="Tahoma" size="2" color="#333333"><?=$Status?></font></td> <td><font face="Tahoma" size="2" color="#333333"><?=$comment?></font></td> </tr> <? } ?></table> </td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="20%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="80%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> </body> </html>

Page 162: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

329 Source Code ชอ project_view <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>::รายละเอยดโครงการ</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php

Page 163: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" valign="top" bgcolor="f6f7f8"> <? $sql_select = "SELECT * FROM project WHERE Proposer='$name'"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"> <tr><td width="100"><font face="Tahoma" size="2" color="#333333"><b>รหสโครงการ</b></font></td><td align="left"><font face="Tahoma" size="2" color="#333333"><b>ชอโครงการ</b></font></td> <td><font face="Tahoma" size="2" color="#333333"><b>วนทยนเสนอ</b></td> <td width="20"><font face="Tahoma" size="2" color="#333333"><b>แกไข</b></td><td width="20"><font face="Tahoma" size="2" color="#333333"><b>ลบ</b></td></tr> <? while($fetch=mysql_fetch_array($result)){ $Project_ID=$fetch["Project_ID"]; $Project_Name=$fetch["Project_Name"]; $Project_Date=$fetch["Project_Date"]; ?> <tr bgcolor="#f6f7f8"><td align="center"><font face="Tahoma" size="2" color="#333333"><?=$Project_ID?></font></td><td align="left"><font face="Tahoma" size="2" color="#333333"><?=$Project_Name?></font></td> <td><font face="Tahoma" size="2" color="#333333"><?=$Project_Date?></font></td> <td><a href="edit_project.php?Project_ID=<?=$Project_ID?>"><font face="Tahoma" size="2" color="#333333">แกไข</font></a></td> <td><a href="delete_project.php?Project_ID=<?=$Project_ID?>"><font face="Tahoma" size="2" color="#333333">ลบ</font></td></tr> <? } ?></table> </td>

Page 164: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="20%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="80%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> </body> </html>

Page 165: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

332 Source Code ชอ project_view_employees <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>::รายละเอยดโครงการ</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php

Page 166: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" valign="top" bgcolor="f6f7f8"> <? $sql_select = "SELECT * FROM project WHERE Project_Status='0' "; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"> <tr><td width="100"><font face="Tahoma" size="2" color="#333333"><b>รหสโครงการ</b></font></td><td align="left"><font face="Tahoma" size="2" color="#333333"><b>ชอโครงการ</b></font></td> <td><font face="Tahoma" size="2" color="#333333"><b>วนทยนเสนอ</b></td> <td width="20"><font face="Tahoma" size="2" color="#333333"><b>แกไข</b></td><td width="20"><font face="Tahoma" size="2" color="#333333"><b>ลบ</b></td></tr> <? while($fetch=mysql_fetch_array($result)){ $Project_ID=$fetch["Project_ID"]; $Project_Name=$fetch["Project_Name"]; $Project_Date=$fetch["Project_Date"]; ?> <tr bgcolor="#f6f7f8"><td align="center"><font face="Tahoma" size="2" color="#333333"><?=$Project_ID?></font></td> <td align="left"><a href="show_project.php?Project_ID=<?=$Project_ID?>"><font face="Tahoma" size="2" color="#333333"><?=$Project_Name?></font></a></td> <td><font face="Tahoma" size="2" color="#333333"><?=$Project_Date?></font></td> <td><a href="edit_project.php?Project_ID=<?=$Project_ID?>"><font face="Tahoma" size="2" color="#333333">แกไข</font></a></td> <td><a href="delete_project.php?Project_ID=<?=$Project_ID?>"><font face="Tahoma" size="2" color="#333333">ลบ</font></td></tr> <? } ?></table>

Page 167: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="20%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="80%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> </body> </html>

Page 168: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

335 Source Code ชอ question_save <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <? include "function.php"; $title_ques=$_POST[title_ques]; $detail_ques=$_POST[detail_ques]; $name_ques=$_POST[name_ques]; $email_ques=$_POST[email_ques]; $date_ques=date("Y-m-d"); include "connect.php"; $sql="insert into tb_question values('','$title_ques','$detail_ques','$name_ques','$email_ques','$date_ques')"; $result=mysql_db_query($dbname,$sql); if ($result) { ?> <script language="javascript"> alert("ตงค าถามในกระทเรยบรอยแลวคะ"); window.location="question_view.php"; </script> <? } else { ?> <script language="javascript"> alert("ไมสามารถตงค าถามในกระทไดคะ"); window.location="question_view.php"; </script> <? } ?> <body> </body> </html>

Page 169: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

336 Source Code ชอ question_view <? session_start(); require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>กระดานสนทนา</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } a:link { color: #999999; } a:visited { color: #999999; } a:hover { color: #666666; } a:active { color: #999999; } --> </style> <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script> <script language="javascript"> function check_form(){ var title = document.main.title_ques; if (title.value==""){ alert("กรณากรอก ค าถาม ดวยคะ"); title.focus();

Page 170: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

return false; } var detail = document.main.detail_ques; if (detail.value==""){ alert("กรณากรอก รายละเอยด ดวยคะ"); detail.focus(); return false; } var name = document.main.name_ques; if (name.value==""){ alert("กรณากรอก ชอผตง ดวยคะ"); name.focus(); return false; } var email = document.main.email_ques; if (email.value==""){ alert("กรณากรอก อเมล ดวยคะ"); email.focus(); return false; } // ตรวจสอบรปแบบอเมล var emailFilter=/^([a-zA-Z0-9_\.\-)+\@(([a-zA-Z0-9\-])+\.([a-zA-Z\.]{2,6})$/ var email_chk=document.main.email_ques.value; // ตรวจสอบการปอนคา email if(!(emailFilter.test(email_chk))) { alert("รปแบบอเมลไมถกตองคะ"); return false; } } </script> </head> <body> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">

Page 171: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td width="14%" height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td width="86%" height="104" valign="top" bgcolor="f6f7f8"><br> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><FORM name="main" METHOD=POST ACTION="question_save.php" onSubmit="Javascript: return check_form();"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td>&nbsp;</td> <td><img src="images/bg_board.gif" width="200" height="50"></td> </tr> <tr> <td width="266" align="right"><font face="Tahoma" size="2" color="#666666">ค าถาม :&nbsp;</font></td> <td width="586"><input name="title_ques" type="text" size="30" id="title_ques" style=" color:#FF6600;border: double 1px #CCCCCC; " ></td> </tr> <tr> <td valign="top" align="right"><font face="Tahoma" color="#666666" size="2">รายละเอยด :&nbsp;</font></td> <td><textarea name="detail_ques" rows="5" cols="40" id="detail_ques"style=" color:#FF6600;border: double 1px #CCCCCC; "></textarea></td> </tr> <tr> <td valign="top" align="right"><font face="Tahoma" color="#666666" size="2" >ชอผตง :&nbsp;</font></td> <td><input name="name_ques" type="text" id="name_ques" style=" color:#FF6600;border: double 1px #CCCCCC; " value="<?=$name?>" size="30"></td> </tr> <tr>

Page 172: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td valign="top" align="right"><font face="Tahoma" color="#666666" size="2">อเมล :&nbsp;</font></td> <td><input name="email_ques" type="text" size="30" id="email_ques" style=" color:#FF6600;border: double 1px #CCCCCC; "></td> </tr> <tr> <td height="5"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td><input type="submit" value="ตกลง" style="cursor:hand"> <input type="reset" value="ยกเลก" style="cursor:hand"></td> </tr> </table> <BR> </FORM></td> </tr> </table></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td colspan="2" align="left" valign="top" bgcolor="f6f7f8"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="100%"><img src="images/read_webboard.gif" width="200" height="50"></td> </tr> <tr> <td><? include "connect.php"; include "function.php"; $sql="select * from tb_question order by id_ques desc"; $result=mysql_db_query($dbname,$sql); echo " <table width='98%' border='0' align='center' bgcolor='#cccccc' cellpadding=3 cellspacing=1 > <tr bgcolor='#D2E9FF'> <td width='8%'><center><b><font size='2' face='tahoma' color='#666666'>รหส</font></b></center></td>

Page 173: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td width='61%'> <center><b><font size='2' face='tahoma' color='#666666'>หวขอค าถาม</font></b></center></td> <td width='15%'> <center><b><font size='2' face='tahoma' color='#666666'>ผตงค าถาม</font></b></center></td> <td width='16%'> <center><b><font size='2' face='tahoma' color='#666666'>ตงเมอวนท</font></b></center></td> <td width='10%'> <center><b><font size='2' face='tahoma' color='#666666'>ตอบ</font></b></center></td> </tr>"; while($record=mysql_fetch_array($result)) { $id_ques=$record[id_ques]; $title_ques=$record[title_ques]; $detail_ques=$record[detail_ques]; $name_ques=$record[name_ques]; $email_ques=$record[email_ques]; $date_ques=$record[date_ques]; $title_ques=htmlspecialchars($title_ques); $name_ques=htmlspecialchars($name_ques); $detail_ques=nl2br(htmlspecialchars($detail_ques)); $date_ques=displaydate($date_ques); $sql2="select * from tb_answer where ref_id='$id_ques' "; $result2=mysql_db_query($dbname,$sql2); $num=mysql_num_rows($result2); echo " <tr bgcolor='#FFFFFF'> <td width='8%'><center><font size='2' face='tahoma' color='#666666'>0000$id_ques</font></center></td> <td width='61%'><a href='answer_view.php?id_ques=$id_ques'> <font size='2' face='tahoma' color='#0066FF'><u>$title_ques</u></font></a></td> <td width='15%'> <font size='2' face='tahoma' color='#666666'>$name_ques</font></td> <td width='16%'> <center><font size='2' face='tahoma' color='#666666'>$date_ques</font></center></td> <td width='10%'> <center><font size='2' face='tahoma' color='#666666'>$num</font></center></td> </tr>"; } // end while echo "</table>"; ?></td> </tr> </table> </td> </tr>

Page 174: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</table> <p>&nbsp;</p> </tr> </table> <p>&nbsp;</p> </body> </html>

Page 175: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

342 Source Code ชอ register_add <? require("config.inc.php"); // เรยกแทรกไฟลคอนฟกตงระบบ $username=trim($_POST['username']); $password1=trim($_POST['password1']); $password2=trim($_POST['password2']); $name=$_POST['name']; $gender=$_POST['gender']; $address=trim($_POST['address']); $email=$_POST['email']; $phone=$_POST['phone']; $StudentID=$_POST["StudentID"]; $Board=$_POST["Board"]; $Grade=$_POST["Grade"]; //เชควารหสทผสมครกรอกเขามา ตรงกบรหสทระบบออกใหหรอไม if (trim($_POST['code']) != ($_SESSION['ses_code']) ) { ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("รหสภาพไมถกตองคะ"); </script> <meta http-equiv="refresh" content="1; Url=register.php"> <? exit(); } #ค าสงตรวจสอบช อลอกอนไมใหซ ากน $sql = "SELECT * from tblmember WHERE user='$username' "; $dbquery = mysql_query($sql); $result = mysql_fetch_array($dbquery); if($result) { // ถาม username อยแลวในฐานขอมล $_SESSION["username"]="somyot"; ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("ชอผใชงานมในระบบแลวคะ"); </script> <meta http-equiv="refresh" content="1; Url=register.php"> <? die; // หยดการท างาน } ?> <? #ค าสงตรวจสอบอเมลไมใหซ ากน $sql = "SELECT * from tblmember WHERE email='$email' "; $dbquery = mysql_query($sql); $result = mysql_fetch_array($dbquery);

Page 176: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

if($result) { // ถาม email อยแลวในฐานขอมล ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("อเมลนมในระบบแลวคะ"); </script> <meta http-equiv="refresh" content="1; Url=register.php"> <? die; // หยดการท างาน } ?> <? #ค าสงตรวจสอบอเบอรโทรศพทไมใหซ ากน $sql = "SELECT * from tblmember WHERE phone='$phone' "; $dbquery = mysql_query($sql); $result = mysql_fetch_array($dbquery); if($result) { // ถาม phone อยแลวในฐานขอมล ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("เบอรโทรนมในระบบแลวคะ"); </script> <meta http-equiv="refresh" content="1; Url=register.php"> <? die; // หยดการท างาน } ?> <? //ท าการเขารหส password $encpwd = md5($password1); #ค าสงเพมขอมล $sql="INSERT INTO tblmember (user,passwd,StudentID,Board,Grade,name,gender,address,email,phone,lastlog,dtnow) VALUES ('$username','$encpwd','$StudentID','$Board','$Grade','$name','$gender','$address','$email','$phone','$now','$now')"; $result=mysql_db_query($dbname,$sql); if ($result) { ?> <html> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("ขอบคณทลงทะเบยนคะ เพมขอมลผใชลงในฐานขอมลเรยบรอยแลว"); </script> <head> <style type="text/css"> <!-- body { background-image: url(images/imageBG.jpg); background-repeat: repeat-x;

Page 177: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

background-color: #6ea820; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> </head> <meta Http-equiv="refresh" Content="2; Url=index.php"> <center> <p><br> </p> <p>&nbsp;</p> <p>&nbsp;</p> <table width="700" height="355" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="29" colspan="3" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="24" background="images/register_02.png">&nbsp;</td> <td height="292" align="center" valign="middle" bgcolor="#F6F6F6"><img src="images/loading.gif"><br> <br> <b><font face="tahoma" color="#FF6600" size="2">รอสกคร ก าลงเขาสระบบ...</font></b></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="33" colspan="3" background="images/register_05.png">&nbsp;</td> </tr> </table> </center> </html> <? }else{ ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("ไมสามารถลงทะเบยนไดคะ"); </script> </head> </html> <meta http-equiv="refresh" content="1; Url=register.php"> <?

Page 178: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

} mysql_close(); ?>

Page 179: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

346 Source Code ชอ register_add_endorsee <? require("config.inc.php"); // เรยกแทรกไฟลคอนฟกตงระบบ $username=trim($_POST['username']); $password1=trim($_POST['password1']); $password2=trim($_POST['password2']); $name=$_POST['name']; $gender=$_POST['gender']; $address=trim($_POST['address']); $email=$_POST['email']; $phone=$_POST['phone']; $StudentID=$_POST["StudentID"]; $Board=$_POST["Board"]; $Grade=$_POST["Grade"]; //เชควารหสทผสมครกรอกเขามา ตรงกบรหสทระบบออกใหหรอไม if (trim($_POST['code']) != ($_SESSION['ses_code']) ) { ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("รหสภาพไมถกตองคะ"); </script> <meta http-equiv="refresh" content="1; Url=register.php"> <? exit(); } #ค าสงตรวจสอบช อลอกอนไมใหซ ากน $sql = "SELECT * from tblmember WHERE user='$username' "; $dbquery = mysql_query($sql); $result = mysql_fetch_array($dbquery); if($result) { // ถาม username อยแลวในฐานขอมล $_SESSION["username"]="somyot"; ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("ชอผใชงานมในระบบแลวคะ"); </script> <meta http-equiv="refresh" content="1; Url=register.php"> <? die; // หยดการท างาน } ?> <? #ค าสงตรวจสอบอเมลไมใหซ ากน $sql = "SELECT * from tblmember WHERE email='$email' "; $dbquery = mysql_query($sql); $result = mysql_fetch_array($dbquery); if($result) { // ถาม email อยแลวในฐานขอมล ?>

Page 180: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("อเมลนมในระบบแลวคะ"); </script> <meta http-equiv="refresh" content="1; Url=register.php"> <? die; // หยดการท างาน } ?> <? #ค าสงตรวจสอบอเบอรโทรศพทไมใหซ ากน $sql = "SELECT * from tblmember WHERE phone='$phone' "; $dbquery = mysql_query($sql); $result = mysql_fetch_array($dbquery); if($result) { // ถาม phone อยแลวในฐานขอมล ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("เบอรโทรนมในระบบแลวคะ"); </script> <meta http-equiv="refresh" content="1; Url=register.php"> <? die; // หยดการท างาน } ?> <? //ท าการเขารหส password $encpwd = md5($password1); #ค าสงเพมขอมล $sql="INSERT INTO tblmember (user,passwd,StudentID,Board,Grade,name,gender,address,email,phone,lastlog,dtnow) VALUES ('$username','$encpwd','$StudentID','$Board','$Grade','$name','$gender','$address','$email','$phone','$now','$now')"; $result=mysql_db_query($dbname,$sql); if ($result) { ?> <html> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("ขอบคณทลงทะเบยนคะ เพมขอมลผใชลงในฐานขอมลเรยบรอยแลว"); </script> <head> <style type="text/css"> <!-- body { background-image: url(images/imageBG.jpg); background-repeat: repeat-x; background-color: #6ea820; margin-left: 0px;

Page 181: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> </head> <meta Http-equiv="refresh" Content="2; Url=index.php"> <center> <p><br> </p> <p>&nbsp;</p> <p>&nbsp;</p> <table width="700" height="355" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="29" colspan="3" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="24" background="images/register_02.png">&nbsp;</td> <td height="292" align="center" valign="middle" bgcolor="#F6F6F6"><img src="images/loading.gif"><br> <br> <b><font face="tahoma" color="#FF6600" size="2">รอสกคร ก าลงเขาสระบบ...</font></b></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="33" colspan="3" background="images/register_05.png">&nbsp;</td> </tr> </table> </center> </html> <? }else{ ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("ไมสามารถลงทะเบยนไดคะ"); </script> </head> </html> <meta http-equiv="refresh" content="1; Url=register.php"> <? } mysql_close(); ?>

Page 182: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

350 Source Code ชอ register_add_officer <? require("config.inc.php"); // เรยกแทรกไฟลคอนฟกตงระบบ $username=trim($_POST['username']); $password=trim($_POST['password']); $name=$_POST['FullName']; $address=trim($_POST['address']); $email=$_POST['email']; $phone=$_POST['phone']; $EmployeesID=$_POST["EmployeesID"]; //เชควารหสทผสมครกรอกเขามา ตรงกบรหสทระบบออกใหหรอไม if (trim($_POST['code']) != ($_SESSION['ses_code']) ) { ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("รหสภาพไมถกตองคะ"); </script> <meta http-equiv="refresh" content="1; Url=officer.php"> <? exit(); } #ค าสงตรวจสอบช อลอกอนไมใหซ ากน $sql = "SELECT * from employees WHERE Username='$username' "; $dbquery = mysql_query($sql); $result = mysql_fetch_array($dbquery); if($result) { // ถาม username อยแลวในฐานขอมล $_SESSION["username"]="somyot"; ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("ชอผใชงานมในระบบแลวคะ"); </script> <meta http-equiv="refresh" content="1; Url=officer.php"> <? die; // หยดการท างาน } ?> <? //ท าการเขารหส password $encpwd = md5($password); #ค าสงเพมขอมล $sql="INSERT INTO employees (Username,Password,EmployeesID,FullName,Address,Email,Phone,lastlog,dtnow) VALUES ('$username','$encpwd','$EmployeesID','$name','$address','$email','$phone','$now','$now')";

Page 183: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

$result=mysql_db_query($dbname,$sql); if ($result) { ?> <html> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("ขอบคณทลงทะเบยนคะ เพมขอมลผใชลงในฐานขอมลเรยบรอยแลว"); </script> <meta http-equiv="refresh" content="1; Url=officer.php"> <? }else{ ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("ไมสามารถลงทะเบยนไดคะ"); </script> </head> </html> <meta http-equiv="refresh" content="1; Url=officer.php"> <? } mysql_close(); ?>

Page 184: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

352 Source Code ชอ save_consideration <?php //require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title></title> </head> <body> <? $user=$_POST["username"]; $pass=md5($_POST["password"]); $name=$_POST["FullName"]; $type=$_POST["type"]; $sql="INSERT INTO consideration VALUES ('','$name','$type','$user','$pass')"; $result=mysql_query($sql); if($result){ ?> <script language="javascript"> alert("บนทกขอมลเรยบรอยแลว"); window.location="consideration.php"; </script> <? }else{ ?> <script language="javascript"> alert("ไมสามารถบนทกขอมลได เนองจากชอผใชช ากน"); window.location="consideration.php"; </script> <? } ?> </body> </html>

Page 185: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

353 Source Code ชอ show_news <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>:: รายละเอยดโครงการ</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="0%" bgcolor="#f1f3f5"></td> <td width="50%" align="center" ><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr>

Page 186: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td colspan="2" align="center"><? require "mnu_index.php";?> <?php echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" align="left" valign="top" bgcolor="f6f7f8"> <? $sql_select = "SELECT * FROM news WHERE News_ID='$_GET[News_ID]'"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC"> <? while($fetch=mysql_fetch_array($result)){ $News_Name=$fetch["News_Name"]; $News_Date=$fetch["News_Date"]; $News_Detail=$fetch["News_Detail"]; ?> <tr><td align="left" ><font face="Tahoma" size="2" color="#333333"><b><u><?=$News_Name?></u></b></font></td> </tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666"> <b>รายละเอยดขาว : </b><?=$News_Detail?> <br/> </font></td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666"> <b>วนทลงขาว : </b><?=$News_Date?> <br/> </font></td></tr> </td> </tr> <? } ?></table>

Page 187: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="23%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="77%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> </body> </html>

Page 188: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

356 Source Code ชอ show_project <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); $project_id=$_GET["Project_ID"]; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>:: รายละเอยดโครงการ</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="0%" bgcolor="#f1f3f5"></td> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">

Page 189: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font> <? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?> </td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" bgcolor="f6f7f8" valign="top"><? require "mnu_member.php"; ?></td> <td height="104" align="left" valign="top" bgcolor="f6f7f8"> <? $sql_select = "SELECT * FROM project WHERE Project_ID='$_GET[Project_ID]'"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC"> <? while($fetch=mysql_fetch_array($result)){ $Project_ID=$fetch["Project_ID"]; $Project_Name=$fetch["Project_Name"]; $Project_Date=$fetch["Project_Date"]; $file=$fetch["file"]; $Fact1=$fetch["Fact1"]; $Proposer=$fetch["Proposer"]; $comment=$fetch["comment"]; ?> <tr><td align="left" ><font face="Tahoma" size="2" color="#333333"><b><u><?=$Project_Name?></u></b></font></td> </tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666"> รหสโครงการ : <?=$Project_ID?> <br/> </font></td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666"> รายละเอยดโครงการ : <? echo "<a href='file/$file' target='_blank'><font face='tahoma' size='2' color='#0066FF'>$file</font></a>"; ?> <br/> </font></td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8">

Page 190: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<font face="Tahoma" size="2" color="#666666"> วนทเรมจดโครงการ : <?=$Project_Date?> <br/> </font></td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666"> ระยะเวลา : <?=$Fact1?> <br/> </font></td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666"> ผรบผดชอบโครงการ : <?=$Proposer?> <br/> </font></td></tr> </td> </tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666"> หมายเหต : <?=$comment?> <br/> </font></td></tr> </td> </tr> <? } ?></table> <br> <? $sql_budget="SELECT * FROM budget As A INNER JOIN facttype As B ON B.facttype_id=A.facttype_id AND A.project_id='$project_id' INNER JOIN object As C ON C.Project_ID=A.project_id INNER JOIN place As D ON D.Project_ID=A.project_id INNER JOIN building As E ON E.building_id=D.Building_id INNER JOIN project As F ON F.Project_ID=$project_id INNER JOIN thinker As G ON G.project_id='$project_id'"; $result_budget=mysql_query($sql_budget); while($rs_budget=mysql_fetch_array($result_budget)){ $budget_use=$rs_budget["budget_use"]; $board=$rs_budget["board"]; $tare_travel=$rs_budget["tare_travel"]; $food=$rs_budget["food"]; $machine=$rs_budget["machine"]; $security_officer=$rs_budget["security_officer"]; $facttype_name=$rs_budget["facttype_name"]; $Computer=$rs_budget["Computer"]; $Audio=$rs_budget["Audio"]; $Speaker=$rs_budget["Speaker"]; $Table=$rs_budget["Table"]; $Room=$rs_budget["Room"]; $Number=$rs_budget["Number"];

Page 191: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

$building_name=$rs_budget["building_name"]; $Project_Status=$rs_budget["Project_Status"]; $DeanAccount=$rs_budget["DeanAccount"]; $comment_DeanAccount=$rs_budget["comment_DeanAccount"]; $AssociateDean=$rs_budget["AssociateDean"]; $comment_AssociateDean=$rs_budget["comment_AssociateDean"]; $AssociateDeanStudent=$rs_budget["AssociateDeanStudent"]; $comment_AssociateDeanStudent=$rs_budget["comment_AssociateDeanStudent"]; $Director=$rs_budget["Director"]; $comment_Director=$rs_budget["comment_Director"]; $StaffActivitiesCommittee=$rs_budget["StaffActivitiesCommittee"]; $comment_StaffActivitiesCommittee=$rs_budget["comment_StaffActivitiesCommittee"]; $Phitsanu=$rs_budget["Phitsanu"]; $comment_Phitsanu=$rs_budget["comment_Phitsanu"]; } if($Project_Status=="Y" OR $Project_Status=="Complete" ){ ?> <table width="95%" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left" ><font face="Tahoma" size="2" color="#333333"><b><u>หมวดงบประมาณ</u></b></font></td> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> ประเภทโครงการ : <?=$facttype_name?> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> งบประมาณทใชในการด าเนนโครงการ : <?=$budget_use?> บาท </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คาอาหาร : <?=$board?> บาท </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คารถเดนทาง : <?=$tare_travel?> บาท </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8">

Page 192: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<font face="Tahoma" size="2" color="#333333"> คาเบยเลยง : <?=$food?> บาท </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คาเครองเดม : <?=$machine?> บาท </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คาเจาหนาทดแลความปลอดภย : <?=$security_officer?> บาท </font> </td></tr> </table> <br> <table width="95%" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left" ><font face="Tahoma" size="2" color="#333333"><b><u>รายการวสด - อปกรณโสดทศนศกษา</u></b></font></td> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คอมพวเตอร จ านวน : <?=$Computer?> ชด </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> เครองเสยงจ านวน จ านวน: <?=$Audio?> ชด </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> ล าโพง จ านวน : <?=$Speaker?> ชด </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> โตะ + เกาอ จ านวน : <?=$Speaker?> ชด </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> หอง จ านวน : <?=$Room?> หอง </font>

Page 193: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</td></tr> </table> <br> <table width="95%" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left" ><font face="Tahoma" size="2" color="#333333"><b><u>รายการอาคารสถานท</u></b></font></td> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> อาคารสถานท : <?=$building_name?> </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> จ านวนผเขารวมโครงการ : <?=$Number?> คน </font> </td></tr> </table> <br> <table width="95%" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left" ><font face="Tahoma" size="2" color="#333333"><b><u>ผพจารณาโครงการ</u></b></font></td> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คณบดคณะการบญชและการจดการ : <? if($DeanAccount=="1"){ echo "ผาน"; }else{ echo "ไมผาน"; } ?> <br> <? if($comment_DeanAccount<>""){ ?> <font face="Tahoma" size="2" color="#666666"><textarea name="comment_DeanAccount" cols="45" rows="4"><?=$comment_DeanAccount?></textarea></font> <? } ?> </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8">

Page 194: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<font face="Tahoma" size="2" color="#333333"> รองคณะบดฝายการเงนและบญช : <? if($AssociateDean=="1"){ echo "ผาน"; }else{ echo "ไมผาน"; } ?> <br> <? if($comment_AssociateDean<>""){ ?> <font face="Tahoma" size="2" color="#666666"><textarea name="comment_AssociateDean" cols="45" rows="4"><?=$comment_AssociateDean?></textarea></font> <? } ?> </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> รองคณะบดฝายพฒนานสต และอาคารสถานท : <? if($AssociateDeanStudent=="1"){ echo "ผาน"; }else{ echo "ไมผาน"; } ?> <br> <? if($comment_AssociateDeanStudent<>""){ ?> <font face="Tahoma" size="2" color="#666666"><textarea name="comment_AssociateDeanStudent" cols="45" rows="4"><?=$comment_AssociateDeanStudent?></textarea></font> <? } ?> </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> ผอ านวยการ ส านกบรหารกจการนสต : <? if($Director=="1"){ echo "ผาน";

Page 195: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

}else{ echo "ไมผาน"; } ?> <br> <? if($comment_Director<>""){ ?> <font face="Tahoma" size="2" color="#666666"><textarea name="comment_Director" cols="45" rows="4"><?=$comment_Director?></textarea></font> <? } ?> </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> เจาหนาทกจกรรมคณะ : <? if($StaffActivitiesCommittee=="1"){ echo "ผาน"; }else{ echo "ไมผาน"; } ?> <br> <? if($comment_StaffActivitiesCommittee<>""){ ?> <font face="Tahoma" size="2" color="#666666"><textarea name="comment_StaffActivitiesCommittee" cols="45" rows="4"><?=$comment_StaffActivitiesCommittee?></textarea></font> <? } ?> </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> เลขาณการ คณะ : <? if($Phitsanu=="1"){ echo "ผาน"; }else{ echo "ไมผาน"; } ?> <br> <? if($comment_Phitsanu<>""){

Page 196: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

?> <font face="Tahoma" size="2" color="#666666"><textarea name="comment_Phitsanu" cols="45" rows="4"><?=$comment_Phitsanu?></textarea></font> <? } ?> </font> </td></tr> </table> <? } ?> </td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="23%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="77%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> </body> </html>

Page 197: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

365 Source Code ชอ single <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>ขอมลโสตทศนปกรณหองเรยน</title> <style type="text/css"> <!-- body,td,th { font-family: tahoma; font-size: 12px; color: #333333; } .style1 {color: #0033FF} .style2 { color: #0066FF; font-weight: bold; } body { background-image: url(images/bg_hexa.gif); } --> </style></head> <body> <p align="center"><span class="style1"><span class="style2">ขอมลโสตทศนปกรณหองเรยน อาคาร 1-บธ. คณะการบญชและการจดการ </span> </span><em> </em></p> <table width="936" border="1" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="161"><p align="center">Classroom</p></td> <td width="128"><p align="center">LCD Projector</p></td> <td width="132" valign="top"><p align="center">VISUALIZER </p></td> <td width="129" valign="top"><p align="center">Amplifier</p></td> <td width="127" valign="top"><p align="center">Speaker </p></td> <td width="130" valign="top"><p align="center">Microphone </p></td> <td width="121" valign="top"><p align="center">Note</p></td> </tr> <tr> <td width="161"><p align="center">1102</p></td> <td width="128"><p>3M/X55</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 B*2</p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 2087 h </p></td> </tr> <tr>

Page 198: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td width="161"><p align="center">1103</p></td> <td width="128"><p>SONY/VPL-EX3</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 B*2</p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 2085 h </p></td> </tr> <tr> <td width="161"><p align="center">1104</p></td> <td width="128"><p>CANNON/LV-7250</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 B*2</p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 330 h </p></td> </tr> <tr> <td width="161"><p align="center">1204</p></td> <td width="128"><p>SONY/VPL-EX3</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>NPE/PDA-150 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 B*2</p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 2036 h </p></td> </tr> <tr> <td width="161"><p align="center">พงษภญโญ</p></td> <td width="128"><p>3M/X20</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>- </p></td> <td width="130" valign="top"><p>NPE/.............</p></td> <td width="121" valign="top"><p>Lamp time 1154 h </p></td> </tr> <tr> <td width="161"><p align="center">Ph.D4</p></td> <td width="128"><p>3M/MP-7650</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>AHUJA CMA 3400 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*1</p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 778 h </p></td> </tr> <tr> <td width="161"><p align="center">Ph.D5</p></td> <td width="128"><p>3M/MP-7650</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE</p></td> <td width="129" valign="top"><p>ROYAL/AP Serie 2</p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*1 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A</p></td>

Page 199: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td width="121" valign="top"><p>Lamp time 376 h</p></td> </tr> <tr> <td width="161"><p align="center">1303</p></td> <td width="128"><p>SONY/VPL-EX3</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>ROYAL/AP Serie 2 </p></td> <td width="127" valign="top"><p>TV Sony*2</p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 1220 h </p></td> </tr> <tr> <td width="161"><p align="center">1304</p></td> <td width="128"><p>3M/X64</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>ROYAL/AP Serie 2 </p></td> <td width="127" valign="top"><p>TV Sony*2</p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 556 h </p></td> </tr> <tr> <td width="161"><p align="center">1306</p></td> <td width="128"><p>SONY/VPL-EX3</p></td> <td width="132" valign="top"><p align="center">- </p></td> <td width="129" valign="top"><p>ROYAL/AP Serie 1 </p></td> <td width="127" valign="top"><p>TV Sony*2</p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 1200 h </p></td> </tr> <tr> <td width="161"><p align="center">บธ1</p></td> <td width="128"><p>3M/X64</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>ROYAL/AP Serie 1 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 B*2</p></td> <td width="130" valign="top"><p>NPE/SM-85 A*2 </p></td> <td width="121" valign="top"><p>Lamp time 1694 h </p></td> </tr> <tr> <td width="161"><p align="center">บธ2 </p></td> <td width="128"><p>SONY/VPL-EX3</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>NPE/PA-100</p></td> <td width="127" valign="top"><p>TV Sony*2/ TOA*2</p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 876 h </p></td> </tr> <tr> <td width="161"><p align="center">1403 </p></td> <td width="128"><p>SONY/VPL-EX3</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td>

Page 200: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td width="129" valign="top"><p>NPE/PA-100</p></td> <td width="127" valign="top"><p>TV Sony*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 1056 h </p></td> </tr> <tr> <td width="161"><p align="center">1404 </p></td> <td width="128"><p>SONY/VPL-EX3</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>NPE/PA-100</p></td> <td width="127" valign="top"><p>TV Sony*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 557 h </p></td> </tr> <tr> <td width="161"><p align="center">1405</p></td> <td width="128"><p>SONY/VPL-EX3</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>NPE/TW-250L</p></td> <td width="127" valign="top"><p>TV Sony*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 2304 h </p></td> </tr> </table> <p align="center"><span class="style2">ขอมลโสตทศนปกรณหองเรยน อาคาร 2 คณะการบญชและการจดการ </span><em> </em></p> <table width="936" border="1" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="161"><p align="center">Classroom</p></td> <td width="128"><p align="center">LCD Projector</p></td> <td width="132" valign="top"><p align="center">VISUALIZER </p></td> <td width="129" valign="top"><p align="center">Amplifier</p></td> <td width="127" valign="top"><p align="center">Speaker </p></td> <td width="130" valign="top"><p align="center">Microphone </p></td> <td width="121" valign="top"><p align="center">Note</p></td> </tr> <tr> <td width="161"><p align="center">3102</p></td> <td width="128"><p>SONY/VPL-EX3</p></td> <td width="132" valign="top"><p>AverMedia/SPC-300 </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A*2</p></td> <td width="121" valign="top"><p>Lamp time 986 h </p></td> </tr> <tr> <td width="161"><p align="center">3103</p></td> <td width="128"><p>3M/X64</p></td> <td width="132" valign="top"><p>AverMedia/SPC-300 </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td>

Page 201: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 632 h </p></td> </tr> <tr> <td width="161"><p align="center">3104</p></td> <td width="128"><p>3M/X64</p></td> <td width="132" valign="top"><p>AverMedia/SPC-300 </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 3320 h </p></td> </tr> <tr> <td width="161"><p align="center">3105</p></td> <td width="128"><p>3M/X20</p></td> <td width="132" valign="top"><p>AverMedia/SPC-300 </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 B*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 2094 h </p></td> </tr> <tr> <td width="161"><p align="center">3106</p></td> <td width="128"><p>3M/X20</p></td> <td width="132" valign="top"><p>AverMedia/SPC-300 </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 B*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 1034 h </p></td> </tr> <tr> <td width="161"><p align="center">3202</p></td> <td width="128"><p>SONY/VPL-EX3</p></td> <td width="132" valign="top"><p>AverMedia/SPC-300</p></td> <td width="129" valign="top"><p>NPE/TW-250</p></td> <td width="127" valign="top"><p>NPE/V-ST 602 B*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A</p></td> <td width="121" valign="top"><p>Lamp time 1850 h</p></td> </tr> <tr> <td width="161"><p align="center">3203(LAB)</p></td> <td width="128"><p>3M/X20</p></td> <td width="132" valign="top"><p>AverMedia/SPC-300 </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>Shure/RS-25 </p></td> <td width="121" valign="top"><p>Lamp time 1823 h </p></td> </tr> <tr> <td width="161"><p align="center">3204(LAB)</p></td>

Page 202: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td width="128"><p>3M/X20</p></td> <td width="132" valign="top"><p>AverMedia/SPC-300 </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>Shure/RS-25 </p></td> <td width="121" valign="top"><p>Lamp time 1619 h </p></td> </tr> <tr> <td width="161"><p align="center">3301</p></td> <td width="128"><p>SONY/VPL-EX3</p></td> <td width="132" valign="top"><p>AverMedia/SPC-300 </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 980 h </p></td> </tr> <tr> <td width="161"><p align="center">3302 </p></td> <td width="128"><p>3M/X64</p></td> <td width="132" valign="top"><p>AverMedia/SPC-300 </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 </p></td> <td width="121" valign="top"><p>Lamp time 1823 h </p></td> </tr> <tr> <td width="161"><p align="center">3303</p></td> <td width="128"><p>SONY/VPL-EX3</p></td> <td width="132" valign="top"><p>AverMedia/SPC-300 </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 1098 h </p></td> </tr> </table> <p align="center"><span class="style2">ขอมลโสตทศนปกรณหองเรยน อาคาร AccBiz1 คณะการบญชและการจดการ </span><em> </em></p> <table width="936" border="1" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="161"><p align="center">Classroom</p></td> <td width="128"><p align="center">LCD Projector</p></td> <td width="132" valign="top"><p align="center">VISUALIZER </p></td> <td width="129" valign="top"><p align="center">Amplifier</p></td> <td width="127" valign="top"><p align="center">Speaker </p></td> <td width="130" valign="top"><p align="center">Microphone </p></td> <td width="121" valign="top"><p align="center">Note</p></td> </tr> <tr> <td width="161"><p align="center">AccBiz205 </p></td> <td width="128"><p>SONY/……………</p></td>

Page 203: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>YAMAHA/ </p></td> <td width="127" valign="top"><p>BOSH……………</p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time ........ h </p></td> </tr> <tr> <td width="161"><p align="center">AccBiz301</p></td> <td width="128"><p>3M/X64</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 1074 h </p></td> </tr> <tr> <td width="161"><p align="center">AccBiz302</p></td> <td width="128"><p>3M/X64</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>Shure </p></td> <td width="121" valign="top"><p>Lamp time 122 h </p></td> </tr> <tr> <td width="161"><p align="center">AccBiz303</p></td> <td width="128"><p>3M/X64</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 181 h </p></td> </tr> <tr> <td width="161"><p align="center">AccBiz304</p></td> <td width="128"><p>3M/X64</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A </p></td> <td width="121" valign="top"><p>Lamp time 1 h </p></td> </tr> <tr> <td width="161"><p align="center">AccBiz306</p></td> <td width="128"><p>3M/X20</p></td> <td width="132" valign="top"><p align="center">-</p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>Deccon-MM94*7</p></td> <td width="121" valign="top"><p>Lamp time 292 h </p></td> </tr>

Page 204: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<tr> <td width="161"><p align="center">AccBiz308</p></td> <td width="128"><p>3M/X20</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>NPE/PA-150</p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>shuer </p></td> <td width="121" valign="top"><p>Lamp time 292 h </p></td> </tr> <tr> <td width="161"><p align="center">AccBiz401 </p></td> <td width="128"><p>3M/X64</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A/Deccon-MM94</p></td> <td width="121" valign="top"><p>Lamp time 663 h </p></td> </tr> <tr> <td width="161"><p align="center">AccBiz402 </p></td> <td width="128"><p>3M/X64</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A/Deccon-MM94</p></td> <td width="121" valign="top"><p>Lamp time 2317 h </p></td> </tr> <tr> <td width="161"><p align="center">AccBiz403 </p></td> <td width="128"><p>3M/X64</p></td> <td width="132" valign="top"><p>JVC/AVP-660AE </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A/Deccon-MM94</p></td> <td width="121" valign="top"><p>Lamp time 1364 h </p></td> </tr> <tr> <td width="161"><p align="center">AccBiz404 </p></td> <td width="128"><p>CASIO</p></td> <td width="132" valign="top"><p>AverMedia/SPC- </p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/SM-85 A/Deccon-MM94</p></td> <td width="121" valign="top"><p>&nbsp;</p></td> </tr> <tr> <td width="161"><p align="center">AccBiz405 </p></td> <td width="128"><p>CASIO</p></td> <td width="132" valign="top"><p>AverMedia/SPC-</p></td> <td width="129" valign="top"><p>NPE/TW-250 </p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td>

Page 205: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td width="130" valign="top"><p>NPE/SM-85 A/Deccon-MM94</p></td> <td width="121" valign="top"><p>&nbsp;</p></td> </tr> </table> <p align="center" class="style2">ขอมลโสตทศนปกรณหองเรยน อาคาร AccBiz 2 คณะการบญชและการจดการ</p> <table width="936" border="1" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="161"><p align="center">Classroom</p></td> <td width="128"><p align="center">LCD Projector</p></td> <td width="132" valign="top"><p align="center">VISUALIZER </p></td> <td width="129" valign="top"><p align="center">Amplifier</p></td> <td width="127" valign="top"><p align="center">Speaker </p></td> <td width="130" valign="top"><p align="center">Microphone </p></td> <td width="121" valign="top"><p align="center">Note</p></td> </tr> <tr> <td width="161"><p align="center">AccBiz406 </p></td> <td width="128" valign="top"><p>3M/X30</p></td> <td width="132" valign="top"><p>AverMedia/SPB-350</p></td> <td width="129" valign="top"><p>NPE/TR-250</p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/PRO-58 </p></td> <td width="121" valign="top"><p>&nbsp;</p></td> </tr> <tr> <td width="161"><p align="center">AccBiz407</p></td> <td width="128" valign="top"><p>3M/X30</p></td> <td width="132" valign="top"><p>AverMedia/SPB-350</p></td> <td width="129" valign="top"><p>NPE/TR-250</p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/PRO-58 </p></td> <td width="121" valign="top"><p>&nbsp;</p></td> </tr> <tr> <td width="161"><p align="center">AccBiz408</p></td> <td width="128" valign="top"><p>3M/X30</p></td> <td width="132" valign="top"><p>AverMedia/SPB-350</p></td> <td width="129" valign="top"><p>NPE/TR-250</p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/PRO-58 </p></td> <td width="121" valign="top"><p>&nbsp;</p></td> </tr> <tr> <td width="161"><p align="center">AccBiz409</p></td> <td width="128" valign="top"><p>3M/X30</p></td> <td width="132" valign="top"><p>AverMedia/SPB-350</p></td> <td width="129" valign="top"><p>NPE/TR-250</p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/PRO-58 </p></td>

Page 206: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td width="121" valign="top"><p>&nbsp;</p></td> </tr> <tr> <td width="161" valign="top"><p align="center">AccBiz410</p></td> <td width="128" valign="top"><p>3M/X30</p></td> <td width="132" valign="top"><p>AverMedia/SPB-350</p></td> <td width="129" valign="top"><p>NPE/TR-250</p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/PRO-58 </p></td> <td width="121" valign="top"><p>&nbsp;</p></td> </tr> <tr> <td width="161" valign="top"><p align="center">AccBiz411</p></td> <td width="128" valign="top"><p>3M/X30</p></td> <td width="132" valign="top"><p>AverMedia/SPB-350</p></td> <td width="129" valign="top"><p>NPE/TR-250</p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/PRO-58 </p></td> <td width="121" valign="top"><p>&nbsp;</p></td> </tr> <tr> <td width="161" valign="top"><p align="center">AccBiz412</p></td> <td width="128" valign="top"><p>3M/X30</p></td> <td width="132" valign="top"><p>AverMedia/SPB-350</p></td> <td width="129" valign="top"><p>NPE/TR-250</p></td> <td width="127" valign="top"><p>NPE/V-ST 602 A*2 </p></td> <td width="130" valign="top"><p>NPE/PRO-58 </p></td> <td width="121" valign="top"><p>&nbsp;</p></td> </tr> </table> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> </body> </html>

Page 207: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

375 Source Code ชอ status_endorsee <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>สถานะของผอนมตโครงการ</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php

Page 208: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

if($type=="consideration"){ echo "<font color='#964408' face='tahoma' size=2>".$_SESSION["name"]."</font><br/>"; ?> <font face="tahoma" color="#964408" size="2">ต าแหนง : </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION["type2"] ."</font>"; }?> </td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" valign="top" bgcolor="f6f7f8"> <? $sql_select = "SELECT * FROM project where Project_Status='1'"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left"><font face="Tahoma" size="2" color="#333333"><b>ชอโครงการ (คลกชอโครงการเพอพจารณาโครงการ)</b></font></td> <td><font face="Tahoma" size="2" color="#333333"><b>วนทยนเสนอ</b></td> <td><font face="Tahoma" size="2" color="#333333"><b>ผานอนมตจากผอนมต</b></td></tr> <? while($fetch=mysql_fetch_array($result)){ $Project_ID=$fetch["Project_ID"]; $Project_Name=$fetch["Project_Name"]; $Project_Status=$fetch["Project_Status"]; $Project_Date=$fetch["Project_Date"]; if($Project_Status=="0"){ $Status="รอพจารณาการอนมต"; } if($Project_Status=="1"){ $Status="ผานการอนมต"; } if($Project_Status=="2"){ $Status="ไมผานการอนมต"; } if($Project_Status=="3"){ $Status="ปรบปรง/แกไขโครงการ"; } if($Project_Status=="Y"){ $Status="รอผอนมตโครงการอนมต"; }

Page 209: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

?> <tr bgcolor="#f6f7f8"><td align="left"><font face="Tahoma" size="2" color="#333333"><a href="the_project.php?Project_ID=<?=$Project_ID?>"><font face="Tahoma" size="2" color="#666666"><?=$Project_Name?></font></a></font></td> <td width="120"><font face="Tahoma" size="2" color="#333333"><?=$Project_Date?></font></td> <td width="150"><font face="Tahoma" size="2" color="#333333"><?=$Status?></font></td> </tr> <? } ?></table> </td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="20%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="80%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> </body> </html>

Page 210: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

378 Source Code ชอ summary <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>ผลสรปโครงการ</title> <script src="conversion.js" language="JavaScript1.2" type="text/javascript"></script> <script src="entities.js" language="JavaScript1.2" type="text/javascript"></script> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } input.button {margin: 0; font: tahoma; font-size:12px; border: 1px solid #FF9900; background: #9288be; padding: 2px 3px; color: #ffee00; cursor: pointer; } --> </style> <script language="javascript"> function open_DateTime(){ myWindow=window.open('DateTime.php','','width=500,height=500,scrollbare=yes') myWindow.focus() } </script> </head>

Page 211: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" valign="top" bgcolor="f6f7f8"><table width="700" height="77" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="4" background="images/register_01.png">&nbsp;</td> </tr> <tr> <td width="25" background="images/register_02.png">&nbsp;</td> <td width="32" bgcolor="#F6F6F6">&nbsp;</td> <td width="621" bgcolor="#F6F6F6"><font face="tahoma" color="#0033FF" size="2"><b>กรณากรอกรายละเอยดโครงการ</b></font> <form action="" method="POST" name="form_register" onsubmit="return check_form_register()" autocomplete="off" enctype="multipart/form-data"> <table border="0" cellpadding="1" cellspacing="0" > <tr> <td width="104" align="right"><font color="#666666" size="2">ชอสรปโครงการ :</font></td> <td width="486" align="left"><input type="text" size="60" name="Project_Name" id="Project_Name" >

Page 212: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<font color="red" size="2">*<a href="file/file.doc"></a></font></td> </tr> <tr> <td align="right"><font color="#666666" size="2">วน/เดอน/ป :&nbsp;</font></td> <td align="left"> <iframe name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="calendar/popcjs.htm" scrolling="no" frameborder="2" style="border:ridge;visibility:hidden;position:absolute;z-index:65535"></iframe> <input type="text" name="date" readonly="readonly" /> <input type="image" src="images/WebResource.gif" onclick="gfPop.fPopCalendar(this.form.date); return false" alt="เลอกวนท"/> &nbsp;<font color="red" size="2">*</font></td> </tr> <tr> <td align="right"><font color="#666666" size="2">แนบไฟล :</font>&nbsp;</td> <td align="left"><input name="filUpload" type="file" size="30"> <font color="red" size="2">* ชอไฟลภาษาองกฤษเทานน</font></td> </tr> <tr> <td align="right"><font color="#666666" size="2">ผเสนอ :&nbsp;</font></td> <td align="left"><input type="text" size="30" name="Proposer" id="Proposer" value="<?=$name?>" ></td> </tr> <tr> <td align="right">&nbsp;</td> <td align="left"><font color="red" size="2">* กรอกขอความหามวาง</font></td> </tr> <tr> <td align="right">&nbsp;</td> <td align="left"><input type="submit" name="btnSave" id="btnSave" value="บนทกโครงการ"> <input type="reset" name="btnCancel" id="btnCancel" value="ยกเลก"></td> </tr> </table> </form></td> <td width="24" background="images/register_04.png">&nbsp;</td> </tr> <tr> <td height="33" colspan="4" background="images/register_05.png">&nbsp;</td> </tr>

Page 213: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</table> <p><? include "summary_view.php"; ?></p></td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="20%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="80%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> <? if($_POST["btnSave"]){ if((!empty($_POST["Project_Name"])) and (!empty($_POST["date"]))){ $file_name=$_FILES["filUpload"]["name"]; copy($_FILES["filUpload"]["tmp_name"],"file/".$_FILES["filUpload"]["name"]); $sql="INSERT INTO summary VALUES ('','$_POST[Project_Name]','$_POST[date]','$file_name','$_POST[Proposer]','0')"; $result=mysql_db_query($dbname,$sql); if($result){ ?> <script language="javascript"> alert("บนทกขอมลเรยบรอยแลว"); window.location="summary.php"; </script> <? }else{ ?> <script language="javascript"> alert("รหสโครงการซ ากนคะ"); window.location="summary.php"; </script> <? exit(); } mysql_close(); } } ?> </body> </html>

Page 214: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

382

Source Code ชอ summary_view <? $sql_select = "SELECT * FROM summary WHERE Proposer='$name'"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left"><font face="Tahoma" size="2" color="#333333"><b>ชอไฟลสรปโครงการ</b></font></td> <td><font face="Tahoma" size="2" color="#333333"><b>วนท</b></td> </tr> <? while($fetch=mysql_fetch_array($result)){ $Project_ID=$fetch["summary_id"]; $Project_Name=$fetch["FileName"]; $Project_Date=$fetch["AdmitDate"]; $File=$fetch["File"]; ?> <tr bgcolor="#f6f7f8"><td align="left"><font face="Tahoma" size="2" color="#333333"><a href="file/<?=$File?>" target="_blank"><?=$Project_Name?></a></font></td> <td><font face="Tahoma" size="2" color="#333333"><?=$Project_Date?></font></td> </tr> <? } ?></table>

Page 215: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

383

Source Code ชอ summary_view_employees <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>::ผลสรปโครงการ</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr>

Page 216: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<td colspan="2" align="center"><? require "mnu_index.php";?> <?php echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" valign="top" bgcolor="f6f7f8"> <? $sql_select = "SELECT * FROM summary WHERE Status='0'"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left"><font face="Tahoma" size="2" color="#333333"><b>ชอไฟลสรปโครงการ</b></font></td> <td><font face="Tahoma" size="2" color="#333333"><b>วนท</b></td> <td width="200"><font face="Tahoma" size="2" color="#333333"><b>ชอผสรปโครงการ</b></td> <td width="100"><font face="Tahoma" size="2" color="#333333"><b>อนมต</b></td> </tr> <? while($fetch=mysql_fetch_array($result)){ $Project_ID=$fetch["summary_id"]; $Project_Name=$fetch["FileName"]; $Project_Date=$fetch["AdmitDate"]; $File=$fetch["File"]; $Proposer=$fetch["Proposer"]; ?> <tr bgcolor="#f6f7f8"><td align="left"><font face="Tahoma" size="2" color="#333333"><a href="file/<?=$File?>" target="_blank"><?=$Project_Name?></a></font></td> <td><font face="Tahoma" size="2" color="#333333"><?=$Project_Date?></font></td> <td><font face="Tahoma" size="2" color="#333333"><?=$Proposer?></font></td> <td><a href="approve_summary.php?summary_id=<?=$Project_ID?>"><font face="Tahoma" size="2" color="#333333">อนมต</font></a>&nbsp;&nbsp;<a

Page 217: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

href="delete_summary.php?summary_id=<?=$Project_ID?>"><font face="Tahoma" size="2" color="#333333">ไมอนมต</font></a></td> </tr> <? } ?></table> </td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="20%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="80%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> </body> </html>

Page 218: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

386

Source Code ชอ summaryveiw <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>::ผลสรปโครงการ</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">

Page 219: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" valign="top" bgcolor="f6f7f8"> <? $sql_select = "SELECT * FROM summary WHERE Status='1'"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left"><font face="Tahoma" size="2" color="#333333"><b>ชอไฟลสรปโครงการ</b></font></td> <td><font face="Tahoma" size="2" color="#333333"><b>วนท</b></td> <td width="200"><font face="Tahoma" size="2" color="#333333"><b>ชอผสรปโครงการ</b></td> </tr> <? while($fetch=mysql_fetch_array($result)){ $Project_ID=$fetch["summary_id"]; $Project_Name=$fetch["FileName"]; $Project_Date=$fetch["AdmitDate"]; $File=$fetch["File"]; $Proposer=$fetch["Proposer"]; ?> <tr bgcolor="#f6f7f8"><td align="left"><font face="Tahoma" size="2" color="#333333"><a href="file/<?=$File?>" target="_blank"><?=$Project_Name?></a></font></td> <td><font face="Tahoma" size="2" color="#333333"><?=$Project_Date?></font></td> <td><font face="Tahoma" size="2" color="#333333"><?=$Proposer?></font></td> </tr> <? }

Page 220: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

?></table> </td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="20%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="80%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> </body> </html>

Page 221: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

389

Source Code ชอ the_project <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); $project_id=$_GET["Project_ID"]; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>:: รายละเอยดโครงการ</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="0%" bgcolor="#f1f3f5"></td> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table>

Page 222: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?> <?php echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font> <? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?> </td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" bgcolor="f6f7f8" valign="top"><? require "mnu_member.php"; ?></td> <td height="104" align="left" valign="top" bgcolor="f6f7f8"> <? $sql_select = "SELECT * FROM project WHERE Project_ID='$_GET[Project_ID]'"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC"> <? while($fetch=mysql_fetch_array($result)){ $Project_ID=$fetch["Project_ID"]; $Project_Name=$fetch["Project_Name"]; $Project_Date=$fetch["Project_Date"]; $file=$fetch["file"]; $Fact1=$fetch["Fact1"]; $Proposer=$fetch["Proposer"]; $comment=$fetch["comment"]; ?> <tr><td align="left" ><font face="Tahoma" size="2" color="#333333"><b><u><?=$Project_Name?></u></b></font></td> </tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666"> รหสโครงการ : <?=$Project_ID?> <br/> </font></td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666"> รายละเอยดโครงการ : <? echo "<a href='file/$file' target='_blank'><font face='tahoma' size='2' color='#0066FF'>$file</font></a>"; ?> <br/> </font></td></tr>

Page 223: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666"> วนทเรมจดโครงการ : <?=$Project_Date?> <br/> </font></td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666"> ระยะเวลา : <?=$Fact1?> <br/> </font></td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666"> ผรบผดชอบโครงการ : <?=$Proposer?> <br/> </font></td></tr> </td> </tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#666666"> หมายเหต : <?=$comment?> <br/> </font></td></tr> </td> </tr> <? } ?></table> <br> <? $sql_budget="SELECT * FROM budget As A INNER JOIN facttype As B ON B.facttype_id=A.facttype_id AND A.project_id='$project_id' INNER JOIN object As C ON C.Project_ID=A.project_id INNER JOIN place As D ON D.Project_ID=A.project_id INNER JOIN building As E ON E.building_id=D.Building_id INNER JOIN project As F ON F.Project_ID=$project_id"; $result_budget=mysql_query($sql_budget); while($rs_budget=mysql_fetch_array($result_budget)){ $budget_use=$rs_budget["budget_use"]; $board=$rs_budget["board"]; $tare_travel=$rs_budget["tare_travel"]; $food=$rs_budget["food"]; $machine=$rs_budget["machine"]; $security_officer=$rs_budget["security_officer"]; $facttype_name=$rs_budget["facttype_name"]; $Computer=$rs_budget["Computer"]; $Audio=$rs_budget["Audio"]; $Speaker=$rs_budget["Speaker"]; $Table=$rs_budget["Table"]; $Room=$rs_budget["Room"];

Page 224: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

$Number=$rs_budget["Number"]; $building_name=$rs_budget["building_name"]; $Project_Status=$rs_budget["Project_Status"]; } if($Project_Status=="Y" OR $Project_Status=="1" ){ ?> <table width="95%" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left" ><font face="Tahoma" size="2" color="#333333"><b><u>หมวดงบประมาณ</u></b></font></td> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> ประเภทโครงการ : <?=$facttype_name?> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> งบประมาณทใชในการด าเนนโครงการ : <?=$budget_use?> บาท </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คาอาหาร : <?=$board?> บาท </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คารถเดนทาง : <?=$tare_travel?> บาท </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คาเบยเลยง : <?=$food?> บาท </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คาเครองดม : <?=$machine?> บาท </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คาเจาหนาทดแลความปลอดภย : <?=$security_officer?> บาท </font>

Page 225: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</td></tr> </table> <br> <table width="95%" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left" ><font face="Tahoma" size="2" color="#333333"><b><u>รายการวสด - อปกรณโสดทศนศกษา</u></b></font></td> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คอมพวเตอร จ านวน : <?=$Computer?> ชด </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> เครองเสยงจ านวน จ านวน: <?=$Audio?> ชด </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> ล าโพง จ านวน : <?=$Speaker?> ชด </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> โตะ + เกาอ จ านวน : <?=$Speaker?> ชด </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> หอง จ านวน : <?=$Room?> หอง </font> </td></tr> </table> <br> <table width="95%" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left" ><font face="Tahoma" size="2" color="#333333"><b><u>รายการอาคารสถานท</u></b></font></td> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> อาคารสถานท : <?=$building_name?> </font> </td></tr> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8">

Page 226: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<font face="Tahoma" size="2" color="#333333"> จ านวนผเขารวมโครงการ : <?=$Number?> คน </font> </td></tr> </table> <? } ?> <form action="" method="post"> <table width="95%" border="0" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC"> <tr><td align="left" ><font face="Tahoma" size="2" color="#333333"><b><u>ผพจารณาโครงการ</u></b></font></td> <? if($_SESSION["type2"]=="1"){ ?> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> คณบดคณะการบญชและการจดการ : <input type="checkbox" name="chkDeanAccountYES" value="Y"><font face="Tahoma" size="2" color="#666666">อนมต</font> <input type="checkbox" name="chkDeanAccountNo" value="N"><font face="Tahoma" size="2" color="#666666">ไมอนมต</font><br> <font face="Tahoma" size="2" color="#666666"><textarea name="comment_DeanAccount" cols="45" rows="4"></textarea></font> </font> </td></tr> <? } ?> <? if($_SESSION["type2"]=="2"){ ?> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> รองคณะบดฝายการเงนและบญช : <input type="checkbox" name="chkAssociateDeanYES" value="Y"><font face="Tahoma" size="2" color="#666666">อนมต</font> <input type="checkbox" name="chkAssociateDeanNo" value="N"><font face="Tahoma" size="2" color="#666666">ไมอนมต</font><br> <font face="Tahoma" size="2" color="#666666"><textarea name="comment_AssociateDean" cols="45" rows="4"></textarea></font> </font> </td></tr> <?

Page 227: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

} ?> <? if($_SESSION["type2"]=="3"){ ?> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> รองคณะบดฝายพฒนานสต และอาคารสถานท : <input type="checkbox" name="chkAssociateDeanStudentYES" value="Y"><font face="Tahoma" size="2" color="#666666">อนมต</font> <input type="checkbox" name="chkAssociateDeanStudentNo" value="N"><font face="Tahoma" size="2" color="#666666">ไมอนมต</font><br> <font face="Tahoma" size="2" color="#666666"><textarea name="comment_AssociateDeanStudent" cols="45" rows="4"></textarea></font> </font> </td></tr> <? } ?> <? if($_SESSION["type2"]=="4"){ ?> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> ผอ านวยการ ส านกบรหารกจการนสต : <input type="checkbox" name="chkDirectorYES" value="Y"><font face="Tahoma" size="2" color="#666666">อนมต</font> <input type="checkbox" name="chkDirectorNo" value="N"><font face="Tahoma" size="2" color="#666666">ไมอนมต</font><br> <font face="Tahoma" size="2" color="#666666"><textarea name="comment_Director" cols="45" rows="4"></textarea></font> </font> </td></tr> <? } ?> <? if($_SESSION["type2"]=="5"){ ?> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> เจาหนาทกจกรรมคณะ : <input type="checkbox" name="chkStaffActivitiesCommitteeYES" value="Y"><font face="Tahoma" size="2" color="#666666">อนมต</font>

Page 228: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<input type="checkbox" name="chkStaffActivitiesCommitteeNo" value="N"><font face="Tahoma" size="2" color="#666666">ไมอนมต</font><br> <font face="Tahoma" size="2" color="#666666"><textarea name="comment_StaffActivitiesCommittee" cols="45" rows="4"></textarea></font> </font> </td></tr> <? } ?> <? if($_SESSION["type2"]=="6"){ ?> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <font face="Tahoma" size="2" color="#333333"> เลขาณการ คณะ : <input type="checkbox" name="chkPhitsanuYES" value="Y"><font face="Tahoma" size="2" color="#666666">อนมต</font> <input type="checkbox" name="chkPhitsanuNo" value="N"><font face="Tahoma" size="2" color="#666666">ไมอนมต</font><br> <font face="Tahoma" size="2" color="#666666"><textarea name="comment_Phitsanu" cols="45" rows="4"></textarea></font> </font><br> </td></tr> <? } ?> <tr bgcolor="#f6f7f8"> <td align="left" bgcolor="#f6f7f8"> <input name="submit" type="submit" value="บนทก"> <input name="reset" type="reset" value="ยกเลก"> </td></tr> </table> </form> </td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="23%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="77%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table>

Page 229: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<? if($_POST["submit"]){ if($_POST["chkDeanAccountYES"]<>""){ $DeanAccount=1; } if($_POST["chkDeanAccountNo"]<>""){ $DeanAccount=2; } if($_POST["chkAssociateDeanYES"]<>""){ $AssociateDean=1; } if($_POST["chkAssociateDeanNo"]<>""){ $AssociateDean=2; } if($_POST["chkAssociateDeanStudentYES"]<>""){ $AssociateDeanStudent=1; } if($_POST["chkAssociateDeanStudentNo"]<>""){ $AssociateDeanStudent=2; } if($_POST["chkDirectorYES"]<>""){ $Director=1; } if($_POST["chkDirectorNo"]<>""){ $Director=2; } if($_POST["chkStaffActivitiesCommitteeYES"]<>""){ $StaffActivitiesCommittee=1; } if($_POST["chkStaffActivitiesCommitteeNo"]<>""){ $StaffActivitiesCommittee=2; } if($_POST["chkPhitsanuYES"]<>""){ $Phitsanu=1; } if($_POST["chkPhitsanuNo"]<>""){ $Phitsanu=2; } $comment_DeanAccount=$_POST["comment_DeanAccount"]; $comment_AssociateDean=$_POST["comment_AssociateDean"]; $comment_AssociateDeanStudent=$_POST["comment_AssociateDeanStudent"]; $comment_Director=$_POST["comment_Director"]; $comment_StaffActivitiesCommittee=$_POST["comment_StaffActivitiesCommittee"]; $comment_Phitsanu=$_POST["comment_Phitsanu"];

Page 230: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

$sql_insert="insert into thinker values ('','$Project_ID','$DeanAccount','$comment_DeanAccount','$AssociateDean','$comment_AssociateDean' ,'$AssociateDeanStudent','$comment_AssociateDeanStudent','$Director','$comment_Director' ,'$StaffActivitiesCommittee','$comment_StaffActivitiesCommittee','$Phitsanu','$comment_Phitsanu')"; mysql_query($sql_insert); $sql="UPDATE Project SET Project_Status='1' WHERE Project_ID='$Project_ID'"; mysql_db_query($dbname,$sql); ?> <script language="javascript"> window.location="status_endorsee.php"; </script> <? } ?> </center> </body> </html>

Page 231: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

399 Source Code ชอ view_news <?php require("auth.inc.php"); // เรยกแทรสครปตรวจสอบวาผานการลอคอนเขามาหรอยง ถายงตองลอคอนเสยกอน require("config.inc.php"); // แทรกสครปปรบคาคอนฟกระบบ require("check_type.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>::รายละเอยดโครงการ</title> <style type="text/css"> <!-- body { background-image: url(images/bg_hexa.gif); background-repeat: repeat; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> </head> <body onLoad="document.formsms.receiver.focus();"> <!-- ค าส งใหเคอรเซอรแสดงทชองผสงอตโนมต --> <center> <table height="100%" width="990" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr height="100%"> <td width="1035" height="100%" valign="top" bgcolor="f6f7f8"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" bgcolor="#f1f3f5"><? include "bg.html"?></td> </tr> </table> <table height="" width="99%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td colspan="2" align="center"><? require "mnu_index.php";?>

Page 232: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

<?php echo "<font color='#964408' face='tahoma' size=2>$name</font>"; ?> <font face="tahoma" color="#964408" size="2">Login ลาสด </font><? echo "<font color=#964408 face='tahoma' size=2>" . $_SESSION['last_log'] ."</font>"; ?></td> </tr> <tr> <td colspan="2" align="center" bgcolor="f6f7f8">&nbsp;</td> </tr> <tr> <td height="104" align="left" valign="top" bgcolor="f6f7f8"><? require "mnu_member.php"; ?></td> <td height="104" valign="top" bgcolor="f6f7f8"> <? $sql_select = "SELECT * FROM news"; $result=mysql_db_query($dbname,$sql_select); ?> <table width="95%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC"> <tr><td width="100"><font face="Tahoma" size="2" color="#333333"><b>รหสขาว</b></font></td><td align="left"><font face="Tahoma" size="2" color="#333333"><b>ชอโครงการ</b></font></td> <td><font face="Tahoma" size="2" color="#333333"><b>วนท</b></td> <td width="20"><font face="Tahoma" size="2" color="#333333"><b>แกไข</b></td><td width="20"><font face="Tahoma" size="2" color="#333333"><b>ลบ</b></td></tr> <? while($fetch=mysql_fetch_array($result)){ $News_ID=$fetch["News_ID"]; $News_Name=$fetch["News_Name"]; $News_Date=$fetch["News_Date"]; ?> <tr bgcolor="#f6f7f8"><td align="center"><font face="Tahoma" size="2" color="#333333"><?=$News_ID?></font></td><td align="left"><font face="Tahoma" size="2" color="#333333"><?=$News_Name?></font></td> <td><font face="Tahoma" size="2" color="#333333"><?=$News_Date?></font></td> <td><a href="edit_News.php?News_ID=<?=$News_ID?>"><font face="Tahoma" size="2" color="#333333">แกไข</font></a></td> <td><a href="delete_News.php?News_ID=<?=$News_ID?>"><font face="Tahoma" size="2" color="#333333">ลบ</font></td></tr> <? } ?></table>

Page 233: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

</td> </tr> <tr> <td colspan="2" align="left" height="1"></td> </tr> <tr> <td width="20%" align="left" valign="top" bgcolor="f6f7f8">&nbsp;</td> <td width="80%" align="left" bgcolor="f6f7f8">&nbsp;</td> </tr> </table> <p>&nbsp;</p> </tr> </table> </center> </body> </html>

Page 234: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

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

Page 235: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

บทน าเสนอการศกษาโครงงานเทคโนโลยสารสนเทศธรกจ เรอง ระบบการจดการโครงการ และกจการนสตออนไลน คณะการบญชและการจดการ มหาวทยาลยมหาสารคาม Project management systems and student affairs online Faculty of accountancy and management Mahasarakham University ผศกษา นางสาวจรนทพย มลตร รหสประจ าตว 50010912086 นางสาวปยธดา มาซา รหสประจ าตว 50010912813 นางสาวสทธดา สมานมตร รหสประจ าตว 50010912863 อาจารยทปรกษา อาจารยณฐอาภา สจจวาท

1.ความเปนมาและความส าคญของปญหา เนองดวยปจจบนนการพฒนาระบบการตดตอสอสารไดกาวไกล และสะดวกรวดเรว จนท าใหกาวตามไมทน ทงในดานเทคโนโลยททนสมย และดานอนเตอรเนตทใชในการตดตอสอสารทตอบสนองความตองการของผใช ดวยเหตผลนจงท าใหไดเหนปญหาการท างานทลาชาของการตดตอสอสาร ในงานกจการนสต ทมการตดตอกนทางดานเอกสาร และเดนเรองขอโครงการทจดกจกรรมนอกมหาวทยาลยมหาสารคาม ทยงตองลาชาและใชระยะเวลาการขออนมตโครงการนาน และเสยเวลาในการยนเรองของนสตทจดกจกรรม ซงการทจะจดกจกรรมไดนนจะตองท าเอกสารโครงการเพอเสนอตอกองกจการนสต และผบรหารตามล าดบ ซงในสวนนจะตองใชเวลามากและผานขนตอนในการตรวจสอบเอกสารหลายสวนเพอทจะอนมตใหจดท าโครงการเปนเหตใหเกดความลาชาและไมสามารถพจารณาโครงการอยางละเอยดได วธการแกไขปญหาดวยการจดท าระบบทเปนสอกลางในการรวมวธทจะสนบสนนใหการตดตามผลการด าเนนการของผบรหารผบรหารและกองกจการนสตไดมความสะดวกขน โดยระบบจะท างานบนเครอขายอนเตอรเนต เชนการรบสมครสมาชกชมรมผานเครอขายอนเตอรเนต การสรางรปแบบของเอกสารทเปนมาตรฐานใหกองกจการนสตไดดาวโหลดไปใชผานเครอขายอนเตอรเนต การจดท าระบบสงอนมตโครงการผานเครอขายอนเตอรเนต การแสดงรายงานขอมลการด าเนนโครงการแกผบรหารและกองกจการนสตผานเครอขายอนเตอรเนต การสรางระบบสรปและ

Page 236: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

404

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

1.2.1 เพอพฒนาระบบงานเอกสารของฝายกจการนสตคณะการบญชและการจดการใหระบบท างานไดโดยผานเครอขายอนเตอรเนต

1.2.2 เพอใหผบรหารงานกจการนสตและคณะกรรมการบรหารไดพจารณาและเซนอนมตเอกสารผานเครอขายอนเตอรเนตและจดเตรยมรปแบบเอกสารใหผเสนอโครงการโหลดเอกสารไปใชงานได

1.2.3 เพอใหผบรหารงานกจการนสตสามารถเรยกดรายงานสรปผลการด าเนนโครงการประจ าปไดและส านกกจการนสตสามารถประเมนโครงการของชมรมไดโดยผานเครอขายอนเตอรเนต 3.ขอบเขตการด าเนนงาน

ระบบการจดการโครงการและกจกรรมนสตออนไลน คณะการบญชและการจดการ มหาวทยาลยมหาสารคาม

3.1 ผใชงานทวไป 3.1.1 สามารถเขาดหนาเวบของโครงการได 3.1.2 สามารถสมครสมาชกได 3.1.3 สามารถเขาสหนา login ของระบบโครงการได 3.2 ผใชงานทเปนสมาชก 3.2.1 สามารถ Login เขาหนาหลกของระบบโครงการได 3.2.1.1 สามารถ ลบ เพม แกไข ขอมลสมาชกได 3.2.2.1 สามารถกรอกขอมลฟอรมโครงการได 3.2.2.2 สามารถ เพม แกไข ฟอรมโครงการทผานการตรวจสอบได 3.2.2.4 สามารถตรวจสอบขาว และกจกรรมผานหนาเวบบอรดได 3.2.2.5 แลกเปลยนขอมล สอบถามผานเวบบอรดได 3.2.2.6 สามารถตงกระทหนาเวบบอรดได 3.2.3 สามารถตดตามดสถานะความคบหนาของโครงการผานเครอขายอนเตอรเนตได 3.2.4 สามารถสงความคบหนาของโครงการทผานการอนมตผานระบบอนเตอรเนตได 3.2.5 สามารถสรปผลการด าเนนโครงการได

Page 237: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

405

3.3 ผใชงานทเปนผดแลระบบ 3.3.1 สามารถเพมรปแบบฟอรมโครงการผานระบบอนเตอรเนตได 3.3.2 สามารถตรวจสอบฟอรมทยนเสนอโครงการผานระบบอนเตอรเนตได 3.3.2.1 สามารถ ลบ เพม แกไข เอกสารโครงการกอนยนเสนอโครงการได 3.3.2.2 สามารถยนเรองของบประมาณจาก หมวดการเงน ตามโครงการทเสนอผาน

ระบบอนเตอรเนตได 3.3.3.1 สามารถอพเดตขอมลขาว ผานหนาเวบบอรดได 3.3.3.2 สามารถใหค าปรกษาตอบค าถามผานเวบบอรดได 3.3.4 สามารถอนมตโครงการเบองตน กอนยนเรองใหฝายบรหารอนมตผานระบบ

อนเตอรเนต 3.3.4.1 สามารถสงเรองขอความคดเหนไปยงฝายผอ านวยการส านกกจการนสต 3.3.4.2 สามารถสงเรองขอความคดเหนไปยงฝายรองคณบดฝายพฒนานสตและอาคาร

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

คณะการบญชและการจดการ 3.3.5 สามารถตรวจสอบอปกรณทใชในการด าเนนงานของโครงการได 3.3.5.1 สามารถท าเรองยม วสด อปกรณโสตทศนศกษาผานระบบอนเตอรเนตได 3.3.5.2 สามารถจดท าเรองขอใชอาคาร-สถานทในการจดกจกรรมโครงการได 3.3.5.3 สามารถจดท าเรองของบประมาณสนบสนนโครงการจากหาง ราน บรษท หรอ

บคคลภายนอกได 3.3.5.4 สามารถจดท าเรองขอยมพาหนะในการเดนทางผานระบบอนเตอรเนตได 3.3.6 สามารถตดตามผลความคบหนาของโครงการทผานการอนมตได 3.3.6.1 สามารถตรวจสอบผลสมฤทธของโครงการได 3.3.8 สามารถด าเนนการจดท ารายงานผล การด าเนนโครงการ เพอใหคณะฯ รบทราบผาน

ระบบอนเตอรเนตได .4 ผใชงานทเปนผอนมตโครงการและผเสนอความคดเหน 3.4.1 สามารถตรวจสอบเอกสารโครงการทยนเสนอผานระบบอนเตอรเนตได 3.4.2 สามารถแสดงความคดเหนผานระบบอนเตอรเนตได 3.4.3 สามารถประเมนผลของโครงการผานระบบอนเตอรเนตได 3.4.4 สามารถอนมตโครงการผานระบบอนเตอรเนตได

Page 238: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

406 3.4.5 สามารถดรายงานผลของโครงการผานระบบอนเตอรเนตได

4.อปกรณและเครองมอในการด าเนนงาน 4.1 ฮารดแวร

4.1.1 เครองคอมพวเตอร Notebook จ านวน 2 เครอง 4.1.1.1 CPU 4.1.1.2 RAM 1 GB ขนไป 4.1.1.3 ฮารดดสก

4.2 ซอฟตแวร 1) ระบบปฏบตการ วนโดว เอกซพ โปรเฟสชนนอล 2002

(Window XP Professional 2002) 2) ฐานขอมล MySQL เวอรชน 5.0.27 ขนไป 3) ไมโครซอฟต ออฟฟซ 2007 (Microsoft Office 2007) 4) โปรแกรมภาษา PHP เวอรชน 5.2.1 ขนไป 5) โปรแกรม phpMyAdmin 6) โปรแกรม Apache เปน Web Server 7) โปรแกรม Adobe Dremweaver cs3 8) โปรแกรม Adobe Flash cs3 9) โปรแกรม Appserv v.2.5.8 10) โปรแกรม Adobe Photoshop cs3

4.3 อปกรณทใชทดสอบผลการท างาน 4.3.1 ฮารดแวร

4.3.1.1 เครองคอมพวเตอร Notebook จ านวน 2 เครอง 4.3.1.1 CPU 4.3.1.2 RAM 1 GB ขนไป 4.3.1.3 ฮารดดสก

4.1.2 ซอฟตแวร 1) ระบบปฏบตการ วนโดว เอกซพ โปรเฟสชนนอล 2002

(Window XP Professional 2002) 2) ฐานขอมล MySQL เวอรชน 5.0.27 ขนไป 3) ไมโครซอฟต ออฟฟซ 2007 (Microsoft Office 2007) 4) โปรแกรมภาษา PHP เวอรชน 5.2.1 ขนไป 5) โปรแกรม phpMyAdmin 6) โปรแกรม Apache เปน Web Server

Page 239: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

407

7) โปรแกรม Adobe Dremweaver cs3 8) โปรแกรม Adobe Flash cs3 9) โปรแกรม Appserv v.2.5.8 10) โปรแกรม Adobe Photoshop cs3

5.ขนตอนการด าเนนงาน 1.8.1 ศกษาความเปนไปไดของโครงการ 1.8.2 จดท าขอเสนอโครงการ 1.8.3 ศกษาทฤษฎทเกยวของ 1.8.4 วเคราะหและออกแบบ

1.8.4.1 การวเคราะห (Analysis) 1 ยสเคส ไดอะแกรม (Use Case Diagram) 2 ซเควน ไดอะแกรม (Sequence Diagram) 3 คลาส ไดอะแกรม (Class Diagram)

1.8.4.2 การออกแบบรายละเอยด (Detail Design)

1 การออกแบบขอมล (Data Design) - ออาร ไดอะแกรม (ER Diagram) - ดาตา ดคชนนาร (Data Dictionary)

3 การออกแบบงาน (Task Design) - โปรแกรมมง โฟลชารท (Programming Flowchart)

1.8.5 เขยนโปรแกรม 1.8.6 ทดสอบระบบงาน 1.8.7 ตรวจสอบและแกไขระบบงาน 1.8.8 จดท าผลการด าเนนงาน 1.8.9 สรปผลและขอเสนอแนะ 1.8.10 จดท าเอกสารฉบบสมบรณ

Page 240: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

408

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

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

7.1 ผใชสามารถเขาถงขอมลการด าเนนโครงการ ผานเครอขายอนเตอรเนตได 7.2 ท าใหการขออนมตโครงการท าไดสะดวกมากขนชวยลดขนตอนในการเดนเอกสารและผ

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

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

เสนอโครงการรวมไปถงผบรหาร 7.5 เกดความคลองตวในการด าเนนงานเกยวกบงานเอกสารของคณะการบญชและการ

จดการ มหาวทยาลยมหาสารคามมากขน

Page 241: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

ภาคผนวก ง. รายงานการเขาพบอาจารยทปรกษา

Page 242: ภาคผนวก - Mahasarakham Universitybc.msu.ac.th/project_file/appendix(217).pdfภาคผนวก ข. Source Code . 173 Source Code ชื่อ config.inc

410

รายงานการพบทปรกษา ชอเรอง ระบบการจดการโครงการ และกจการนสตออนไลน คณะการบญชและการจดการ มหาวทยาลยมหาสารคาม ผศกษา นางสาวจรนทพย มลตร 50010912086 นางสาวปยธดา มาซา 50010912813 นางสาวสทธดา สมานมตร 50010912863 ทปรกษา อาจารยณฐอาภา สจจาวาท

วน เดอน ป รายงานความคบหนา ลายมอชอทปรกษา

6 มกราคม 2554 นดความคบหนากอนเสรจสมบรณ

7 มกราคม 2554 ดความคบหนาโปรเจค

8 มกราคม 2554 ดความคบหนาโปรเจค

9 มกราคม 2554 ดความคบหนาโปรเจค

10 มกราคม 2554 ดความคบหนาโปรเจค

13 มกราคม 2554 นดเสนองานโปรเจคกอนขนงาน Combiz

20 มกราคม 2554 นดเรองการสงไฟลขอมลสมบรณ