This topic is locked

User controlled selections

6/17/2008 5:03:21 PM
PHPRunner General questions
H
horsey_kim author

I have 7 different levels of users. Each user is only allowed to pick various options for a record. Not every user level is the same and some do share the same options.
Example: User Level 1 might be able to pick "sell, jacket, turns" where user level 2 can pick "sell, mark, diamond"
Instead of creating the same page for all 7 levels. I created a table that has the following fields: userlevel, options
My idea was that I could just enter in all the optional choices for each level in the table. Then in the visual editor on that page I could use the lookup table feature. So that only the options come up that person level would allow.
I have a user table where each users - usernames, passwords and userlevel is assigned. Then the options table with options and userlevel fields. How would I get the logged in user's userlevel to match up with the options table userlevel.
Does this make sense?

J
Jane 6/18/2008

Hi,
I think you need to create field where userID or username will be stored in the userlevel table and then use this field for linking these tables.

H
horsey_kim author 6/22/2008

Jane or someone,
Using lookup wizard - I saw where you could put in a where statement. I checked and the $_session["GroupID"] is picking up the group Id I need to pick out the user level instead of putting in a user name for every field.
I though I use the where statement in the lookup definition of the wizard. Based on the example provided in the where entry box.
I entered this: "userlevel = ".$_SESSION["GroupID"]
but I get an error on line 120 ( Parse error: syntax error, unexpected '=' in /home/oregro/public_html/oretrade/include/commonfunctions.php on line 120 )
Am I entering [b] Wrong?
the example says to enter as [color=#0000FF]"user = ".$_SESSION["OwnerID"]

H
horsey_kim author 6/22/2008

this worked in the where statement for the lookup wizard, when using the group permission for security.
"userlevel = '".$_SESSION["GroupID"] . "'"
COMMENT - Maybe the examples in the lookup wizard could be changed to using the right amount of " and ' - I am using a mysql database and the way the example is now it failed.
thanks <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=30486&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />