$selected = array("ที่นี่","ที่โน่น"); while($row = mysql_fetch_assoc($mysql_result)){ if(!in_array($row['สถานประกอบการ'],$selected)) echo '<option value="'.$row['สถานประกอบการ'].'">'.$row['ชื่อสถานประกอบการ'].'</option>'; }
<select style="width:200px" name ="bus_id<?=$i;?>" id="bus_id"> <option value="0">เลือกสถานประกอบการ</option> <? include 'connect.php'; $sql = "select * from business where year(curdate()) = bus_year -543"; $selected = array("[bus_id]"); $res = mysql_query($sql); while($data=mysql_fetch_array($res)){ if(!in_array($row['bus_id'],$selected)) echo " <option value='$data[0]'>$data[1]</option>"; } ?> </select>
Quote:ถึง คุณ Unidentifier
<form id="form1" name="form1" method="post" action="admin_add_supervision.php"> <table width="99%" border="1" cellspacing="0" cellpadding="0"> <tr> <td width="22"> </td> <td width="774"><strong>จำนวนอาจารย์นิเทศก์ :</strong> <select name="value" onchange="MM_jumpMenu('parent',this,0)"> <? for($i=1;$i<=50;$i++){ if($_GET["Line"] == $i){ $sel = "selected"; } else{ $sel = ""; } ?> <option value="<?=$_SERVER["PHP_SELF"];?>?Line=<?=$i;?>" <?=$sel;?>> <?=$i;?> </option> <? } ?> </select> <strong> ท่าน / สถานประกอบการ</strong></td> </tr> <tr> <td colspan="2" align="center" class="data1"><table width="80%" border="1" align="center" class="data1"> <tr bgcolor="#0D7AD5" class="data1"> <th class="data1"> <div align="center">สถานประกอบการ</div></th> <th class="data1"> <div align="center">อาจารย์นิเทศก์</div></th> <th class="data1">ปีการศึกษา</th> </tr> <? $line = $_GET["Line"]; if($line == 0){$line=1;} for($i=1;$i<=$line;$i++) { ?> <tr> <td align="center"><span class="style9"> <select style="width:200px" name ="bus_id<?=$i;?>" id="bus_id"> <option value="0">เลือกสถานประกอบการ</option> <? include 'connect.php'; $sql = "select * from business where year(curdate()) = bus_year -543"; $res = mysql_query($sql); while($data=mysql_fetch_array($res)){ echo " <option value='$data[0]'>$data[1]</option>"; } ?> </select> </span></td> <td align="center"><span class="style9"> <select style="width:150px" name ="sup_id<?=$i;?>" id="sup_id"> <option value="0">เลือกอาจารย์นิเทศก์</option> <? include 'connect.php'; $sql = "select * from suppervisor order by sup_name"; $res = mysql_query($sql); while($data=mysql_fetch_array($res)){ echo " <option value='$data[0]'>$data[1] $data[2] $data[3] </option>"; } ?> </select> </span></td> <td align="center"><input name="super_year<?=$i;?>" type="text" id="super_year" size="15" onKeypress='if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;1'/> <input type="hidden" name="type<?=$i;?>"/></td> </tr> <? } ?> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="right"><input type="submit" name="submit" value=" บันทึก " class="button" /> <input type="hidden" name="hdnLine" value="<?=$i;?>" /></td> <td> </td> </tr> </table> <p> </p></td> </tr> </table> </form>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง