This topic is locked
[SOLVED]

 Assign a 'worker' to a 'location'

10/21/2014 5:18:10 AM
PHPRunner General questions
S
shoppy author

I will try to explain what I want/need.

The project contains a few locations with houses to give care to children.

Under 'Location' all the children are located that live at that location (logical huh?)

The carers (workers) can login and work in all the locations because they all worked at all the different locations.

But now, because of some changes, every worker just works at one location.

So now I have to change the rules that a worker cannot login another location any more.
But right now a worker is not assigned to a location. How do I do that?
I have a table called "Location" and a different table "Worker".

(Still working with PHPRunner 4.2)

S
shoppy author 11/6/2014

Now one knows?
I was playing with the security but can't figure it out.

S
Sergej 11/6/2014

Perhaps with S_Session variable Worker and to see who is logged in and added fiel worker to location table to define which worker can see which location....

then somethimg like this in before SQL query event for location

{

$strWhereClause = whereAdd($strWhereClause, "Worker = '".$_SESSION["Worker"]."'");

}

you can add wit or mor worker names for same location

S
swanside 11/7/2014

In your workers table, add a new field as location. Then edit all the workers to have location id based upon the location.

On the Security page, you can set that the users can only se there data, so set the worker locationId ad the site Id as the same.

Then when a worker logs in there location ID must match the site Id

S
shoppy author 12/27/2014



In your workers table, add a new field as location. Then edit all the workers to have location id based upon the location.

On the Security page, you can set that the users can only se there data, so set the worker locationId ad the site Id as the same.

Then when a worker logs in there location ID must match the site Id


Thanks, that worked!