<select name='categor' id='categor' onchange="data_show(this.value,'typename');"> <option value="">--- กรุณาเลือก ---</option> <? $rstTemp=mysql_query('select * from categor Order By cat_id ASC'); while($arr_2=mysql_fetch_array($rstTemp)){ ?> <option value="<?=$arr_2['cat_id']?>"><?=$arr_2['cat_number']?><?=$arr_2['cat_name']?></option> <? }?> </select> </div></td> </tr> <tr> <td width="47%" bgcolor="#FFFF99"><div align="right">หมายเลขชนิดครุภัณฑ์ :</div></td> <td width="53%" bgcolor="#FFFF99"><label> <div align="left"> <select name='typename' id='typename'> <option value="">--- กรุณาเลือก ---</option> </select> </label> </div></td> </tr> <tr> <td bgcolor="#FFFF99"><div align="right">ชื่อชนิดครุภัณฑ์ :</div></td> <td bgcolor="#FFFF99"><input type="text" name="textfield" id="textfield" /></td> </tr> <tr> <td bgcolor="#FFFF99"><div align="right"></div></td> <td bgcolor="#FFFF99"><label> <div align="left"> <input type="submit" name="save" id="save" value="จัดเก็บ" /> <input type="submit" name="cancel" id="cancel" value="ยกเลิก" /> </div> </label></td> </tr> </table> </div> <div align="center"></div><p align="left"> </p> </td> </tr> </table> </td> </tr> </form> <?php include ("footer.php") ; ?> </div> </body> </html> <script language="javascript"> // Start XmlHttp Object function uzXmlHttp(){ var xmlhttp = false; try{ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }catch(e){ try{ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }catch(e){ xmlhttp = false; } } if(!xmlhttp && document.createElement){ xmlhttp = new XMLHttpRequest(); } return xmlhttp; } // End XmlHttp Object function data_show(select_id,result){ var url = 'data.php?select_id='+select_id+'&result='+result; //alert(url); xmlhttp = uzXmlHttp(); xmlhttp.open("GET", url, false); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); // set Header xmlhttp.send(null); document.getElementById(result).innerHTML = xmlhttp.responseText; } //window.onLoad=data_show(5,'amphur'); </script>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620" /> <?php include("config.php"); ?> <?php if($result=='typename'){ ?> <?php $rstTemp=mysql_query("select * from typename Where cat_id ='".$select_id."' Order By cat_id ASC"); while($arr_2=mysql_fetch_array($rstTemp)){ ?> <option value="<?=$arr_2['tyn_id']?>"><?=$arr_2['tyn_number']?><?=$arr_2['tyn_name']?></option> <?php }?> <?php }?>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620" /> <?php include("config.php"); $typ_id=$_REQUEST["typ_id"]; $cat_number=$_REQUEST["cat_number"]; $typ_number=$_REQUEST["typ_number"]; $typ_name=$_REQUEST["typ_name"]; $sql="INSERT INTO type (typ_id,cat_number,typ_number,typ_name)"; $sql.="VALUES ('$typ_id','$cat_number','$typ_number','$typ_name')"; echo "<meta http-equiv=\"refresh\" content=\"1;URL=typ_nameshow.php\">"; mysql_query($sql,$conn) or die("ไม่สามารถเพิ่มข้อมูลลงสู่ตาราง type ได้".mysql_error()); //echo "การเพิ่มข้อมูลสมบูรณ์"; mysql_close($conn); echo "<meta http-equiv=\"refresh\" content=\"1;URL=typ_nameshow.php\">"; ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง