|
|
|
ส่งค่าจาก popup มา form หลัก..........ค่าของข้อมูลจากlistmenu มันไม่แสดง |
|
|
|
|
|
|
|
ทำไมส่งค่าจาก pop มา หน้าหลักฟิลด์ของรุ่นรถใน listmenu ที่ 2ถึงไม่แสดงอ้ะค้ะ
SET03.PHP
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>รุ่นสินค้า</title>
<script type="text/javascript">
function OpenBrand() {
var myWindow=window.open("search_type.php",'windowRef','width=1600,height=900');
if (!myWindow.opener) myWindow.opener = self;
}
function PopDel() {
var myWindow=window.open("del03.php",'windowRef','width=1600,height=900');
if (!myWindow.opener) myWindow.opener = self;
}
</script>
<? include"connect.php";?>
<?
$strSQL = "select * FROM model ORDER BY type_id DESC LIMIT 0,1";
$objQuery = mysql_query($strSQL)or die ("select error");
$objResult = mysql_fetch_array($objQuery);
$type_id = $objResult["type_id"];
$type_id = $type_id+1;
?>
<fieldset>
<form action="save_set03.php" method="post">
<table align="center" style="font-family:Verdana, Geneva, sans-serif; font-size:13px">
<tr>
<th align="left">รหัสแบบรถ :</th>
<td align="right"><input type="text" id="type_id" name="type_id" value="<?=$type_id;?>"></td>
<td width="75"></td>
</tr>
</table>
</fieldset>
<br>
<fieldset>
<? include"s1.php";?>
<table align="center" style="font-family:Verdana, Geneva, sans-serif; font-size:13px">
<tr>
<th height="43" align="right">เลือกยี่ห้อรถ :</th>
<td align="left">
<select id="txtbrand" name="txtbrand">
<option value="">------------เลือก-----------</option>
<?php
$result = mysql_query("
SELECT
brand_id,
brand_name
FROM
brand
ORDER BY CONVERT(brand_id USING TIS620) ASC;
");
while($row = mysql_fetch_assoc($result))
{
echo '<option value="', $row['brand_id'], '">', $row['brand_name'],'</option>';
}
?>
</select>
<select id="txtclass" name="txtclass">
<option value="<?=$class_id;?>" selected="selected" ><?=$class_name;?></option>
<option value="">------------เลือก-----------</option>
</select><span id="waitClass"></span>
</td>
</tr>
<tr>
<th align="right">ชื่อแบบรถ :</th>
<td align="left"><input type="text" id="type_name" name="type_name" onKeyUp="javascript:this.value=this.value.toUpperCase();"></td>
<td><button type="submit" value="บันทึก"><img src="image/save.png" />บันทึก</button></td>
</tr>
</table>
</form>
</fieldset>
<br />
<fieldset>
<table width="400" align="center" style="font-family:Verdana, Geneva, sans-serif; font-size:13px">
<tr>
<th align="center"><a href="SET03.php"><img src="image/add.png" width="32" height="32" /><br />เพิ่มข้อมูล</a></th>
<th align="center"><a href="" onClick="Javascript:OpenBrand();"><img src="image/search1.png" /><br />ค้นหาข้อมูล</a></th>
<th align="center"><a href="" onClick="Javascript:PopDel();"><img src="image/delete.png" width="32" height="32" /><br />ลบข้อมูล</a></th>
<th align="center"><a href="report_set03.pdf"><img src="image/print.png" width="32" height="32"/><br />รายงาน</a></th>
<th align="center"><a href="" onClick="JavaScript:window.close();"><img src="image/exit.png" width="32" height="32"/><br />ปิดระบบ</a></th>
</tr>
</table>
</fieldset>
SEARCH_TYPE.PHP
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ค้นหาอะไหล่</title>
<? include"connect.php";?>
<? include"s1.php";?>
<script language="javascript">
function selData(intLine,type_id,type_name,brand_id,class_id)
{
var stype_id = self.opener.document.getElementById("type_id" +intLine);
stype_id.value = type_id;
var stype_name = self.opener.document.getElementById("type_name" +intLine);
stype_name.value = type_name;
var stxtbrand = self.opener.document.getElementById("txtbrand" +intLine);
stxtbrand.value = brand_id;
var stxtclass = self.opener.document.getElementById("txtclass" +intLine);
stxtclass.value = class_id;
window.close();
}
</script>
<fieldset>
<form name="frmSearch" method="get" action="<?=$_SERVER['SCRIPT_NAME'];?>">
<select id="txtbrand" name="txtbrand" value="<?=$_GET["brand_name"];?>">
<option value="">------------เลือก-----------</option>
<?php
$result = mysql_query("SELECT brand_id,brand_name FROM brand
ORDER BY CONVERT(brand_id USING TIS620) ASC;
");
while($row = mysql_fetch_assoc($result))
{
echo '<option value="', $row['brand_id'], '">', $row['brand_name'],'</option>';
}
?>
</select>
<select id="txtclass" name="txtclass" value="<?=$_GET["class_name"];?>">
<option value="">------------เลือก-----------</option>
</select><span id="waitClass"></span>
</td>
<button type="submit" id="button"><img src="image/search1.png" width="16" height="16" /> ค้นหา</button>
<button type="button" name="Submit" value="Search" onClick="JavaScript:window.close();"/><img src="image/exit.png" width="18" height="18"/>ปิดระบบ</button>
</form>
</fieldset>
<br />
<fieldset>
<?php
$query=mysql_query("SELECT * from model WHERE class_id = '$txtclass' AND brand_id = '$txtbrand' ");
?>
<table style="font-size:12px; font-family:Verdana, Geneva, sans-serif;">
<tr height="35" bgcolor="#CCCCCC">
<th width="161"> <div align="center">รหัสแบบรถ</div></th>
<th width="248"> <div align="center">ชื่อแบบรถ</div></th>
</tr>
<?
$i=1;
while($arr_product=mysql_fetch_array($query)){
{
if($i%2==0)
{
$bg = "#FFFFFF";
}
else
{
$bg = "#ebf0f0";
}
?>
<tr align="center" style="font-size:13px" bgcolor="<?=$bg;?>">
<td align="left"><a href="#" OnClick="selData('<?=$_GET["Line"];?>' ,'<?=$arr_product["type_id"];?>', '<?=$arr_product["type_name"];?>',
'<?=$arr_product["brand_id"];?>','<?=$arr_product["class_id"];?>' );">
<?=$arr_product["type_name"];?>
</a>
</td>
<td align="left"><?=$arr_product["type_name"];?></td>
</tr>
<?
}}
?>
</table>
<?
mysql_close();
?>
</fieldset>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2013-05-29 10:59:09 |
By :
PALM26 |
View :
1033 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Passing Popup to Main Page เทคนิคการส่งค่าจาก Popup ไปยังหน้าเพจ Form หลัก
|
|
|
|
|
Date :
2013-05-30 09:28:32 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้แล้วค่ะ เเต่ติดส่วนอื่นอีก
list menu จังหวัดมันแสดง แต่ว่า อำเภอ กับ ตำบล ทำไมมันไม่แสดงอ้ะค้ะ
|
ประวัติการแก้ไข 2013-05-30 09:34:58
|
|
|
|
Date :
2013-05-30 09:34:26 |
By :
PALM26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|