Steps to Create a Management Users Menu in PHPMaker

Paramita Daniswari
5 min readJul 2, 2024

--

Hi all! Welcome to PHPMaker tutorial Series..

Today we will learn about how to make management user menu in PHPMaker.

1. Set Up Users Table and Master Users Table In The Database

When entering user data into the Users Table, users don’t need to type it manually. Instead, they can use the master table as a reference and utilize the autofill feature in PHPMaker to automatically populate the Users Table. The master table contains all company users, while the Users Table includes only those specific users who have been granted access to the website. Make sure the primary key of Users Table is the foreign key in Master Users, also Users Table must include role, username, password, user’s name, key user. These fields important for the further step.

2. Import The Tables Into PHPMaker

Picture 1. Load Table by Sync

Import tables into phpmaker by click the Synchronize Button.

Picture 2. Master user Table

make sure primary key of master_users is checked.

3. Configure The Role and Security Settings

After importing the tables, click Security tab

Picture 3. Choose Security Tab

After chosing security tab, let’s define our users table. Check “Use Existing Table” and choose our users table. Define the username and password field as we defined in database before. Click “Advance” to setup the role and security.

Picture 4. Define Users Table

configure the users level as shown below :

Picture 5. Setting Up The Role

In PHPMaker, each user category or level has a unique role value. As shown in Picture 4, these user categories range from Anonymous to pt_utama, each assigned a specific integer value: Anonymous is -2, Administrator is -1, Default is 0, and so on, up to pt_utama at 3. These values must align with the corresponding role values in the database. Anonymous users can access the site without logging in, while default users can only access it after logging in successfully.

To add new levels, right click on “User levels” then click add user :

Picture 6. Add User level

We can configure which menus are allowed to each user :

picture 7. Configure Users Table

Make sure on the Default role, users table cannot add, delete, edit. We will make view from users table on the next step.

4. Make Custom View of Users Table

After configuring the roles and security settings, the next step is to set up the users table. In PHPMaker, it is not recommended to perform CRUD operations directly on the users table. Instead, create a custom view from this table and perform CRUD operations on the custom view. Let’s name this custom view v_manajemen_user. Here are the steps:

Right click on “Custom Views” :

Picture 9. Add Custom View

Select “No” Option for this dialogue

Picture 10. Select No

Rename the custom view and add the object

Picture 11. Change view name

Chose Users Table because our object of this custom view is Users Table

Picture 12. Add Object

Choose All columns and click OK.

Picture 13. Add All columns

Now We have “new” Users Table called v_manajemen_users. We will perform CRUD of Users Data on this table.

5. Configure The “New” Users Table

To perform CRUD Data in our new Users Table, we have to ensure the security is already set-up. Go to Security tab setting

Picture 14. Choose Security Tab

on Default level, make sure add, edit, delete, list, lookup, search, view is already checked.

Picture 15. Configure the access

also, make sure the lookup for master users is already checked.

Picture 16. Make Sure to check the lookup

Click Ok then go back to v_manajemen_users:

Picture 17. Choose v_manajemen_user

Let’s make automatic fill while inserting the table. First, setup the Look-up Table on NRP (key) column :

Picture 18. Lookup Table to Master Users

Customize the autofill feature :

Scroll down on the left-down of the window and find the autofill column. Change the value to “True” as shown below :

Picture 19. Choose “true” for Auto fill

then clicked the circled button as shown below :

Picture 20. Advance Setting

then the autofill menu will shown :

Picture 21. Set-up the Autofill Columns

chose the column that will be autofill by master table. then click OK.

then let’s configure the CRUD, click the v_manajemen_user then choose the Table tab then configure as shown below :

Picture 22. Set-Up CRUD on v_manajemen_user

6. Customize The Menu

After setting the new users table, let’s configure the menu. Click menu editor

Picture 23. Menu Editor

On the menu Item rename the v_manajemen_users to “Manajemen User” as shown below :

Picture 24. Rename The Menu

make sure to check navbar Item so the menu will be placed on header, if navbar item is not checked then the menu will be placed on sidebar. Anonymous User is not allowed to access it so don’t check the “Allow Anonymous User”.

7. Generate The Project

Generate the project and call it on localhost.

Picture 25. Generate The Project

The result will be looks like this

Picture 26. The result of Management Users Page
Picture 27. Add page for Management Users page

That’s All.

Thank you for reading, and happy learning!

--

--

Paramita Daniswari
Paramita Daniswari

Written by Paramita Daniswari

Programming Enthusiast - The written words yearn for timeless wings

No responses yet