|
|
|
ใส่คอมม่าให้ตัวเลขที่แสดงจากฐานข้อมูลหน่อยครับ ขอบคุณครับ |
|
|
|
|
|
|
|
Code (PHP)
<?php
//กำหนดให้ IE อ่าน page นี้ทุกครั้ง ไม่ไปเอาจาก cache
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
header("content-type: application/x-javascript; charset=utf-8");
$objConnect = mysql_connect("localhost","root","abcd1234") or die("Error Connect to Database");
mysql_query("SET NAMES UTF8");
$objDB = mysql_select_db("thaimee");
list($Supplier_ID,$name) = explode("|",$_GET["id"]);
$strSQL = "SELECT pd.*,pk.Packing,pk.price FROM product as pd, packing as pk WHERE pd.ProductID=pk.ProductID and pd.Supplier_ID = '".$Supplier_ID."' ";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$i = 0;
?>
<!-- For po -->
<table id="addpotable">
<tr>
<td><b>Product(T)<b></td>
<td><b>Product(E)<b></td>
<td><b>Size<b></td>
<td><b>Unit Price<b></td>
<td><b>Amount<b></td>
<td><b>Total<b></td>
</tr>
<?php while($objResult = mysql_fetch_array($objQuery)) { ?>
<tr>
<td><?php echo $objResult["Product_thainame"] ;?><input type="hidden" name="Product_name[<?php print $i?>]" value="<?php echo $objResult["Product_thainame"] ;?>"></td>
<td><?php echo $objResult["Productname"];?><input type="hidden" name="Product_name_eng[<?php print $i?>]" value="<?php echo $objResult["Productname"];?>"></td>
<td><?php echo $objResult["Packing"];?><input type="hidden" name="Size[<?php print $i?>]" value="<?php echo $objResult["Packing"];?>"></td>
<td><center><?php echo $objResult ["price"];?><input type='hidden' name='Price[<?php print $i?>]' id='Price<?php print $i?>' class='Price' style='width: 50px;' onkeyup='cal(<?php print $i?>);' value="<?php echo floatval($objResult["price"]);?>"><center></td>
<td><input type='text' name='Amount[<?php print $i?>]' id='Amount<?php print $i?>' class='Amount' style='width: 30px;' onkeyup='cal(<?php print $i?>);'></td>
<td><input type='text' name='Total[<?php print $i?>]' id='Total<?php print $i?>' class='Total' style='width: 70px;' readonly="readonly"></td>
</tr>
<?php $i++; } ?>
</table>
Tag : PHP
|
|
|
|
|
|
Date :
2016-06-13 15:11:07 |
By :
athiwatbuun |
View :
754 |
Reply :
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
echo number_format('999999.99',2);
|
|
|
|
|
Date :
2016-06-13 15:14:52 |
By :
arm8957 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<?php echo number_format($objResult ["price"],2);?>
|
|
|
|
|
Date :
2016-06-13 15:23:32 |
By :
mm2mail |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|