AdminPRO

AdminPro / Documentation


Introduction


First of all, Thank you so much for purchasing this template and for being my loyal customer. You are awesome!
You are entitled to get free updates to this product + exceptional support from the author directly.

This documentation is to help you regarding each step of customization. Please go through the documentation carefully to understand how this script is made and how to edit this properly. Basic HTML, CSS & PHP knowledge is required to customize this script.

Requirements

You will need the following requirements to customize this template.

  1. PHP 5.6+
  2. MYSQL
  3. Code Editing Software (eg: Visual Studio Code, Sublime Text or Notepad)
  4. Web Browser for testing (eg: Google Chrome or Mozilla Firefox)
  5. FTP Tool to upload files to Server (eg: FileZilla)

Be careful while editing the script. If not edited properly, the layout may break completely.
No support is provided for faulty customization.

Getting Started

AdminPro is easy to use admin panel with all basic tools that start development of your amazing web application. Script is built with Codeigniter 3 and uses AdminLTE 3 theme. This Script is starter script made for developers to directly start work on their applications instead of creating basic functionalities like login, users, logs, etc etc which saves time and also saves you from that boring setup. Just Install & you're ready to go.

Before installation

Make sure Downloaded the latest code from Codecanyon

How to Install AdminPro

Steps to install manually

Make sure you downloaded latest code. These steps only apply to AdminPro v2.1.0 & upcoming which are based on Codeigniter 4.

  1. Extract Zip file
  2. Open .env file located in root folder of code in Notepad or any editor
  3. Edit Database Configuration & other Details
  4. Create a Database in MYSQL & import the sql provided with code.
  5. After that, Open the url in Browser, it will take directly to login page

    Username Password
    admin admin123
  6. All Done ! Ready to Start
  7. Now you start The Development Work. You can refer to Developer Documentation for more info.
  8. Happy Coding :)

Steps to Install via Composer

Make sure you downloaded latest code. These steps only apply to AdminPro v2.1.0 & upcoming which are based on Codeigniter 4.

  1. Extract Zip file
  2. delete vendor folder if exists
  3. Go to command line & go to root of folder. Then run this command
    composer install
  4. Open .env file located in root folder of code in Notepad or any editor
  5. Edit Database Configuration & other Details
  6. Create a Database in MYSQL & import the sql provided with code.
  7. After that, Open the url in Browser, it will take directly to login page

    Username Password
    admin admin123
  8. All Done ! Ready to Start
  9. Now you start The Development Work. You can refer to Developer Documentation for more info.
  10. Happy Coding :)

Dependencies & Plugins

Note! You need to load the js/css files of the plugin that you want to use. AdminLTE doesn’t load automatically all plugins, this would cause huge load times on every page load.

Dependencies


Plugins

Roles & Permissions

Here, you can manage roles & permissions for the users. You can manage which role can have access to which section/feature

  • Permissions -> Roles -> Users
  • This means, Permissions are attached to roles and further roles can be linked to users. So, to change any permission for specific role, just edit and update permissions. It will be applied to all users linked to that role.

To implement any permission, hasPermission function can be called to check if logged in user has access to the particular permission

hasPermission('permission_code_name')

Another way to check for permission is

                                    if(ifPermission('permission_code_name')):
                                        return redirect('path');
                                    endif
                                

Settings

Settings are provided to manage application and configure with ease. To standardize some tasks, like date format, timezone, etc. This section will allow us to manage application from one place.

To access any setting. It returns value

setting('key')

FAQ's

Can i customize this script ?

Yes, the script can be customized easily. iv>

Can i change theme ?

Yes, Changing theme is possible. However, It will require some knowledge of codeigniter directory structure.

Does it have Crud Operations available ?

Crud Operations are avilable but only for database table functions. Every Model that extends MY_MODEL class can access to crud functions. Documentation will be available soon.

Support Desk

Please remember you have purchased a very affordable script. Occasionally we will help with small tweaks, but these requests will be put on a lower priority due to their nature. Support is also 100% optional and we provide it for your connivence, so please be patient, polite and respectful.

Please visit our profile page or ask question ramansaluja849@gmail.com

Support for my items includes:
  • * Responding to questions or problems regarding the item and its features
  • * Fixing bugs and reported issues
  • * Providing updates to ensure compatibility
Item support does not include:
  • * Customization and installation services
  • * Support for third party software and plug-ins
Before seeking support, please...
  • * Make sure your question is a valid Issue and not a customization request.
  • * Make sure you have read through the documentation and any related video guides before asking support on how to accomplish a task.
  • * Make sure to double check the AdminPro FAQs.
  • * If you have customized code and now have an issue, back-track to make sure you didn't make a mistake. If you have made changes and can't find the issue, please provide us with your changelog.
  • * Almost 80% of the time we find that the solution to people's issues can be solved with a simple "Google Search". You might want to try that before seeking support. You might be able to fix the issue yourself much quicker than we can respond to your request.
  • * Make sure to state the name of the item you are having issues with when requesting support via Codecanyon.

Version History (Changelog)

Once again, thank you so much for purchasing this script. As I said at the beginning, I'd be glad to help you if you have any questions relating to this script. No guarantees, but I'll do my best to assist. If you have a more general question relating to the project on Codecanyon, you might consider visting FAQ's section.


Changelog

                                # Version 2.1.0
                                
                                - [upgrade] upgraded from codeigniter 3 to codeigniter 4
                                - [fixed] reported bug fixed
                                
                                # Version 2.0
                                    
                                - [new] multi language support
                                - [new] latest bootstrap 4
                                - [new] new design
                                - [upgrade] upgraded to bootstrap 4
                                - [upgrade] upgraded to AdminLTE 3
                                - [update] new documentation design & structure with developer documentation merged
                                - [fixed] reported bug fixed
                            
                                # Version 1.2
                            
                                - [fixed] minor bugs
                                - [fixed] login by changing value '1' from cookie
                                - [update] upgraded to latest CI version 3.1.11
                                - [update] secured login system with additional validations and security practices
                                - [update] documentation redesign
                                - [new] separate tab in profile page for changing password
                                - [new] google recaptcha with enable/disable feature
                                - [new] manage email template directly in settings
                                - [new] custom 404 & 403 error pages according to theme
                                - [new] user status active/inactive
                                - [new] enabled csrf protection & xss clean, prevent sql injection 
                                - [new] developer documentation
                                - [new] ability to change login page background image
                            
                            
                                # Version 1.1
                            
                                - [Fixed]		Reported Bugs
                                - [Fixed]		Roles & Permissions in session when user is logged in
                                - [Fixed]		Roles name in users list
                                - [New]		Added Option to change Login Theme
                                - [New]		New Database Backup Feature 
                                - [New]		Upgrade to Codeigniter Version 3.1.10
                                - [New]		All AdminLTE Components are included as shown in demo
                                    
                                
                                


                                      

Copyright and license

Code released under the Un License License.

For more information about copyright and license check choosealicense.com.

Files & Sources

Note! It is recommended that you understand Codeigniter 4 files & folder structure as this application is built with codeigniter framework. To know more click here !


Included Folders
                                    /app
                                       
                                        /Config -  Stores the configuration files
                                       
                                        /Controllers -  Controllers determine the program flow
                                       
                                        /Database -  Stores the database migrations and seeds files
                                       
                                        /Filters -  Stores filter classes that can run before and after controller
                                       
                                        /Helpers -  Helpers store collections of standalone functions
                                       
                                        /Language -  Multiple language support reads the language strings from here
                                       
                                        /Libraries -  Useful classes that don't fit in another category
                                       
                                        /Models -  Models work with the database to represent the business entities.
                                       
                                        /ThirdParty -  ThirdParty libraries that can be used in application
                                       
                                        /Views -  Views make up the HTML that is displayed to the client.

                                

Controllers

Controllers are entry points for your application. Format for urls is

http://website.com/controller/method


AdminBaseController

It is recommended for controllers which may have admin page layout or accessible after logged in. These Controllers must extend AdminBaseController. You can explore other controller to understand more.

To create a controller
  1. Create a New File in ./app/Controllers folder following naming conditions.
  2. Copy the below code and paste it your file
                                <?php
                                
                                namespace App\Controllers;
                                
                                use App\Controllers\AdminBaseController;
                                
                                class Dashboard extends AdminBaseController
                                {
                                
                                    public function index()
                                    {
                                        return view('admin/dashboard');
                                    }
                                }

                            

Models

Models are the one which interacts directly with Database and responsible for tasks related database like exectuing SQL.


BaseModel

Models which you can create should extend BaseModel. It will give you access to CRUD functionality.

To create a model
  1. Create a New File in ./app/Models/ folder
  2. Copy the below code and paste it your model file
                                <?php
                                
                                namespace App\Models;
                                
                                use App\Models\BaseModel;
                                
                                class ModelName extends BaseModel
                                {
                                    protected $table = 'roles';
                                    protected $primaryKey = 'id';
                                    protected $returnType = 'object';
                                    protected $allowedFields = ['title'];
                                }

Views

Views includes code which can have html, css, php and displays data/result to user. Basically, it includes UI of your application

To create a view
  1. Create a New File in ./application/views/ folder following naming conditions.
  2. Copy the below code and paste it your views file
<?= $this->extend('admin/layout/default') ?>
<?= $this->section('content') ?>

<!-- Content Header (Page header) -->
<section class="content-header">
  <div class="container-fluid">
    <div class="row mb-2">
      <div class="col-sm-6">
        <h1><?php echo lang('App.name') ?></h1>
      </div>
      <div class="col-sm-6">
        <ol class="breadcrumb float-sm-right">
          <li class="breadcrumb-item"><a href="<?php echo url('/') ?>"><?php echo lang('App.home') ?></a></li>
          <li class="breadcrumb-item active"><?php echo lang('App.name') ?></li>
        </ol>
      </div>
    </div>
  </div><!-- /.container-fluid -->
</section>

<!-- Main content -->
<section class="content">

  <!-- Default card -->
  <div class="card">
    <div class="card-header with-border">
      <h3 class="card-title"><?php echo lang('App.name') ?></h3>
    </div>

    <div class="card-body">
      content...
    </div>
    <!-- /.card-body -->

  </div>
  <!-- /.card -->

</section>
<!-- /.content -->


<?= $this->endSection() ?>

<?= $this->section('css') ?>
<style>
/*  code... */
</style>
<?= $this->endSection() ?>

<?= $this->section('javscript') ?>
<script>
// code...
</script>
<?= $this->endSection() ?>

Helper Functions

  1. Create Url

    url('/');
  2. Get Assets Url

    assets_url('/');
  3. Get Upload Path Url

    urlUpload('/');
  4. Get User Profile Image Url by ID

    userProfile(1);
  5. Get POST Input

    post(key);
  6. Get GET Input

    get(key);
  7. Allow when POST input data is sent

    postAllowed();
  8. Print Data (used in debugging);

    dd($data);
  9. To Check if User Logged In

    is_logged();
  10. Get All Data of Logged In User

    logged();
  11. Get Specific Data of Logged In User

    logged(key);
  12. Function to show amount using custom format

    currency( amount );
  13. Get value of any Setting using key

    setting( code );
  14. Generate HTML breadcrumb

    breadcrumb( [ '/admin' => 'Admin' ] );
  15. Get Visitor IP Address

    ip_address();
  16. Get Basic Shortcodes available for all Email Template

    getEmailShortCodes();
  17. To Check if user has permission to access specific modole/section otherwise it will show 403 error

    ifPermissions(code);
  18. Only Checks permission using code, and returns boolean

    hasPermissions('key');
  19. Obfuscate Email

    obfuscate_email(email);
  20. Modules List

    modules();
  21. Check If Module Exists

    hasModule("moduleName");
  22. More Funtions will be added in future updates....

MY_MODEL

This is a custom controller which is extended by other models
Basically It provides some basic functions which are used to perform the operations on a table
For Example -- CustomerModel extends MY_Model, so functions available will be :

                                    $model = model('CustomerModel');
                                
  • To Get Data

    $model->get();
  • To Get Data Row By ID

    $model->getById($id);
  • To Get Specific Data Column-Row By ID

    $model->getRowById($id, $row);
  • Insert the data adn returns inserted ID

    $model->create($data);
  • Insert the batch data i.e multiple data

    $model->createBatch($data);
  • Update the data by ID

    $model->update($id, $data);
  • Delete the data by ID

    $model->delete($id);
  • Select Data with where conditions with custom arguments

    $model->getByWhere( $whereArg, $args = [] );
  • Predict the next ID for a table

    $model->predictId();
  • Total Number of Rows in a Table

    $model->countAllResults();