<script type="text/javascript"> function tr_hide(name){ var id_btn=$("#"+name+"").val(); if(id_btn=="hide"){ $("."+name+"").hide(); $("#"+name+"").val("show") }else{ $("."+name+"").show(); $("#"+name+"").val("hide") } } </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <td bgcolor="#00CCFF"> <h2 class='art-postheader'><span class='art-postheadericon'>ระบบวินิจฉัยโรคจากอาการเบื้องต้น </span></h2> <br/> <font size="5px">เลือกประเภทของสัตว์เลี้ยง: <? $result = mysql_query("SELECT * FROM pet_type") or die(mysql_error()); while(list($pet_typeid,$pet_typename)=mysql_fetch_row($result))//วนลูปให้มัน { echo "<input type='radio' id='rdo' value='$pet_typeid' name='pet_typeid' >$pet_typename "; } ?></font> <br/><br/> <?php echo "<table class='table'>";//อะไรที่ไม่ซ้ำเอาไว้นอกลูป $body_pet_query = mysql_query("select * from body_pet"); while($body = mysql_fetch_array($body_pet_query)){ $id=$body['b_id']; echo "<tr><th colspan='3' align='center' bgcolor='#0099FF'> <font color='#FFFFFF' size='5'>$body[b_type_name]</font> <input type=\"button\" id=\"$id\" value=\"hide\" onclick=\" tr_hide('$id')\"/></th></tr>"; echo "<tr class=\"$id\"><th>ลำดับ</th><th>ลักษณะอาการ</th><th>เลือก</th></tr>"; $body_b_id = $body['b_id']; $manner_query = mysql_query("select * from manner where b_id=$body_b_id"); $row=1; while($manner = mysql_fetch_array($manner_query)){ echo "<tr class=\"$id\"><td>".$row."</td>"; echo "<td align='center'>$manner[manner_name]</td>"; echo "<th align=center><input type='checkbox' value='$manner[manner_id]' name='manner[]'></th>"; echo "</tr>"; $row++; } } echo "</table>"; ?>
<?php $body_pet_query = mysql_query("select * from body_pet"); while($body = mysql_fetch_array($body_pet_query)) { $id=$body['b_id']; $count=count($id); for($n=1;$n<=$count;$n++){ ?> <table class='table'> <tr><th colspan='3' align='center' bgcolor='#0099FF' style="cursor:pointer;" onclick="$('#tr_toggle<?=$n?>').toggle();"><font color='#FFFFFF' size='5'><? echo $body[b_type_name] ?></font> </th> <? $body_b_id = $body['b_id']; $manner_query = mysql_query("select * from manner where b_id=$body_b_id"); while($manner = mysql_fetch_array($manner_query)){ ?> <tr style="display:none;" id="tr_toggle<?=$n?>" align="center"><td><?=$n?></td> <td align='center' ><? echo $manner[manner_name]; ?></td> <th align="center"><input type='checkbox' value='<? echo $manner[manner_id]; ?>' name='manner[]'></th> </tr> <? } } } ?> </table> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
function tr_hide(name){ $('.' + className).toggle(); }
while($manner = mysql_fetch_array($manner_query)){ echo "<tr class=\"$id hideTr\"><td>".$row."</td>"; echo "<td align='center'>$manner[manner_name]</td>"; echo "<th align=center><input type='checkbox' value='$manner[manner_id]' name='manner[]'></th>"; echo "</tr>"; $row++; }
<script> $(document).ready(function(){ $(".btn1").click(function(){ $("tr").hide(); }); $(".btn2").click(function(){ $("tr").show(); }); }); </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <td bgcolor="#00CCFF"> <div align="left"> <h2 class='art-postheader'><span class='art-postheadericon'>ระบบวินิจฉัยโรคจากอาการเบื้องต้น </span></h2></div> <br/> <font size="5px">เลือกประเภทของสัตว์เลี้ยง: <form name="form1" id = "form1" action="index.php?modules=dianose&file=result2" method="post" onSubmit="JavaScript:return fncSubmit();"/> <? $result = mysql_query("SELECT * FROM pet_type") or die(mysql_error()); while(list($pet_typeid,$pet_typename)=mysql_fetch_row($result))//วนลูปให้มัน { echo "<input type='radio' id='rdo' value='$pet_typeid' name='pet_typeid' >$pet_typename "; } ?> </font> <br/><br/> <?php echo "<table class='table'>";//อะไรที่ไม่ซ้ำเอาไว้นอกลูป $body_pet_query = mysql_query("select * from body_pet"); while($body = mysql_fetch_array($body_pet_query)){ $id=$body['b_id']; ?> <tr><th colspan='3' align='center' bgcolor='#55cfee'><font color='#000000' size='5'><? echo $body[b_type_name] ?></font><div align='right' ><button class="btn1" type="button">Hide</button> <button class="btn2" type="button">Show</button></div></th></tr> <p> <tr><th>ลำดับ</th><th>ลักษณะอาการ</th><th>เลือก</th></tr></p> <? $body_b_id = $body['b_id']; $manner_query = mysql_query("select * from manner where b_id=$body_b_id"); $row=1; while($manner = mysql_fetch_array($manner_query)){ ?> <p><tr><td><? echo $row ?></td> <td align='center'><? echo $manner[manner_name] ?></td> <th align=center><input type='checkbox' value='<? $manner[manner_id] ?>' name='manner[]'></th> </tr></p> <? $row++; } } ?> </table>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง