|
|
|
ต้องการสร้างระบบออกบิลเพื่อคำนวนยอดเงินของสินค้า และยอดเงินรวมค่ะรบกวนดูโค้ตให้หน่อยนะค่ะ |
|
|
|
|
|
|
|
ซึ่งการออกบิลนะค่ะ จะรับค่าID สินค้าเข้ามาแล้วแสดงข้อมูลราคา ชื่อสินค้าโดยอัตโนมัติ และมีอีกอย่งที่มีปัญหาคือ ต้องการรับค่าจำนวนที่ต้องการซื้อ แล้วเอาจำนวนคูณกับราคาที่แสดง แล้วโชว์ราคารวม ในช่องถัดไปทันที่ ที่มีการป้อนจำนวนเข้ามาค่ะ แล้วต้องมาแสดงราคารวมทั้งของรายการสินค้าที่บรรทัดสุดท้ายตามภาพนะค่ะ รบกวนช่วยดูโค้ตและแก้ไขหรือ ช่วยหน่อยได้ไหมค่ะ
โค้ตหน้า 1
<?php
$num = trim($_POST["num"]);
$strProduct = trim($_POST["tProductID"]);
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
mysql_query("SET NAMES UTF8");
$objDB = mysql_select_db("cooperative");
$strSQL = "SELECT * FROM products WHERE pro_No = '".$strProduct."' ";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$objResult = mysql_fetch_array($objQuery);
if($objResult)
{
echo $objResult["P_Name"]."|".$objResult["P_Cost"];
}
mysql_close($objConnect); ?>
โค้ตหน้า 2
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><?php
include"../includes/connect.php";
$date =$_POST["day"];
$day = date('Y-m-d', strtotime($date));
$b_name=$_POST["b_name"];
$b_add=$_POST["b_add"];
$M_ID=$_POST["M_ID"];
$sum=$_POST["sum"];
$num1 = $_POST["num1"];
$num2 = $_POST["num2"];
$num3 = $_POST["num3"];
$num4 = $_POST["num4"];
$num5 = $_POST["num5"];
$num6 = $_POST["num6"];
$num7 = $_POST["num7"];
$num8 = $_POST["num8"];
$num9 = $_POST["num9"];
$num10 = $_POST["num10"];
$txtProductID1 = $_POST["txtProductID1"];
$sql1 = "SELECT * FROM `products` WHERE pro_No ='$txtProductID1'";
$result1 = mysql_query($sql1);
$row1=mysql_fetch_array($result1);
$P_Cost1 = $row1['P_Cost'];
$P_Stock1 = $row1['P_Stock'];
$Stock1 = $P_Stock1-$num1;
$txtProductID2 = $_POST["txtProductID2"];
$sql2 = "SELECT * FROM `products` WHERE pro_No ='$txtProductID2'";
$result2 = mysql_query($sql2);
$row2=mysql_fetch_array($result2);
$P_Cost2 = $row2['P_Cost'];
$P_Stock12= $row2['P_Stock'];
$Stock2 = $P_Stock2-$num2;
$txtProductID3 = $_POST["txtProductID3"];
$sql3 = "SELECT * FROM `products` WHERE pro_No ='$txtProductID3'";
$result3 = mysql_query($sql3);
$row3=mysql_fetch_array($result3);
$P_Cost3 = $row3['P_Cost'];
$P_Stock3 = $row3['P_Stock'];
$Stock3 = $P_Stock3-$num3;
$txtProductID4 = $_POST["txtProductID4"];
$sql4 = "SELECT * FROM `products` WHERE pro_No ='$txtProductID4'";
$result4 = mysql_query($sql4);
$row4=mysql_fetch_array($result4);
$P_Cost4 = $row4['P_Cost'];
$P_Stock4 = $row4['P_Stock'];
$Stock4 = $P_Stock4-$num4;
$txtProductID5 = $_POST["txtProductID5"];
$sql5 = "SELECT * FROM `products` WHERE pro_No ='$txtProductID5'";
$result5 = mysql_query($sql5);
$row5=mysql_fetch_array($result5);
$P_Cost5 = $row5['P_Cost'];
$P_Stock5 = $row5['P_Stock'];
$Stock5 = $P_Stock5-$num5;
$txtProductID6 = $_POST["txtProductID6"];
$sql6 = "SELECT * FROM `products` WHERE pro_No ='$txtProductID6'";
$result6 = mysql_query($sql6);
$row6=mysql_fetch_array($result6);
$P_Cost6 = $row6['P_Cost'];
$P_Stock6 = $row6['P_Stock'];
$Stock6 = $P_Stock6-$num6;
$txtProductID7= $_POST["txtProductID7"];
$sql7 = "SELECT * FROM `products` WHERE pro_No ='$txtProductID7'";
$result7 = mysql_query($sql7);
$row7=mysql_fetch_array($result7);
$P_Cost7 = $row7['P_Cost'];
$P_Stock7 = $row7['P_Stock'];
$Stock7 = $P_Stock7-$num7;
$txtProductID8 = $_POST["txtProductID8"];
$sql8 = "SELECT * FROM `products` WHERE pro_No ='$txtProductID8'";
$result8 = mysql_query($sql8);
$row8=mysql_fetch_array($result8);
$P_Cost8 = $row8['P_Cost'];
$P_Stock8 = $row8['P_Stock'];
$Stock8 = $P_Stock8-$num8;
$txtProductID9 = $_POST["txtProductID9"];
$sql9 = "SELECT * FROM `products` WHERE pro_No ='$txtProductID9'";
$result9 = mysql_query($sql9);
$row9=mysql_fetch_array($result9);
$P_Cost9 = $row9['P_Cost'];
$P_Stock9 = $row9['P_Stock'];
$Stock9 = $P_Stock9-$num9;
$txtProductID10 = $_POST["txtProductID10"];
$sql10 = "SELECT * FROM `products` WHERE pro_No ='$txtProductID10'";
$result10 = mysql_query($sql10);
$row1=mysql_fetch_array($result10);
$P_Cost10 = $row10['P_Cost'];
$P_Stock10 = $row10['P_Stock'];
$Stock10 = $P_Stock10-$num10;
$n1=$num1*$P_Cost1;
$n2=$num2*$P_Cost2;
$n3=$num3*$P_Cost3;
$n4=$num4*$P_Cost4;
$n5=$num5*$P_Cost5;
$n6=$num6*$P_Cost6;
$n7=$num7*$P_Cost7;
$n8=$num8*$P_Cost8;
$n9=$num9*$P_Cost9;
$n10=$num10*$P_Cost10;
$sum=$n1+$n2+$n3+$n4+$n5+$n6+$n7+$n8+$n9+$n10;
if($_POST["Submit"]){
$sql1a= "select * from products WHERE pro_No ='$txtProductID1'";
$result1a= mysql_query($sql1a);
$row1a = mysql_fetch_array($result1a);
$P_Stock = $row1a['P_Stock'];
if($num1 >$P_Stock){
echo "<script language='javascript'>alert('ลำดับกรอกข้อมูลสินค้าที่ 1 จำนวนที่ซื้อมากกว่ากรอกข้อมูลสินค้าในสต๊อก');</script>";
echo "<meta http-equiv=\"refresh\" content=\"0;URL=Bilsell.php\" />"; exit;
}
$sql2a= "select * from products WHERE pro_No ='$txtProductID2'";
$result2a= mysql_query($sql2a);
$row2a = mysql_fetch_array($result2a);
$P_Stock = $row2a['P_Stock'];
if($num2 >$P_Stock){
echo "<script language='javascript'>alert('ลำดับกรอกข้อมูลสินค้าที่ 2 จำนวนที่ซื้อมากกว่ากรอกข้อมูลสินค้าในสต๊อก');</script>";
echo "<meta http-equiv=\"refresh\" content=\"0;URL=Bilsell.php\" />"; exit;
}
$sql3a= "select * from products WHERE pro_No ='$txtProductID3'";
$result3a= mysql_query($sql3a);
$row3a = mysql_fetch_array($result3a);
$P_Stock = $row3a['P_Stock'];
if($num3 >$P_Stock){
echo "<script language='javascript'>alert('ลำดับกรอกข้อมูลสินค้าที่ 3 จำนวนที่ซื้อมากกว่ากรอกข้อมูลสินค้าในสต๊อก');</script>";
echo "<meta http-equiv=\"refresh\" content=\"0;URL=Bilsell.php\" />"; exit;
}
$sql4a= "select * from products WHERE pro_No ='$txtProductID4'";
$result4a= mysql_query($sql4a);
$row4a = mysql_fetch_array($result4a);
$P_Stock = $row4a['P_Stock'];
if($num4 >$P_Stock){
echo "<script language='javascript'>alert('ลำดับกรอกข้อมูลสินค้าที่ 4 จำนวนที่ซื้อมากกว่ากรอกข้อมูลสินค้าในสต๊อก');</script>";
echo "<meta http-equiv=\"refresh\" content=\"0;URL=Bilsell.php\" />"; exit;
}
$sql5a= "select * from products WHERE pro_No ='$txtProductID5'";
$result5a= mysql_query($sql5a);
$row5a = mysql_fetch_array($result5a);
$P_Stock = $row5a['P_Stock'];
if($num5 >$P_Stock){
echo "<script language='javascript'>alert('ลำดับกรอกข้อมูลสินค้าที่ 5 จำนวนที่ซื้อมากกว่ากรอกข้อมูลสินค้าในสต๊อก');</script>";
echo "<meta http-equiv=\"refresh\" content=\"0;URL=Bilsell.php\" />"; exit;
}
$sql6a= "select * from products WHERE pro_No ='$txtProductID6'";
$result6a= mysql_query($sql6a);
$row6a = mysql_fetch_array($result6a);
$P_Stock = $row6a['P_Stock'];
if($num6 >$P_Stock){
echo "<script language='javascript'>alert('ลำดับกรอกข้อมูลสินค้าที่ 6 จำนวนที่ซื้อมากกว่ากรอกข้อมูลสินค้าในสต๊อก');</script>";
echo "<meta http-equiv=\"refresh\" content=\"0;URL=Bilsell.php\" />"; exit;
}
$sql7a= "select * from products WHERE pro_No ='$txtProductID7'";
$result7a= mysql_query($sql7a);
$row7a = mysql_fetch_array($result7a);
$P_Stock = $row7a['P_Stock'];
if($num7 >$P_Stock){
echo "<script language='javascript'>alert('ลำดับกรอกข้อมูลสินค้าที่ 7 จำนวนที่ซื้อมากกว่ากรอกข้อมูลสินค้าในสต๊อก');</script>";
echo "<meta http-equiv=\"refresh\" content=\"0;URL=Bilsell.php\" />"; exit;
}
$sql8a= "select * from products WHERE pro_No ='$txtProductID8'";
$result8a= mysql_query($sql8a);
$row8a = mysql_fetch_array($result8a);
$P_Stock = $row8a['P_Stock'];
if($num8 >$P_Stock){
echo "<script language='javascript'>alert('ลำดับกรอกข้อมูลสินค้าที่ 8 จำนวนที่ซื้อมากกว่ากรอกข้อมูลสินค้าในสต๊อก');</script>";
echo "<meta http-equiv=\"refresh\" content=\"0;URL=Bilsell.php\" />"; exit;
}
$sql9a= "select * from products WHERE pro_No ='$txtProductID9'";
$result9a= mysql_query($sql9a);
$row9a = mysql_fetch_array($result9a);
$P_Stock = $row9a['P_Stock'];
if($num9 >$P_Stock){
echo "<script language='javascript'>alert('ลำดับกรอกข้อมูลสินค้าที่ 9 จำนวนที่ซื้อมากกว่ากรอกข้อมูลสินค้าในสต๊อก');</script>";
echo "<meta http-equiv=\"refresh\" content=\"0;URL=Bilsell.php\" />"; exit;
}
$sql10a= "select * from products WHERE pro_No ='$txtProductID10'";
$result10a= mysql_query($sql10a);
$row10a = mysql_fetch_array($result10a);
$P_Stock = $row10a['P_Stock'];
if($num10 >$P_Stock){
echo "<script language='javascript'>alert('ลำดับกรอกข้อมูลสินค้าที่ 10 จำนวนที่ซื้อมากกว่ากรอกข้อมูลสินค้าในสต๊อก');</script>";
echo "<meta http-equiv=\"refresh\" content=\"0;URL=Bilsell.php\" />"; exit;
}
echo $SQL="INSERT INTO `bilsell` (`day` ,`b_name` ,`b_add` ,`M_ID` ,`P_ID1` ,`P_ID2` ,`P_ID3` ,`P_ID4` ,
`P_ID5` ,`P_ID6` ,`P_ID7` ,`P_ID8` ,`P_ID9` ,`P_ID10` ,`num1` ,`num2` ,`num3` ,`num4` ,
`num5` ,`num6` ,`num7` ,`num8` ,`num9` ,`num10` ,`sum` )
VALUES ('$day', '$b_name', '$b_add', '$M_ID', '$txtProductID1', '$txtProductID2', '$txtProductID3', '$txtProductID4', '$txtProductID5', '$txtProductID6', '$txtProductID7', '$txtProductID8', '$txtProductID9', '$txtProductID10', '$num1', '$num2', '$num3', '$num4', '$num5', '$num6', '$num7', '$num8', '$num9', '$num10', '$sum')";
if(mysql_query($SQL)){
$sq=mysql_query("SELECT * FROM products ORDER BY pro_No DESC");
$dat=mysql_fetch_array($sq);
$SQL1="UPDATE `products` SET `P_Stock` = '$Stock1' WHERE pro_No ='$txtProductID1'";
$result1 = mysql_query($SQL1);
if(!$result1) {
echo"<br><br><br><br><center><b> sql txtProductID1 error </b></center>";
exit;}
///------------
$SQL2="UPDATE `products` SET `P_Stock` = '$Stock2' WHERE pro_No ='$txtProductID2'";
$result2 = mysql_query($SQL2);
if(!$result2) {
echo"<br><br><br><br><center><b> sql txtProductID2 error </b></center>";
exit;}
///------------
$SQL3="UPDATE `products` SET `P_Stock` = '$Stock3' WHERE pro_No ='$txtProductID3'";
$result3 = mysql_query($SQL3);
if(!$result3) {
echo"<br><br><br><br><center><b> sql txtProductID3 error </b></center>";
exit;}
///------------
$SQL4="UPDATE `products` SET `P_Stock` = '$Stock4' WHERE pro_No ='$txtProductID4'";
$result4 = mysql_query($SQL4);
if(!$result4) {
echo"<br><br><br><br><center><b> sql txtProductID4 error </b></center>";
exit;}
///------------
$SQL5="UPDATE `products` SET `P_Stock` = '$Stock5' WHERE pro_No ='$txtProductID5'";
$result5 = mysql_query($SQL5);
if(!$result5) {
echo"<br><br><br><br><center><b> sql txtProductID5 error </b></center>";
exit;}
///------------
$SQL6="UPDATE `products` SET `P_Stock` = '$Stock6' WHERE pro_No ='$txtProductID6'";
$result6 = mysql_query($SQL6);
if(!$result7) {
echo"<br><br><br><br><center><b> sql txtProductID7 error </b></center>";
exit;}
///------------
$SQL7="UPDATE `products` SET `P_Stock` = '$Stock7' WHERE pro_No ='$txtProductID7'";
$result7 = mysql_query($SQL7);
if(!$result7) {
echo"<br><br><br><br><center><b> sql txtProductID7 error </b></center>";
exit;}
///------------
$SQL8="UPDATE `products` SET `P_Stock` = '$Stock8' WHERE pro_No ='$txtProductID8'";
$result8 = mysql_query($SQL8);
if(!$result8) {
echo"<br><br><br><br><center><b> sql txtProductID2 error </b></center>";
exit;}
///------------
$SQL9="UPDATE `products` SET `P_Stock` = '$Stock9' WHERE pro_No ='$txtProductID9'";
$result9 = mysql_query($SQL9);
if(!$result9) {
echo"<br><br><br><br><center><b> sql txtProductID9 error </b></center>";
exit;}
///------------
$SQL10="UPDATE `products` SET `P_Stock` = '$Stock10' WHERE pro_No ='$txtProductID10'";
$result10 = mysql_query($SQL10);
if(!$result10) {
echo"<br><br><br><br><center><b> sql txtProductID10 error </b></center>";
exit;}
///------------
echo "<meta http-equiv=\"refresh\" content=\"0;URL=Bilsell_Print.php\" />";
echo "<script language='javascript'>alert('การบันทึกเรียบร้อยแล้วค่ะ');</script>";
exit();
}
}
?>
<script language="JavaScript" type="text/javascript">
var HttPRequest = false;
function doCallAjax(fProductID,fProductName,fPrice) {
HttPRequest = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
HttPRequest = new XMLHttpRequest();
if (HttPRequest.overrideMimeType) {
HttPRequest.overrideMimeType('text/html');
}
} else if (window.ActiveXObject) { // IE
try {
HttPRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
HttPRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!HttPRequest) {
alert('Cannot create XMLHTTP instance');
return false;
}
var url = 'AjaxGetFill.php';
var pmeters = "tProductID=" + encodeURI( document.getElementById(fProductID).value);
HttPRequest.open('POST',url,true);
HttPRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
HttPRequest.setRequestHeader("Content-length", pmeters.length);
HttPRequest.setRequestHeader("Connection", "close");
HttPRequest.send(pmeters);
HttPRequest.onreadystatechange = function()
{
//if(HttPRequest.readyState == 3) // Loading Request
//{
//document.getElementById(fProductName).innerHTML = "..";
//}
if(HttPRequest.readyState == 4) // Return Request
{
var myProduct = HttPRequest.responseText;
if(myProduct != "")
{
var myArr = myProduct.split("|");
document.getElementById(fProductName).value = myArr[0];
document.getElementById(fPrice).value = myArr[1];
}
}
}
}
</script>
<script language="JavaScript">
function chk(){
var a = document.all.M_ID.value
if(a=='0')
{
document.all.b_name.disabled='';
document.all.b_add.disabled='';
}
else
{
document.all.b_name.disabled='true';
document.all.b_add.disabled='true';
document.all.b_name.value='';
document.all.b_add.value='';
}
}
</script>
<form id="form1" name="form1" method="post" action="">
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<th height="257" colspan="6"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#FCFDFD" class="style130">
<td height="18" colspan="4" align="center" bgcolor="#CCCCCC"> </td>
</tr>
<tr bgcolor="#FCFDFD" class="style130">
<td height="79" colspan="4" align="center" bgcolor="#FFFFFF"><span class="style2"><span class="style153"><span class="style62 style185"><img src="../images/logo1.gif" width="90" height="75" /></span></span></span></td>
</tr>
<tr bgcolor="#FCFDFD" class="style130">
<td height="28" colspan="4" align="center" bgcolor="#CCCCCC"><div align="center" class="style2"><span class="style155 style62"><span class="style201"><span class="style13"><span class="style62 "><span class="style4">ร้านสหกรณ์มัสยิดกลางควนโดน จำกัด <br />
</span></span></span><span class="style193">104 หมู่1 ตำบลควนโดน อำเภอควนโดน จังหวัดสตูล</span></span></span></div></td>
</tr>
<tr bgcolor="#FCFDFD" class="style15">
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
<td height="25" bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
</tr>
<tr bgcolor="#FCFDFD" class="style15">
<td width="11%" bgcolor="#FFFFFF"> </td>
<td width="13%" align="left" bgcolor="#FFFFFF"><span class="style14"><span class="style177 style193">ปี/เดือน/วัน</span></span></td>
<td width="2%" height="25" bgcolor="#FFFFFF"><span class="style14"><span class="style177 style193"> :</span></span></td>
<td width="74%" bgcolor="#FFFFFF"><div align="left"><span class="style62 style2">
<input name="day" type="text" id="day" value="<? echo $date = date("Y-m-d"); ?>" size="10" />
<a href="javascript:displayDatePicker('day')"><img src="../pic/formcal.gif" width="16" height="16" border="0" /></a> <span class="style30"> </span></span></div></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="style62 style13 style16"> </td>
<td align="left" bgcolor="#FFFFFF" class="style62 style13 style16"><span class="style178"><span class="st1">ชื่อสมาชิก</span></span></td>
<td height="32" bgcolor="#FFFFFF" class="style62 style13 style16"><span class="style30">
<label> </label>
<span class="style14"><span class="style177 style193">:</span></span></span></td>
<td bgcolor="#FFFFFF" class="style62"><div align="left"><span class="style178"><span class="style16 style30"><span class="style62 style13 style16"><span class="style30"><span class="style14"><span class="style177 style193">
<select name="M_ID" size="1" id="M_ID" onchange="chk();" />
<option value="0" selected="selected"> ------------เลือก------------</option>
<?
$sql = "select * from members order by M_Name asc";
$result = mysql_query($sql);
while($row=mysql_fetch_array($result)) { ?>
<option value=""> <? echo $row['M_Prefix'];?> <? echo $row['M_Name']; ?> <? echo $row['M_Lastname']; ?> </option>
<? } ?>
</select>
ชื่อลูกค้าทั่วไป</span></span></span></span></span><span class="st1">:</span></span><span class="style178"><span class="style16 style30">
<input name="b_name" type="text" id="b_name"onchange="chk();" />
</span></span></div></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"> </td>
<td align="left" bgcolor="#FFFFFF"><span class="style62 style13 style16"><span class="style30"><span class="style14"><span class="style177 style193"><span class="style177"><span class="style13">ที่อยู่</span></span></span></span></span></span></td>
<td bgcolor="#FFFFFF"><span class="style62 style13 style16"><span class="style30"><span class="style14"><span class="style177 style193"><span class="style177"><span class="style13">:</span></span></span></span></span></span></td>
<td bgcolor="#FFFFFF"><div align="left"><span class="style16 style30">
<input name="b_add" type="text" id="b_add" onchange="chk();" size="50" />
</span></div></td>
</tr>
<tr>
<td colspan="4" bgcolor="#FFFFFF"> </td>
</tr>
</table></th>
</tr>
<tr>
<th width="42" bgcolor="#666666"><div align="center" class="style199">ลำดับ</div></th>
<th width="77" bgcolor="#666666"><div align="center" class="style199">รหัสสินค้า</div></th>
<th width="219" bgcolor="#666666"><div align="center" class="style199">รายการ</div></th>
<th width="103" bgcolor="#666666"><div align="center" class="style199">ราคา/หน่วย</div></th>
<th width="85" bgcolor="#666666"><span class="style199">จำนวน</span></th>
<th width="80" align="left" bgcolor="#666666"><span class="style184">ราคารวม</span></th>
</tr>
<tr>
<th bgcolor="#999999"><span class="style130">1</span></th>
<th bgcolor="#CCCCCC"> <div align="center">
<input type="text" name="txtProductID1" id="txtProductID1" size="5" onchange="JavaScript:doCallAjax('txtProductID1','txtProductName1','txtPrice1');" />
</div></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtProductName1" id="txtProductName1" size="30" /></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtPrice1" id="txtPrice1" size="10" /></th>
<td align="center" bgcolor="#CCCCCC" class="style16 style30"><input name="num1" type="text" id="num1" size="5" /></td>
<td align="left" bgcolor="#CCCCCC" class="style16 style30"><input name="num1" type="text" id="num1" size="5" /></td>
</tr>
<tr>
<th bgcolor="#999999"><span class="style130">2</span></th>
<th bgcolor="#CCCCCC"> <div align="center">
<input type="text" name="txtProductID2" id="txtProductID2" size="5" onchange="JavaScript:doCallAjax('txtProductID2','txtProductName2','txtPrice2');" />
</div></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtProductName2" id="txtProductName2" size="30" /></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtPrice2" id="txtPrice2" size="10" /></th>
<td align="center" bgcolor="#CCCCCC" class="style16 style30"><input name="num2" type="text" id="num2" size="5" /></td>
<td align="left" bgcolor="#CCCCCC" class="style16 style30"><input name="num2" type="text" id="num2" size="5" /></td>
</tr>
<tr>
<th bgcolor="#999999"><span class="style130">3</span></th>
<th bgcolor="#CCCCCC"> <div align="center">
<input type="text" name="txtProductID3" id="txtProductID3" size="5" onchange="JavaScript:doCallAjax('txtProductID3','txtProductName3','txtPrice3');" />
</div></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtProductName3" id="txtProductName3" size="30" /></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtPrice3" id="txtPrice3" size="10" /></th>
<td align="center" bgcolor="#CCCCCC" class="style16 style30"><input name="num3" type="text" id="num3" size="5" /></td>
<td align="left" bgcolor="#CCCCCC" class="style16 style30"><input name="num3" type="text" id="num3" size="5" /></td>
</tr>
<tr>
<th bgcolor="#999999"><span class="style130">4</span></th>
<th bgcolor="#CCCCCC"> <div align="center">
<input type="text" name="txtProductID4" id="txtProductID4" size="5" onchange="JavaScript:doCallAjax('txtProductID4','txtProductName4','txtPrice4');" />
</div></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtProductName4" id="txtProductName4" size="30" /></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtPrice4" id="txtPrice4" size="10" /></th>
<td align="center" bgcolor="#CCCCCC" class="style16 style30"><input name="num4" type="text" id="num4" size="5" /></td>
<td align="left" bgcolor="#CCCCCC" class="style16 style30"><input name="num4" type="text" id="num4" size="5" /></td>
</tr>
<tr>
<th bgcolor="#999999"><span class="style130">5</span></th>
<th bgcolor="#CCCCCC"> <div align="center">
<input type="text" name="txtProductID5" id="txtProductID5" size="5" onchange="JavaScript:doCallAjax('txtProductID5','txtProductName5','txtPrice5');" />
</div></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtProductName5" id="txtProductName5" size="30" /></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtPrice5" id="txtPrice5" size="10" /></th>
<td align="center" bgcolor="#CCCCCC" class="style16 style30"><input name="num5" type="text" id="num5" size="5" /></td>
<td align="left" bgcolor="#CCCCCC" class="style16 style30"><input name="num5" type="text" id="num5" size="5" /></td>
</tr>
<tr>
<th bgcolor="#999999"><span class="style130">6</span></th>
<th bgcolor="#CCCCCC"> <div align="center">
<input type="text" name="txtProductID6" id="txtProductID6" size="5" onchange="JavaScript:doCallAjax('txtProductID6','txtProductName6','txtPrice6');" />
</div></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtProductName6" id="txtProductName6" size="30" /></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtPrice6" id="txtPrice6" size="10" /></th>
<td align="center" bgcolor="#CCCCCC" class="style16 style30"><input name="num6" type="text" id="num6" size="5" /></td>
<td align="left" bgcolor="#CCCCCC" class="style16 style30"><input name="num6" type="text" id="num6" size="5" /></td>
</tr>
<tr>
<th bgcolor="#999999"><span class="style130">7</span></th>
<th bgcolor="#CCCCCC"> <div align="center">
<input type="text" name="txtProductID7" id="txtProductID7" size="5" onchange="JavaScript:doCallAjax('txtProductID7','txtProductName7','txtPrice7');" />
</div></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtProductName7" id="txtProductName7" size="30" /></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtPrice7" id="txtPrice7" size="10" /></th>
<td align="center" bgcolor="#CCCCCC" class="style16 style30"><input name="num7" type="text" id="num7" size="5" /></td>
<td align="left" bgcolor="#CCCCCC" class="style16 style30"><input name="num7" type="text" id="num7" size="5" /></td>
</tr>
<tr>
<th bgcolor="#999999"><span class="style130">8</span></th>
<th bgcolor="#CCCCCC"> <div align="center">
<input type="text" name="txtProductID8" id="txtProductID8" size="5" onchange="JavaScript:doCallAjax('txtProductID8','txtProductName8','txtPrice8');" />
</div></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtProductName8" id="txtProductName8" size="30" /></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtPrice8" id="txtPrice8" size="10" /></th>
<td align="center" bgcolor="#CCCCCC" class="style16 style30"><input name="num8" type="text" id="num8" size="5" /></td>
<td align="left" bgcolor="#CCCCCC" class="style16 style30"><input name="num8" type="text" id="num8" size="5" /></td>
</tr>
<tr>
<th bgcolor="#999999"><span class="style130">9</span></th>
<th bgcolor="#CCCCCC"> <div align="center">
<input type="text" name="txtProductID9" id="txtProductID9" size="5" onchange="JavaScript:doCallAjax('txtProductID9','txtProductName9','txtPrice9');" />
</div></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtProductName9" id="txtProductName9" size="30" /></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtPrice9" id="txtPrice9" size="10" /></th>
<td align="center" bgcolor="#CCCCCC" class="style16 style30"><input name="num9" type="text" id="num9" size="5" /></td>
<td align="left" bgcolor="#CCCCCC" class="style16 style30"><input name="num9" type="text" id="num9" size="5" /></td>
</tr>
<tr>
<th bgcolor="#999999"><span class="style130">10</span></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtProductID10" id="txtProductID10" size="5" onchange="JavaScript:doCallAjax('txtProductID10','txtProductName10','txtPrice10');" /></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtProductName10" id="txtProductName10" size="30" /></th>
<th bgcolor="#CCCCCC"><input type="text" name="txtPrice10" id="txtPrice10" size="10" /></th>
<td align="center" bgcolor="#CCCCCC" class="style16 style30"><input name="num10" type="text" id="num10" size="5" /></td>
<td align="left" bgcolor="#CCCCCC" class="style16 style30"><input name="num10" type="text" id="num10" size="5" /></td>
</tr>
<tr>
<th bgcolor="#666666"> </th>
<th bgcolor="#666666"> </th>
<th bgcolor="#666666"> </th>
<th colspan="3" align="right" bgcolor="#666666"><span class="style184">รวมเงินทั้งหมด</span><span class="style16 style30">
<input name="num102" type="text" id="num102" size="5" />
</span><span class="style200">บาท</span></th>
</tr>
<tr>
<th height="32" colspan="6" bgcolor="#CCCCCC"><input name="Submit2" type="submit" id="Submit" value="บันทึกรายการ"/></th>
</tr>
</table>
</form></td>
</tr>
</table>
Tag : PHP, MySQL, JavaScript, Ajax
|
|
|
|
|
|
Date :
2011-07-20 19:58:38 |
By :
atrmedia |
View :
1223 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไม่รู้จะใส่โค้ตการคำนวน และรับค่ายังเพื่อคำนวนราคารวม
|
|
|
|
|
Date :
2011-07-20 20:00:32 |
By :
atrmedia |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|