
nmsinc
User
Dec 16, 2011, 7:10 AM
Post #7 of 15
(1035 views)
Shortcut
|
|
Re: [Jason] Problem with List Options in CMS
[In reply to]
|
Can't Post
|
|
Hi Jason, Thanks for the update - you can see below where I took your suggestion and tweaked it a little. Now I have another issue I'm dealing with. The top section listed below is code placed in the field "List Options". This allows (if admin) to choose any company from the "member_companies" table, all other users are subject only to the member company that has been assigned to them in the user "accounts" table. This section works as needed! The field labled "assigned_adjuster" follows within the same record. If the user is the "admin" or the user has the rights of an Independent, then I need this field to list only user "accounts" that match the company choice in the previous field - see the if admin code I already have that does not work in the section labeld "Assign Adjuster" blelow: --------------- Field = "member_company" -------------- [all of this works OK] <?php if ($CURRENT_USER['isAdmin']):?> SELECT num, member_company_name FROM `<?php echo $TABLE_PREFIX ?>member_companies` <?php elseif ($CURRENT_USER['company_type'] == "Insurance"):?> SELECT num, member_company_name FROM `<?php echo $TABLE_PREFIX ?>member_companies` WHERE <?php echo $CURRENT_USER['member_company_accounts'] ?> = `<?php echo $ESCAPED_FILTER_VALUE ?>num` <?php else: ?> SELECT num, member_company_name FROM `<?php echo $TABLE_PREFIX ?>member_companies` <?php endif ?> ---------------- Field = "assigned_adjuster" ---------------- [the first php if statement for admin is where I need help] <?php if ($CURRENT_USER['isAdmin']):?> SELECT num, fullname FROM `<?php echo $TABLE_PREFIX ?>accounts` WHERE "member_company" = '<?php echo $ESCAPED_FILTER_VALUE ?>num' AND user_type = 'Adjuster' <?php elseif (!$CURRENT_USER['isAdmin']):?> SELECT num, fullname FROM `<?php echo $TABLE_PREFIX ?>accounts` WHERE <?php echo $CURRENT_USER['member_company_accounts'] ?> = `<?php echo $ESCAPED_FILTER_VALUE ?>member_company_accounts` AND user_type = 'Adjuster' <?php else: ?> SELECT num, fullname FROM `<?php echo $TABLE_PREFIX ?>accounts` WHERE user_type = 'Adjuster' <?php endif ?> ---------------------------------------------------------------------- Thanks nmsinc
(This post was edited by nmsinc on Dec 16, 2011, 7:18 AM)
|