Universal PHP Admin is a php script that is created to manage any type of php application or website. It provides a flexible backend or content management system (CMS) that can be easily customized to manage a blog, a gallery, a poll e.t.c. It comes with its own user authentication system that allows for granular management of the access that the users have to the backend. With this script you will not have to keep creating backends for every php project from scratch.
That's it!
If you're new to Universal PHP Admin, please read the Getting Started section to begin using Universal PHP Admin.
Once Universal PHP Admin has been installed you will been to configure it so that it can your specific application. Universal PHP Admin is design with the assumption that all the objects in your application have a corresponding table in your database. Configuring Universal PHP Admin entails defining the tables for these objects and their fields
To start configuring Universal PHP Admin, just sign in and click on the configure link at the top-right area on the Admin dashboard.
First we will need to add a table. To define a table all you need is the table's name and a display name that will be convinient for users. For example, lets say that you have a poll application that you need to manage and the poll questions are saved in a table named mysite_polls. You would define this table by providing its name as mysite_polls and a display name Polls.
After you click save you will then be directed to define the fields for this table.
For your own convinence you will need to start by defining tables that are not linked to other tables. For example if you have a table for polls questions and another for the choices for these questions, you would need to start by defining th table for the polls and then the one for the choices.
To define a field you will need to provide the following information. Please read this section carefully.
Depending on the input widget that you will have selected for a field you may be needed to provide additional information:
Checkbox:
A checkbox widget require you to specify the value that will be saved if it is checked and another value if the the checkbox is not checked. You will also need to specify if it is checked or not by default
Foreign Key:
For this widget you will need to select the table to which this field is linked to.
Date/Time :
You will need to specify the format that will be used to save the date. The format should be the PHP style, i.e. D F j, Y, g:i a. If this value is not provided then the timestamp is saved. You could also choose to make it that the field is automatically filled with the current timestamp when a record is created or updated
Upload File:
You will need to specify the path to the folder where the uploaded file will be saved. This path need to be relative to the administration folder of the Universal PHP Admin package. You will also need to specify the allowed file extensions in this format: png|jpg|gif|swf
Select options:
You will need to specify the options This widget will use the select form element. For each option that can be selected you will need to specify the value that will be displayed and the value that will be saved. For example, lets say that you want to save the gender of a person as F or M but you want the person that will input the information to see either Female or Male. You will need to input the options as
The widget in the add and change forms will look like this
Note: Each tables needs one field to be the primary key and one field to be the string representation. If either of these two is missing then the table is not displayed in the Admin Dashboard
Once you have defined the tables and their fields then you can start managing them from the dashboard
In the Admin Dashboard there are 3 area that can be accessed:
The things that a user can do in the Dashboard can be controlled using the permissions that their roles have.
Everytime a table is defines permissions to add, change and delete the table's items are also automatically created.
The authentication system can also be used to manage pages that are not part of the admin dashboard. To do this all you need to do is:
To access user information from the session variables:
You can further customize Universal PHP Admin adding your own validation rules for input and actions to be performed on items.
To add you own validation you will need to first add a function for doing the validation in the file includes/validation.php. The function should be something like this:
After you have created the function, add its details to the __construct() function of the class like this:
$this->validation_functions[] = array('table'=>'the_table_name', 'field' => 'the_field_name', 'function'=>'the_function_name');
That is all it takes.
Actions can be performed on items in the change list.
To add an action you will need to first add the function in the file includes/actions.php. The function should be something like this:
After you have created the function, add its details to the __construct() function of the class like this:
$this->action_functions[] = array('table'=>'the_table_name', 'function_name'=>'the_function_name', 'display_message'=>'The name for the action to in the select list');
That is all it takes.
The following are the styling changes that you might want to make:
This script has been prepared for translation. To translate it, simple follow these instructions.