I have Signup and UserWallet Table – the Signup table is where signup data is stored (for both Admin and user) and the UserWallet is where money is.
When admin logs in, Admin ID and wallet balance is displayed from the AdminWallet.
Here is how the structure of my “Signup” table to save new signup data looks like; it has 7 columns:
Email, pass, con_pass, Name, UserType, CreatedBy, CreateDate
I have two sets of people with access to one account (these two sets of people are Admin and Users). There are two Database Tables (Sign Up and User wallet). When an admin signs up and/or login, Admin ID and wallet balance will be displayed on the web forms, this data that will be displayed is gotten from the wallet Table. The admin ID is the Email of the Admin.
Then Admin will proceed to the dashboard and create new users that he or she will grant access to use the same account as Admin’s. Then when new user is created, the user will be linked to the Admin ID (as seen in the Database Table); the column CreatedBy represents the Admin ID who created the user. From the image of the database table, you can see that UserType column differentiates between Admin – A and User – U. How can I make it in such a way that when the new user created logs in, the Admin ID and wallet balance that created the user will be displayed exactly like when the Admin logs in?
For example, if an Admin (check@gmail.com) registers as new Admin and logs in, the ID and wallet balance of Admin (check@gmail.com) will display. Then Admin (check@gmail.com) proceeds to dashboard and creates new user (tyler@yahoo.com). The user (tyler@yahoo.com) will be under the Admin (check@gmail.com).
So what I want achieve is when the user (tyler@yahoo.com) logs in, the ID and wallet balance of Admin (check@gmail.com) will be displayed and the user will not be able to do some of the things the Admin does, which are see deposit button to make deposit or see dashboard too. But user can be able to use funds in the Admin's wallet and Admin can know if funds have been used.
The issue here is that the ID and wallet balance is gotten from wallet Table which has two columns (email and amount), and the user created has no record in the wallet table except the Admin. How can user be linked to Admin Id in wallet so that when user logs in the Admin ID and wallet balance will be displayed?