This topic is locked

Each user can access cities and towns according to his / her region....

7/25/2017 4:19:06 AM
PHPRunner General questions
C
casuva author

I want the user to have authority to access cities and townships according to the region they are in.

I want you to have access to the towns and villages of these cities only to the cities that are located in their own territories.

I created a structure for it below, but I can only do it on the city charts.
How can I make this effect in other tables by making use of the relationships in cities?
If this is not possible, I will add the "bolgesi" field in the other table.

thank you so much.
respects.
Database diagram screen shoot (as png file)
https://drive.google.com/open?id=0B79rUTj4GAXabGZZQUpTdllvTzA
Bolgesi = Region

IL_ADI = city

ILCE_ADI = town

MAHALLE_ADI = village

romaldus 7/25/2017

In Phprunner After successfully login event, save user data in a session variable:

$_SESSION["region"] = $data["bolgesi"];


and than in visual editor > lookup wizard > use the following code in WHERE field to filter city by user region.

"bolgesi = '".$_SESSION["region"]."'"
C
casuva author 7/25/2017

Thanks for helping <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=82752&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
Actually, I thought that I could do all the work by using the "BOLGESI" field in the "il" table.
Otherwise, I have to create "bolgesi" field in all tables.
Same data always repeating.
I may be wrong because I'm new, but do you think I'm wrong.
Respects..

romaldus 7/25/2017

You only need to link the bolgesi field to the 2nd table. For the rest tables, use phprunner dependent lookup feature.