PHPackages                             sisjosex/phpadmin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. sisjosex/phpadmin

ActiveLibrary[Admin Panels](/categories/admin)

sisjosex/phpadmin
=================

PHP/Mysql Admin generator

26JavaScript

Since Oct 2Pushed 11y ago1 watchersCompare

[ Source](https://github.com/sisjosex/phpadmin)[ Packagist](https://packagist.org/packages/sisjosex/phpadmin)[ RSS](/packages/sisjosex-phpadmin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHPAdmin
========

[](#phpadmin)

Nice and easy admin for generate backend and implement frontend side also.

Requirements
------------

[](#requirements)

- Rewrite module enabled, for example on ubuntu, apache2:

`$sudo a2enmod rewrite`

`$sudo service apache2 restart`

- Grunt for build .min files for js/css, inside `assets/admin/`

`$npm install -g grunt-cli`

`$npm install`

`$grunt uglify`

`$grunt cssmin`

see  for more details

Installation
------------

[](#installation)

- Copy files and folders inside some directory, for example "project1".
- Edit `config/constants.php` #8

`define('BASE_URL', $protocol . ':' . '//' . $_SERVER['SERVER_NAME'] . $port . 'project1');`

- Edit Database config `config/database.php`
- Load in browser depending your environment maybe:

    `http://localhost/project1`

    `http://localhost/project1/admin`
- Admin Credentials

    `admin@gmail.com`

    `admin`

\*\* Basic concepts and structure for tables recomended \*\*

- Database Table names. must be in lowercase and singular, for example:

    city, company, gym.
- Table column names, must be in lowercase you need a status of type ENUM if you may bot want delete permanently, see examples below.
- Table referenced names must be of format: tablename\_id, ending with "\_id" after table name in lowercase.
-

Examples
--------

[](#examples)

1. \*\* Building a simple admin for a table called gym referencing two tables: city/company \*\*

```
CREATE TABLE IF NOT EXISTS `city` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(250) NOT NULL,
  `status` enum('active','deleted') DEFAULT 'active',
  PRIMARY KEY (`id`),
  KEY `status` (`status`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

```

```
CREATE TABLE IF NOT EXISTS `company` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `style` enum('pfc','mfc','psf','nn') DEFAULT 'nn',
  `name` varchar(250) NOT NULL,
  `logo` varchar(500) NOT NULL,
  `logo_small` varchar(500) NOT NULL,
  `logo_big` varchar(500) NOT NULL,
  `marker` varchar(500) NOT NULL,
  `permalink` varchar(500) NOT NULL,
  `status` enum('active','deleted') DEFAULT 'active',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `status` (`status`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8

```

```
CREATE TABLE IF NOT EXISTS `gym` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `city_id` int(11) NOT NULL,
  `company_id` int(11) NOT NULL,
  `name` varchar(250) NOT NULL,
  `short_name` varchar(100) NOT NULL,
  `latitude` varchar(20) NOT NULL,
  `longitude` varchar(20) NOT NULL,
  `phone` varchar(20) NOT NULL,
  `email` varchar(200) NOT NULL,
  `address` varchar(500) NOT NULL,
  `permalink` varchar(500) NOT NULL,
  `status` enum('active','incoming','deleted') DEFAULT 'active',
  `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `company_id` (`company_id`),
  KEY `city_id` (`city_id`),
  KEY `status` (`status`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

```

\*\* Import that tables into database and build three next models inside `models` folder \*\* `city_model.php`

```
