separating users

A

Anonymous

Guest
I want to separate users of my database. One method is to simply put them on different databases. At the same time I want a global view of all users and to check that they are not treading on each others toes. ie the items in their territory are exclusive. We cannot have three users banging on the same door.

As I see it as a newbie, not just to php but also to databases, I could put each user on a different table.
I am trying to think of a neat way to switching each user to his own table. Could I then have a master table which combines all with another username.

From where I stand this is new and no doubt there are several standard ways of treating the issue but I would be a fool if I did not first take opinion.

All suggestions appreciated
 
please explain why would you like to separate those users? to create different user types (admin, moderator, user and so on?)
or to have profiles?

as for each case there are some good ways of doing it..
 
It is about sales area. I am dealing with Benelux where we have two languages and I have two separate sales strategies. One where I generate leads and the other where the salesman gets his own. I am taking opinion on how to chop the cake from marketing experts.

A salesman's attitude is territorial. The finite leads need to be handed out carefully. Then I have to bring the whole thing together and present it to my principals who are in the UK.

This may sound like an empire but this is a business starting from scratch on a shoe string.
 
use id numbers for territorials and anything else needed: column terr_id should contain an id from the column 'territor' or something simmilar: i hope you know what i mean: i will be back alter today -- have to run now..
 
I may be able to guess or think something through. However I am not in a desperate rush. Will think a bit and wait till time is freer
 
Your solution, Alexie, is not clear to me.

Now I am clearer about my target.

There are four or five territories each with a salesperson who needs to be able log on to their own area only and for me to be able to organize, pass leads on etc.

I have found out how to get files onto Excel where I can sort them and then either run gzip or make a txt file and upload them. I point I note here is that in older versions of Excel "Saving as" in CSV format was simple. Now it seems not to be there. Is it elsewhere and is this point off topic? I am worried about duplicating entries...

I am fishing for a tried and tested format which will save me all the teething problems of constant modification to get it running smoothly
 
Peter Gardiner said:
Your solution, Alexie, is not clear to me.

Now I am clearer about my target.

There are four or five territories each with a salesperson who needs to be able log on to their own area only and for me to be able to organize, pass leads on etc.

I have found out how to get files onto Excel where I can sort them and then either run gzip or make a txt file and upload them. I point I note here is that in older versions of Excel "Saving as" in CSV format was simple. Now it seems not to be there. Is it elsewhere and is this point off topic? I am worried about duplicating entries...

I am fishing for a tried and tested format which will save me all the teething problems of constant modification to get it running smoothly
table users
user_id
name
territory_id
payment_id

table territory
territory_id
territory_name
......

table payment
payment_id
payment_ame
......

Other variant then on each territory need special payment system:
table users
user_id
name
territory_id

table territory
territory_id
payment_id
territory_name
......
| |
v v
table payment
payment_id
payment_ame
......
Other question
 
Wizard,

You certainly look close to God in that kit.

More seriously, I am mulling over your structure. At this stage payment does not matter as we are only handling the data on prospects. I will mull further.

In the meantime a fresh element springs


I have a session_start password routine. One of several users can enter and the session name depends upon their name.

On the first level where they can all enter, there is the option of editing which I want to confine to a specific user.

Is it feasible for them to click to the edit sheet where the following sits early on the page?


Code:
<?php
  session_start();

    if(!session_is_registered('name'))
      {
      echo 'You are not authorized to enter this zone.';
      exit;
      }
      echo "Lets get moving ".$_SESSION["name"]; 

?>

What I want to do is modyfy that
'name' element to the specific name such that others are excluded.

Or do we have to say that if only it were that simple?
 
for that you need to save anoter session variable which holds the privileges
eg..
Code:
<?php
$_SESSION['priv'] = array ('Section1','Section2');
?>

and in the following sections you check

Code:
<?php
if(array_search('Section1', $_SESSION['priv'])) {
  //allow
} else {
  //disallow
}
?>
 
Back
Top