It's incredible how smart you are!!! :)
Thank you Campbell!! Works like a dream!
Jill
On Fri, Mar 23, 2012 at 12:57 AM, Campbell Morrison <
campbell.morrison@...> wrote:
> Sorry – the code should be****
>
> ** **
>
> global $tbl_users;****
>
> $user = getUserName();****
>
> if (isset($user))****
>
> {****
>
> $room = sql_query1("SELECT R.id****
>
> FROM $tbl_room R, $tbl_users U****
>
> WHERE R.room_admin_email=U.email****
>
> AND U.name='" . addslashes($user) . "'****
>
> AND R.disabled=0****
>
> AND R.area_id=$area****
>
> LIMIT 1");****
>
> if ($room >= 0)****
>
> {****
>
> return $room;****
>
> }****
>
> }****
>
> ** **
>
> You will also need to change the function get_default_area() adding the
> following code just after the global declarations:****
>
> ** **
>
> global $tbl_users;****
>
> $user = getUserName();****
>
> if (isset($user))****
>
> {****
>
> $area = sql_query1("SELECT area.id****
>
> FROM $tbl_room R, $tbl_users U, $tbl_area A****
>
> WHERE R.room_admin_email=U.email****
>
> AND U.name='" . addslashes($user) . "'****
>
> AND R.area_id = A.id****
>
> AND R.disabled=0****
>
> AND A.disabled=0****
>
> LIMIT 1");****
>
> if ($area >= 0)****
>
> {****
>
> return $area;****
>
> }****
>
> }****
>
> ** **
>
> ** **
>
> Campbell****
>
> ** **
>
> ** **
>
> ** **
>
> *From:* Jill Jensen [mailto:jillian.e.jensen@...]
> *Sent:* 23 March 2012 00:50
> *To:* mail@...; General purpose list
> (support/developers/users)
>
> *Subject:* Re: [MRBS-general] Default Room - Based On User Login****
>
> ** **
>
> Thanks Campbell!!!****
>
> ** **
>
> The code works great when the user logs in it goes directly to their room
> however when you switch areas it's not finding any bookings.****
>
> I've searched and searched through all the code but can't find why it's
> not linking properly.****
>
> ** **
>
> I'm perplexed. Am I missing something?****
>
> ** **
>
> Many, many thank yous for all your help.****
>
> ** **
>
> Jill****
>
> On Thu, Mar 15, 2012 at 9:13 AM, Campbell Morrison <
> campbell.morrison@...> wrote:****
>
> If you insert the following piece of code in get_default_room() just after
> the global declarations I think it should do the trick:****
>
> ****
>
> global $tbl_users;****
>
> $user = getUserName();****
>
> if (isset($user))****
>
> {****
>
> $room = sql_query1("SELECT R.id****
>
> FROM $tbl_room R, $tbl_users U****
>
> WHERE R.room_admin_email=U.email****
>
> AND U.name='" . addslashes($user) . "'****
>
> AND R.disabled=0****
>
> LIMIT 1");****
>
> if ($room >= 0)****
>
> {****
>
> return $room;****
>
> }****
>
> }****
>
> ****
>
> I haven’t tested it though.****
>
> ****
>
> Campbell****
>
> ****
>
> ****
>
> ****
>
> *From:* Jillian Jensen [mailto:jillian.e.jensen@...]
> *Sent:* 15 March 2012 15:19
> *To:* mail@...; General purpose
> list(support/developers/users)
> *Cc:* General purpose list (support/developers/users)
> *Subject:* Re: [MRBS-general] Default Room - Based On User Login****
>
> ****
>
> Yes. I'm using. Db. ****
>
> ****
>
>
>
> Sent from my iPhone****
>
>
> On Mar 15, 2012, at 12:32 AM, "Campbell Morrison" <
> campbell.morrison@...> wrote:****
>
> What authentication scheme are you using? If it’s the ‘db’
> authentication scheme, then it should be possible.****
>
> ****
>
> Campbell****
>
> ****
>
> ****
>
> ****
>
> *From:* Jill Jensen [mailto:jillian.e.jensen@...>]
>
> *Sent:* 15 March 2012 02:54
> *To:* mrbs-general@...
> *Subject:* [MRBS-general] Default Room - Based On User Login****
>
> ****
>
> Thank you in advance for reading my post!****
>
> ****
>
> I've seen a few similar requests but I just haven't been able to solve my
> question.****
>
> ****
>
> I'd like the default room to be displayed based on the user. Right now my
> only users are room admins. ****
>
> Can the function get_default_room be altered so that it shows the room
> that matches the user. For example the room admin email will equal the
> user's email so default to the room that matches when they log in. Or if I
> were to make their user name their email address, can I call the php
> session variable into a query to show the default room.****
>
> ****
>
> I really hope that makes sense. :) I think it would be a simple query but
> I just can't quite figure it out. It's driving me crazy!! :)****
>
> ****
>
> Thanks again!****
>
> ****
>
> Jill ****
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure****
>
> _______________________________________________
> mrbs-general mailing list
> mrbs-general@...
> https://lists.sourceforge.net/lists/listinfo/mrbs-general
> Want to unsubscribe:
> mailto:mrbs-general-request@...>
> ****
>
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> mrbs-general mailing list
> mrbs-general@...
> https://lists.sourceforge.net/lists/listinfo/mrbs-general
> Want to unsubscribe: mailto:mrbs-general-request@...
> ?subject=unsubscribe****
>
> ** **
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> mrbs-general mailing list
> mrbs-general@...
> https://lists.sourceforge.net/lists/listinfo/mrbs-general
> Want to unsubscribe: mailto:mrbs-general-request@...
> ?subject=unsubscribe
>
>
|