cata
|
| Posted: 06/25/2003, 7:01 AM |
|
I have a table with phone numbers.An user can have one or more numbers. I create a page where an user can see and could edit and delete only his numbers. Where i can test if an user delete his number and not an other user number? On validate is not fired for delete operation. What should i do in "before delete" event ?
|
|
|
 |
RonB
|
| Posted: 06/25/2003, 7:46 AM |
|
global $yourgrid;
$db=new clsDBConnection1();
//create the check first in sql
$my_check=$db->query("select phonenumber from phonetable where phonumber=" CCToSQL($yourgrid->your_phone_field->GetValue(),"ccsInteger")." and user=" CCToSQL($yourgrid->your_user_field->GetValue(),"ccsInteger"));
if ($my_check== "")
{
$yourgrid->DeleteAllowed = false;
$yourgrid->Errors->addError("Removal of this account is not allowed");
}
unset($db);
Ron
|
|
|
 |
|