diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000..39f48d95
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,15 @@
+# top-most EditorConfig file
+root = true
+
+# Unix-style newlines with a newline ending every file
+[*]
+end_of_line = lf
+insert_final_newline = true
+
+# Matches multiple files with brace expansion notation
+# Set default charset
+[*]
+charset = utf-8
+
+# Tab indentation (no size specified)
+indent_style = tab
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000..bdb0cabc
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,17 @@
+# Auto detect text files and perform LF normalization
+* text=auto
+
+# Custom for Visual Studio
+*.cs diff=csharp
+
+# Standard to msysgit
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..0c7de110
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,88 @@
+*/config/development
+*/logs/log-*.php
+*/logs/!index.html
+*/cache/*
+*/cache/!index.html
+*/cache/!.htaccess
+
+# =========================
+# Operating System Files
+# =========================
+
+# OSX
+# =========================
+
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Thumbnails
+._*
+
+# Files that might appear on external disk
+.Spotlight-V100
+.Trashes
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+
+# Windows
+# =========================
+
+# Windows image file caches
+Thumbs.db
+ehthumbs.db
+
+# Folder config file
+Desktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# Windows Installer files
+*.cab
+*.msi
+*.msm
+*.msp
+
+# Windows shortcuts
+*.lnk
+
+# Copy of CodeIgniter .gitignore file
+# =========================
+
+.DS_Store
+
+application/cache/*
+!application/cache/index.html
+
+application/logs/*
+!application/logs/index.html
+
+!application/*/.htaccess
+
+composer.lock
+
+user_guide_src/build/*
+user_guide_src/cilexer/build/*
+user_guide_src/cilexer/dist/*
+user_guide_src/cilexer/pycilexer.egg-info/*
+/vendor/
+
+# IDE Files
+#-------------------------
+/nbproject/
+.idea/*
+
+## Sublime Text cache files
+*.tmlanguage.cache
+*.tmPreferences.cache
+*.stTheme.cache
+*.sublime-workspace
+*.sublime-project
+/tests/tests/
+/tests/results/
\ No newline at end of file
diff --git a/.htaccess b/.htaccess
new file mode 100644
index 00000000..7eba6361
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1,15 @@
+### CODEIGNITER ###
+
+# Suppress index.php from the URL
+
+RewriteEngine On
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule ^(.*)$ index.php/$1 [L]
+
+
+# Define CI execution environment :
+# "development" (default) on development servers
+# "testing" for running automated tests, set automatically by PHPUnit
+# "production" on production servers
+SetEnv CI_ENV development
diff --git a/application/.htaccess b/application/.htaccess
new file mode 100644
index 00000000..6c63ed4c
--- /dev/null
+++ b/application/.htaccess
@@ -0,0 +1,6 @@
+
+ Require all denied
+
+
+ Deny from all
+
\ No newline at end of file
diff --git a/application/config/autoload.php b/application/config/autoload.php
new file mode 100644
index 00000000..a896b650
--- /dev/null
+++ b/application/config/autoload.php
@@ -0,0 +1,143 @@
+ 'ua');
+*/
+$autoload['libraries'] = array('database', 'session', 'form_validation');
+
+/*
+| -------------------------------------------------------------------
+| Auto-load Drivers
+| -------------------------------------------------------------------
+| These classes are located in system/libraries/ or in your
+| application/libraries/ directory, but are also placed inside their
+| own subdirectory and they extend the CI_Driver_Library class. They
+| offer multiple interchangeable driver options.
+|
+| Prototype:
+|
+| $autoload['drivers'] = array('cache');
+|
+| You can also supply an alternative property name to be assigned in
+| the controller:
+|
+| $autoload['drivers'] = array('cache' => 'cch');
+|
+*/
+$autoload['drivers'] = array();
+
+/*
+| -------------------------------------------------------------------
+| Auto-load Helper Files
+| -------------------------------------------------------------------
+| Prototype:
+|
+| $autoload['helper'] = array('url', 'file');
+*/
+$autoload['helper'] = array('date', 'form', 'html', 'language');
+if (!defined('ENVIRONMENT') || ENVIRONMENT !== 'testing') {
+ /*
+ | Autoloading url_helper in tests does NOT work with HMVC.
+ | So you have to load it in the tests.
+ | The other option is to modify url_helper.
+ */
+ $autoload['helper'][] = 'url';
+}
+
+/*
+| -------------------------------------------------------------------
+| Auto-load Config files
+| -------------------------------------------------------------------
+| Prototype:
+|
+| $autoload['config'] = array('config1', 'config2');
+|
+| NOTE: This item is intended for use ONLY if you have created custom
+| config files. Otherwise, leave it blank.
+|
+*/
+$autoload['config'] = array();
+
+/*
+| -------------------------------------------------------------------
+| Auto-load Language files
+| -------------------------------------------------------------------
+| Prototype:
+|
+| $autoload['language'] = array('lang1', 'lang2');
+|
+| NOTE: Do not include the "_lang" part of your file. For example
+| "codeigniter_lang.php" would be referenced as array('codeigniter');
+|
+*/
+$autoload['language'] = array('MY_application');
+
+/*
+| -------------------------------------------------------------------
+| Auto-load Models
+| -------------------------------------------------------------------
+| Prototype:
+|
+| $autoload['model'] = array('first_model', 'second_model');
+|
+| You can also supply an alternative model name to be assigned
+| in the controller:
+|
+| $autoload['model'] = array('first_model' => 'first');
+*/
+$autoload['model'] = array();
diff --git a/application/config/config.php b/application/config/config.php
new file mode 100644
index 00000000..cf4ec4f9
--- /dev/null
+++ b/application/config/config.php
@@ -0,0 +1,525 @@
+]+$/i
+|
+| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
+|
+*/
+$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
+
+/*
+|--------------------------------------------------------------------------
+| Enable Query Strings
+|--------------------------------------------------------------------------
+|
+| By default CodeIgniter uses search-engine friendly segment based URLs:
+| example.com/who/what/where/
+|
+| You can optionally enable standard query string based URLs:
+| example.com?who=me&what=something&where=here
+|
+| Options are: TRUE or FALSE (boolean)
+|
+| The other items let you set the query string 'words' that will
+| invoke your controllers and its functions:
+| example.com/index.php?c=controller&m=function
+|
+| Please note that some of the helpers won't work as expected when
+| this feature is enabled, since CodeIgniter is designed primarily to
+| use segment based URLs.
+|
+*/
+$config['enable_query_strings'] = FALSE;
+$config['controller_trigger'] = 'c';
+$config['function_trigger'] = 'm';
+$config['directory_trigger'] = 'd';
+
+/*
+|--------------------------------------------------------------------------
+| Allow $_GET array
+|--------------------------------------------------------------------------
+|
+| By default CodeIgniter enables access to the $_GET array. If for some
+| reason you would like to disable it, set 'allow_get_array' to FALSE.
+|
+| WARNING: This feature is DEPRECATED and currently available only
+| for backwards compatibility purposes!
+|
+*/
+$config['allow_get_array'] = TRUE;
+
+/*
+|--------------------------------------------------------------------------
+| Error Logging Threshold
+|--------------------------------------------------------------------------
+|
+| You can enable error logging by setting a threshold over zero. The
+| threshold determines what gets logged. Threshold options are:
+|
+| 0 = Disables logging, Error logging TURNED OFF
+| 1 = Error Messages (including PHP errors)
+| 2 = Debug Messages
+| 3 = Informational Messages
+| 4 = All Messages
+|
+| You can also pass an array with threshold levels to show individual error types
+|
+| array(2) = Debug Messages, without Error Messages
+|
+| For a live site you'll usually only enable Errors (1) to be logged otherwise
+| your log files will fill up very fast.
+|
+*/
+$config['log_threshold'] = 0;
+
+/*
+|--------------------------------------------------------------------------
+| Error Logging Directory Path
+|--------------------------------------------------------------------------
+|
+| Leave this BLANK unless you would like to set something other than the default
+| application/logs/ directory. Use a full server path with trailing slash.
+|
+*/
+$config['log_path'] = '';
+
+/*
+|--------------------------------------------------------------------------
+| Log File Extension
+|--------------------------------------------------------------------------
+|
+| The default filename extension for log files. The default 'php' allows for
+| protecting the log files via basic scripting, when they are to be stored
+| under a publicly accessible directory.
+|
+| Note: Leaving it blank will default to 'php'.
+|
+*/
+$config['log_file_extension'] = '';
+
+/*
+|--------------------------------------------------------------------------
+| Log File Permissions
+|--------------------------------------------------------------------------
+|
+| The file system permissions to be applied on newly created log files.
+|
+| IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal
+| integer notation (i.e. 0700, 0644, etc.)
+*/
+$config['log_file_permissions'] = 0644;
+
+/*
+|--------------------------------------------------------------------------
+| Date Format for Logs
+|--------------------------------------------------------------------------
+|
+| Each item that is logged has an associated date. You can use PHP date
+| codes to set your own date formatting
+|
+*/
+$config['log_date_format'] = 'Y-m-d H:i:s';
+
+/*
+|--------------------------------------------------------------------------
+| Error Views Directory Path
+|--------------------------------------------------------------------------
+|
+| Leave this BLANK unless you would like to set something other than the default
+| application/views/errors/ directory. Use a full server path with trailing slash.
+|
+*/
+$config['error_views_path'] = '';
+
+/*
+|--------------------------------------------------------------------------
+| Cache Directory Path
+|--------------------------------------------------------------------------
+|
+| Leave this BLANK unless you would like to set something other than the default
+| application/cache/ directory. Use a full server path with trailing slash.
+|
+*/
+$config['cache_path'] = '';
+
+/*
+|--------------------------------------------------------------------------
+| Cache Include Query String
+|--------------------------------------------------------------------------
+|
+| Whether to take the URL query string into consideration when generating
+| output cache files. Valid options are:
+|
+| FALSE = Disabled
+| TRUE = Enabled, take all query parameters into account.
+| Please be aware that this may result in numerous cache
+| files generated for the same page over and over again.
+| array('q') = Enabled, but only take into account the specified list
+| of query parameters.
+|
+*/
+$config['cache_query_string'] = FALSE;
+
+/*
+|--------------------------------------------------------------------------
+| Encryption Key
+|--------------------------------------------------------------------------
+|
+| If you use the Encryption class, you must set an encryption key.
+| See the user guide for more info.
+|
+| https://codeigniter.com/user_guide/libraries/encryption.html
+|
+*/
+$config['encryption_key'] = 'k7W2DvW4Y9st';
+
+/*
+|--------------------------------------------------------------------------
+| Session Variables
+|--------------------------------------------------------------------------
+|
+| 'sess_driver'
+|
+| The storage driver to use: files, database, redis, memcached
+|
+| 'sess_cookie_name'
+|
+| The session cookie name, must contain only [0-9a-z_-] characters
+|
+| 'sess_expiration'
+|
+| The number of SECONDS you want the session to last.
+| Setting to 0 (zero) means expire when the browser is closed.
+|
+| 'sess_save_path'
+|
+| The location to save sessions to, driver dependent.
+|
+| For the 'files' driver, it's a path to a writable directory.
+| WARNING: Only absolute paths are supported!
+|
+| For the 'database' driver, it's a table name.
+| Please read up the manual for the format with other session drivers.
+|
+| IMPORTANT: You are REQUIRED to set a valid save path!
+|
+| 'sess_match_ip'
+|
+| Whether to match the user's IP address when reading the session data.
+|
+| WARNING: If you're using the database driver, don't forget to update
+| your session table's PRIMARY KEY when changing this setting.
+|
+| 'sess_time_to_update'
+|
+| How many seconds between CI regenerating the session ID.
+|
+| 'sess_regenerate_destroy'
+|
+| Whether to destroy session data associated with the old session ID
+| when auto-regenerating the session ID. When set to FALSE, the data
+| will be later deleted by the garbage collector.
+|
+| Other session cookie settings are shared with the rest of the application,
+| except for 'cookie_prefix' and 'cookie_httponly', which are ignored here.
+|
+*/
+$config['sess_driver'] = 'database';
+$config['sess_cookie_name'] = 'ci_session';
+$config['sess_expiration'] = 7200;
+$config['sess_save_path'] = 'ci_sessions';
+$config['sess_match_ip'] = FALSE;
+$config['sess_time_to_update'] = 300;
+$config['sess_regenerate_destroy'] = FALSE;
+
+/*
+|--------------------------------------------------------------------------
+| Cookie Related Variables
+|--------------------------------------------------------------------------
+|
+| 'cookie_prefix' = Set a cookie name prefix if you need to avoid collisions
+| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
+| 'cookie_path' = Typically will be a forward slash
+| 'cookie_secure' = Cookie will only be set if a secure HTTPS connection exists.
+| 'cookie_httponly' = Cookie will only be accessible via HTTP(S) (no javascript)
+|
+| Note: These settings (with the exception of 'cookie_prefix' and
+| 'cookie_httponly') will also affect sessions.
+|
+*/
+$config['cookie_prefix'] = 'ci_packbase';
+$config['cookie_domain'] = '';
+$config['cookie_path'] = '/';
+$config['cookie_secure'] = FALSE;
+$config['cookie_httponly'] = FALSE;
+
+/*
+|--------------------------------------------------------------------------
+| Standardize newlines
+|--------------------------------------------------------------------------
+|
+| Determines whether to standardize newline characters in input data,
+| meaning to replace \r\n, \r, \n occurrences with the PHP_EOL value.
+|
+| WARNING: This feature is DEPRECATED and currently available only
+| for backwards compatibility purposes!
+|
+*/
+$config['standardize_newlines'] = FALSE;
+
+/*
+|--------------------------------------------------------------------------
+| Global XSS Filtering
+|--------------------------------------------------------------------------
+|
+| Determines whether the XSS filter is always active when GET, POST or
+| COOKIE data is encountered
+|
+| WARNING: This feature is DEPRECATED and currently available only
+| for backwards compatibility purposes!
+|
+*/
+$config['global_xss_filtering'] = FALSE;
+
+/*
+|--------------------------------------------------------------------------
+| Cross Site Request Forgery
+|--------------------------------------------------------------------------
+| Enables a CSRF cookie token to be set. When set to TRUE, token will be
+| checked on a submitted form. If you are accepting user data, it is strongly
+| recommended CSRF protection be enabled.
+|
+| 'csrf_token_name' = The token name
+| 'csrf_cookie_name' = The cookie name
+| 'csrf_expire' = The number in seconds the token should expire.
+| 'csrf_regenerate' = Regenerate token on every submission
+| 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks
+*/
+$config['csrf_protection'] = FALSE;
+$config['csrf_token_name'] = 'csrf_test_name';
+$config['csrf_cookie_name'] = 'csrf_cookie_name';
+$config['csrf_expire'] = 7200;
+$config['csrf_regenerate'] = TRUE;
+$config['csrf_exclude_uris'] = array();
+
+/*
+|--------------------------------------------------------------------------
+| Output Compression
+|--------------------------------------------------------------------------
+|
+| Enables Gzip output compression for faster page loads. When enabled,
+| the output class will test whether your server supports Gzip.
+| Even if it does, however, not all browsers support compression
+| so enable only if you are reasonably sure your visitors can handle it.
+|
+| Only used if zlib.output_compression is turned off in your php.ini.
+| Please do not use it together with httpd-level output compression.
+|
+| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
+| means you are prematurely outputting something to your browser. It could
+| even be a line of whitespace at the end of one of your scripts. For
+| compression to work, nothing can be sent before the output buffer is called
+| by the output class. Do not 'echo' any values with compression enabled.
+|
+*/
+$config['compress_output'] = FALSE;
+
+/*
+|--------------------------------------------------------------------------
+| Master Time Reference
+|--------------------------------------------------------------------------
+|
+| Options are 'local' or any PHP supported timezone. This preference tells
+| the system whether to use your server's local time as the master 'now'
+| reference, or convert it to the configured one timezone. See the 'date
+| helper' page of the user guide for information regarding date handling.
+|
+*/
+$config['time_reference'] = 'local';
+
+/*
+|--------------------------------------------------------------------------
+| Rewrite PHP Short Tags
+|--------------------------------------------------------------------------
+|
+| If your PHP installation does not have short tag support enabled CI
+| can rewrite the tags on-the-fly, enabling you to utilize that syntax
+| in your view files. Options are TRUE or FALSE (boolean)
+|
+| Note: You need to have eval() enabled for this to work.
+|
+*/
+$config['rewrite_short_tags'] = FALSE;
+
+/*
+|--------------------------------------------------------------------------
+| Reverse Proxy IPs
+|--------------------------------------------------------------------------
+|
+| If your server is behind a reverse proxy, you must whitelist the proxy
+| IP addresses from which CodeIgniter should trust headers such as
+| HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify
+| the visitor's IP address.
+|
+| You can use both an array or a comma-separated list of proxy addresses,
+| as well as specifying whole subnets. Here are a few examples:
+|
+| Comma-separated: '10.0.1.200,192.168.5.0/24'
+| Array: array('10.0.1.200', '192.168.5.0/24')
+*/
+$config['proxy_ips'] = '';
diff --git a/application/config/constants.php b/application/config/constants.php
new file mode 100644
index 00000000..18d3b4b7
--- /dev/null
+++ b/application/config/constants.php
@@ -0,0 +1,85 @@
+db->last_query() and profiling of DB queries.
+| When you run a query, with this setting set to TRUE (default),
+| CodeIgniter will store the SQL statement for debugging purposes.
+| However, this may cause high memory usage, especially if you run
+| a lot of SQL queries ... disable this to avoid that problem.
+|
+| The $active_group variable lets you choose which connection group to
+| make active. By default there is only one group (the 'default' group).
+|
+| The $query_builder variables lets you determine whether or not to load
+| the query builder class.
+*/
+$active_group = 'default';
+$query_builder = TRUE;
+
+$db['default'] = array(
+ 'dsn' => '',
+ 'hostname' => 'localhost',
+ 'username' => 'root',
+ 'password' => '',
+ 'database' => 'plafor',
+ 'dbdriver' => 'mysqli',
+ 'dbprefix' => '',
+ 'pconnect' => FALSE,
+ 'db_debug' => (ENVIRONMENT !== 'production'),
+ 'cache_on' => FALSE,
+ 'cachedir' => '',
+ 'char_set' => 'utf8',
+ 'dbcollat' => 'utf8_general_ci',
+ 'swap_pre' => '',
+ 'encrypt' => FALSE,
+ 'compress' => FALSE,
+ 'stricton' => FALSE,
+ 'failover' => array(),
+ 'save_queries' => TRUE
+);
diff --git a/application/config/doctypes.php b/application/config/doctypes.php
new file mode 100644
index 00000000..59a7991e
--- /dev/null
+++ b/application/config/doctypes.php
@@ -0,0 +1,24 @@
+ '',
+ 'xhtml1-strict' => '',
+ 'xhtml1-trans' => '',
+ 'xhtml1-frame' => '',
+ 'xhtml-basic11' => '',
+ 'html5' => '',
+ 'html4-strict' => '',
+ 'html4-trans' => '',
+ 'html4-frame' => '',
+ 'mathml1' => '',
+ 'mathml2' => '',
+ 'svg10' => '',
+ 'svg11' => '',
+ 'svg11-basic' => '',
+ 'svg11-tiny' => '',
+ 'xhtml-math-svg-xh' => '',
+ 'xhtml-math-svg-sh' => '',
+ 'xhtml-rdfa-1' => '',
+ 'xhtml-rdfa-2' => ''
+);
diff --git a/application/config/foreign_chars.php b/application/config/foreign_chars.php
new file mode 100644
index 00000000..995f4830
--- /dev/null
+++ b/application/config/foreign_chars.php
@@ -0,0 +1,103 @@
+ 'ae',
+ '/ö|œ/' => 'oe',
+ '/ü/' => 'ue',
+ '/Ä/' => 'Ae',
+ '/Ü/' => 'Ue',
+ '/Ö/' => 'Oe',
+ '/À|Á|Â|Ã|Ä|Å|Ǻ|Ā|Ă|Ą|Ǎ|Α|Ά|Ả|Ạ|Ầ|Ẫ|Ẩ|Ậ|Ằ|Ắ|Ẵ|Ẳ|Ặ|А/' => 'A',
+ '/à|á|â|ã|å|ǻ|ā|ă|ą|ǎ|ª|α|ά|ả|ạ|ầ|ấ|ẫ|ẩ|ậ|ằ|ắ|ẵ|ẳ|ặ|а/' => 'a',
+ '/Б/' => 'B',
+ '/б/' => 'b',
+ '/Ç|Ć|Ĉ|Ċ|Č/' => 'C',
+ '/ç|ć|ĉ|ċ|č/' => 'c',
+ '/Д/' => 'D',
+ '/д/' => 'd',
+ '/Ð|Ď|Đ|Δ/' => 'Dj',
+ '/ð|ď|đ|δ/' => 'dj',
+ '/È|É|Ê|Ë|Ē|Ĕ|Ė|Ę|Ě|Ε|Έ|Ẽ|Ẻ|Ẹ|Ề|Ế|Ễ|Ể|Ệ|Е|Э/' => 'E',
+ '/è|é|ê|ë|ē|ĕ|ė|ę|ě|έ|ε|ẽ|ẻ|ẹ|ề|ế|ễ|ể|ệ|е|э/' => 'e',
+ '/Ф/' => 'F',
+ '/ф/' => 'f',
+ '/Ĝ|Ğ|Ġ|Ģ|Γ|Г|Ґ/' => 'G',
+ '/ĝ|ğ|ġ|ģ|γ|г|ґ/' => 'g',
+ '/Ĥ|Ħ/' => 'H',
+ '/ĥ|ħ/' => 'h',
+ '/Ì|Í|Î|Ï|Ĩ|Ī|Ĭ|Ǐ|Į|İ|Η|Ή|Ί|Ι|Ϊ|Ỉ|Ị|И|Ы/' => 'I',
+ '/ì|í|î|ï|ĩ|ī|ĭ|ǐ|į|ı|η|ή|ί|ι|ϊ|ỉ|ị|и|ы|ї/' => 'i',
+ '/Ĵ/' => 'J',
+ '/ĵ/' => 'j',
+ '/Ķ|Κ|К/' => 'K',
+ '/ķ|κ|к/' => 'k',
+ '/Ĺ|Ļ|Ľ|Ŀ|Ł|Λ|Л/' => 'L',
+ '/ĺ|ļ|ľ|ŀ|ł|λ|л/' => 'l',
+ '/М/' => 'M',
+ '/м/' => 'm',
+ '/Ñ|Ń|Ņ|Ň|Ν|Н/' => 'N',
+ '/ñ|ń|ņ|ň|ʼn|ν|н/' => 'n',
+ '/Ò|Ó|Ô|Õ|Ō|Ŏ|Ǒ|Ő|Ơ|Ø|Ǿ|Ο|Ό|Ω|Ώ|Ỏ|Ọ|Ồ|Ố|Ỗ|Ổ|Ộ|Ờ|Ớ|Ỡ|Ở|Ợ|О/' => 'O',
+ '/ò|ó|ô|õ|ō|ŏ|ǒ|ő|ơ|ø|ǿ|º|ο|ό|ω|ώ|ỏ|ọ|ồ|ố|ỗ|ổ|ộ|ờ|ớ|ỡ|ở|ợ|о/' => 'o',
+ '/П/' => 'P',
+ '/п/' => 'p',
+ '/Ŕ|Ŗ|Ř|Ρ|Р/' => 'R',
+ '/ŕ|ŗ|ř|ρ|р/' => 'r',
+ '/Ś|Ŝ|Ş|Ș|Š|Σ|С/' => 'S',
+ '/ś|ŝ|ş|ș|š|ſ|σ|ς|с/' => 's',
+ '/Ț|Ţ|Ť|Ŧ|τ|Т/' => 'T',
+ '/ț|ţ|ť|ŧ|т/' => 't',
+ '/Þ|þ/' => 'th',
+ '/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|Ũ|Ủ|Ụ|Ừ|Ứ|Ữ|Ử|Ự|У/' => 'U',
+ '/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|υ|ύ|ϋ|ủ|ụ|ừ|ứ|ữ|ử|ự|у/' => 'u',
+ '/Ƴ|Ɏ|Ỵ|Ẏ|Ӳ|Ӯ|Ў|Ý|Ÿ|Ŷ|Υ|Ύ|Ϋ|Ỳ|Ỹ|Ỷ|Ỵ|Й/' => 'Y',
+ '/ẙ|ʏ|ƴ|ɏ|ỵ|ẏ|ӳ|ӯ|ў|ý|ÿ|ŷ|ỳ|ỹ|ỷ|ỵ|й/' => 'y',
+ '/В/' => 'V',
+ '/в/' => 'v',
+ '/Ŵ/' => 'W',
+ '/ŵ/' => 'w',
+ '/Ź|Ż|Ž|Ζ|З/' => 'Z',
+ '/ź|ż|ž|ζ|з/' => 'z',
+ '/Æ|Ǽ/' => 'AE',
+ '/ß/' => 'ss',
+ '/IJ/' => 'IJ',
+ '/ij/' => 'ij',
+ '/Œ/' => 'OE',
+ '/ƒ/' => 'f',
+ '/ξ/' => 'ks',
+ '/π/' => 'p',
+ '/β/' => 'v',
+ '/μ/' => 'm',
+ '/ψ/' => 'ps',
+ '/Ё/' => 'Yo',
+ '/ё/' => 'yo',
+ '/Є/' => 'Ye',
+ '/є/' => 'ye',
+ '/Ї/' => 'Yi',
+ '/Ж/' => 'Zh',
+ '/ж/' => 'zh',
+ '/Х/' => 'Kh',
+ '/х/' => 'kh',
+ '/Ц/' => 'Ts',
+ '/ц/' => 'ts',
+ '/Ч/' => 'Ch',
+ '/ч/' => 'ch',
+ '/Ш/' => 'Sh',
+ '/ш/' => 'sh',
+ '/Щ/' => 'Shch',
+ '/щ/' => 'shch',
+ '/Ъ|ъ|Ь|ь/' => '',
+ '/Ю/' => 'Yu',
+ '/ю/' => 'yu',
+ '/Я/' => 'Ya',
+ '/я/' => 'ya'
+);
diff --git a/application/config/hooks.php b/application/config/hooks.php
new file mode 100644
index 00000000..a8f38a5d
--- /dev/null
+++ b/application/config/hooks.php
@@ -0,0 +1,13 @@
+
+
+
+ 403 Forbidden
+
+
+
+Directory access is forbidden.
+
+
+
diff --git a/application/config/memcached.php b/application/config/memcached.php
new file mode 100644
index 00000000..5c23b39c
--- /dev/null
+++ b/application/config/memcached.php
@@ -0,0 +1,19 @@
+ array(
+ 'hostname' => '127.0.0.1',
+ 'port' => '11211',
+ 'weight' => '1',
+ ),
+);
diff --git a/application/config/migration.php b/application/config/migration.php
new file mode 100644
index 00000000..4b585a65
--- /dev/null
+++ b/application/config/migration.php
@@ -0,0 +1,84 @@
+migration->current() this is the version that schema will
+| be upgraded / downgraded to.
+|
+*/
+$config['migration_version'] = 0;
+
+/*
+|--------------------------------------------------------------------------
+| Migrations Path
+|--------------------------------------------------------------------------
+|
+| Path to your migrations folder.
+| Typically, it will be within your application path.
+| Also, writing permission is required within the migrations path.
+|
+*/
+$config['migration_path'] = APPPATH.'migrations/';
diff --git a/application/config/mimes.php b/application/config/mimes.php
new file mode 100644
index 00000000..7aa5c9e4
--- /dev/null
+++ b/application/config/mimes.php
@@ -0,0 +1,184 @@
+ array('application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40'),
+ 'cpt' => 'application/mac-compactpro',
+ 'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel', 'text/plain'),
+ 'bin' => array('application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', 'application/x-macbinary'),
+ 'dms' => 'application/octet-stream',
+ 'lha' => 'application/octet-stream',
+ 'lzh' => 'application/octet-stream',
+ 'exe' => array('application/octet-stream', 'application/x-msdownload'),
+ 'class' => 'application/octet-stream',
+ 'psd' => array('application/x-photoshop', 'image/vnd.adobe.photoshop'),
+ 'so' => 'application/octet-stream',
+ 'sea' => 'application/octet-stream',
+ 'dll' => 'application/octet-stream',
+ 'oda' => 'application/oda',
+ 'pdf' => array('application/pdf', 'application/force-download', 'application/x-download', 'binary/octet-stream'),
+ 'ai' => array('application/pdf', 'application/postscript'),
+ 'eps' => 'application/postscript',
+ 'ps' => 'application/postscript',
+ 'smi' => 'application/smil',
+ 'smil' => 'application/smil',
+ 'mif' => 'application/vnd.mif',
+ 'xls' => array('application/vnd.ms-excel', 'application/msexcel', 'application/x-msexcel', 'application/x-ms-excel', 'application/x-excel', 'application/x-dos_ms_excel', 'application/xls', 'application/x-xls', 'application/excel', 'application/download', 'application/vnd.ms-office', 'application/msword'),
+ 'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint', 'application/vnd.ms-office', 'application/msword'),
+ 'pptx' => array('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/x-zip', 'application/zip'),
+ 'wbxml' => 'application/wbxml',
+ 'wmlc' => 'application/wmlc',
+ 'dcr' => 'application/x-director',
+ 'dir' => 'application/x-director',
+ 'dxr' => 'application/x-director',
+ 'dvi' => 'application/x-dvi',
+ 'gtar' => 'application/x-gtar',
+ 'gz' => 'application/x-gzip',
+ 'gzip' => 'application/x-gzip',
+ 'php' => array('application/x-httpd-php', 'application/php', 'application/x-php', 'text/php', 'text/x-php', 'application/x-httpd-php-source'),
+ 'php4' => 'application/x-httpd-php',
+ 'php3' => 'application/x-httpd-php',
+ 'phtml' => 'application/x-httpd-php',
+ 'phps' => 'application/x-httpd-php-source',
+ 'js' => array('application/x-javascript', 'text/plain'),
+ 'swf' => 'application/x-shockwave-flash',
+ 'sit' => 'application/x-stuffit',
+ 'tar' => 'application/x-tar',
+ 'tgz' => array('application/x-tar', 'application/x-gzip-compressed'),
+ 'z' => 'application/x-compress',
+ 'xhtml' => 'application/xhtml+xml',
+ 'xht' => 'application/xhtml+xml',
+ 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed', 'application/s-compressed', 'multipart/x-zip'),
+ 'rar' => array('application/x-rar', 'application/rar', 'application/x-rar-compressed'),
+ 'mid' => 'audio/midi',
+ 'midi' => 'audio/midi',
+ 'mpga' => 'audio/mpeg',
+ 'mp2' => 'audio/mpeg',
+ 'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'),
+ 'aif' => array('audio/x-aiff', 'audio/aiff'),
+ 'aiff' => array('audio/x-aiff', 'audio/aiff'),
+ 'aifc' => 'audio/x-aiff',
+ 'ram' => 'audio/x-pn-realaudio',
+ 'rm' => 'audio/x-pn-realaudio',
+ 'rpm' => 'audio/x-pn-realaudio-plugin',
+ 'ra' => 'audio/x-realaudio',
+ 'rv' => 'video/vnd.rn-realvideo',
+ 'wav' => array('audio/x-wav', 'audio/wave', 'audio/wav'),
+ 'bmp' => array('image/bmp', 'image/x-bmp', 'image/x-bitmap', 'image/x-xbitmap', 'image/x-win-bitmap', 'image/x-windows-bmp', 'image/ms-bmp', 'image/x-ms-bmp', 'application/bmp', 'application/x-bmp', 'application/x-win-bitmap'),
+ 'gif' => 'image/gif',
+ 'jpeg' => array('image/jpeg', 'image/pjpeg'),
+ 'jpg' => array('image/jpeg', 'image/pjpeg'),
+ 'jpe' => array('image/jpeg', 'image/pjpeg'),
+ 'jp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
+ 'j2k' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
+ 'jpf' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
+ 'jpg2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
+ 'jpx' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
+ 'jpm' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
+ 'mj2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
+ 'mjp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
+ 'png' => array('image/png', 'image/x-png'),
+ 'tiff' => 'image/tiff',
+ 'tif' => 'image/tiff',
+ 'css' => array('text/css', 'text/plain'),
+ 'html' => array('text/html', 'text/plain'),
+ 'htm' => array('text/html', 'text/plain'),
+ 'shtml' => array('text/html', 'text/plain'),
+ 'txt' => 'text/plain',
+ 'text' => 'text/plain',
+ 'log' => array('text/plain', 'text/x-log'),
+ 'rtx' => 'text/richtext',
+ 'rtf' => 'text/rtf',
+ 'xml' => array('application/xml', 'text/xml', 'text/plain'),
+ 'xsl' => array('application/xml', 'text/xsl', 'text/xml'),
+ 'mpeg' => 'video/mpeg',
+ 'mpg' => 'video/mpeg',
+ 'mpe' => 'video/mpeg',
+ 'qt' => 'video/quicktime',
+ 'mov' => 'video/quicktime',
+ 'avi' => array('video/x-msvideo', 'video/msvideo', 'video/avi', 'application/x-troff-msvideo'),
+ 'movie' => 'video/x-sgi-movie',
+ 'doc' => array('application/msword', 'application/vnd.ms-office'),
+ 'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword', 'application/x-zip'),
+ 'dot' => array('application/msword', 'application/vnd.ms-office'),
+ 'dotx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip', 'application/msword'),
+ 'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip', 'application/vnd.ms-excel', 'application/msword', 'application/x-zip'),
+ 'word' => array('application/msword', 'application/octet-stream'),
+ 'xl' => 'application/excel',
+ 'eml' => 'message/rfc822',
+ 'json' => array('application/json', 'text/json'),
+ 'pem' => array('application/x-x509-user-cert', 'application/x-pem-file', 'application/octet-stream'),
+ 'p10' => array('application/x-pkcs10', 'application/pkcs10'),
+ 'p12' => 'application/x-pkcs12',
+ 'p7a' => 'application/x-pkcs7-signature',
+ 'p7c' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
+ 'p7m' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'),
+ 'p7r' => 'application/x-pkcs7-certreqresp',
+ 'p7s' => 'application/pkcs7-signature',
+ 'crt' => array('application/x-x509-ca-cert', 'application/x-x509-user-cert', 'application/pkix-cert'),
+ 'crl' => array('application/pkix-crl', 'application/pkcs-crl'),
+ 'der' => 'application/x-x509-ca-cert',
+ 'kdb' => 'application/octet-stream',
+ 'pgp' => 'application/pgp',
+ 'gpg' => 'application/gpg-keys',
+ 'sst' => 'application/octet-stream',
+ 'csr' => 'application/octet-stream',
+ 'rsa' => 'application/x-pkcs7',
+ 'cer' => array('application/pkix-cert', 'application/x-x509-ca-cert'),
+ '3g2' => 'video/3gpp2',
+ '3gp' => array('video/3gp', 'video/3gpp'),
+ 'mp4' => 'video/mp4',
+ 'm4a' => 'audio/x-m4a',
+ 'f4v' => array('video/mp4', 'video/x-f4v'),
+ 'flv' => 'video/x-flv',
+ 'webm' => 'video/webm',
+ 'aac' => array('audio/x-aac', 'audio/aac'),
+ 'm4u' => 'application/vnd.mpegurl',
+ 'm3u' => 'text/plain',
+ 'xspf' => 'application/xspf+xml',
+ 'vlc' => 'application/videolan',
+ 'wmv' => array('video/x-ms-wmv', 'video/x-ms-asf'),
+ 'au' => 'audio/x-au',
+ 'ac3' => 'audio/ac3',
+ 'flac' => 'audio/x-flac',
+ 'ogg' => array('audio/ogg', 'video/ogg', 'application/ogg'),
+ 'kmz' => array('application/vnd.google-earth.kmz', 'application/zip', 'application/x-zip'),
+ 'kml' => array('application/vnd.google-earth.kml+xml', 'application/xml', 'text/xml'),
+ 'ics' => 'text/calendar',
+ 'ical' => 'text/calendar',
+ 'zsh' => 'text/x-scriptzsh',
+ '7z' => array('application/x-7z-compressed', 'application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'),
+ '7zip' => array('application/x-7z-compressed', 'application/x-compressed', 'application/x-zip-compressed', 'application/zip', 'multipart/x-zip'),
+ 'cdr' => array('application/cdr', 'application/coreldraw', 'application/x-cdr', 'application/x-coreldraw', 'image/cdr', 'image/x-cdr', 'zz-application/zz-winassoc-cdr'),
+ 'wma' => array('audio/x-ms-wma', 'video/x-ms-asf'),
+ 'jar' => array('application/java-archive', 'application/x-java-application', 'application/x-jar', 'application/x-compressed'),
+ 'svg' => array('image/svg+xml', 'application/xml', 'text/xml'),
+ 'vcf' => 'text/x-vcard',
+ 'srt' => array('text/srt', 'text/plain'),
+ 'vtt' => array('text/vtt', 'text/plain'),
+ 'ico' => array('image/x-icon', 'image/x-ico', 'image/vnd.microsoft.icon'),
+ 'odc' => 'application/vnd.oasis.opendocument.chart',
+ 'otc' => 'application/vnd.oasis.opendocument.chart-template',
+ 'odf' => 'application/vnd.oasis.opendocument.formula',
+ 'otf' => 'application/vnd.oasis.opendocument.formula-template',
+ 'odg' => 'application/vnd.oasis.opendocument.graphics',
+ 'otg' => 'application/vnd.oasis.opendocument.graphics-template',
+ 'odi' => 'application/vnd.oasis.opendocument.image',
+ 'oti' => 'application/vnd.oasis.opendocument.image-template',
+ 'odp' => 'application/vnd.oasis.opendocument.presentation',
+ 'otp' => 'application/vnd.oasis.opendocument.presentation-template',
+ 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
+ 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
+ 'odt' => 'application/vnd.oasis.opendocument.text',
+ 'odm' => 'application/vnd.oasis.opendocument.text-master',
+ 'ott' => 'application/vnd.oasis.opendocument.text-template',
+ 'oth' => 'application/vnd.oasis.opendocument.text-web'
+);
diff --git a/application/config/profiler.php b/application/config/profiler.php
new file mode 100644
index 00000000..3db22e39
--- /dev/null
+++ b/application/config/profiler.php
@@ -0,0 +1,14 @@
+ my_controller/index
+| my-controller/my-method -> my_controller/my_method
+*/
+$route['default_controller'] = 'welcome';
+$route['404_override'] = '';
+$route['translate_uri_dashes'] = FALSE;
diff --git a/application/config/smileys.php b/application/config/smileys.php
new file mode 100644
index 00000000..abf9a898
--- /dev/null
+++ b/application/config/smileys.php
@@ -0,0 +1,64 @@
+ array('grin.gif', '19', '19', 'grin'),
+ ':lol:' => array('lol.gif', '19', '19', 'LOL'),
+ ':cheese:' => array('cheese.gif', '19', '19', 'cheese'),
+ ':)' => array('smile.gif', '19', '19', 'smile'),
+ ';-)' => array('wink.gif', '19', '19', 'wink'),
+ ';)' => array('wink.gif', '19', '19', 'wink'),
+ ':smirk:' => array('smirk.gif', '19', '19', 'smirk'),
+ ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'),
+ ':-S' => array('confused.gif', '19', '19', 'confused'),
+ ':wow:' => array('surprise.gif', '19', '19', 'surprised'),
+ ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'),
+ ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'),
+ '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'),
+ ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'),
+ ':P' => array('raspberry.gif', '19', '19', 'raspberry'),
+ ':blank:' => array('blank.gif', '19', '19', 'blank stare'),
+ ':long:' => array('longface.gif', '19', '19', 'long face'),
+ ':ohh:' => array('ohh.gif', '19', '19', 'ohh'),
+ ':grrr:' => array('grrr.gif', '19', '19', 'grrr'),
+ ':gulp:' => array('gulp.gif', '19', '19', 'gulp'),
+ '8-/' => array('ohoh.gif', '19', '19', 'oh oh'),
+ ':down:' => array('downer.gif', '19', '19', 'downer'),
+ ':red:' => array('embarrassed.gif', '19', '19', 'red face'),
+ ':sick:' => array('sick.gif', '19', '19', 'sick'),
+ ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'),
+ ':-/' => array('hmm.gif', '19', '19', 'hmmm'),
+ '>:(' => array('mad.gif', '19', '19', 'mad'),
+ ':mad:' => array('mad.gif', '19', '19', 'mad'),
+ '>:-(' => array('angry.gif', '19', '19', 'angry'),
+ ':angry:' => array('angry.gif', '19', '19', 'angry'),
+ ':zip:' => array('zip.gif', '19', '19', 'zipper'),
+ ':kiss:' => array('kiss.gif', '19', '19', 'kiss'),
+ ':ahhh:' => array('shock.gif', '19', '19', 'shock'),
+ ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'),
+ ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'),
+ ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'),
+ ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'),
+ ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'),
+ ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'),
+ ':vampire:' => array('vampire.gif', '19', '19', 'vampire'),
+ ':snake:' => array('snake.gif', '19', '19', 'snake'),
+ ':exclaim:' => array('exclaim.gif', '19', '19', 'exclaim'),
+ ':question:' => array('question.gif', '19', '19', 'question')
+
+);
diff --git a/application/config/user_agents.php b/application/config/user_agents.php
new file mode 100644
index 00000000..b6c85631
--- /dev/null
+++ b/application/config/user_agents.php
@@ -0,0 +1,214 @@
+ 'Windows 10',
+ 'windows nt 6.3' => 'Windows 8.1',
+ 'windows nt 6.2' => 'Windows 8',
+ 'windows nt 6.1' => 'Windows 7',
+ 'windows nt 6.0' => 'Windows Vista',
+ 'windows nt 5.2' => 'Windows 2003',
+ 'windows nt 5.1' => 'Windows XP',
+ 'windows nt 5.0' => 'Windows 2000',
+ 'windows nt 4.0' => 'Windows NT 4.0',
+ 'winnt4.0' => 'Windows NT 4.0',
+ 'winnt 4.0' => 'Windows NT',
+ 'winnt' => 'Windows NT',
+ 'windows 98' => 'Windows 98',
+ 'win98' => 'Windows 98',
+ 'windows 95' => 'Windows 95',
+ 'win95' => 'Windows 95',
+ 'windows phone' => 'Windows Phone',
+ 'windows' => 'Unknown Windows OS',
+ 'android' => 'Android',
+ 'blackberry' => 'BlackBerry',
+ 'iphone' => 'iOS',
+ 'ipad' => 'iOS',
+ 'ipod' => 'iOS',
+ 'os x' => 'Mac OS X',
+ 'ppc mac' => 'Power PC Mac',
+ 'freebsd' => 'FreeBSD',
+ 'ppc' => 'Macintosh',
+ 'linux' => 'Linux',
+ 'debian' => 'Debian',
+ 'sunos' => 'Sun Solaris',
+ 'beos' => 'BeOS',
+ 'apachebench' => 'ApacheBench',
+ 'aix' => 'AIX',
+ 'irix' => 'Irix',
+ 'osf' => 'DEC OSF',
+ 'hp-ux' => 'HP-UX',
+ 'netbsd' => 'NetBSD',
+ 'bsdi' => 'BSDi',
+ 'openbsd' => 'OpenBSD',
+ 'gnu' => 'GNU/Linux',
+ 'unix' => 'Unknown Unix OS',
+ 'symbian' => 'Symbian OS'
+);
+
+
+// The order of this array should NOT be changed. Many browsers return
+// multiple browser types so we want to identify the sub-type first.
+$browsers = array(
+ 'OPR' => 'Opera',
+ 'Flock' => 'Flock',
+ 'Edge' => 'Edge',
+ 'Chrome' => 'Chrome',
+ // Opera 10+ always reports Opera/9.80 and appends Version/ to the user agent string
+ 'Opera.*?Version' => 'Opera',
+ 'Opera' => 'Opera',
+ 'MSIE' => 'Internet Explorer',
+ 'Internet Explorer' => 'Internet Explorer',
+ 'Trident.* rv' => 'Internet Explorer',
+ 'Shiira' => 'Shiira',
+ 'Firefox' => 'Firefox',
+ 'Chimera' => 'Chimera',
+ 'Phoenix' => 'Phoenix',
+ 'Firebird' => 'Firebird',
+ 'Camino' => 'Camino',
+ 'Netscape' => 'Netscape',
+ 'OmniWeb' => 'OmniWeb',
+ 'Safari' => 'Safari',
+ 'Mozilla' => 'Mozilla',
+ 'Konqueror' => 'Konqueror',
+ 'icab' => 'iCab',
+ 'Lynx' => 'Lynx',
+ 'Links' => 'Links',
+ 'hotjava' => 'HotJava',
+ 'amaya' => 'Amaya',
+ 'IBrowse' => 'IBrowse',
+ 'Maxthon' => 'Maxthon',
+ 'Ubuntu' => 'Ubuntu Web Browser'
+);
+
+$mobiles = array(
+ // legacy array, old values commented out
+ 'mobileexplorer' => 'Mobile Explorer',
+// 'openwave' => 'Open Wave',
+// 'opera mini' => 'Opera Mini',
+// 'operamini' => 'Opera Mini',
+// 'elaine' => 'Palm',
+ 'palmsource' => 'Palm',
+// 'digital paths' => 'Palm',
+// 'avantgo' => 'Avantgo',
+// 'xiino' => 'Xiino',
+ 'palmscape' => 'Palmscape',
+// 'nokia' => 'Nokia',
+// 'ericsson' => 'Ericsson',
+// 'blackberry' => 'BlackBerry',
+// 'motorola' => 'Motorola'
+
+ // Phones and Manufacturers
+ 'motorola' => 'Motorola',
+ 'nokia' => 'Nokia',
+ 'palm' => 'Palm',
+ 'iphone' => 'Apple iPhone',
+ 'ipad' => 'iPad',
+ 'ipod' => 'Apple iPod Touch',
+ 'sony' => 'Sony Ericsson',
+ 'ericsson' => 'Sony Ericsson',
+ 'blackberry' => 'BlackBerry',
+ 'cocoon' => 'O2 Cocoon',
+ 'blazer' => 'Treo',
+ 'lg' => 'LG',
+ 'amoi' => 'Amoi',
+ 'xda' => 'XDA',
+ 'mda' => 'MDA',
+ 'vario' => 'Vario',
+ 'htc' => 'HTC',
+ 'samsung' => 'Samsung',
+ 'sharp' => 'Sharp',
+ 'sie-' => 'Siemens',
+ 'alcatel' => 'Alcatel',
+ 'benq' => 'BenQ',
+ 'ipaq' => 'HP iPaq',
+ 'mot-' => 'Motorola',
+ 'playstation portable' => 'PlayStation Portable',
+ 'playstation 3' => 'PlayStation 3',
+ 'playstation vita' => 'PlayStation Vita',
+ 'hiptop' => 'Danger Hiptop',
+ 'nec-' => 'NEC',
+ 'panasonic' => 'Panasonic',
+ 'philips' => 'Philips',
+ 'sagem' => 'Sagem',
+ 'sanyo' => 'Sanyo',
+ 'spv' => 'SPV',
+ 'zte' => 'ZTE',
+ 'sendo' => 'Sendo',
+ 'nintendo dsi' => 'Nintendo DSi',
+ 'nintendo ds' => 'Nintendo DS',
+ 'nintendo 3ds' => 'Nintendo 3DS',
+ 'wii' => 'Nintendo Wii',
+ 'open web' => 'Open Web',
+ 'openweb' => 'OpenWeb',
+
+ // Operating Systems
+ 'android' => 'Android',
+ 'symbian' => 'Symbian',
+ 'SymbianOS' => 'SymbianOS',
+ 'elaine' => 'Palm',
+ 'series60' => 'Symbian S60',
+ 'windows ce' => 'Windows CE',
+
+ // Browsers
+ 'obigo' => 'Obigo',
+ 'netfront' => 'Netfront Browser',
+ 'openwave' => 'Openwave Browser',
+ 'mobilexplorer' => 'Mobile Explorer',
+ 'operamini' => 'Opera Mini',
+ 'opera mini' => 'Opera Mini',
+ 'opera mobi' => 'Opera Mobile',
+ 'fennec' => 'Firefox Mobile',
+
+ // Other
+ 'digital paths' => 'Digital Paths',
+ 'avantgo' => 'AvantGo',
+ 'xiino' => 'Xiino',
+ 'novarra' => 'Novarra Transcoder',
+ 'vodafone' => 'Vodafone',
+ 'docomo' => 'NTT DoCoMo',
+ 'o2' => 'O2',
+
+ // Fallback
+ 'mobile' => 'Generic Mobile',
+ 'wireless' => 'Generic Mobile',
+ 'j2me' => 'Generic Mobile',
+ 'midp' => 'Generic Mobile',
+ 'cldc' => 'Generic Mobile',
+ 'up.link' => 'Generic Mobile',
+ 'up.browser' => 'Generic Mobile',
+ 'smartphone' => 'Generic Mobile',
+ 'cellphone' => 'Generic Mobile'
+);
+
+// There are hundreds of bots but these are the most common.
+$robots = array(
+ 'googlebot' => 'Googlebot',
+ 'msnbot' => 'MSNBot',
+ 'baiduspider' => 'Baiduspider',
+ 'bingbot' => 'Bing',
+ 'slurp' => 'Inktomi Slurp',
+ 'yahoo' => 'Yahoo',
+ 'ask jeeves' => 'Ask Jeeves',
+ 'fastcrawler' => 'FastCrawler',
+ 'infoseek' => 'InfoSeek Robot 1.0',
+ 'lycos' => 'Lycos',
+ 'yandex' => 'YandexBot',
+ 'mediapartners-google' => 'MediaPartners Google',
+ 'CRAZYWEBCRAWLER' => 'Crazy Webcrawler',
+ 'adsbot-google' => 'AdsBot Google',
+ 'feedfetcher-google' => 'Feedfetcher Google',
+ 'curious george' => 'Curious George',
+ 'ia_archiver' => 'Alexa Crawler',
+ 'MJ12bot' => 'Majestic-12',
+ 'Uptimebot' => 'Uptimebot'
+);
diff --git a/application/controllers/index.html b/application/controllers/index.html
new file mode 100644
index 00000000..b702fbc3
--- /dev/null
+++ b/application/controllers/index.html
@@ -0,0 +1,11 @@
+
+
+
+ 403 Forbidden
+
+
+
+Directory access is forbidden.
+
+
+
diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php
new file mode 100644
index 00000000..df7bc3b7
--- /dev/null
+++ b/application/core/MY_Controller.php
@@ -0,0 +1,107 @@
+
+ */
+
+class MY_Controller extends MX_Controller
+{
+
+ /**
+ * '*' for all users
+ * '@' for logged in users
+ * '0, 1, 2, 4, 8, ...' for access level (power of 2)
+ */
+ protected $access_level = "*";
+
+ public function __construct()
+ {
+ parent::__construct();
+
+ /* Check permission on construct */
+ if (!$this->check_permission()) {
+ show_error(lang('msg_err_access_denied_message'), 403, lang('msg_err_access_denied_header'));
+ }
+ }
+
+ /**
+ * Check if user access level matches the required access level.
+ * Required level can be the controller's default level or a custom
+ * specified level.
+ *
+ * @param $required_level : minimum level required to get permission
+ * @return bool : true if user level is equal or higher than required level,
+ * false else
+ */
+ protected function check_permission($required_level = NULL)
+ {
+ if (!isset($_SESSION['logged_in'])) {
+ // Tests can accidentally delete $_SESSION,
+ // this makes sure it always exists.
+ $_SESSION['logged_in'] = FALSE;
+ }
+ if (is_null($required_level)) {
+ $required_level = $this->access_level;
+ }
+
+ if ($required_level == "*") {
+ // page is accessible for all users
+ return true;
+ }
+ else {
+ // check if user is logged in
+ // if not, redirect to login page
+ if ($_SESSION['logged_in'] != true) {
+ redirect("user/auth/login");
+ }
+ // check if page is accessible for all logged in users
+ elseif ($required_level == "@") {
+ return true;
+ }
+ // check access level
+ elseif ($required_level <= $_SESSION['user_access']) {
+ return true;
+ }
+ // no permission
+ else {
+ return false;
+ }
+ }
+ }
+
+
+ /**
+ * Display the view, adding header, footer and any other common view part
+ *
+ * @param $view_parts : single view or array of view parts to display
+ * $data : data array to send to the view
+ */
+ public function display_view($view_parts, $data = NULL)
+ {
+ // If not defined in $data, set page title to empty string
+ if (!isset($data['title'])) {
+ $data['title'] = '';
+ }
+
+ // Display common headers
+ $this->load->view('common/header', $data);
+ $this->load->view('common/login_bar');
+
+ if (is_array($view_parts)) {
+ // Display multiple view parts defined in $data
+ foreach ($view_parts as $view_part) {
+ $this->load->view($view_part, $data);
+ }
+ }
+ elseif (is_string($view_parts)) {
+ // Display unique view part defined in $data
+ $this->load->view($view_parts, $data);
+ }
+
+ // Display common footer
+ $this->load->view('common/footer');
+ }
+}
diff --git a/application/core/MY_Exceptions.php b/application/core/MY_Exceptions.php
new file mode 100644
index 00000000..2ba4a32d
--- /dev/null
+++ b/application/core/MY_Exceptions.php
@@ -0,0 +1,49 @@
+'.(is_array($message) ? implode('', $message) : $message).'
';
+ $template = 'html'.DIRECTORY_SEPARATOR.$template;
+ }
+
+ // Default to application/views/common
+ $common_templates_path = VIEWPATH.'common'.DIRECTORY_SEPARATOR;
+ if (!file_exists($common_templates_path)) {
+ // Select the views in the common module
+ $common_templates_path = APPPATH.'modules'.DIRECTORY_SEPARATOR.'common'.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR;
+ }
+
+ if (ob_get_level() > $this->ob_level + 1)
+ {
+ ob_end_flush();
+ }
+ ob_start();
+ if (!is_cli()) {
+ include($common_templates_path.'header.php');
+ include($common_templates_path.'login_bar.php');
+ }
+ include($errors_templates_path.$template.'.php');
+ if (!is_cli()) {
+ include($common_templates_path.'footer.php');
+ }
+ $buffer = ob_get_contents();
+ ob_end_clean();
+ return $buffer;
+ }
+}
\ No newline at end of file
diff --git a/application/core/MY_Loader.php b/application/core/MY_Loader.php
new file mode 100644
index 00000000..20633702
--- /dev/null
+++ b/application/core/MY_Loader.php
@@ -0,0 +1,8 @@
+
+ *
+ * @author modified and completed by Orif (ViDi)
+ * @link https://github.com/OrifInformatique/
+ * @copyright Copyright (c) 2019, Orif
+ */
+class MY_Model extends CI_Model
+{
+
+ /* --------------------------------------------------------------
+ * VARIABLES
+ * ------------------------------------------------------------ */
+
+ /**
+ * This model's default database table. Automatically
+ * guessed by pluralising the model name.
+ */
+ protected $_table;
+
+ /**
+ * The database connection object. Will be set to the default
+ * connection. This allows individual models to use different DBs
+ * without overwriting CI's global $this->db connection.
+ */
+ public $_database;
+
+ /**
+ * This model's default primary key or unique identifier.
+ * Used by the get(), update() and delete() functions.
+ */
+ protected $primary_key = 'id';
+
+ /**
+ * Support for soft deletes and this model's 'deleted' key
+ */
+ protected $soft_delete = FALSE;
+ protected $soft_delete_key = 'deleted';
+ protected $_temporary_with_deleted = FALSE;
+ protected $_temporary_only_deleted = FALSE;
+
+ /**
+ * The various callbacks available to the model. Each are
+ * simple lists of method names (methods will be run on $this).
+ */
+ protected $before_create = array();
+ protected $after_create = array();
+ protected $before_update = array();
+ protected $after_update = array();
+ protected $before_get = array();
+ protected $after_get = array();
+ protected $before_delete = array();
+ protected $after_delete = array();
+
+ protected $callback_parameters = array();
+
+ /**
+ * Protected, non-modifiable attributes
+ */
+ protected $protected_attributes = array();
+
+ /**
+ * Relationship arrays. Use flat strings for defaults or string
+ * => array to customise the class name and primary key
+ */
+ protected $belongs_to = array();
+ protected $has_many = array();
+
+ protected $_with = array();
+
+ /**
+ * An array of validation rules. This needs to be the same format
+ * as validation rules passed to the Form_validation library.
+ */
+ protected $validate = array();
+
+ /**
+ * Optionally skip the validation. Used in conjunction with
+ * skip_validation() to skip data validation for any future calls.
+ */
+ protected $skip_validation = FALSE;
+
+ /**
+ * By default we return our results as objects. If we need to override
+ * this, we can, or, we could use the `as_array()` and `as_object()` scopes.
+ */
+ protected $return_type = 'object';
+ protected $_temporary_return_type = NULL;
+
+ /* --------------------------------------------------------------
+ * GENERIC METHODS
+ * ------------------------------------------------------------ */
+
+ /**
+ * Initialise the model, tie into the CodeIgniter superobject and
+ * try our best to guess the table name.
+ */
+ public function __construct()
+ {
+ parent::__construct();
+
+ $this->load->helper('inflector');
+
+ $this->_fetch_table();
+
+ $this->_database = $this->db;
+
+ array_unshift($this->before_create, 'protect_attributes');
+ array_unshift($this->before_update, 'protect_attributes');
+
+ $this->_temporary_return_type = $this->return_type;
+ }
+
+ /* --------------------------------------------------------------
+ * CRUD INTERFACE
+ * ------------------------------------------------------------ */
+
+ /**
+ * Fetch a single record based on the primary key. Returns an object.
+ */
+ public function get($primary_value)
+ {
+ return $this->get_by($this->primary_key, $primary_value);
+ }
+
+ /**
+ * Fetch a single record based on an arbitrary WHERE call. Can be
+ * any valid value to $this->_database->where().
+ */
+ public function get_by()
+ {
+ $where = func_get_args();
+
+ if ($this->soft_delete && $this->_temporary_with_deleted !== TRUE)
+ {
+ $this->_database->where($this->soft_delete_key, (bool)$this->_temporary_only_deleted);
+ }
+
+ $this->_set_where($where);
+
+ $this->trigger('before_get');
+
+ $row = $this->_database->get($this->_table)
+ ->{$this->_return_type()}();
+ $this->_temporary_return_type = $this->return_type;
+
+ $row = $this->trigger('after_get', $row);
+
+ $this->_with = array();
+ return $row;
+ }
+
+ /**
+ * Fetch an array of records based on an array of primary values.
+ */
+ public function get_many($values)
+ {
+ $this->_database->where_in($this->primary_key, $values);
+
+ return $this->get_all();
+ }
+
+ /**
+ * Fetch an array of records based on an arbitrary WHERE call.
+ */
+ public function get_many_by()
+ {
+ $where = func_get_args();
+
+ $this->_set_where($where);
+
+ return $this->get_all();
+ }
+
+ /**
+ * Fetch all the records in the table. Can be used as a generic call
+ * to $this->_database->get() with scoped methods.
+ */
+ public function get_all()
+ {
+ $this->trigger('before_get');
+
+ if ($this->soft_delete && $this->_temporary_with_deleted !== TRUE)
+ {
+ $this->_database->where($this->soft_delete_key, (bool)$this->_temporary_only_deleted);
+ }
+
+ $result = $this->_database->get($this->_table)
+ ->{$this->_return_type(1)}();
+ $this->_temporary_return_type = $this->return_type;
+
+ foreach ($result as $key => &$row)
+ {
+ $row = $this->trigger('after_get', $row, ($key == count($result) - 1));
+ }
+
+ $this->_with = array();
+ return $result;
+ }
+
+ /**
+ * Insert a new row into the table. $data should be an associative array
+ * of data to be inserted. Returns newly created ID.
+ */
+ public function insert($data, $skip_validation = FALSE)
+ {
+ if ($skip_validation === FALSE)
+ {
+ $data = $this->validate($data);
+ }
+
+ if ($data !== FALSE)
+ {
+ $data = $this->trigger('before_create', $data);
+
+ $this->_database->insert($this->_table, $data);
+ $insert_id = $this->_database->insert_id();
+
+ $this->trigger('after_create', $insert_id);
+
+ return $insert_id;
+ }
+ else
+ {
+ return FALSE;
+ }
+ }
+
+ /**
+ * Insert multiple rows into the table. Returns an array of multiple IDs.
+ */
+ public function insert_many($data, $skip_validation = FALSE)
+ {
+ $ids = array();
+
+ foreach ($data as $key => $row)
+ {
+ $ids[] = $this->insert($row, $skip_validation, ($key == count($data) - 1));
+ }
+
+ return $ids;
+ }
+
+ /**
+ * Updated a record based on the primary value.
+ */
+ public function update($primary_value, $data, $skip_validation = FALSE)
+ {
+ $data = $this->trigger('before_update', $data);
+
+ if ($skip_validation === FALSE)
+ {
+ $data = $this->validate($data);
+ }
+
+ if ($data !== FALSE)
+ {
+ $result = $this->_database->where($this->primary_key, $primary_value)
+ ->set($data)
+ ->update($this->_table);
+
+ $this->trigger('after_update', array($data, $result));
+
+ return $result;
+ }
+ else
+ {
+ return FALSE;
+ }
+ }
+
+ /**
+ * Update many records, based on an array of primary values.
+ */
+ public function update_many($primary_values, $data, $skip_validation = FALSE)
+ {
+ $data = $this->trigger('before_update', $data);
+
+ if ($skip_validation === FALSE)
+ {
+ $data = $this->validate($data);
+ }
+
+ if ($data !== FALSE)
+ {
+ $result = $this->_database->where_in($this->primary_key, $primary_values)
+ ->set($data)
+ ->update($this->_table);
+
+ $this->trigger('after_update', array($data, $result));
+
+ return $result;
+ }
+ else
+ {
+ return FALSE;
+ }
+ }
+
+ /**
+ * Updated a record based on an arbitrary WHERE clause.
+ */
+ public function update_by()
+ {
+ $args = func_get_args();
+ $data = array_pop($args);
+
+ $data = $this->trigger('before_update', $data);
+
+ if ($this->validate($data) !== FALSE)
+ {
+ $this->_set_where($args);
+ $result = $this->_database->set($data)
+ ->update($this->_table);
+ $this->trigger('after_update', array($data, $result));
+
+ return $result;
+ }
+ else
+ {
+ return FALSE;
+ }
+ }
+
+ /**
+ * Update all records
+ */
+ public function update_all($data)
+ {
+ $data = $this->trigger('before_update', $data);
+ $result = $this->_database->set($data)
+ ->update($this->_table);
+ $this->trigger('after_update', array($data, $result));
+
+ return $result;
+ }
+
+ /**
+ * Delete a row from the table by the primary value
+ *
+ * @param boolean $force_hard_delete Force deletion from table even if
+ * soft_delete is set to true.
+ */
+ public function delete($id, $force_hard_delete = false)
+ {
+ $this->trigger('before_delete', $id);
+
+ $this->_database->where($this->primary_key, $id);
+
+ if ($this->soft_delete && !$force_hard_delete) {
+ $result = $this->_database->update($this->_table, array($this->soft_delete_key => TRUE));
+ } else {
+ $result = $this->_database->delete($this->_table);
+ }
+
+ $this->trigger('after_delete', $result);
+
+ return $result;
+ }
+
+ /**
+ * Delete a row from the database table by an arbitrary WHERE clause
+ */
+ public function delete_by()
+ {
+ $where = func_get_args();
+
+ $where = $this->trigger('before_delete', $where);
+
+ $this->_set_where($where);
+
+
+ if ($this->soft_delete)
+ {
+ $result = $this->_database->update($this->_table, array( $this->soft_delete_key => TRUE ));
+ }
+ else
+ {
+ $result = $this->_database->delete($this->_table);
+ }
+
+ $this->trigger('after_delete', $result);
+
+ return $result;
+ }
+
+ /**
+ * Delete many rows from the database table by multiple primary values
+ *
+ * @param boolean $force_hard_delete Force deletion from table even if
+ * soft_delete is set to true.
+ */
+ public function delete_many($primary_values, $force_hard_delete = false)
+ {
+ $primary_values = $this->trigger('before_delete', $primary_values);
+
+ $this->_database->where_in($this->primary_key, $primary_values);
+
+ if ($this->soft_delete && !$force_hard_delete) {
+ $result = $this->_database->update($this->_table, array($this->soft_delete_key => TRUE));
+ } else {
+ $result = $this->_database->delete($this->_table);
+ }
+
+ $this->trigger('after_delete', $result);
+
+ return $result;
+ }
+
+ /**
+ * Rollback a soft deletion for a row in the database, by the primary value
+ */
+ public function undelete($id)
+ {
+ if ($this->soft_delete) {
+ /* The data to update is the soft delete key, to reset to false */
+ $data = array($this->soft_delete_key => FALSE);
+
+ return $this->update($id, $data);
+ } else {
+ return FALSE;
+ }
+ }
+
+ /**
+ * Truncates the table
+ */
+ public function truncate()
+ {
+ $result = $this->_database->truncate($this->_table);
+
+ return $result;
+ }
+
+ /* --------------------------------------------------------------
+ * RELATIONSHIPS
+ * ------------------------------------------------------------ */
+
+ public function with($relationship)
+ {
+ $this->_with[] = $relationship;
+
+ if (!in_array('relate', $this->after_get))
+ {
+ $this->after_get[] = 'relate';
+ }
+
+ return $this;
+ }
+
+ public function with_all()
+ {
+ // Add all relationships in _with array
+ foreach ($this->belongs_to as $key => $value) {
+ if (is_string($value)) {
+ $relationship = $value;
+ } else {
+ $relationship = $key;
+ }
+
+ $this->_with[] = $relationship;
+ }
+
+ foreach ($this->has_many as $key => $value) {
+ if (is_string($value)) {
+ $relationship = $value;
+ } else {
+ $relationship = $key;
+ }
+
+ $this->_with[] = $relationship;
+ }
+
+ if (!in_array('relate', $this->after_get)) {
+ $this->after_get[] = 'relate';
+ }
+
+ return $this;
+ }
+
+ public function relate($row)
+ {
+ if (empty($row))
+ {
+ return $row;
+ }
+
+ foreach ($this->belongs_to as $key => $value)
+ {
+ if (is_string($value))
+ {
+ $relationship = $value;
+ $options = array( 'primary_key' => $value . '_id', 'model' => $value . '_model' );
+ }
+ else
+ {
+ $relationship = $key;
+ $options = $value;
+ }
+
+ if (in_array($relationship, $this->_with))
+ {
+ $this->load->model($options['model'], $relationship . '_model');
+
+ if (is_object($row))
+ {
+ $row->{$relationship} = $this->{$relationship . '_model'}->get($row->{$options['primary_key']});
+ }
+ else
+ {
+ $row[$relationship] = $this->{$relationship . '_model'}->get($row[$options['primary_key']]);
+ }
+ }
+ }
+
+ foreach ($this->has_many as $key => $value)
+ {
+ if (is_string($value))
+ {
+ $relationship = $value;
+ $options = array( 'primary_key' => singular($this->_table) . '_id', 'model' => singular($value) . '_model' );
+ }
+ else
+ {
+ $relationship = $key;
+ $options = $value;
+ }
+
+ if (in_array($relationship, $this->_with))
+ {
+ $this->load->model($options['model'], $relationship . '_model');
+
+ if (is_object($row))
+ {
+ $row->{$relationship} = $this->{$relationship . '_model'}->get_many_by($options['primary_key'], $row->{$this->primary_key});
+ }
+ else
+ {
+ $row[$relationship] = $this->{$relationship . '_model'}->get_many_by($options['primary_key'], $row[$this->primary_key]);
+ }
+ }
+ }
+
+ return $row;
+ }
+
+ /* --------------------------------------------------------------
+ * UTILITY METHODS
+ * ------------------------------------------------------------ */
+
+ /**
+ * Retrieve and generate a form_dropdown friendly array
+ */
+ function dropdown()
+ {
+ $args = func_get_args();
+
+ if(count($args) == 2)
+ {
+ list($key, $value) = $args;
+ }
+ else
+ {
+ $key = $this->primary_key;
+ $value = $args[0];
+ }
+
+ $this->trigger('before_dropdown', array( $key, $value ));
+
+ if ($this->soft_delete && $this->_temporary_with_deleted !== TRUE)
+ {
+ $this->_database->where($this->soft_delete_key, FALSE);
+ }
+
+ $result = $this->_database->select(array($key, $value))
+ ->get($this->_table)
+ ->result();
+
+ $options = array();
+
+ foreach ($result as $row)
+ {
+ $options[$row->{$key}] = $row->{$value};
+ }
+
+ $options = $this->trigger('after_dropdown', $options);
+
+ return $options;
+ }
+
+ /**
+ * Fetch a count of rows based on an arbitrary WHERE call.
+ */
+ public function count_by()
+ {
+ if ($this->soft_delete && $this->_temporary_with_deleted !== TRUE)
+ {
+ $this->_database->where($this->soft_delete_key, (bool)$this->_temporary_only_deleted);
+ }
+
+ $where = func_get_args();
+ $this->_set_where($where);
+
+ return $this->_database->count_all_results($this->_table);
+ }
+
+ /**
+ * Fetch a total count of rows, disregarding any previous conditions
+ */
+ public function count_all()
+ {
+ if ($this->soft_delete && $this->_temporary_with_deleted !== TRUE)
+ {
+ $this->_database->where($this->soft_delete_key, (bool)$this->_temporary_only_deleted);
+ }
+
+ return $this->_database->count_all($this->_table);
+ }
+
+ /**
+ * Tell the class to skip the insert validation
+ */
+ public function skip_validation()
+ {
+ $this->skip_validation = TRUE;
+ return $this;
+ }
+
+ /**
+ * Get the skip validation status
+ */
+ public function get_skip_validation()
+ {
+ return $this->skip_validation;
+ }
+
+ /**
+ * Return the next auto increment of the table. Only tested on MySQL.
+ */
+ public function get_next_id()
+ {
+ return (int) $this->_database->select('AUTO_INCREMENT')
+ ->from('information_schema.TABLES')
+ ->where('TABLE_NAME', $this->_table)
+ ->where('TABLE_SCHEMA', $this->_database->database)->get()->row()->AUTO_INCREMENT;
+ }
+
+ /**
+ * Getter for the table name
+ */
+ public function table()
+ {
+ return $this->_table;
+ }
+
+ /* --------------------------------------------------------------
+ * GLOBAL SCOPES
+ * ------------------------------------------------------------ */
+
+ /**
+ * Return the next call as an array rather than an object
+ */
+ public function as_array()
+ {
+ $this->_temporary_return_type = 'array';
+ return $this;
+ }
+
+ /**
+ * Return the next call as an object rather than an array
+ */
+ public function as_object()
+ {
+ $this->_temporary_return_type = 'object';
+ return $this;
+ }
+
+ /**
+ * Don't care about soft deleted rows on the next call
+ */
+ public function with_deleted()
+ {
+ $this->_temporary_with_deleted = TRUE;
+ return $this;
+ }
+
+ /**
+ * Only get deleted rows on the next call
+ */
+ public function only_deleted()
+ {
+ $this->_temporary_only_deleted = TRUE;
+ return $this;
+ }
+
+ /* --------------------------------------------------------------
+ * OBSERVERS
+ * ------------------------------------------------------------ */
+
+ /**
+ * MySQL DATETIME created_at and updated_at
+ */
+ public function created_at($row)
+ {
+ if (is_object($row))
+ {
+ $row->created_at = date('Y-m-d H:i:s');
+ }
+ else
+ {
+ $row['created_at'] = date('Y-m-d H:i:s');
+ }
+
+ return $row;
+ }
+
+ public function updated_at($row)
+ {
+ if (is_object($row))
+ {
+ $row->updated_at = date('Y-m-d H:i:s');
+ }
+ else
+ {
+ $row['updated_at'] = date('Y-m-d H:i:s');
+ }
+
+ return $row;
+ }
+
+ /**
+ * Serialises data for you automatically, allowing you to pass
+ * through objects and let it handle the serialisation in the background
+ */
+ public function serialize($row)
+ {
+ foreach ($this->callback_parameters as $column)
+ {
+ $row[$column] = serialize($row[$column]);
+ }
+
+ return $row;
+ }
+
+ public function unserialize($row)
+ {
+ foreach ($this->callback_parameters as $column)
+ {
+ if (is_array($row))
+ {
+ $row[$column] = unserialize($row[$column]);
+ }
+ else
+ {
+ $row->$column = unserialize($row->$column);
+ }
+ }
+
+ return $row;
+ }
+
+ /**
+ * Protect attributes by removing them from $row array
+ */
+ public function protect_attributes($row)
+ {
+ foreach ($this->protected_attributes as $attr)
+ {
+ if (is_object($row))
+ {
+ unset($row->$attr);
+ }
+ else
+ {
+ unset($row[$attr]);
+ }
+ }
+
+ return $row;
+ }
+
+ /* --------------------------------------------------------------
+ * QUERY BUILDER DIRECT ACCESS METHODS
+ * ------------------------------------------------------------ */
+
+ /**
+ * A wrapper to $this->_database->order_by()
+ */
+ public function order_by($criteria, $order = 'ASC')
+ {
+ if ( is_array($criteria) )
+ {
+ foreach ($criteria as $key => $value)
+ {
+ $this->_database->order_by($key, $value);
+ }
+ }
+ else
+ {
+ $this->_database->order_by($criteria, $order);
+ }
+ return $this;
+ }
+
+ /**
+ * A wrapper to $this->_database->limit()
+ */
+ public function limit($limit, $offset = 0)
+ {
+ $this->_database->limit($limit, $offset);
+ return $this;
+ }
+
+ /* --------------------------------------------------------------
+ * INTERNAL METHODS
+ * ------------------------------------------------------------ */
+
+ /**
+ * Trigger an event and call its observers. Pass through the event name
+ * (which looks for an instance variable $this->event_name), an array of
+ * parameters to pass through and an optional 'last in interation' boolean
+ */
+ public function trigger($event, $data = FALSE, $last = TRUE)
+ {
+ if (isset($this->$event) && is_array($this->$event))
+ {
+ foreach ($this->$event as $method)
+ {
+ if (strpos($method, '('))
+ {
+ preg_match('/([a-zA-Z0-9\_\-]+)(\(([a-zA-Z0-9\_\-\., ]+)\))?/', $method, $matches);
+
+ $method = $matches[1];
+ $this->callback_parameters = explode(',', $matches[3]);
+ }
+
+ $data = call_user_func_array(array($this, $method), array($data, $last));
+ }
+ }
+
+ return $data;
+ }
+
+ /**
+ * Run validation on the passed data
+ */
+ public function validate($data)
+ {
+ if($this->skip_validation)
+ {
+ return $data;
+ }
+
+ if(!empty($this->validate))
+ {
+ foreach($data as $key => $val)
+ {
+ $_POST[$key] = $val;
+ }
+
+ $this->load->library('form_validation');
+
+ if(is_array($this->validate))
+ {
+ $this->form_validation->set_rules($this->validate);
+
+ if ($this->form_validation->run() === TRUE)
+ {
+ return $data;
+ }
+ else
+ {
+ return FALSE;
+ }
+ }
+ else
+ {
+ if ($this->form_validation->run($this->validate) === TRUE)
+ {
+ return $data;
+ }
+ else
+ {
+ return FALSE;
+ }
+ }
+ }
+ else
+ {
+ return $data;
+ }
+ }
+
+ /**
+ * Guess the table name by pluralising the model name
+ */
+ private function _fetch_table()
+ {
+ if ($this->_table == NULL)
+ {
+ $this->_table = plural(preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this))));
+ }
+ }
+
+ /**
+ * Guess the primary key for current table
+ */
+ private function _fetch_primary_key()
+ {
+ if($this->primary_key == NULl)
+ {
+ $this->primary_key = $this->_database->query("SHOW KEYS FROM `".$this->_table."` WHERE Key_name = 'PRIMARY'")->row()->Column_name;
+ }
+ }
+
+ /**
+ * Set WHERE parameters, cleverly
+ */
+ protected function _set_where($params)
+ {
+ if (count($params) == 1 && is_array($params[0]))
+ {
+ foreach ($params[0] as $field => $filter)
+ {
+ if (is_array($filter))
+ {
+ $this->_database->where_in($field, $filter);
+ }
+ else
+ {
+ if (is_int($field))
+ {
+ $this->_database->where($filter);
+ }
+ else
+ {
+ $this->_database->where($field, $filter);
+ }
+ }
+ }
+ }
+ else if (count($params) == 1)
+ {
+ $this->_database->where($params[0]);
+ }
+ else if(count($params) == 2)
+ {
+ if (is_array($params[1]))
+ {
+ $this->_database->where_in($params[0], $params[1]);
+ }
+ else
+ {
+ $this->_database->where($params[0], $params[1]);
+ }
+ }
+ else if(count($params) == 3)
+ {
+ $this->_database->where($params[0], $params[1], $params[2]);
+ }
+ else
+ {
+ if (is_array($params[1]))
+ {
+ $this->_database->where_in($params[0], $params[1]);
+ }
+ else
+ {
+ $this->_database->where($params[0], $params[1]);
+ }
+ }
+ }
+
+ /**
+ * Return the method name for the current return type
+ */
+ protected function _return_type($multi = FALSE)
+ {
+ $method = ($multi) ? 'result' : 'row';
+ return $this->_temporary_return_type == 'array' ? $method . '_array' : $method;
+ }
+
+
+ /**
+ * Get validation rules for use in another class, typically in the controller
+ * to valid a form.
+ *
+ * @access public
+ * @param $rules_set : The set of rules to get, based on the controller
+ * method calling (see $this->validate array)
+ * @return validation rules array
+ */
+ public function get_validation_rules($rules_set)
+ {
+ return $this->validate[$rules_set];
+ }
+}
diff --git a/application/core/MY_Router.php b/application/core/MY_Router.php
new file mode 100644
index 00000000..15cbac14
--- /dev/null
+++ b/application/core/MY_Router.php
@@ -0,0 +1,8 @@
+
+
+
+ 403 Forbidden
+
+
+
+Directory access is forbidden.
+
+
+
diff --git a/application/helpers/MY_date_helper.php b/application/helpers/MY_date_helper.php
new file mode 100644
index 00000000..9febaaca
--- /dev/null
+++ b/application/helpers/MY_date_helper.php
@@ -0,0 +1,74 @@
+
+ */
+
+
+/**
+* Check if a given date (for example a date written in a form) is a valid date
+*
+* @return true if the date is valid, false else
+*/
+function validateDate($date, $format)
+{
+ // Check that $date is a valid date
+ $d = DateTime::createFromFormat($format, $date);
+ return $d && $d->format($format) == $date;
+}
+
+/**
+* Format a given date or the current date to the php timestamp format
+*
+* @return The formated date
+*/
+function phpDate($date)
+{
+ if (empty($date) || strtolower($date) == 'now')
+ {
+ return now();
+ }
+ else
+ {
+ return strtotime($date);
+ }
+}
+
+/**
+* Format a given date or the current date to MySQL DATE type
+*
+* @return The formated date
+*/
+function mysqlDate($date)
+{
+ if (empty($date) || strtolower($date) == 'now')
+ {
+ return date('Y-m-d');
+ }
+ else
+ {
+ return nice_date($date, 'Y-m-d');
+ }
+}
+
+/**
+* Format a given date or the current date to MySQL DATETIME type
+*
+* @return The formated date
+*/
+function mysqlDateTime($date)
+{
+ if (empty($date) || strtolower($date) == 'now')
+ {
+ return date('Y-m-d H:i:s');
+ }
+ else
+ {
+ return nice_date($date, 'Y-m-d H:i:s');
+ }
+}
+
+/* End of file My_date_helper.php */
\ No newline at end of file
diff --git a/application/helpers/index.html b/application/helpers/index.html
new file mode 100644
index 00000000..b702fbc3
--- /dev/null
+++ b/application/helpers/index.html
@@ -0,0 +1,11 @@
+
+
+
+ 403 Forbidden
+
+
+
+Directory access is forbidden.
+
+
+
diff --git a/application/hooks/index.html b/application/hooks/index.html
new file mode 100644
index 00000000..b702fbc3
--- /dev/null
+++ b/application/hooks/index.html
@@ -0,0 +1,11 @@
+
+
+
+ 403 Forbidden
+
+
+
+Directory access is forbidden.
+
+
+
diff --git a/application/index.html b/application/index.html
new file mode 100644
index 00000000..b702fbc3
--- /dev/null
+++ b/application/index.html
@@ -0,0 +1,11 @@
+
+
+
+ 403 Forbidden
+
+
+
+Directory access is forbidden.
+
+
+
diff --git a/application/language/english/index.html b/application/language/english/index.html
new file mode 100644
index 00000000..b702fbc3
--- /dev/null
+++ b/application/language/english/index.html
@@ -0,0 +1,11 @@
+
+
+
+ 403 Forbidden
+
+
+
+Directory access is forbidden.
+
+
+
diff --git a/application/language/french/MY_application_lang.php b/application/language/french/MY_application_lang.php
new file mode 100644
index 00000000..6168579b
--- /dev/null
+++ b/application/language/french/MY_application_lang.php
@@ -0,0 +1,36 @@
+
+ */
+
+// Application name
+$lang['app_title'] = 'Section informatique
Package de base';
+
+// Page titles
+$lang['page_prefix'] = 'Pack base';
+
+// Date and time formats
+$lang['date_format_short'] = 'd.m.Y';
+$lang['datetime_format_short'] = 'd.m.Y H:i';
+
+// Buttons
+$lang['btn_cancel'] = 'Annuler';
+$lang['btn_add_m'] = 'Nouveau';
+$lang['btn_add_f'] = 'Nouvelle';
+$lang['btn_save'] = 'Enregistrer';
+$lang['btn_disable'] = 'Désactiver';
+$lang['btn_reactivate'] = 'Réactiver';
+$lang['btn_delete'] = 'Supprimer';
+$lang['btn_hard_delete'] = 'Supprimer définitivement';
+
+// Messages
+$lang['msg_err_access_denied_header'] = 'Accès interdit';
+$lang['msg_err_access_denied_message'] = 'Vous n\'êtes pas autorisé à accéder à cette fonction';
+
+// Other texts
+$lang['yes'] = 'Oui';
+$lang['no'] = 'Non';
diff --git a/application/language/french/calendar_lang.php b/application/language/french/calendar_lang.php
new file mode 100644
index 00000000..f8efd533
--- /dev/null
+++ b/application/language/french/calendar_lang.php
@@ -0,0 +1,55 @@
+
+
+
+ 403 Forbidden
+
+
+
+Directory access is forbidden.
+
+
+
diff --git a/application/language/french/migration_lang.php b/application/language/french/migration_lang.php
new file mode 100644
index 00000000..77672ca2
--- /dev/null
+++ b/application/language/french/migration_lang.php
@@ -0,0 +1,18 @@
+
+
+
+ 403 Forbidden
+
+
+
+Directory access is forbidden.
+
+
+
diff --git a/application/libraries/MY_Form_validation.php b/application/libraries/MY_Form_validation.php
new file mode 100644
index 00000000..27241402
--- /dev/null
+++ b/application/libraries/MY_Form_validation.php
@@ -0,0 +1,8 @@
+
+
+
+ 403 Forbidden
+
+
+
+Directory access is forbidden.
+
+
+
diff --git a/application/logs/index.html b/application/logs/index.html
new file mode 100644
index 00000000..b702fbc3
--- /dev/null
+++ b/application/logs/index.html
@@ -0,0 +1,11 @@
+
+
+
+ 403 Forbidden
+
+
+
+Directory access is forbidden.
+
+
+
diff --git a/application/models/index.html b/application/models/index.html
new file mode 100644
index 00000000..b702fbc3
--- /dev/null
+++ b/application/models/index.html
@@ -0,0 +1,11 @@
+
+
+
+ 403 Forbidden
+
+
+
+Directory access is forbidden.
+
+
+
diff --git a/application/modules/common/index.html b/application/modules/common/index.html
new file mode 100644
index 00000000..b702fbc3
--- /dev/null
+++ b/application/modules/common/index.html
@@ -0,0 +1,11 @@
+
+
+
+ 403 Forbidden
+
+
+
+Directory access is forbidden.
+
+
+
diff --git a/application/modules/common/views/footer.php b/application/modules/common/views/footer.php
new file mode 100644
index 00000000..308b1d01
--- /dev/null
+++ b/application/modules/common/views/footer.php
@@ -0,0 +1,2 @@
+