|
 |
|
คงค่า ..list menu ที่เลือกไว้ ให้แสดง list menu จากการค้นหาในช่องแรกค่ะ |
|
 |
|
|
 |
 |
|

List/Select Menu และการ Auto Fill Textbox สร้างลิสเมนู และ เลือกค่าแสดงผลไปยัง Textbox
|
 |
 |
 |
 |
Date :
2013-04-25 11:40:05 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าเราไม่ใช้ form ได้มั้ยอ้ะค้ะ
ได้เเล้วค่ะ ขอบคุณมากค่ะ
|
ประวัติการแก้ไข 2013-04-25 11:45:58
 |
 |
 |
 |
Date :
2013-04-25 11:43:13 |
By :
lookpla26 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

|
 |
 |
 |
 |
Date :
2013-04-25 11:49:04 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตอนนี้ jump menu มันไม่แสดงใน text box อีกเเล้วอ้ะค้ะเพราะว่าแทรกฟอร์มบันทึกข้อมูลเข้าไปด้วย
<? include"connect.php";?>
<? include"script.php";?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ประเมินการตรวจสภาพรถ</title>
<link href="main_style.css" rel="stylesheet" type="text/css">
<style type="text/css">
.longtext{
height:500px;
overflow:scroll;}
</style>
<body>
<form action="save_check_motor.php" method="post" >
<div id="right_block">
<table style="font-size:13px" >
<tr>
<td>ผู้ประเมิน :</td>
<td><input type="text" name="name_est" id="name_est" />
<?php
$date = date("Y-m-d ");
?>
<td>วันที่ประเมิน :</td>
<td><input type="text" name="date_est" id="date_est" />
</tr>
<tr>
<td>รุ่น</td>
<td><input type="text" name="class" id="class" /></td>
<td>เลขเครื่อง</td>
<td><input type="text" name="machine_id" id="machine_id" /></td>
</tr>
<tr>
<td colspan="4"><hr /></td>
</tr>
<tr>
<td colspan="2"><b>ความสมบูรณ์ของเครื่องยนต์</b></td>
<td>
<select name="complete">
<option value=""></option>
<?
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("motor");
mysql_query("SET NAMES UTF8");
$strSQL1 = "SELECT * FROM complete ORDER BY com_id ASC";
$objQuery1 = mysql_query($strSQL1);
while($objResuut = mysql_fetch_array($objQuery1))
{
?>
<option value="<?=$objResuut["com_id"];?>" size="14"><?=$objResuut["com_name"];?></option>
<?
}
?>
</select>
</td>
</tr>
<tr>
<td colspan="4"><hr /></td>
</tr>
<tr>
<td>รหัสอะไหล่</td>
<td>ชื่ออะไหล่</td>
<td>ราคา</td>
<td>จำนวนที่เบิก/ชิ้น</td>
<td>ระบุสาเหตุ</td>
</tr>
<tr>
<td>
<select name="sp_code" >
<option value="">รหัสอะไหล่</option>
<?
$strSQL = "SELECT * FROM spare ORDER BY sp_id ASC";
$objQuery = mysql_query($strSQL);
while($objResult = mysql_fetch_array($objQuery))
{
?>
<option value="<?=$objResult["sp_id"];?>"><?=$objResult["sp_code"];?></option>
<?
}
?>
</select>
</td>
<td><input name="sp_name" type="text" id="sp_name" ></td>
<td><input name="sp_price" type="text" id="sp_price" ></td>
<td><input type="text" name="num_take" id="num_take" /></td>
<td>
<select name="cause">
<option value=""></option>
<?
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("motor");
mysql_query("SET NAMES UTF8");
$strSQL1 = "SELECT * FROM cause ORDER BY cau_id ASC";
$objQuery1 = mysql_query($strSQL1);
while($objResuut = mysql_fetch_array($objQuery1))
{
?>
<option value="<?=$objResuut["cau_id"];?>" size="14"><?=$objResuut["cau_name"];?></option>
<?
}
?>
</select>
</td>
<td> <input type="submit" name="submit" value="บันทึก"></td>
</tr>
</form>
<?
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("motor");
mysql_query("SET NAMES UTF8");
$strSQL1 = "SELECT * FROM res_estimate
INNER JOIN cause ON res_estimate.cause = cause.cau_id
INNER JOIN spare ON res_estimate.sp_code = spare.sp_id
";
$objQuery1 = mysql_query($strSQL1) or die ("Error Query [".$strSQL1."]");
?>
<tr bgcolor="#99FFCC" >
<td>รหัสอะไหล่</td>
<td>ชื่ออะไหล่</td>
<td>ราคา</td>
<td>จำนวนที่เบิก/ชิ้น</td>
<td>ระบุสาเหตุ</td>
</tr>
<?
while($objResult1 = mysql_fetch_array($objQuery1))
{
?>
<tr>
<td><?=$objResult1["sp_code"];?></td>
<td><?=$objResult1["sp_name"];?></td>
<td><?=$objResult1["sp_price"];?></td>
<td align="center"><?=$objResult1["num_take"];?></td>
<td><?=$objResult1["cau_name"];?></td>
</tr>
<?
}
?>
</div>
|
 |
 |
 |
 |
Date :
2013-04-25 15:27:42 |
By :
lookpla26 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|