<? session_start(); if(!isset($_SESSION['username'])){ echo "<script>alert('คุณยังไม่ได้ Login กรุณา Login ก่อนเข้าใช้งาน') window.location='index.php';</script>"; exit(); } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>แสดงหลักสูตร</title> <style> body { font-family : Tahoma; font-size:12px; margin : 0px; padding : 0px; text-align:-moz-center; #text-align:center; } </style> </head> <script language="JavaScript"> var HttPRequest = false; function doCallAjax(Search) { HttPRequest = false; if (window.XMLHttpRequest) { // Mozilla, Safari,... HttPRequest = new XMLHttpRequest(); if (HttPRequest.overrideMimeType) { HttPRequest.overrideMimeType('text/html'); } } else if (window.ActiveXObject) { // IE try { HttPRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { HttPRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!HttPRequest) { alert('Cannot create XMLHTTP instance'); return false; } var url = 'TEST3.php'; var pmeters = 'mySearch='+Search; HttPRequest.open('POST',url,true); HttPRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); HttPRequest.setRequestHeader("Content-length", pmeters.length); HttPRequest.setRequestHeader("Connection", "close"); HttPRequest.send(pmeters); HttPRequest.onreadystatechange = function() { if(HttPRequest.readyState == 3) // Loading Request { document.getElementById("mySpan").innerHTML = "Now is Loading..."; } if(HttPRequest.readyState == 4) // Return Request { document.getElementById("mySpan").innerHTML = HttPRequest.responseText; } } } </script> <body Onload="JavaScript:doCallAjax('');"> <? include("head.php"); ?> <br> <table width="900" border="0" cellspacing="2" cellpadding="2" align="center"> <tr><td><h1>ข้อมูลรายวิชา</h1></td></tr> <tr> <td align="right"><a href="indexbit4.php">เพิ่มรายวิชา</a></td> </tr> <tr><td> <form name="frmMain"> Search <select name="class" id="class"> <option value=""><- เลือก-></option> <? include("connect.php"); $strSQL = "SELECT * from name_subjects"; $objQuery = mysql_query($strSQL); while($objResuut = mysql_fetch_array($objQuery)) { ?> <option value="<?=$objResuut["name_sub"];?>"> <?=$objResuut["name_sub"];?></option> <? } ?> </select> <input type="button" name="btnSearch" id="btnSearch" value="Search" OnClick="JavaScript:doCallAjax(document.getElementById('class').value);"> <span id="mySpan"></span> </form> </td> </table> <center> <? include("footer.php"); ?> </center> </body> </html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style> body { font-family : Tahoma; font-size:12px; margin : 0px; padding : 0px; text-align:-moz-center; #text-align:center; } </style> <?php $strSearch = $_POST["mySearch"]; include("connect.php"); mysql_query("SET NAMES utf8"); $strSQL = "SELECT * FROM subjects inner join name_subjects on subjects.education = name_subjects.name_sub WHERE education LIKE '%".$strSearch."%' ORDER BY name_thai ASC "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); ?> <br /><br /> <table width="900" border="1" align="center"> <tr> <td align="center">รหัสวิชา</td> <td align="center"> ชื่อวิชา</td> <td align="center"> หน่วยกิต</td> <td align="center"> ประเภทวิชา</td> <td align="center"> หมวด</td> <td align="center">ระบบจัดการ</td> </tr> <? while($objResult = mysql_fetch_array($objQuery)) { ?> <tr> <td align="center"><a href="view_subject.php?view_id=<?=$objResult[id_sub]?>"><?=$objResult["id_sub"]?></a></td> <td align="center"><?=$objResult["name_thai"];?> (<?=$objResult["name_eng"];?>)</td> <td align="center"><?=$objResult["credit"];?></td> <td align="center"><?=$objResult["category"];?></td> <td align="center"><?=$objResult["muad"];?></td> <td align="center"><div align="center"><a href="edit.php?edit_id=<?=$objResult[id]?>">แก้ไข</a> <a href="delete_st.php?delete_id=<?=$objResult[id]?>">ลบ</a></td> </tr> <? } ?> </table> <? mysql_close(); ?>
<? session_start(); if(!isset($_SESSION['username'])){ echo "<script>alert('คุณยังไม่ได้ Login กรุณา Login ก่อนเข้าใช้งาน') window.location='index.php';</script>"; exit(); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <? include("head.php"); include("connect.php"); $sql_show = "SELECT * FROM subjects inner join name_subjects on subjects.education = name_subjects.name_sub WHERE education LIKE '%".$strSearch."%' ORDER BY name_thai ASC "; $result_show = mysql_query($sql_show) or die(mysql_error()); $row_show = mysql_fetch_array($result_show); ?> <title>คำอธิบายรายวิชา</title> </head> <body> <link href="sty.css" rel="stylesheet" type="text/css"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <? echo $_SERVER["REQUEST_URI"]."<br>"; ?> <table border="0" cellpadding="2" cellspacing="2" align="center"> <tr> <td align="right"><label><?=$row_show['id_sub']?></label> </td> <td align="left"><label><?=$row_show['name_thai']?></label></td> </tr> <tr> <td align="right"></td> <td align="left"><label><?=$row_show['name_eng']?></label></td> </tr> <td align="right">หน่วยกิต : </td> <td align="left"><label><?=$row_show['credit']?></label></td> </tr> <tr> <td align="right">คำอธิบายรายวิชา : </td> <td align="left"><label><?=$row_show['msg']?></label></td> </tr> </table><center> <? include("footer.php"); ?></center> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง