<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>MU-EXQD</title> <style> A{text-decoration:none} </style> <script type="text/javascript" src="js/jquery-2.0.2.min.js"></script> </head> <body > <? include 'connect_test.php' ;?> <script language="javascript"> $(document).ready(function () { showHideOption(); $("[name=subcatalog]").change(function () { showHideOption(); }); }); function showHideOption() { var option_type = $("[name=subcatalog]").val(); if (option_type == "all") { $("#option").fadeIn(); $("[name=type]").attr("disabled", false); } else { $("#option").fadeOut(); $("[name=type]").attr("disabled", true); } } </script> <table width="1024" cellpadding="1" cellspacing="1" align="center"> <tr > <td align="center" ><img src="image/MU-EXQD.jpg" /></td> </tr> <tr><td> <a href="upload.php"><input type="button" name="show" value="Upload เอกสาร"/></a> </td></tr> <tr><td> <form name="from1" enctype="multipart/form-data" method="post" action="<?php $PHP_SELF;?>"> <center> <table align="center"> <tr><td> องค์ประกอบ :</td><td> <select name="catalog" id="catalog" onChange="location.href='show.php?list_id='+this.value;" style="width:300px"> <option value="all">ทั้งหมด</option> <? $sql="select * from tbllist order by list_id ASC"; $dbquery=mysql_query($sql); while($result=mysql_fetch_array($dbquery)){ if($list_id == $result[list_id]){ //เพื่อให้ แสดง $cat_id ที่ส่งค่ามาให้ ?> <option value="<?=$result[list_id];?>" selected="selected"><?=$result[list_name];?></option> <? }else{?> <option value="<?=$result[list_id];?>"><?=$result[list_name];?></option> <? } } ?> </select> </td></tr> <br /><br /> <tr><td> ตัวชี้วัด : </td><td> <select name="subcatalog" id="subcatalog" style="width:400px" > <option value="all">ทั้งหมด</option> <? if($list_id != ""){ //กรณีที่ มี่คา cat_id ส่งมาให้ทำงาน $sql_sub="select * from tblsublist where sub_ref = '$list_id' "; $dbquery_sub = mysql_query($sql_sub); while($result_sub=mysql_fetch_array($dbquery_sub)){ ?> <option value="<?=$result_sub[sub_id];?>"><?=$result_sub[sub_name];?></option> <? }} ?> </select> </td></tr> <br /><br /> <tr> <td> </td><td> <div id="option"> <select name="type" > <option value="M">สกอ.</option> <option value="O">สมศ.</option> </select> </div> </td></tr> <tr><td> <input type="hidden" name="check" /> </td><td><input type="submit" name"IL" value="ค้นหา" /> </form> </td></td> <br><br> </table> ---------------------------------------------------------------------------------------------------------------------------------------------<br> <font Color="#0000AA"><b>องค์ประกอบ / ตัวบ่งชี้</b></font><br> ---------------------------------------------------------------------------------------------------------------------------------------------<br><br> <? if($catalog != "all" and $subcatalog =="all" ) { //echo "1"; $rr = "%".$type.$list_id."_"; $sqltest = "select DISTINCT sub_id from tblfile where sub_id like '$rr' order by sub_id asc "; $test = mysql_query($sqltest); $bb = $list_id.".php"; include $bb; while ($row = mysql_fetch_row($test)) { $aa = $row[0].".php"; include $aa; } } elseif($catalog == "all" and $subcatalog == "all" and $type == "M" ) { //echo "2"; $sqltest = "select * from tbllist order by list_id asc"; $test = mysql_query($sqltest); while ($row = mysql_fetch_row($test)) { ?><br /><? $bb = $row[0].".php"; include $bb; $rr = "%".$type.$row[0]."_"; $sqltest2 = "select DISTINCT sub_id from tblsublist where sub_id like '$rr' order by sub_id asc"; $test2 = mysql_query($sqltest2); while ($row2 = mysql_fetch_row($test2)) { $aa = $row2[0].".php"; include $aa; } } } elseif($catalog == "all" and $subcatalog == "all" and $type == "O" ) { //echo "3"; $sqltest = "select * from tbllist order by list_id asc"; $test = mysql_query($sqltest); while ($row = mysql_fetch_row($test)) { ?><br /><? $bb = $row[0].".php"; include $bb; $rr = "%".$type.$row[0]."_"; $sqltest2 = "select DISTINCT sub_id from tblsublist where sub_id like '$rr' order by sub_id asc"; $test2 = mysql_query($sqltest2); while ($row2 = mysql_fetch_row($test2)) { $aa = $row2[0].".php"; include $aa; } } } elseif ($catalog != "" and $subcatalog != "") { //echo "4"; $sqltest = "select DISTINCT sub_id from tblsublist where sub_id = '$subcatalog' order by sub_id asc"; $test = mysql_query($sqltest); $bb = $list_id.".php"; include $bb; while ($row = mysql_fetch_row($test)) { $aa = $row[0].".php"; include $aa; } } else {echo "";} ?> </table> </td></td></table> </center> </body> </html>
$_GET['catalog']; $_GET['subcatalog']; $_GET['type'];
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง