|
 |
|
สอบถามเรื่องการส่งค่าไปพร้อมกัน ต้องการส่งค่า status ไปพร้อมกับ quanlity แต่ปัญหาว่าพอเราคำนวณราคาใหม่ |
|
 |
|
|
 |
 |
|
<input type="hidden" name="status" value="0" />
ใส่ hidden ไปด้วยครับ
|
 |
 |
 |
 |
Date :
2009-11-14 12:37:10 |
By :
deawx |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ยังไม่ได้ครับ เวลาผมจำนวนสินค้าและคิดราคาใหม่แล้วกด Calcu จะมีการส่งแต่แค่ quantity มาอย่างเดียว ผมอยากเพิ่มให้มีการส่งค่า bookstatus มาด้วยเพื่อที่จะกำหนดได้กว่าสินค้านั้นเป็นโปรโมชั่นหรือไม่
echo "<input name=\"quantity\" type=\"text\" value=\"$quantity\" size=\"3\"> //ต้องให้ส่งค่า จำนวนไปส่งไปใหม่กับค่า status ไปด้วยกันโดยค่า status จะมี 0 กับ 1 โดยทำการ ส่งมาจากหน้า detail สินค้าอยู่ด้วย
echo "<input name=\"submit\" type=\"submit\" value=\"Calcu\">";
เพื่อที่จะเอาค่ามาเช็ค เพื่อจะทำการคำนวณราคาได้ใหม่
if($bookstatus==0 && $quantity){
$amount=$quantity * $book_price;
$total=$total+$amount;
}
else{
if($bookstatus==1 && $quantity){
$amount=$quantity * $book_price-($book_price*10/100);
$total=$total+$amount;
}
}
echo number_format($amount,2,'.',',');
|
 |
 |
 |
 |
Date :
2009-11-14 14:09:29 |
By :
hijackthis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตามเพ่เดี่ยวพูดนั้นมันก็ถูกเเล้วนะครับ
<input type="hidden" name="bookstatus" value="<?=$bookstatus?>" />
|
 |
 |
 |
 |
Date :
2009-11-14 14:14:47 |
By :
phpbasi |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|