|
 |
|
รบกวนช่วยแนะนำหน่อยนะคะ คือว่าต้องการให้ทำการเลือก checkbox ด้านหน้าแล้วก็ให้ข้อความนั้นขึ้นมาอยู่ที่ box ที่เพื่อต้องการแก้ไขข้อมูล |
|
 |
|
|
 |
 |
|
คือว่าต้องการให้ทำการเลือก checkbox ด้านหน้าแล้วก็ให้ข้อความนั้นขึ้นมาอยู่ที่ box ที่เพื่อต้องการแก้ไขข้อมูล
case 'edit' :
$detail=!empty($_POST['txtDetail'])?$_POST['txtDetail']:"";
$unit=!empty($_POST['txtUnit'])?$_POST['txtUnit']:"";
$unitprice=!empty($_POST['txtUnitPrice'])?$_POST['txtUnitPrice']:"";
if ($detail !=""){
if ($code !=""){
$dTotalprice=$unit*$unitprice;
$strUpdate="Insert Into quotation_detail(MasterCode,Detail,Price,Unit,Totalprice) values('$code','$detail','$unitprice','$unit','$dTotalprice')";
$rs=mysql_query($strUpdate);
$strUpdate="Select sum(Totalprice) as sumtotal From quotation_detail Where MasterCode='$code'";
$rs=mysql_query($strUpdate);
$sTotal=mysql_result($rs,0,"sumtotal");
$sVat=round(($sTotal*7)/107,2);
$sPrice=round($sTotal-$sVat,2);
$strUpdate="Update quotation_master SET Price='$sPrice',Vat='$sVat',TotalPrice='$sTotal' Where Code='$code'";
$rs=mysql_query($strUpdate);
$message="เพิ่มรายละเอียดสำเร็จ " . mysql_affected_rows($conn) . " รายการ";
}
}
break;
ด้านบนเป็นโค้ดที่จาทำการแก้ไข
ส่วนด้านล่างเป็นส่วนของแสดง cheackbox
<input type="submit" name="detail" value="edit"></td><td width="60%" align="center" value="<?php echo $detail;?>">รายการ</td>
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-08-17 11:52:44 |
By :
porn8830 |
View :
865 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<input type="submit" name="detail" value="edit"></td><td width="60%" align="center" value="<?php echo $detail;?>">รายการ</td>
โค้ดเอามาไม่หมดมั้งครับนี่ ขอเต้มๆดีกว่าครับ
|
 |
 |
 |
 |
Date :
2009-08-17 12:38:23 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|