<? include('../Connection/connect.php');?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <?php mysql_query("SET NAMES UTF8");?> <? $id=$branch_id; $branch_name=$branch_name; $faculty_id=$faculty_id; $faculty_name=$faculty_name; ?> <script language = "JavaScript"> //**** List faculty (Start) ***// function Listfaculty(SelectValue) { frmMain.Lfaculty.length = 0 //*** Insert null Default Value ***// var myOption = new Option('','') frmMain.Lfaculty.options[frmMain.Lfaculty.length]= myOption <? $intRows = 0; $strSQL = "SELECT * FROM faculty ORDER BY faculty_id ASC "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $intRows = 0; while($objResult = mysql_fetch_array($objQuery)) { $intRows++; ?> x = <?=$intRows;?>; mySubList = new Array(); strGroup = <?=$objResult["campus_id"];?>; strValue = "<?=$objResult["faculty_id"];?>"; strItem = "<?=$objResult["faculty_name"];?>"; mySubList[x,0] = strItem; mySubList[x,1] = strGroup; mySubList[x,2] = strValue; if (mySubList[x,1] == SelectValue){ var myOption = new Option(mySubList[x,0], mySubList[x,2]) frmMain.Lfaculty.options[frmMain.Lfaculty.length]= myOption } <? } ?> } //**** List faculty (End) ***// </script> <script language="javascript"> function Listbranch(SelectValue) { if(SelectValue != "") window.location.href="view_branch_.php?a="+SelectValue; } </script> </head> <body> <form name="frmMain" action="" method="post"> <div id="divResult"> <p> <iframe id="iframe_target" name="iframe_target" src="#" style="width:0;height:0;border:0px solid #FFFFFF;"></iframe> <script language="JavaScript" type="text/javascript"> function showResult(result) { if(result==1) { <? echo "alert('กรุณาเลือกวิทยาเขต')"; ?> //document.getElementById("divResult").innerHTML="<font color=red>กรุณาใส่ชื่อสื่อการสอน</font><br>"; } else if(result==2) { <? echo "alert('กรุณาเลือกคณะ')"; ?> //document.getElementById("divResult").innerHTML="<font color=red>กรุณาใส่ชื่อสื่อการสอนด้วย</font><br>"; } else if(result==3) { <? echo "alert('กรุณาใส่ชื่อสาขา')"; ?> //document.getElementById("divResult").innerHTML="<font color=red>กรุณาใส่ชื่อสื่อการสอนด้วย</font><br>"; } else if(result==4) { <? echo "alert('ชื่อสาขานี้มีอยู่แล้ว')"; ?> //document.getElementById("divResult").innerHTML="<font color=red>กรุณาใส่ชื่อสื่อการสอนด้วย</font><br>"; } else { var url ="http://localhost/project54/admin/view_branch.php"; window.location =url; } } </script> </p> </div> <table width="361" border="1" align="center"> <tr> <td colspan="2" align="center">ตรวจสอบชื่อสาขาในแต่ละคณะของแต่ละวิทยาเขต</td> </tr> <tr> <td width="84">วิทยาเขต</td> <td width="261"><select id="DDLcampus" name="DDLcampus" onChange ="Listfaculty(this.value)"> <option selected value="">กรุณาเลือก</option> <? $strSQL = "SELECT * FROM campus ORDER BY campus_id ASC "; mysql_query("SET NAME UTF8"); $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); while($objResult = mysql_fetch_array($objQuery)) { ?> <option value="<?=$objResult["campus_id"];?>"> <?=$objResult["campus_name"];?> </option> <? } ?> </select></td> </tr> <tr> <td>คณะ </td> <td><select id="Lfaculty" name="Lfaculty" style="width:120px" onChange="Listbranch(this.value)"> <option selected value="0">กรุณาเลือก</option> </select></td> </tr> </table> <br> <p> </p> <? if(isset($a)) { $sql_show ="select * from branch where branch.faculty_id=$a"; mysql_query("SET NAMES UTF8"); $result_show =mysql_query($sql_show) or die (mysql_error()); $row= mysql_num_rows($result_show); if($row==0) { echo "<font color = red>ไม่พบข้อมูล</font>"; } else { ?> <table width="427" border="1" align="center"> <tr> <td width="41" align="center">ลำดับ</td> <td width="299" align="center">สาขา</td> <td colspan="2" align="center"><a href="add_branch_.php">เพิ่ม</a></td> </tr> <? while ($row_show=mysql_fetch_array($result_show)) { ?> <tr> <td align="center"><?=$row_show['branch_id'];?></td> <td align="left"><?=$row_show['branch_name'];?></td> <td width="29" align="center"><a href="view_branch_.php?branch_id=<?=$row_show['branch_id'];?>&branch_name=<? echo $branch_name?>" onclick="return chkdel();"> ลบ</a></td> <td width="30" align="center"><a href=" edit_branch.php?branch_id=<?=$row_show['branch_id'];?>">แก้ไข</a></td> </tr> <? $i++;} ?> <? } } ?> </table> </form> <? if($id!=""){ $sql_del ="delete from branch where branch_id=$id"; $result_del =mysql_query($sql_del)or die(mysql_error()); $branch_id = ""; if($result_del) { echo"<script language=\"javaScript\">"; echo "alert('ข้อมูลถูกลบเรียบร้อบแล้ว !!!');"; echo "</script>"; echo"<meta http-equiv='refresh' content='0; url=view_branch_.php?a'>"; } } ?> </body> </html>
<? $a=$_GET['a']; ?> <html> <head> <script type="text/javascript" language="javascript"> <!-- function goToPage(page) { window.location = page; } //--> </script> </head> <body> <form name="form1"> <select name="list1" id="list1" onChange="javascript:goToPage(options[selectedIndex].value)"> <option value="http://localhost/test.php?a=Develop PHP">Develop PHP</option> <option value="http://localhost/test.php?a=Web Intersect">Web Intersect</option> <option value="http://localhost/test.php?a=Flash Building">Flash Building</option> <option value="http://localhost/test.php?a=Adam Khoury">Adam Khoury</option> </select> </form>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง