Reputation: 1
Hi My scenario is like if suppose employee1 had created 3 client and employee2 had created 4 client, What i need is that employee1 logged he must see only those detail of client which he had created. Please guide me out how to proceed , bit confused about how create a table structure and how to get filter criteria.
Thanks
Upvotes: 0
Views: 40
Reputation: 62260
First of all, you need a Login, so that employees can to login to your site. Otherwise, you do not know which employee created which client.
Then, you need a business logic in which employee can only retrieve his/her client.
In database, you need to create a column to keep track of who created this client record.
EmployeeId | Username | Password
-----------+---------------------
1 | johndoe | hashed
2 | marrydoe | hashed
RoleId | Name
-------+--------------
1 | Administrator
2 | Employee
EmployeeId | RoleId
-----------+--------
1 | 2
2 | 2
ClientId | EmployeeId | Some other data
---------+------------+-----------------
1 | 1 | ...
2 | 1 | ...
Upvotes: 1