CodeIgniter Forums
Advice on associating related entries - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Advice on associating related entries (/showthread.php?tid=12963)



Advice on associating related entries - El Forum - 11-05-2008

[eluser]patrick-vibes[/eluser]
I am fairly new to CI and throwing myself in the deep in developing a web app.

basically I need advice on how to achieve the following;

I have three tables:

"manager"

"staff_member"

"job"

(where manager and staff_member tables have a userID, name, email, password -- and job has jobID, details) I want client and job separated as there will be multiple jobs uploaded

I want to have the "manager" be able to log in and have a profile type landing page from which he/she sees a list of staff_member they have and a list of jobs they have, where staff_member and job lists are pulled from the database relating t the "manager" who is signed in.

I think I am right to assume that i need to use the "managerID" from the manager table to select from the "staff_member" and "job" tables respectively.

And from the listing of clients and jobs, have links to each table respectively, so the manager can click a link on a particular job to view who the client is or vise versa by clicking the link on a staff_member to see which jobs are related to them

Can someone please give me a a nudge in the right direction as to how to achieve this as I am not 100%.

Also, what is the most secure way to allow a manager to log in and view his/her clients and jobs - i.e. I dont want someone to be able to just spoof the URI to get a list.

Thanks in advance.

P.S. I am not trying to be lazy and look for someone to post the solution if thats what your thinking, but rather need a point in the right direction as to how to achieve this.


Advice on associating related entries - El Forum - 11-05-2008

[eluser]patrick-vibes[/eluser]
Cheers jermemyapp, seems a very logical way of implementing the db tables. I will do a google search and read up just to expand my knowledge on the normalization, as in the past I have not had to create very complex db's th table relationships.