# CI Login

## Run

```bash
# Install composer related packages before run
composer install && composer dump-autoload
# In-time generate autoloaded classes with namespace
composer dump-autoload
```

## Introduction

Populate admin and tenat data to system 'system' database using `sql/admin.sql`

Populate rbac and menu data to tenant 'main' database using `sql/rbac.sql`

Populate the permission record on tenant 'main' via command `php public/index.php console/buld_main_permission`

## Login ES Modules

All of them has been migrated to `public/static/login`

To use it, just `<script type="module" src="static/login/app.js"></script>`

https://jsfiddle.net/jamuhl/dvk0e8a9/#tabs=js,result,html

## Public Holiday 2019 - 2020

```bash
composer require louis1021/sg-i-calendar dev-master
```

## Event

### Model and Database

1. event (mas_event)
2. event_course (mas_event_course)
3. event_timeslot (mas_event_timeslot)

```sql
ALTER TABLE `mas_event_timeslot` ADD `update_skip` TINYINT(1) NOT NULL DEFAULT '0' AFTER `holiday_skip`;
ALTER TABLE `mas_event_course` ADD `deleted_at` DATETIME NULL, ADD `updated_at` DATETIME NULL AFTER `deleted_at`, ADD `updated_by` INT NULL AFTER `updated_at`, ADD `created_at` DATETIME on update CURRENT_TIMESTAMP NULL AFTER `updated_by`, ADD `created_by` INT NULL AFTER `created_at`;
ALTER TABLE `mas_event_timeslot` ADD `deleted_at` DATETIME NULL, ADD `updated_at` DATETIME NULL AFTER `deleted_at`, ADD `updated_by` INT NULL AFTER `updated_at`, ADD `created_at` DATETIME on update CURRENT_TIMESTAMP NULL AFTER `updated_by`, ADD `created_by` INT NULL AFTER `created_at`;
```

## Time is Wrong

Add default timezone ON THE TOP OF base_url in `application/config/config.php`

```php
// Default timezone
date_default_timezone_set('Asia/Hong_Kong');
```

