#########################################
Codeigniter Project Template Modification
#########################################

This project is modification from Codeigniter PHP Framework. All things like
first configuration for Codeigniter, migration, separated frontend-backend 
application, layout for view, and etc is already defined. This project created 
for base of all Earworks Website Project base on Codeigniter. Visit 
<https://www.codeigniter.com/> for Codeigniter information.

*****************
About Codeigniter
*****************

CodeIgniter is an Application Development Framework - a toolkit - for people
who build web sites using PHP. Its goal is to enable you to develop projects
much faster than you could if you were writing code from scratch, by providing
a rich set of libraries for commonly needed tasks, as well as a simple
interface and logical structure to access these libraries. CodeIgniter lets
you creatively focus on your project by minimizing the amount of code needed
for a given task.

*******************
Server Requirements
*******************

PHP version 5.6 or newer is recommended.

It should work on 5.3.7 as well, but we strongly advise you NOT to run
such old versions of PHP, because of potential security and performance
issues, as well as missing features.

************
Installation
************

- `Unzip system.zip and assets/plugins/plugins.zip`
Because bitbucket no need to store file where there is no need changed
sometimes you need to change version of Codeigniter, you can replace all system
folder with new version of Codeigniter

- `Rename "database" file` 
Rename file are stored in "application/config/database" to
"application/config/database.php"
Database config in local are different with config in server, So we must rename database file after installation.

- `Edit .htaccess file` 
In root project open .htaccess file and find "RewriteBase /codeigniter" 
and change to your project name example : "RewriteBase /your-project"

- `change project environment` 
In root project open .htaccess file and find at bottom of file "SetEnv CI_ENV" 
default is "SetEnv CI_ENV development" for production you can change to 
"SetEnv CI_ENV production" 

- `run "php index.php console/migrate"` 
For migrate basic table to database

- `access http://localhost/projectname`

**************
Developer Rule
**************

- `naming table & fields`
for master table please use 1 plural words definition
for jumping table please 2 singular words definition
for table fields please use table name as prefix
for all table please add "created", and "modified" with type INT(11) for extra
information

example :
::
     create table users (
           userid BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
           username VARCHAR(255) NOT NULL,
           userpassword VARCHAR(255) NOT NULL,
           created INT(11) NULL,
           modified INT(11) NULL,
           PRIMARY KEY (userid)
     );      
example for jumping table :
::
     create table userprofile (
           userprofileid BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
           userid BIGINT(20) UNSIGNED NOT NULL,
           profileid BIGINT(20) UNSIGNED NOT NULL,
           created INT(11) NULL,
           modified INT(11) NULL,
           CONSTRAINT FK_UserProfileUser FOREIGN KEY (userid) REFERENCES users(userid),
           CONSTRAINT FK_UserProfileProfile FOREIGN KEY (profileid) REFERENCES profiles(profileid),
           PRIMARY KEY (userprofileid)
     );      

| note : only foreign key field, please use table name referrence as prefix.
| please see relation field between users and userprofile table above

- `Class and method naming`
please refer codeigniter page for information _
<https://www.codeigniter.com/user_guide/general/styleguide.html>

- `All table structure update must use migration`

- `Each table must have 1 model` 
file format is "Tablename_model" capitalize with "_model" as prefix

************************
Developer Daily Activity 
************************

- `Before starting code`
1. check pull request project on bitbucket
2. if you have pull request from master / developer, merge it
3. if merge success, run ``git pull`` from your console
4. start your new code

- `Before leaving office`
1. ``git add -A``
2. ``git commit -m "what are you doing"``
3. ``git push``
4. don't forget

*******
License
*******

coming soon

