Gossamer Forum
Home : Products : DBMan : Customization :

Multiple forms with one database

Quote Reply
Multiple forms with one database
I'm doing this thing that require different entry for every user. There will be a database with different set of form for different set of user, example student from Computing department fill in one form and from engineering department another form, how do i overcome this. Since I want the user to be promt the correct form when he/she login.

Please help me, Thanks
Quote Reply
Re: Multiple forms with one database In reply to
How would the script know which department the student is from? Or is that what you're asking? Smile

You could make a different type of userid for each department -- computer students would be, for example, "ComUserID" and engineering students would be "EngUserID." Another way would be to add fields to the password file, but the only way I can see doing this would be to add a field for every possible department, which would be excessive.

Even though the students from different departments are going to use different forms, are you still using the same database for all of them?


------------------
JPD





Quote Reply
Re: Multiple forms with one database In reply to
What I mean here is that, the database have been set with the user and their course is set. The user login, then by looking at the course they doing in the database, how that the dbman could determine which form to give them to fill in, which for every case the form is different in input but same in value. The same database is expected to be use for every student.
Quote Reply
Re: Multiple forms with one database In reply to
So you want it to look up the value in the database after a user logs in to determine which form to use.

Having different forms is not a problem. You set up each form in a subroutine, with each subroutine having a unique name. Then when they add or modify, you switch them to the right one using "if" statements

Code:
if ($condition eq "option1") {
&html_record_form_1(&get_defaults);
}
elsif ($condition eq "option2") {
&html_record_form_2(&get_defaults):
}

The problem is in figuring out what value the variable "$condition" is. And I'm afraid I'm still not clear enough on the structure of your database to know how to define it.


------------------
JPD