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 > PHP การขายสินค้า โดยเลือกจากประเภทสินค้าและโชว์รายการสินค้าในหน้าเดียวกันทำอย่างไรคะ พี่วินคะช่วยนูทีT_T



 

PHP การขายสินค้า โดยเลือกจากประเภทสินค้าและโชว์รายการสินค้าในหน้าเดียวกันทำอย่างไรคะ พี่วินคะช่วยนูทีT_T

 



Topic : 087629



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



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




ตัวอย่าง interface ที่ต้องการออกแบบ

จะต้องเขียนโค้ดยังไงอ่าคะ ให้มันโชว์ในหน้าเดียวกัน ทำมาหลายวัยเเร้วไม่ได้เรยอ่า



Tag : PHP, MySQL, HTML/CSS, Action Script









ประวัติการแก้ไข
2012-12-04 23:47:50
2012-12-04 23:49:05
2012-12-05 02:05:36
2012-12-06 21:12:09
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-12-04 23:46:19 By : MiNnY_LoVer View : 4730 Reply : 17
 

 

No. 1



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



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


ช่วยดูให้ทีได้มั้ยคะ คิดไม่ออกเเร้วอ่า ว่าควรทำไงดี






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-12-05 02:03:00 By : MiNnY_LoVer
 


 

No. 2



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



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



แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-12-05 11:33:20 By : MiNnY_LoVer
 

 

No. 3



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



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

เอิ่ม มันยังไงอะ ไม่เข้าใจ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-12-05 11:58:53 By : biggest59
 


 

No. 4



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

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

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


https://www.thaicreate.com/php/forum/071046.html
https://www.thaicreate.com/php/php-mysql-search-record.html
https://www.thaicreate.com/tutorial/ajax-search-record.html
https://www.thaicreate.com/php/forum/064296.html
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-12-05 12:10:57 By : sakuraei
 


 

No. 5



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



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


ตอบความคิดเห็นที่ : 3 เขียนโดย : biggest59 เมื่อวันที่ 2012-12-05 11:58:53
รายละเอียดของการตอบ ::
คือ หน้าการขายสินค้าอ่าคะ โดยเลือกจากประเภทสินค้า แล้วกดเพิ่มตรงรูปตะกร้าสินค้า
แร้วโชว์รายละเอียดสินค้าที่เลือกตรงด้านล่างอ่าคะ แร้วถ้าต้องการสินค้าอื่นอีก ก็จะทำเหมือนตอนแรกอ่า
ไม่รุ้จะเขียนยังไงดี

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-12-05 13:58:25 By : MiNnY_LoVer
 


 

No. 6



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



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


อันนี้อาศัยหลักการที่ไม่ได้ใช้ Ajax นะคับ แต่ถ้าต้องการใช้ก็สามารถใช้ได้นะคับ ตามนี้เลยคับผม.....
script dagabase:

Code (SQL)
-- phpMyAdmin SQL Dump
-- version 2.10.3
-- http://www.phpmyadmin.net
-- 
-- โฮสต์: localhost
-- เวลาในการสร้าง: 
-- รุ่นของเซิร์ฟเวอร์: 5.0.51
-- รุ่นของ PHP: 5.2.6

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

-- 
-- ฐานข้อมูล: `test1`
-- 

-- --------------------------------------------------------

-- 
-- โครงสร้างตาราง `product`
-- 

CREATE TABLE `product` (
  `id` int(11) NOT NULL auto_increment,
  `pId` varchar(10) collate utf8_unicode_ci NOT NULL,
  `pName` varchar(100) collate utf8_unicode_ci NOT NULL,
  `pType` varchar(100) collate utf8_unicode_ci NOT NULL,
  `pPrice` float NOT NULL,
  `pStock` int(11) NOT NULL,
  `status` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ;

-- 
-- dump ตาราง `product`
-- 

INSERT INTO `product` VALUES (1, 'P0001', 'adidas', 'football shoe', 12000.5, 2, 0);
INSERT INTO `product` VALUES (2, 'P0002', 'puma', 'football shoe', 2700.55, 5, 0);




ก่อนอื่น ต้องสร้าง DB ตามผมก่อนนะคับ เริ่มเลยนะคับ

ไฟล์ที่ 1 config.php
<?
$host="localhost";
$user_name="root";
$password="mysql";
$db="test1";
mysql_connect( $host,$user_name,$password) or die ("ติดต่อกับฐานข้อมูล Mysql ไม่ได้ ");
mysql_select_db($db) or die("เลือกฐานข้อมูลไม่ได้"); 
mysql_query("SET NAMES UTF8");
?>


ไฟล์ที่ 2 show_data.php
<!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>Untitled Document</title>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
.style3 {color: #000000}
-->
</style>
</head>

<body>
<? include("config.php");?>
<table width="100%" border="1">
  <tr bgcolor="#006699">
    <td><div align="center"><span class="style1">p_id</span></div></td>
    <td><div align="center"><span class="style1">p_name</span></div></td>
    <td><div align="center"><span class="style1">p_type</span></div></td>
    <td><div align="center"><span class="style1">p_price</span></div></td>
    <td><div align="center"><span class="style1">stock</span></div></td>
    <td><div align="center"><span class="style1">add</span></div></td>
  </tr>
  <?
  	$sql="select * from product order by pName";
	$query=mysql_query($sql);
	while($result=mysql_fetch_assoc($query)){
  ?>
  <tr>
    <td><?=$result['pId']?></td>
    <td><?=$result['pName']?></td>
    <td><?=$result['pType']?></td>
    <td><?=number_format($result['pPrice'],2,'.',',')?></td>
    <td><?=$result['pStock']?></td>
    <td align="center">
	<script>
		function CallAjax(PID){
			window.open("receive.php?PID="+PID,"MainIframe");
		}
	</script>
      <input type="button" name="btnAdd" value="เพิ่มรายการ" onclick="CallAjax('<?=$result['pId']?>');" style="cursor:pointer;" />    </td>
  </tr>
  <?
    	}
  ?>
</table>
<br />

<table width="100%" border="0">
  <tr>
    <td>  <IFRAME NAME="MainIframe" SRC="sale.php" WIDTH="100%" HEIGHT="100%" VSPACE=0 STYLE="" frameborder="0">
				   </IFRAME></td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>



ไฟล์ที่ 3 receive.php
<?
//echo ">>>>".$PID;
include("config.php");
$sqlUp="update product set status='1' where pid='$PID' ";
mysql_query($sqlUp);
echo  "<meta http-equiv=refresh content=0;URL=sale.php>";//สามารถใส่ parameter ส่งกลับได้
?>



ไฟล์ที่ 4 del.php
<?
//echo ">>>>".$PID;
include("config.php");
$sqlUp="update product set status='0' where pid='$PID' ";
mysql_query($sqlUp);
echo  "<meta http-equiv=refresh content=0;URL=sale.php>";//สามารถใส่ parameter ส่งกลับได้
?>


ไฟล์ที่ 5 sale.php
<!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>Untitled Document</title>
</head>

<body>
รายการขายสินค้า<br />
<table width="100%" border="1">
  <tr bgcolor="#FFCC99">
    <td><div align="center"><span class="style3">ชื่อสินค้า</span></div></td>
    <td><div align="center"><span class="style3">ราคา/หน่วย</span></div></td>
    <td><div align="center"><span class="style3">จำนวน</span></div></td>
    <td><div align="center"><span class="style3">ราคารวม</span></div></td>
    <td><div align="center"><span class="style3">ลบ</span></div></td>
  </tr>
  <?
  	include("config.php");
  	$sql="select * from product where status='1' order by pName";
	$query=mysql_query($sql);
	while($result=mysql_fetch_assoc($query)){
  ?>
  <tr>
    <td><div align="center">
      <?=$result['pName']?>
    </div></td>
    <td><div align="center">
      <?=number_format($result['pPrice'],2,'.',',')?>
    </div></td>
    <td><div align="center">
      <input name="txtCount" type="text" />
    </div></td>
    <td><div align="center">
     &nbsp;
    </div></td>
    <td align="center">
	  <div align="center">
	    <script>
		function del(PID){
			window.open("del.php?PID="+PID,"MainIframe");
		}
	  </script>
	    <input type="button" name="btnDel" value=" ลบ " onclick="del('<?=$result['pId']?>');" style="cursor:pointer;" />    
      </div></td>
  </tr>
  <? }?>
</table>
</body>
</html>


ผลลัพธ์

example
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-12-05 18:17:28 By : beerkingdom
 


 

No. 7



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



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


Code (PHP)
<?php
		session_start();
		require_once("config.php");
		require_once("check_off.php");
			if(!session_is_registered("Admin_user"))
				{
				require_once("header1_ad.php");
				header_html1("ผู้ดูแลระบบ");
			}
			else
		{
				require_once("header_ad.php");  //เรียกใช้หน้า header_ad.php
				header_html("ผู้ดูแลระบบ");
				
			}
	?>
<style type="text/css">
<!--
.style2 {	font-size: medium;
	text-align: center;
}
.style201 {color: #000000; font-size: medium; }
.style201 {font-size: medium;
}
.style201 {font-size: medium;
}
-->
</style>

<!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=windows-874" />
<style type="text/css">
<!--
.asasa {	font-size: medium;
}
.eeeeeeeee {font-size: large;
}
.eeeeeeeee {text-align: center;
}
.wetrtey {
	text-align: center;
}
.-0 {	font-size: 18px;
	font-weight: bold;
}
.style2 {	font-size: medium;
	text-align: center;
}
.style201 {color: #000000; font-size: medium; }
.style201 {font-size: medium;
}
.style201 {font-size: medium;
}
.่ {	font-size: 24px;
}
.่่ {	font-size: 24px;
}
.่่่่ {	font-size: 24px;
}
.style2011 .-0 .่่ {
	font-size: 18px;
}
.style2011 {
	font-size: 16px;
}
dgdfhfjgfgj {
	font-size: 16px;
}
-->
</style>
<form name="from" method="post" action="">
<table width="1200" height="131" border="1" align="center" cellpadding="1" cellspacing="1">
  <tr>
    <th width="15" rowspan="3" align="left" nowrap="nowrap" bgcolor="#6699CC">&nbsp;</th>
    <th height="15" colspan="2" align="center" nowrap="nowrap" bgcolor="#6699CC"><table border="0" align="right">
      <tr>
        <td align="center" valign="bottom" class="eeeeeeeee"><span style="color: #FFF"></span>
          <?
$thai_w=array("อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัสบดี","ศุกร์","เสาร์");
$thai_n=array("มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม");
$w=$thai_w[date("w")];
$d=date("d");
$n=$thai_n[date("n") -1];
$Y=date("Y") +543 ;
echo "วัน $w ที่ $d เดือน $n ปี พ.ศ. $Y "; 
?>
          &nbsp;</td>
      </tr>
    </table></th>
    <th width="15" rowspan="3" align="right" nowrap="nowrap" bgcolor="#6699CC">&nbsp;</th>
  </tr>
  <tr>
    <td width="200" height="61" align="center" valign="top" bgcolor="#EEEEEE"><?php
			require_once("manu.php");	//&#3648;&#3619;&#3637;&#3618;&#3585;&#3651;&#3594;&#3657;&#3627;&#3609;&#3657;&#3634;&#3648;&#3617;&#3609;&#3641;
		mn();
		?>
</td>
    <td width="951" align="center" bgcolor="#EEEEEE"><table border="0" align="center">
		 <td>ข้อมูลการขายสินค้า</td>
         <td colspan="7" rowspan="5"></td>
      </tr>
      <tr>
        <td>รหัสการขายสินค้า</td>
      </tr>
      <tr>
        <td><?php
				$host = "localhost";
	$user = "root";
	$passwd = "mintra";
	$dbname = "kt";
	$conn = mysql_connect($host,$user,$passwd) or die ("Could not connect to DBMSserver");
	mysql_select_db($dbname,$conn);
				// แสดงรหัสสินค้า
				$sql_id = "SELECT *  FROM cash WHERE 'Cash_id' LIKE '%C%' ORDER BY `Cash_id` DESC " ;
				mysql_query("set NAMES tis620");
				$result_id=mysql_query($sql_id);
				$rs_id = mysql_fetch_array($result_id);
								$max_pro1 =  $rs_id[Cash_id] ;
				$max_pro2 = substr($max_pro1,-4,4)  + 1 ;
				$max_pro3 =  "000$max_pro2" ; 
				$max_pro4 = substr($max_pro3,-4,4) ;
						if ($rs_id[Sale_id] != "")
						{
						$max_pro11 = "C$max_pro4";
						}
						else 
						{
						$max_pro11 = "C0001";
						}
				echo("$max_pro11");
				echo"<input name='Cash_id'  type='hidden'  value='$max_pro11'>";
			?></td>
      </tr>
      <tr>
        <td>วันที่ขาย</td>
      </tr>
      <tr>
        <td><input name="Cash_name" type="text" id="Cash_name" value="" size="20" /></td>
      </tr>
      <tr>
        <td>ชื่อลูกค้า</td>
        &nbsp;&nbsp;
        <td>นามสกุลลูกค้า</td>
        </tr>
      <tr>
        <td><input name="Cash_name2" type="text" id="Cash_name" value="" size="20" /></td>
        <td align="left"><p>
          <input name="Cus_lname" type="text" id="Cus_lname" value="" size="20" />
        </p></td>
      </tr>
      <tr>
        <td>รายละเอียดการขายสินค้า</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>เลือกประเภทสินค้า</td>
        <td>&nbsp;</td>
      </tr>
      <tr align="left" valign="middle">
        <td valign="middle"><select name="se_brand" >
          <?
									$sql = "select * from type";
									mysql_query("set NAMES tis620");
									$result = mysql_query($sql);
									$i=0;
										echo('
											<option value="" selected>เลือกสินค้า</option>
										');
									while($row=mysql_fetch_array($result)){		//แสดงสีที่มีทั้งหมด
										echo"<option value='$row[Pro_type]' ".$se.">$row[Pro_type]</option>";
										}	
							  ?>
        </select>
          <input name="Submit" type="submit" class="style23" value="ค้นหา" /></td>
        <td colspan="6" valign="middle"><table width="650" border="0" align="center" bordercolor="#000000" class="style2011">
          <tr align="center" bgcolor="#FF9966" class="-0">
            <td width="95" scope="col"><span class="style21">รหัสสินค้า</span></td>
            <td width="153" scope="col"><span class="style21">ชื่อสินค้า</span></td>
            <td width="101" class="-0" scope="col">ประเภทสินค้า</td>
            <td colspan="2" class="-0" scope="col">ราคาสินค้า</td>
            <td width="65" class="-0" scope="col"><span class="style21">คงเหลือ</span></td>
            <td width="86" class="-0" scope="col"> เพิ่มรายการ</td>
          </tr>
          <?
		  if($se_brand!=""){
  $sql_seleect = "SELECT Pro_id,Pro_name,Pro_type,Pro_price,Pro_unit FROM product where Pro_type='$se_brand' ";
  mysql_db_query($dbname,"SET NAMES tis620");
  $result_select = mysql_query($sql_seleect) or die(mysql_error());
  while($read_data = mysql_fetch_array($result_select)){
	?>
          <tr class="style2011">
            <td align="left"><p class="style2011"><? echo $read_data['Pro_id']; ?></p></td>
            <td align="left"><p class="style2011"><? echo $read_data['Pro_name']; ?></p></td>
            <td align="center" class="style2011"><? echo $read_data['Pro_type']; ?></td>
            <td width="53" align="right" class="style2011"><? echo $read_data['Pro_price']; ?></td>
            <td width="63" align="center" class="style2011">บาท</td>
            <td align="center" class="style2011"><? echo $read_data['Pro_unit']; ?></td>
<td align="center" class="style2011">
<script>
		function CallAjax(Pro_id){
			window.open("receive.php?Pro_id="+Pro_id,"MainIframe");
		}
	</script>
  <img src="image/shopping-basket-add-icon.png" width="30" height="30" /><input type="button" name="btnAdd" value="เพิ่มรายการ" onclick="CallAjax('<?=$result['Pro_id']?>');" style="cursor:pointer;" /></td>
  </tr><? }?> <? }?>
        </table></td>
      </tr>
      <tr>
        <td>showรายการขายสินค้า</td>
        <td colspan="5"><p>&nbsp;</p></td>
      </tr>
      <tr>
        <td colspan="6"><IFRAME NAME="MainIframe" SRC="sale0.php" WIDTH="100%" HEIGHT="100%" VSPACE=0 STYLE="" frameborder="0">
				   </IFRAME></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="30" colspan="2" align="center" bgcolor="#6699CC"><?php
			require_once("manu.php");	//&#3648;&#3619;&#3637;&#3618;&#3585;&#3651;&#3594;&#3657;&#3627;&#3609;&#3657;&#3634;&#3648;&#3617;&#3609;&#3641;
		footer();
		?></td>
  </tr>
</table>
<p>&nbsp;</p>


ตอบความคิดเห็นที่ : 6 เขียนโดย : beerkingdom เมื่อวันที่ 2012-12-05 18:17:28
รายละเอียดของการตอบ ::
หนูไม่รุ้จะแก้ยังไงอ่าคะ แก้เท่าไหร่มันก้อไม่ขึ้นให้สักที พี่ช่วยดูหน่อยได้ป่ะคะ

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-12-06 14:01:19 By : MiNnY_LoVer
 


 

No. 8



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



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


ใครก้อได้ช่วยที แก้ไม่ได้เเร้วอ่า
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-12-06 15:49:45 By : MiNnY_LoVer
 


 

No. 9



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



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

จากที่ดูครับ บรรทัดที่ 206 เหมือนกับว่าเรา สร้าง รูปตะกร้ามา แล้ว ให้มันกดแล้วจะขึ้น ข้อมูลที่ต้องการใช่ไหมครับ

แต่จากที่ดูๆ ยังไม่เห็น ว่าจะมี link ไปหน้าใหม่ หรือเรียกอะไรออกมา

เห็นแต่ id ที่เราเอามาจาก select * form Type

ถ้าเราจะเอาออกมาตามที่บอกไว้ในตอนต้น

ก็ให้ สร้างเลียนแบบคล้ายๆ

บรรทัด 188 ถึง 199

เหมือนกับว่าเรียกสิ่งที่ต้องการออกมาอีกน้าหนึ่งอะครับ

พอจะเข้าใจเราอะป่าว
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-12-06 16:12:15 By : INTz
 


 

No. 10



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



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


ตอบความคิดเห็นที่ : 9 เขียนโดย : INTz เมื่อวันที่ 2012-12-06 16:12:15
รายละเอียดของการตอบ ::
ตอนนี้สับสนเเร้วอ่าคะ เเร้วต้องเอาไปใส่ในบรรทัดไหนอ่า นูทำตามแบบที่พี่เค้าให้ไว้ด้านบนอ่าคะ ยังทำไม่ได้เรยคะ



ประวัติการแก้ไข
2012-12-06 16:28:50
2012-12-06 21:13:09
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-12-06 16:25:56 By : MiNnY_LoVer
 


 

No. 11



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



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


จนปัญญาแร้วอ่า
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-12-06 21:14:00 By : MiNnY_LoVer
 


 

No. 12



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



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


หน้าที่ทำงานได้

หน้าที่มันทำงานได้ปกติ
Code (PHP)
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</head>

<body>
<p>
  <? include("config.php");?>
</p>
<form action="" method="post" name="from" id="from">
  <select name="se_brand" >
    <?
									$sql = "select * from type";
									mysql_query("set NAMES tis620");
									$result = mysql_query($sql);
									$i=0;
										echo('
											<option value="" selected>เลือกสินค้า</option>
										');
									while($row=mysql_fetch_array($result)){		//แสดงสีที่มีทั้งหมด
										echo"<option value='$row[Pro_type]' ".$se.">$row[Pro_type]</option>";
										}	
							  ?>
  </select>
  <input name="Submit" type="submit" class="style23" value="ค้นหา" />
</form>
</p>
<table width="100%" border="1">
  <tr bgcolor="#006699">
    <td><div align="center"><span class="style1">Pro_id</span></div></td>
    <td><div align="center"><span class="style1">Pro_name</span></div></td>
    <td><div align="center"><span class="style1">Pro_type</span></div></td>
    <td><div align="center"><span class="style1">p_price</span></div></td>
    <td><div align="center"><span class="style1">stock</span></div></td>
    <td><div align="center"><span class="style1">add</span></div></td>
  </tr>
  <?
  	$sql= "SELECT * FROM product where Pro_type='$se_brand' ";
	
	$query=mysql_query($sql);
	mysql_query("SET NAMES UTF8");
	while($result=mysql_fetch_assoc($query)){
  ?>
  <tr>
    <td><?=$result['Pro_id']?></td>
    <td><?=$result['Pro_name']?></td>
    <td><?=$result['Pro_type']?></td>
    <td><?=number_format($result['Pro_price'],2,'.',',')?></td>
    <td><?=$result['Pro_unit']?></td>
    <td align="center"><script>
		function CallAjax(Pro_id){
			window.open("receive.php?Pro_id="+Pro_id,"MainIframe");
		}
	  </script>
      <input type="button" name="btnAdd" value="เพิ่มรายการ" onclick="CallAjax('<?=$result['Pro_id']?>');" style="cursor:pointer;" /></td>
  </tr>
  <?
    	}
  ?>
</table>
<br />
<table width="100%" border="0">
  <tr>
    <td><iframe src="sale0.php" name="MainIframe" width="100%" height="100%" frameborder="0" vspace="0" id="MainIframe" style=""> </iframe></td>
  </tr>
</table>
</body>



ประวัติการแก้ไข
2012-12-07 17:17:21
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-12-07 17:16:38 By : MiNnY_LoVer
 


 

No. 13



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



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


หน้าที่ไม่ทำงาน

แต่พอมาอยุ่ในตาราง มันกับไม่ทำงาน
Code (PHP)
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
.style3 {color: #000000}
-->
</style>
</head>

<body>
<table width="1200" height="131" border="1" align="center" cellpadding="1" cellspacing="1">
  <tr>
    <th width="15" rowspan="3" align="left" nowrap="nowrap" bgcolor="#6699CC">&nbsp;</th>
    <th height="15" colspan="2" align="center" nowrap="nowrap" bgcolor="#6699CC"><table border="0" align="right">
      <tr>
        <td align="center" valign="bottom" class="eeeeeeeee"><span style="color: #FFF"></span>
          <?
$thai_w=array("อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัสบดี","ศุกร์","เสาร์");
$thai_n=array("มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม");
$w=$thai_w[date("w")];
$d=date("d");
$n=$thai_n[date("n") -1];
$Y=date("Y") +543 ;


echo "วัน $w ที่ $d เดือน $n ปี พ.ศ. $Y "; 
?>
          &nbsp;</td>
      </tr>
    </table></th>
    <th width="15" rowspan="3" align="right" nowrap="nowrap" bgcolor="#6699CC">&nbsp;</th>
  </tr>
  <tr>
    <td width="200" height="61" align="center" valign="top" bgcolor="#EEEEEE"><?php
			require_once("manu.php");	//&#3648;&#3619;&#3637;&#3618;&#3585;&#3651;&#3594;&#3657;&#3627;&#3609;&#3657;&#3634;&#3648;&#3617;&#3609;&#3641;
		mn();
		?>
      &nbsp;</td>
    <td width="951" align="center" bgcolor="#EEEEEE"><p>
      <? include("config.php");?>
    </p>
      <form name="from" method="post" action="">
        <select name="se_brand" >
          <?
									$sql = "select * from type";
									mysql_query("set NAMES tis620");
									$result = mysql_query($sql);
									$i=0;
										echo('
											<option value="" selected>เลือกสินค้า</option>
										');
									while($row=mysql_fetch_array($result)){		//แสดงสีที่มีทั้งหมด
										echo"<option value='$row[Pro_type]' ".$se.">$row[Pro_type]</option>";
										}	
							  ?>
        </select>
        <input name="Submit" type="submit" class="style23" value="ค้นหา" />
      </form>
      </p>
      <table width="100%" border="1">
        <tr bgcolor="#006699">
          <td><div align="center"><span class="style1">Pro_id</span></div></td>
          <td><div align="center"><span class="style1">Pro_name</span></div></td>
          <td><div align="center"><span class="style1">Pro_type</span></div></td>
          <td><div align="center"><span class="style1">p_price</span></div></td>
          <td><div align="center"><span class="style1">stock</span></div></td>
          <td><div align="center"><span class="style1">add</span></div></td>
        </tr>
        <?
  	$sql= "SELECT * FROM product where Pro_type='$se_brand' ";
	$query=mysql_query($sql);
	while($result=mysql_fetch_assoc($query)){
  ?>
        <tr>
          <td><?=$result['Pro_id']?></td>
          <td><?=$result['Pro_name']?></td>
          <td><?=$result['Pro_type']?></td>
          <td><?=number_format($result['Pro_price'],2,'.',',')?></td>
          <td><?=$result['Pro_unit']?></td>
          <td align="center"><script>
		function CallAjax(Pro_id){
			window.open("receive.php?Pro_id="+Pro_id,"MainIframe");
		}
	  </script>
            <input type="button" name="btnAdd" value="เพิ่มรายการ" onclick="CallAjax('<?=$result['Pro_id']?>');" style="cursor:pointer;" /></td>
        </tr>
        <?
    	}
  ?>
      </table>
      <br />
      <table width="100%" border="0">
        <tr>
          <td><IFRAME NAME="MainIframe" SRC="sale0.php" WIDTH="100%" HEIGHT="100%" VSPACE=0 STYLE="" frameborder="0"> </IFRAME></td>
        </tr>
      </table>
    <p>&nbsp;</p></td>
  </tr>
  <tr>
    <td height="30" colspan="2" align="center" bgcolor="#6699CC"><?php
			require_once("manu.php");	//&#3648;&#3619;&#3637;&#3618;&#3585;&#3651;&#3594;&#3657;&#3627;&#3609;&#3657;&#3634;&#3648;&#3617;&#3609;&#3641;
		footer();
		?></td>
  </tr>
</table>
</body>



ประวัติการแก้ไข
2012-12-07 17:20:04
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-12-07 17:19:40 By : MiNnY_LoVer
 


 

No. 14



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



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


เรียกไปยัง Iframe ถูกต้องป่าวคับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-12-09 21:37:09 By : beerkingdom
 


 

No. 15



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



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


link ที่ส่งไปอ่ะคับ มีไฟล์ receive.php รึยังเอ่ย...ส่งโปรเจคเข้าเมล์พี่ก็ได้เด๋วพี่ดูให้คับ..เอาไฟล์ที่เกี่ยวข้องกับฐานข้อมูลที่เกี่ยวข้องอ่ะครับส่งมาที่เมล์ก้ได้คับผม.. [email protected]
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-12-09 21:40:43 By : beerkingdom
 


 

No. 16



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



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


ตอบความคิดเห็นที่ : 15 เขียนโดย : beerkingdom เมื่อวันที่ 2012-12-09 21:40:43
รายละเอียดของการตอบ ::
มีคะ อย่างที่หนูบอกอ่ามันทำงานได้ปกติ ตอนที่มันยังไม่อยุ่ในกรอบอ่า

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-12-11 22:22:40 By : MiNnY_LoVer
 


 

No. 17

Guest


AA

อยากทราบว่า copy โค้ดมาเหมือนกันหมดแต่ส่งสัยทำไมพอกดเพิ่มรายการแต่ไม่มาที่หน้า Sale
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-06-02 23:31:10 By : ggggg
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : PHP การขายสินค้า โดยเลือกจากประเภทสินค้าและโชว์รายการสินค้าในหน้าเดียวกันทำอย่างไรคะ พี่วินคะช่วยนูทีT_T
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 04
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 อัตราราคา คลิกที่นี่