This topic is locked
[SOLVED]

 <<< Record was NOT edited >>>

10/13/2012 4:54:26 AM
PHPRunner General questions
T
Tayyab Ilyas author

I have three tables

Users (UserID, Name, etc)

Claims (ClaimID, claim type, claim details)

claimtousermapping(UserID,ClaimID)
I have created a view of claims called AgentClaims using query designer.

Now i wants to allow only those users to edit the data who have been given permission in claimtousermapping.

Now if i set permission to allow user to edit their own data i get following error and if i set permission to user can see and edit other users data that does not solve my permission issue.
Please help
<<< Record was NOT edited >>>

Unknown column 'claimtousermapping.userID' in 'where clause'

SELECT

claim.claimID,

claim.userID,

claim.typeOfInjury,

claim.accidentDate,

claim.accidentLocation,

claim.accidentDescription,

claim.isTherePoliceReport,

claim.whoIsAtFault,

claim.insuranceNameOfOtherParty,

claim.insuranceNumberOfOtherParty,

claim.claimNumberOfOtherParty,

claim.policeReportInsuranceCode,

claim.bodyPartInjury,

claim.placeOfTreatment,

claim.claimStatus,

claim.liabilityEstablished,

claim.injuriesEstabilished,

claim.claimRefund,

claim.agentComments,

claim.clientComments,

claimtousermapping.userID AS AgentID,

claimtousermapping.claimID AS claimID1

FROM claim

INNER JOIN claimtousermapping ON claim.claimID = claimtousermapping.claimID

WHERE (claim.claimStatus !="Archived")
C
cgphp 10/13/2012

userID or UserID ?

T
Tayyab Ilyas author 10/13/2012

Its all userID
In user table userID is PK for all users and Role(3 possible-->client,Agent,Admin)
Clients will submit claims, and agents will respond to claims
Admin can assign any claim to any agent this is why i used claimtousermapping



userID or UserID ?

C
cgphp 10/13/2012

Do you have some code in the "Before record edited" or "After record edited" events? Check firebug for errors.

T
Tayyab Ilyas author 10/13/2012

No I do not have any code in events.
I have this error when i select permission to user can view/edit their own data only. and this is what i need.



Do you have some code in the "Before record edited" or "After record edited" events? Check firebug for errors.

T
Tayyab Ilyas author 10/15/2012

Thanks all i solved the issue. To help others:
I have added below code to Event List Page:Before SQL Query and changed advance security to user can edit and see other users data
$strWhereClause = whereAdd($strWhereClause,"claimtousermapping.userID='".$_SESSION["UserID"]."'");