J
|
Jane 3/11/2008 |
Hi, global $conn; $str="SELECT count(asset_id) as number FROM asset_repair WHERE asset_id='".$values['asset_id']."' and status <> 'Closed' GROUP by asset_id"; $rs=db_query($str,$conn); $data=db_fetch_numarray($rs); if($data[0]!=0) { $strSQLUpdate = "UPDATE asset SET status='In Used' WHERE id='".$values['asset_id']."'"; db_exec($strSQLUpdate,$conn); } else { $strSQLUpdate = "UPDATE asset SET status='For Repair' WHERE id='".$values['asset_id']."'"; db_exec($strSQLUpdate,$conn); } |
![]() |
mic'',) author 3/12/2008 |
Hi, |
J
|
Jane 3/12/2008 |
Hi, |
![]() |
mic'',) author 3/13/2008 |
Hi, |
![]() |
mic'',) author 3/13/2008 |
Actually I made in add new Job Orders after add, the Asset becomes "For Repair" status, I don't know why code doen't work in after edit. Or the other option I want is if there is no Pending Order the Asset status becomes "In Use" else the status is "For Repair" |
J
|
Jane 3/13/2008 |
Hi, |