Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > รบกวนพี่ๆช่วยแนะนำวิธีแสดงค่าของ List/Menu ทีครับผม



 

รบกวนพี่ๆช่วยแนะนำวิธีแสดงค่าของ List/Menu ทีครับผม

 



Topic : 073885



โพสกระทู้ ( 33 )
บทความ ( 0 )



สถานะออฟไลน์




List/Menu

ผมต้องการที่จะเลือกประเภทสินค้า แล้วให้แสดงเฉพาะชื่อสินค้าที่อยู่ในประเภท
เช่นเลือก Cpu ก็ให้แสดงเฉพาะชื่อ Cpu ต้องทำอย่างไรครับผม รบกวนช่วยแนะนำทีครับผม

Code (PHP)
<?
session_start();
if ($sess_adminid<>session_id()) { 
	header( "Location: admin_index.php"); exit(); 
}
include "connect.php";
$sql="select * from seller order by Sel_id desc";
mysql_query("SET NAMES utf8");
$result=mysql_db_query($dbname,$sql);
$number=mysql_num_rows($result);
$no=1;
?>
<!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> Smile-IT สำหรับผู้ดูแลระบบ</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-image: url();
	background-repeat: no-repeat;
}
.style3 {color: #FFFFFF}
a:link {
	color: #0000FF;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #0000FF;
}
a:hover {
	text-decoration: none;
}
a:active {
	text-decoration: none;
}
.style4 {color: #FF0000}
-->
</style>
<script src="../Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script language="javascript">
        
        function check(){
          if(document.form1.protype.value=="0"){
            alert("กรุณาเลือกประเภทสินค้าด้วยครับ");
            document.form1.protype.focus();
            return false;
          }
        
          else if(document.form1.orders_proid.value=="0"){
          alert("กรุณาเลือกชนิดสินค้า");
          document.form1.orders_proid.focus();
         
          return false;
          }
          
         else if(document.form1.seller.value=="0"){
         alert("กรุณาเลือกชื่อตัวแทนจำหน่่าย");
         document.form1.seller.focus();
         return false;
         }
          
         else if(document.form1.number.value==""){
         alert("กรุณากรอกจำนวนสินค้า");
           document.form1.number.focus();
         return false;
         }
        
         
        return true;
        }
		
		function checkNum(){
                if (event.keyCode < 48 || event.keyCode > 57){
                      event.returnValue = false;
                    }
            }
        
</script>
</head>

<body>
<form id="form1" name="form1" method="post" action="admin_orders_stock_save.php" onSubmit="return check()">
  <div align="center">
    <table width="1217" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td height="235" colspan="4" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="312" height="234" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
              <!--DWLayoutTable-->
              <tr>
                <td height="234" colspan="2" valign="top"><img src="image/logo_zz.jpg" width="347" height="234" /></td>
                  </tr>
              <tr>
                <td width="315" height="1"></td>
                    <td width="315"></td>
                  </tr>
              </table></td>
              <td width="769" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                <!--DWLayoutTable-->
                <tr>
                  <td width="773" height="235" valign="top"><img src="image/bgweb2.jpg" width="903" height="234" /></td>
                  </tr>
              </table></td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td height="30" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="311" height="30" valign="top" bgcolor="#000000"><!--DWLayoutEmptyCell-->&nbsp;
           
            </td>
            </tr>
        </table></td>
        <td colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="10" height="30" valign="middle" bgcolor="#000000"> <div align="right" class="style3">
              <td width="830" height="30" valign="middle" bgcolor="#000000"> <div align="right" class="style3">
              <div align="center"></div>
            </div></td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td width="250" height="37">&nbsp;</td>
        <td colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="770" height="37" align="center" valign="middle"><div align="center">             </td>
          </tr>     
        </table></td>
        <td width="197" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="197" height="198" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
            </tr>
        </table></td>
      </tr>
      
      <tr>
        <td height="161">&nbsp;</td>
        <td colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="790" height="160" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
              <!--DWLayoutTable-->
              <tr>
                <td width="790" height="160" valign="top"><label></label>
                  <div align="center">
                    <table width="500" border="0">
                      <tr>
                        <td>&nbsp;</td>
                        <td>สั่งซื้อสินค้าจากตัวแทนจำหน่าย</td>
                      </tr>
                      <tr>
                        <td width="181"><div align="right">ประเภทสินค้า : </div></td>
                        <td width="309"><div align="left"><label>  <label><select name="protype" id="protype"></div>
  

   <option value="0"selected="selected">กรุณาเลือก</option>
   
   <?
$sql1="select * from type";                                   //การเลือกชนิดข้อมูล
mysql_query("SET NAMES tis620");
$result1=mysql_db_query($dbname,$sql1);                   //นำคำสั่ง sql ไปประมวลผล
while($row1=mysql_fetch_array($result1)){                //นำข้อมูลแต่ละแถวเก็บที่ row
?>
  <option value="<?=$row1[Type_id]?>" ><?=$row1[Type_name]?>
</option>             
<?            
}
?>
</label></td>
           </tr>
            <td width="181"><div align="right">รุ่นสินค้า : </div></td>
            <td width="309"><div align="left"><label>  <label><select name="orders_proid" id="product"></div>
  <option value="0" selected="selected">กรุณาเลือก</option>
  <?
  $sql2="select * from products";                                   //การเลือกชนิดข้อมูล
  mysql_query("SET NAMES tis620");
$result2=mysql_db_query($dbname,$sql2);                   //นำคำสั่ง sql ไปประมวลผล
while($row2=mysql_fetch_array($result2)){                //นำข้อมูลแต่ละแถวเก็บที่ row
?>
  <option value="<?=$row2[Pro_id]?>" ><?=$row2[Proname]?>
</option>             
<?            
}
?>
</label></td>
        </tr>
        <tr>
        <td width="181"><div align="right"> ตัวแทนจำหน่าย : </div></td>
        <td width="309"><div align="left"><label>  <label><select name="seller" id="seller"></div>
  <option value="0"selected="selected" >กรุณาเลือก</option>
  <?
  $sql3="select * from seller";                                   //การเลือกชนิดข้อมูล
  mysql_query("SET NAMES tis620");
$result3=mysql_db_query($dbname,$sql3);                   //นำคำสั่ง sql ไปประมวลผล
while($row3=mysql_fetch_array($result3)){                //นำข้อมูลแต่ละแถวเก็บที่ row
?>
  <option value="<?=$row3[Sel_id]?>" ><?=$row3[sellername]?>
</option>             
<?            
}
?>
</label></td>
                      </tr>
                      <tr>
                        <td><div align="right">จำนวนสินค้า :</div></td>
                        <td><label>
                          <div align="left">
                            <input type="text" name="number" id="number"onKeyPress="checkNum()" />
                            </div>
                        </label></td>
                      </tr>
                      <tr>
                        <td><div align="right">บันทึกข้อความ :</div></td>
                        <td><label>
                          <div align="left">
                            <textarea name="textarea" id="textarea" cols="45" rows="3"></textarea>
                            </div>
                        </label></td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td><label>
                          <input type="submit" name="button" id="button" value="ยืนยัน" />
                          <input type="reset" name="button2" id="button2" value="ยกเลิก" />
                        </label></td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                      </tr>
                    </table>
                  </div></td>
                </tr>
            </table></td>
          </tr>
          
        </table></td>
      </tr>
      <tr>
        <td height="337" colspan="4" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="1217" height="337" align="center" valign="top">&nbsp;</td>
            </tr>
          
          
        </table></td>
      </tr>
      <tr>
        <td height="47" colspan="4" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="1217" height="47" align="center" valign="top"><img src="image/logolow.jpg" width="934" height="47" /></td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td height="825">&nbsp;</td>
        <td width="127">&nbsp;</td>
        <td width="643">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
  </div>
</form>
</body>
</html>




Tag : PHP, MySQL, Action Script









ประวัติการแก้ไข
2012-02-17 13:51:02
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-02-15 15:23:14 By : kakeruna View : 1010 Reply : 5
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

จัดตามนี้ครับ นั่งเกะ แก้ไขดัดแปลงไม่ยากครับ



Go to : สร้าง Dependent ListMenu เลือกข้อมูลหลักและข้อมูลย่อยเปลี่ยนตามหัวข้อหลัก






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-15 15:40:21 By : webmaster
 


 

No. 2



โพสกระทู้ ( 33 )
บทความ ( 0 )



สถานะออฟไลน์


จะลองดูครับผม
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-15 16:53:15 By : kakeruna
 

 

No. 3



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

หรืออีกวิธีทำเป็น Jump Menu ครับ คือส่งค่า $_GET ไปครับ วิธ๊นี้ง่าย แต่ข้อเสียคือจะต้อง Refresh หน้า Webpage ครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-15 17:09:06 By : webmaster
 


 

No. 4



โพสกระทู้ ( 33 )
บทความ ( 0 )



สถานะออฟไลน์


ขอบคุณครับผม
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-16 10:24:29 By : kakeruna
 


 

No. 5



โพสกระทู้ ( 33 )
บทความ ( 0 )



สถานะออฟไลน์


รบกวนถามต่อ ถ้าต้องการจะ Join ตาราง โดยแสดงค่าจากตาราง order_stock ที่เก็บค่า Primary ของตารางอื่นไว้
จะต้อง Join แบบนี้หรือเปล่าครับ

select * from order_stock.o, type.t, product.p, seller.s
where o.orders_type=t.type_id and
o.orders_pro=p.pro_id and
o.orders_seller = s.sell_id ;

แบบนี้ถูกหรือเปล่าครับผม พอดีว่าลองทำแล้วมีปัญหาครับผม รบกวนด้วยนะครับผม
select
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-17 13:48:34 By : kakeruna
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : รบกวนพี่ๆช่วยแนะนำวิธีแสดงค่าของ List/Menu ทีครับผม
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 03
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่