Set up logins
Posted: Thu Jul 15, 2010 9:58 am
Hello. I have a little coding dilema. I am making an application, but i think i better explain by an example.
I have to make different logins for people at my job. Lets say "login 1", "login 2", "login 3", "login 4" and "login 5". Not everybody needs those logins, some people only need "login 1" or "login 2" and "login 3".
There is one person that says the name of the employee and which logins he needs. Another person sets up the logins. I have a form for the first person where he can write the name of the person and have 5 checkboxes for the different logins. The second person would get the name of the person and the id and password box for every login.
The way I have it set up right now is that the table has the following:
id
employee_name
needs_login1
login_1_id
login_1_ps
needs_login2
login_2_id
login_2_ps
needs_login3
login_3_id
login_3_ps
needs_login4
login_4_id
login_4_ps
needs_login5
login_5_id
login_5_ps
Meaning, if needs_login1 is equal to 1 then show the boxes for login_1_id and login_1_ps. It does that through a couple of if statements. I find my way very messy. What would be the best way to do this? let me know if you dont understand. Thank you.
I have to make different logins for people at my job. Lets say "login 1", "login 2", "login 3", "login 4" and "login 5". Not everybody needs those logins, some people only need "login 1" or "login 2" and "login 3".
There is one person that says the name of the employee and which logins he needs. Another person sets up the logins. I have a form for the first person where he can write the name of the person and have 5 checkboxes for the different logins. The second person would get the name of the person and the id and password box for every login.
The way I have it set up right now is that the table has the following:
id
employee_name
needs_login1
login_1_id
login_1_ps
needs_login2
login_2_id
login_2_ps
needs_login3
login_3_id
login_3_ps
needs_login4
login_4_id
login_4_ps
needs_login5
login_5_id
login_5_ps
Meaning, if needs_login1 is equal to 1 then show the boxes for login_1_id and login_1_ps. It does that through a couple of if statements. I find my way very messy. What would be the best way to do this? let me know if you dont understand. Thank you.