Welcome To My Webboard

เพื่อแลกเปลี่ยนความรู้, ถาม-ตอบปัญหาคาใจ, แนะนำ, ประกาศ, หรือทุกสิ่งตามต้องการ

[ หน้าหลักเว็บบอร์ด | ตั้งกระทู้ใหม่ | สมัครสมาชิก ]

สอบถามเรื่องการใช้checkboxครับ




:: วัน / เวลาตั้งกระทู้ ::
26/07/2559 - 17:35:29 น.

ผมต้องการให้สามารถติ๊กcheckboxเลือกข้อมูลก่อนกดsearch

แล้วพอกดsearchก็แสดงข้อมูลออกมาเป็นtable

<html>
<head>
<title>SEARCH PART</title>
<script type="text/javascript">
<!--
function showMe (it, box) {
var vis = (box.checked) ? "block" : "none";
document.getElementById(it).style.display = vis;
}
//-->
</script>


</head>
<body>
<form name = "search" method = "GET" action = "<?php echo $_SERVER['SCRIPT_NAME'];?>" onSubmit="return check(this)">
    <table width = "800" border = "0" align = "center">PART NO.
      <input name = "txtKeyword" type = "text" id = "txtKeyword" value = "<?php echo $_GET["txtKeyword"];?>">
  
<input type="submit" name="onclick" id="onclick" onClick="function showMe (it, box)" value="Search">
<br><br>
<input type="checkbox" name="modtype" value="value1" onClick="showMe('div1', this)" />Equipment
<input type="checkbox" name="modtype" value="value2" onClick="showMe('div2', this)" />Laptop
<input type="checkbox" name="modtype" value="value3" onClick="showMe('div3', this)" />Desktop
<input type="checkbox" name="modtype" value="value4" onClick="showMe('div4', this)" />Software
 </table>
 </form>
 <form action = "updaterecord.php?partno=<?php echo $_GET["txtKeyword"];?>" name = "frmEdit" method = "POST" >
<?php
if($_GET["txtKeyword"] != "")
 {
 $objConnect = mysql_connect("localhost","root","123456") or die("Error Connect to Database");
 $objDB = mysql_select_db("stock");
 //Search By part no.
 $strSQL = "SELECT * FROM tbl_part WHERE partno = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_part WHERE model = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_part WHERE type = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_part WHERE description = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_part WHERE sn = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_part WHERE po = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_part WHERE companame = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_part WHERE bin = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_part WHERE plant = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_part WHERE warranty = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_part WHERE status = '".$_GET["txtKeyword"]."' ";
 $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
  <p>&nbsp;</p>
 <div id = "div1">
 <table width = "1260" border = "1">
 <tr>
   <th width = "20" align = "center"> ID </th>
   <th width = "120" align = "center"> Part No. </th>
   <th width = "100" align = "center"> Model </th>
   <th width = "80" align = "center"> Type </th>
   <th width = "180" align = "center"> Description </th>
   <th width = "100" align = "center"> Serial No. </th>
   <th width = "100" align = "center"> PO No. </th>
   <th width = "100" align = "center"> Supplier </th>
   <th width = "100" align = "center"> Store bin </th>
   <th width = "80" align = "center"> Plant </th>
         <th width = "100" align = "center"> Warrant </th>
   <th width = "100" align = "center"> Status </th>
  </tr> 
<?php
 while($objResult = mysql_fetch_array($objQuery))
 {
?>
  <tr>
   <td align = "center"><?php echo $objResult["id"];?></td>
   <td align = "center"><input type = "text" name = "txtpartno" size = "15" value = "<?php echo $objResult["partno"];?>"></td>
   <td align = "center"><input type = "text" name = "txtmodel" size = "10" value = "<?php echo $objResult["model"];?>"></td>
   <td align = "center"><input type = "text" name = "txttype" size = "10" value = "<?php echo $objResult["type"];?>"></td>
   <td align = "center"><input type = "text" name = "txtdescription" size = "25" value = "<?php echo $objResult["description"];?>"></td>
   <td align = "center"><input type = "text" name = "txtsn" size = "10" value = "<?php echo $objResult["sn"];?>"></td>
   <td align = "center"><input type = "text" name = "txtpo" size = "10" value = "<?php echo $objResult["po"];?>"></td>
   <td align = "center"><input type = "text" name = "txtcompaname" size = "10" value = "<?php echo $objResult["companame"];?>"></td>
   <td align = "center"><input type = "text" name = "txtbin" size = "10" value = "<?php echo $objResult["bin"];?>"></td>
   <td align = "center"><input type = "text" name = "txtplant" size = "10" value = "<?php echo $objResult["plant"];?>"></td>
   <td align = "center"><input type = "text" name = "txtwarranty" size = "10" value = "<?php echo $objResult["warranty"];?>"></td>
   <td align = "center"><input type = "text" name = "txtstatus" size = "10" value = "<?php echo $objResult["status"];?>"></td>
  </tr>
<?php
 }
?>
 </table>
 <input type = "submit" name = "submit" value = "submit">
 </div>
 
<?php
  }
  ?>
</form>
<form action = "updatelaptop.php?comname=<?php echo $_GET["txtKeyword"];?>" name = "frmEdit" method = "POST" >
<?php
if($_GET["txtKeyword"] != "")
 {
 $objConnect = mysql_connect("localhost","root","123456") or die("Error Connect to Database");
 $objDB = mysql_select_db("stock");
 //Search By part no.
 $strSQL = "SELECT * FROM tbl_laptop WHERE comname = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_laptop WHERE model = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_laptop WHERE tag = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_laptop WHERE site = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_laptop WHERE mouse = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_laptop WHERE adapter = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_laptop WHERE companame = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_laptop WHERE user = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_laptop WHERE position = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_laptop WHERE depart = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_laptop WHERE warranty = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_laptop WHERE status = '".$_GET["txtKeyword"]."' ";
 $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
  <p>&nbsp;</p>
 <div id = "div2">
 <table width = "1200" border = "1">
  <tr>
   <th width = "20" align = "left"> ID </th>
   <th width = "50" align = "left"> Computer Name </th>
   <th width = "50" align = "left"> Model </th>
   <th width = "50" align = "left"> Tag </th>
   <th width = "30" align = "left"> Site </th>
   <th width = "50" align = "left"> Mosuse </th>
   <th width = "50" align = "left"> Adapter </th>
   <th width = "50" align = "left"> Supplier </th>
   <th width = "30" align = "left"> User </th>
   <th width = "50" align = "left"> Position </th>
   <th width = "50" align = "left"> Department </th>
   <th width = "50" align = "left"> Warranty </th>
   <th width = "50" align = "left"> Status </th>
  </tr> 
<?php
 while($objResult = mysql_fetch_array($objQuery))
 {
?>
  <tr>
   <td align = "center"><?php echo $objResult["id"];?></td>
   <td align = "center"><input type = "text" name = "txtcomname" size = "10" value = "<?php echo $objResult["comname"];?>"></td>
   <td align = "center"><input type = "text" name = "txtmodel" size = "10" value = "<?php echo $objResult["model"];?>"></td>
   <td align = "center"><input type = "text" name = "txttag" size = "10" value = "<?php echo $objResult["tag"];?>"></td>
   <td align = "center"><input type = "text" name = "txtsite" size = "10" value = "<?php echo $objResult["site"];?>"></td>
   <td align = "center"><input type = "text" name = "txtmouse" size = "10" value = "<?php echo $objResult["mouse"];?>"></td>
   <td align = "center"><input type = "text" name = "txtadapter" size = "10" value = "<?php echo $objResult["adapter"];?>"></td>
   <td align = "center"><input type = "text" name = "txtcompaname" size = "10" value = "<?php echo $objResult["companame"];?>"></td>
   <td align = "center"><input type = "text" name = "txtuser" size = "10" value = "<?php echo $objResult["user"];?>"></td>
   <td align = "center"><input type = "text" name = "txtposition" size = "10" value = "<?php echo $objResult["position"];?>"></td>
   <td align = "center"><input type = "text" name = "txtdepart" size = "10" value = "<?php echo $objResult["depart"];?>"></td>
   <td align = "center"><input type = "text" name = "txtwarranty" size = "10" value = "<?php echo $objResult["warranty"];?>"></td>
   <td align = "center"><input type = "text" name = "txtstatus" size = "10" value = "<?php echo $objResult["status"];?>"></td>
  </tr>
<?php
 }
?>
 </table>
 <input type = "submit" name = "submit" value = "submit">
   </div>
 
<?php
}
?>
</form>
<form action = "updatedesktop.php?desktop=<?php echo $_GET["txtKeyword"];?>" name = "frmEdit" method = "POST" >
<?php
if($_GET["txtKeyword"] != "")
 {
 $objConnect = mysql_connect("localhost","root","123456") or die("Error Connect to Database");
 $objDB = mysql_select_db("stock");
 //Search By part no.
 $strSQL = "SELECT * FROM tbl_desktop WHERE desktop = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_desktop WHERE model = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_desktop WHERE tag = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_desktop WHERE display = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_desktop WHERE site = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_desktop WHERE mouse = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_desktop WHERE keyboard = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_desktop WHERE companame = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_desktop WHERE user = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_desktop WHERE position = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_desktop WHERE depart = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_desktop WHERE warranty = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_desktop WHERE status = '".$_GET["txtKeyword"]."' ";
 $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
  <p>&nbsp;</p>
 <div id = "div3">
 <table width = "1200" border = "1">
  <tr>
   <th width = "20" align = "left"> ID </th>
   <th width = "50" align = "left"> Computer Name </th>
   <th width = "50" align = "left"> Model </th>
   <th width = "50" align = "left"> Tag </th>
   <th width = "50" align = "left"> Monitor </th>
   <th width = "50" align = "left"> Site </th>
   <th width = "50" align = "left"> Mouse </th>
   <th width = "50" align = "left"> Keyboard </th>
   <th width = "50" align = "left"> Supplier </th>
   <th width = "50" align = "left"> User </th>
   <th width = "50" align = "left"> Position </th>
   <th width = "50" align = "left"> Department </th>
   <th width = "50" align = "left"> Warranty </th>
   <th width = "50" align = "left"> Status </th>
  </tr>
<?php
 while($objResult = mysql_fetch_array($objQuery))
 {
?>
  <tr>
   <td align = "center"><?php echo $objResult["id"];?></td>
   <td align = "center"><input type = "text" name = "txtdesktop" size = "10" value = "<?php echo $objResult["desktop"];?>"></td>
   <td align = "center"><input type = "text" name = "txtmodel" size = "10" value = "<?php echo $objResult["model"];?>"></td>
   <td align = "center"><input type = "text" name = "txttag" size = "10" value = "<?php echo $objResult["tag"];?>"></td>
   <td align = "center"><input type = "text" name = "txtdisplay" size = "10" value = "<?php echo $objResult["display"];?>"></td>
   <td align = "center"><input type = "text" name = "txtsite" size = "10" value = "<?php echo $objResult["site"];?>"></td>
   <td align = "center"><input type = "text" name = "txtmouse" size = "10" value = "<?php echo $objResult["mouse"];?>"></td>
   <td align = "center"><input type = "text" name = "txtkeyboard" size = "10" value = "<?php echo $objResult["keyboard"];?>"></td>
   <td align = "center"><input type = "text" name = "txtcompaname" size = "10" value = "<?php echo $objResult["companame"];?>"></td>
   <td align = "center"><input type = "text" name = "txtuser" size = "10" value = "<?php echo $objResult["user"];?>"></td>
   <td align = "center"><input type = "text" name = "txtposition" size = "10" value = "<?php echo $objResult["position"];?>"></td>
   <td align = "center"><input type = "text" name = "txtdepart" size = "10" value = "<?php echo $objResult["depart"];?>"></td>
   <td align = "center"><input type = "text" name = "txtwarranty" size = "10" value = "<?php echo $objResult["warranty"];?>"></td>
   <td align = "center"><input type = "text" name = "txtstatus" size = "10" value = "<?php echo $objResult["status"];?>"></td>
  </tr>
<?php
 }
?>
 </table>
 <input type = "submit" name = "submit" value = "submit">
 </div>
 
<?php
  }
  ?>
</form>
<form action = "updatesoftware.php?softname=<?php echo $_GET["txtKeyword"];?>" name = "frmEdit" method = "POST" >
<?php
if($_GET["txtKeyword"] != "")
 {
 $objConnect = mysql_connect("localhost","root","123456") or die("Error Connect to Database");
 $objDB = mysql_select_db("stock");
 //Search By part no.
 $strSQL = "SELECT * FROM tbl_software WHERE softname = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_software WHERE contactno = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_software WHERE productno = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_software WHERE sn = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_software WHERE description = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_software WHERE location = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_software WHERE companame = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_software WHERE warranty = '".$_GET["txtKeyword"]."' ";
 //$strSQL = "SELECT * FROM tbl_software WHERE status = '".$_GET["txtKeyword"]."' ";
 $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
  <p>&nbsp;</p>
 <div id = "div4">
 <table width = "1200" border = "1">
  <tr>
   <th width = "20" align = "left"> ID </th>
   <th width = "20" align = "left"> Software Name </th>
   <th width = "50" align = "left"> Contact No. </th>
   <th width = "50" align = "left"> Product No. </th>
   <th width = "50" align = "left"> Serial No. </th>
   <th width = "50" align = "left"> Description </th>
   <th width = "50" align = "left"> Location </th>
   <th width = "50" align = "left"> Supplier </th>
   <th width = "50" align = "left"> Warranty </th>
   <th width = "50" align = "left"> Status </th>
  </tr>
<?php
 while($objResult = mysql_fetch_array($objQuery))
 {
?>
  <tr>
   <td align = "center"><?php echo $objResult["id"];?></td>
   <td align = "center"><input type = "text" name = "txtsoftname" size = "10" value = "<?php echo $objResult["softname"];?>"></td>
   <td align = "center"><input type = "text" name = "txtcontactno" size = "10" value = "<?php echo $objResult["contactno"];?>"></td>
   <td align = "center"><input type = "text" name = "txtproductno" size = "10" value = "<?php echo $objResult["productno"];?>"></td>
   <td align = "center"><input type = "text" name = "txtsn" size = "10" value = "<?php echo $objResult["sn"];?>"></td>
   <td align = "center"><input type = "text" name = "txtdescription" size = "10" value = "<?php echo $objResult["description"];?>"></td>
   <td align = "center"><input type = "text" name = "txtlocation" size = "10" value = "<?php echo $objResult["location"];?>"></td>
   <td align = "center"><input type = "text" name = "txtcompaname" size = "10" value = "<?php echo $objResult["companame"];?>"></td>
   <td align = "center"><input type = "text" name = "txtwarranty" size = "10" value = "<?php echo $objResult["warranty"];?>"></td>
   <td align = "center"><input type = "text" name = "txtstatus" size = "10" value = "<?php echo $objResult["status"];?>"></td>
  </tr>
<?php
 }
?>
 </table>
 <input type = "submit" name = "submit" value = "submit">
 </div>
<?php
  }
  ?>
</form>
</body>
</html>

</body>
</html>






<< มีทั้งหมด 1 ความคิดเห็น >>

[1]



zhengjx



:: วัน / เวลาตั้งกระทู้ ::
14/04/2560 - 12:48:14 น.

zhengjx 20170414

nike huarache

longchamp handbags

pandora charms

adidas tubular shadow

chrome hearts online

atlanta falcons jersey

cheap jordans

kobe bryant shoes

nmd

air force 1

longchamp bags

nike air max 2017

yeezy boost 350

true religion outlet

pandora jewelry

michael kors outlet

kobe 11

hermes belt

nike air max

adidas superstar

yeezy shoes

longchamp outlet

lacoste outlet

jordan shoes

hermes belt

links of london outlet store

michael kors outlet

nike mercurial

fitflops clearance

lebron 13

kyrie irving shoes

adidas neo

huaraches shoes

adidas ultra

lebron james shoes

yeezy boost 350

tory burch shoes

nike zoom running shoe

jordans for cheap

adidas superstar shoes

nike air force 1

retro jordans

ultra boost

louboutin shoes

longchamp bags

tory burch shoes

lebron 14

yeezy boost

brady jersey

air max thea

nike huarache

yeezy boost

adidas ultra boost

nike air huarache

yeezy boost

nike roshe uk

kobe basketball shoes

adidas online shop

michael jordan shoes

basketball shoes

michael kors

yeezy boost

kobe basketball shoes

air jordans

adidas stan smith

air jordan

yeezys

adidas nmd

michael kors outlet online

cheap jordans

cheap jordans

kyrie 3

yeezy boost 350

roshe shoes

adidas stan smith sneakers

nike dunks shoes

reebok shoes

cheap jordans

new england patriots jersey

light up shoes

chrome hearts online

nike air max

michael kors outlet

nike zoom

kobe 9

nike roshe run

adidas nmd

fitflops

longchamps

lebron 14 shoes

michael kors outlet online

longchamp bags

timberland boots

nike air zoom

adidas superstar shoes

nike air force 1

fitflops

retro jordans

adidas nmd

adidas ultra boost uncaged

roshe run

http://www.kobeshoes.uk

yeezy boost

yeezy shoes

yeezy sneakers

james harden shoes

lacoste outlet

reebok outlet

adidas ultra boost

nike huaraches

nike air force

led shoes

yeezy boost 350

nike huarache

longchamp

links of london

tory burch outlet

michael kors outlet

kyrie 3 shoes

air yeezy

nmd

yeezy boost 350

timberland shoes

adidas nmd

longchamp sale

michael kors outlet store

authentic jordans

nike dunks

lacoste outlet

yeezy boost

michael jordan shoes

louboutin shoes uk

michael kors handbags

air max

kobe shoes

longchamp bags

kobe sneakers

michael kors outlet

kyrie shoes

true religion

Kanye West shoes

adidas yeezy boost

michael kors handbags

air max 2016

adidas tubular

nike football boots

nike air max thea

yeezy boost 350 v2

huarache shoes

michael kors factory outlet

air jordan

chrome hearts

michael kors outlet store

chrome hearts online

adidas nmd runner

nike polo shirts

longchamp handbags

adidas neo

yeezy boost 350

longchamp outlet

nike roshe run

pandora charms

air jordan shoes

yeezy boost 350

harden shoes

pandora jewelry

polo lacoste

true religion jeans

cheap jordans

michael kors outlet

<






<< เพิ่มความคิดเห็น >>
* ข้อความ :   
* โดย :   
* อีเมล์ :   
เบอร์โทรศัพท์ :   
ไฟล์ประกอบ :   
รูปภาพประกอบ :   
Security Code :   
Audio Version
Reload Image
* กรอก Security Code :   
<< ตั้งรหัสผ่านสำหรับ แก้ไข/ลบ ความคิดเห็นของคุณ >>

:: โปรดกรอกรหัสผ่านที่ต้องการใช้ ในการแก้ไข/ลบ ความคิดเห็นที่ท่านได้โพสไว้ ::


[ ไม่เกิน 20 ตัวอักษร ]