CodeIgniter 4 Authentication Login and Registration
User authentication is a standard security mechanism, It allows identified users to access any digital application or website. In this tutorial, we will learn you how to build a simple auth system with login and signup functionalities using MySQL.
So let’s implement Codeigniter 4 Authentication Login and Registration. look files structure:
- authentication-login-registration
- app
- Config
- App.php
- Constants.php
- Database.php
- Routes.php
- Models
- UserModel.php
- SettingsModel.php
- LogsModel.php
- EmailconfigModel.php
- Controllers
- Auth
- AccountController.php
- LoginController.php
- PasswordController.php
- RegistrationController.php
- SettingsController.php
- UsersController.php
- Auth
- Views
- auth
- edit-user.php
- profile.php
- register.php
- settings.php
- starter.php
- user-logs.php
- users.php
- auth
- forgot.php
- login.php
- reset.php
- components
- navbar.php
- notifications.php
- edits
- edit-user.php
- emails
- activation.php
- confirmation.php
- footer.php
- header.php
- notification.php
- reset.php
- layouts
- auth.php
- default.php
- default-table.php
- modals
- add-user.php
- auth
- Config
- public
- .htaccess
- index.php
- favicon.ico
- .htaccess
- .env
- css
- vendor
- bootstrap
- datatables
- fontawesome
- jquery
- app
- .env
Here some are pretty simple steps you have to follow to create a simple Authentication Login and Registration.
- Step 1: Install CodeIgniter 4 Application
- Step 2: Display Errors
- Step 3: Create the Database and Table
- Step 4: Basic App Configurations
- Step 5: Setup and Configure Database access
- Step 6: Update routes file
- Step 7: Create and Update Model for user Auth module
- Step 8: Create/Update controllers for user Auth
- Step 9: Create views
- Step 10: Run Application
Step 1 – Install Codeigniter 4 Application
To handle the actual install you would use the following command in your terminal.
1 |
composer create-project codeigniter4/appstarter authentication-login-registration |
Step 2 – Display Errors
You may turn on the feature to errors, go to the
app/Config/Boot/production.php
and change display_errors prop value to 1 from 0.OR Second method is go to Codeigniter site and download the application
Step 3: Create the Database and Table
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
CREATE TABLE `emailconfig` ( `id` int(11) NOT NULL, `fromemail` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `fromname` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `protocol` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `host` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `security` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `port` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `updated_at` varchar(255) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `emailconfig` (`id`, `fromemail`, `fromname`, `protocol`, `host`, `username`, `security`, `port`, `password`, `created_at`, `updated_at`) VALUES (1, 'smtp@example.com', 'TechArise', 'smtp', 'gmail.google.com', 'username@gmail.com', 'tls', '22', '$2y$10$MoSleqpx.LnP.F5pRBNmS.SbtwI03zoxt3VHDHkrLcbAPvLEwl4sm', '2023-02-12 19:20:18', '2023-02-12 19:20:18'); CREATE TABLE `logs` ( `id` int(255) NOT NULL, `date` date NOT NULL, `time` time NOT NULL, `reference` int(255) NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `ip` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `location` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `browser` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `status` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `created_at` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `updated_at` varchar(255) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; CREATE TABLE `settings` ( `id` int(11) NOT NULL, `language` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `timezone` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `dateformat` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `timeformat` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `iprestriction` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `created_at` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `updated_at` varchar(255) COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `settings` (`id`, `language`, `timezone`, `dateformat`, `timeformat`, `iprestriction`, `created_at`, `updated_at`) VALUES (1, 'en', 'Asia/Kolkata', 'yyyy-mm-dd', '12', NULL, '2023-02-12 19:23:08', '2023-02-12 19:24:24'); CREATE TABLE `users` ( `id` int(11) UNSIGNED NOT NULL, `email` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `new_email` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL, `password_hash` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `name` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `firstname` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL, `lastname` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL, `activate_hash` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL, `reset_hash` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL, `reset_expires` bigint(20) DEFAULT NULL, `active` tinyint(1) NOT NULL DEFAULT 0, `created_at` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `updated_at` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `users` (`id`, `email`, `new_email`, `password_hash`, `name`, `firstname`, `lastname`, `activate_hash`, `reset_hash`, `reset_expires`, `active`, `created_at`, `updated_at`) VALUES (1, 'info@techarise.com', NULL, '$2y$10$Xxij22VkIj4QuTCkPfr8iOtTIV8cORS6fs9jKR1Lr2uR66NhMvluW', 'techarise', 'Team', 'TechArise', 'lhSXvzk9NeB0GxZ16Ww7UmPfYJt428qa', NULL, NULL, 1, '2023-01-29 19:15:39', '2023-01-29 19:15:39'); ALTER TABLE `emailconfig` ADD PRIMARY KEY (`id`); ALTER TABLE `logs` ADD PRIMARY KEY (`id`); ALTER TABLE `settings` ADD PRIMARY KEY (`id`); ALTER TABLE `users` ADD PRIMARY KEY (`id`); ALTER TABLE `emailconfig` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; ALTER TABLE `logs` MODIFY `id` int(255) NOT NULL AUTO_INCREMENT; ALTER TABLE `settings` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; ALTER TABLE `users` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; |
Step 4 – Basic App Configurations
Now, you need to some basic configuration on the
app/config/app.php
file.
1 2 3 |
public $baseURL = 'http://localhost:8080'; To public $baseURL = 'http://localhost/authentication-login-registration/public'; |
Step 5: Setup and Configure Database access
Update the file app/Config/Database.php OR .env file:
i) .env
1 2 3 4 5 |
database.default.hostname = localhost database.default.database = demo_DB database.default.username = root database.default.password = database.default.DBDriver = MySQLi |
ii) Database.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<?php // configure database public $default = [ 'DSN' => '', 'hostname' => 'localhost', 'username' => 'root', 'password' => '', 'database' => 'demo_DB', 'DBDriver' => 'MySQLi', 'DBPrefix' => '', 'pConnect' => false, 'DBDebug' => (ENVIRONMENT !== 'production'), 'charset' => 'utf8', 'DBCollat' => 'utf8_general_ci', 'swapPre' => '', 'encrypt' => false, 'compress' => false, 'strictOn' => false, 'failover' => [], 'port' => 3306, ]; ?> |
Step 6: Update routes file
Add/Update code the file app/Config/Routes.php in your CodeIgniter installation with you controller’s name.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
<?php $routes->get('/', 'Auth\LoginController::login'); /** * -------------------------------------------------------------------- * Custom Routing * -------------------------------------------------------------------- */ $routes->group('', ['namespace' => 'App\Controllers'], function ($routes) { // Registration $routes->get('register', 'Auth\RegistrationController::register', ['as' => 'register']); $routes->post('register', 'Auth\RegistrationController::attemptRegister'); // Activation $routes->get('activate-account', 'Auth\RegistrationController::activateAccount', ['as' => 'activate-account']); // Login-out $routes->get('login', 'Auth\LoginController::login', ['as' => 'login']); $routes->post('login', 'Auth\LoginController::attemptLogin'); $routes->get('logout', 'Auth\LoginController::logout'); // Forgotten password $routes->get('forgot-password', 'Auth\PasswordController::forgotPassword', ['as' => 'forgot-password']); $routes->post('forgot-password', 'Auth\PasswordController::attemptForgotPassword'); // Reset password $routes->get('reset-password', 'Auth\PasswordController::resetPassword', ['as' => 'reset-password']); $routes->post('reset-password', 'Auth\PasswordController::attemptResetPassword'); // Account settings $routes->get('account', 'Auth\AccountController::account', ['as' => 'account']); $routes->post('account', 'Auth\AccountController::updateAccount'); $routes->post('change-email', 'Auth\AccountController::changeEmail'); $routes->get('confirm-email', 'Auth\AccountController::confirmNewEmail'); $routes->post('change-password', 'Auth\AccountController::changePassword'); $routes->post('delete-account', 'Auth\AccountController::deleteAccount'); // Profile $routes->get('profile', 'Auth\AccountController::profile', ['as' => 'profile']); $routes->post('update-profile', 'Auth\AccountController::updateProfile'); // Users $routes->get('users', 'Auth\UsersController::users', ['as' => 'users']); $routes->get('users/enable/(:num)', 'Auth\UsersController::enable'); $routes->get('users/edit/(:num)', 'Auth\UsersController::edit'); $routes->post('users/update-user', 'Auth\UsersController::update'); $routes->get('users/delete/(:num)', 'Auth\UsersController::delete'); $routes->post('users/create-user', 'Auth\UsersController::createUser'); $routes->get('users/logs', 'Auth\UsersController::userLogs', ['as' => 'userlogs']); // Settings $routes->get('settings', 'Auth\SettingsController::settings', ['as' => 'settings']); $routes->post('settings-update-system', 'Auth\SettingsController::updateSystem'); $routes->post('settings-update-email', 'Auth\SettingsController::updateEmail'); }); ?> |
Step 7: Create and Update Model for user Auth module
Create model files are named
UserModel.php, SettingsModel.php, LogsModel.php and EmailconfigModel.php
inside “app/Models” folder. i- UserModel.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
<?php /* * *** * Version: 1.0.0 * * Description of Auth Model * * @author Coders Mag * * @email info@codersmag.com * * *** */ namespace App\Models; use CodeIgniter\Model; class UserModel extends Model { protected $table = 'users'; protected $primaryKey = 'id'; protected $returnType = 'array'; protected $useSoftDeletes = false; // this happens first, model removes all other fields from input data protected $allowedFields = [ 'name', 'firstname', 'lastname', 'email', 'new_email', 'password', 'password_confirm', 'activate_hash', 'reset_hash', 'reset_expires', 'active' ]; protected $useTimestamps = true; protected $createdField = 'created_at'; protected $updatedField = 'updated_at'; protected $dateFormat = 'datetime'; protected $validationRules = []; // we need different rules for registration, account update, etc protected $dynamicRules = [ 'registration' => [ 'firstname' => 'required|alpha_space|min_length[2]', 'lastname' => 'required|alpha_space|min_length[2]', 'name' => 'required|alpha_space|min_length[2]', 'email' => 'required|valid_email|is_unique[users.email,id,{id}]', 'password' => 'required|min_length[5]', 'password_confirm' => 'matches[password]' ], 'updateAccount' => [ 'id' => 'required|is_natural', 'name' => 'required|alpha_space|min_length[2]' ], 'updateProfile' => [ 'id' => 'required|is_natural', 'name' => 'required|alpha_space|min_length[2]', 'firstname' => 'required|alpha_space|min_length[2]', 'lastname' => 'required|alpha_space|min_length[2]', 'email' => 'required|valid_email|is_unique[users.email,id,{id}]', 'active' => 'required|integer', ], 'changeEmail' => [ 'id' => 'required|is_natural', 'new_email' => 'required|valid_email|is_unique[users.email]', 'activate_hash' => 'required' ], 'enableuser' => [ 'id' => 'required|is_natural', 'active' => 'required|integer' ] ]; protected $validationMessages = []; protected $skipValidation = false; // this runs after field validation protected $beforeInsert = ['hashPassword']; protected $beforeUpdate = ['hashPassword']; //-------------------------------------------------------------------- /** * Retrieves validation rule */ public function getRule(string $rule) { return $this->dynamicRules[$rule]; } //-------------------------------------------------------------------- /** * Hashes the password after field validation and before insert/update */ protected function hashPassword(array $data) { if (! isset($data['data']['password'])) return $data; $data['data']['password_hash'] = password_hash($data['data']['password'], PASSWORD_DEFAULT); unset($data['data']['password']); unset($data['data']['password_confirm']); return $data; } } ?> |
ii- SettingsModel.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
<?php /* * *** * Version: 1.0.0 * * Description of Auth Model * * @author Coders Mag * * @email info@codersmag.com * * *** */ namespace App\Models; use CodeIgniter\Model; class SettingsModel extends Model { protected $table = 'settings'; protected $primaryKey = 'id'; protected $returnType = 'array'; protected $useSoftDeletes = false; // this happens first, model removes all other fields from input data protected $allowedFields = [ 'language', 'timezone', 'dateformat', 'timeformat', 'iprestriction' ]; protected $useTimestamps = true; protected $createdField = 'created_at'; protected $updatedField = 'updated_at'; protected $dateFormat = 'datetime'; protected $validationRules = []; // we need different rules for logs protected $dynamicRules = [ 'settings' => [ 'language' => 'required', 'timezone' => 'required', 'dateformat' => 'required', 'timeformat' => 'required', 'iprestriction' => 'required', ] ]; protected $validationMessages = []; protected $skipValidation = false; //-------------------------------------------------------------------- /** * Retrieves validation rule */ public function getRule(string $rule) { return $this->dynamicRules[$rule]; } } ?> |
iii- LogsModel.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
<?php /* * *** * Version: 1.0.0 * * Description of Auth Model * * @author Coders Mag * * @email info@codersmag.com * * *** */ namespace App\Models; use CodeIgniter\Model; class LogsModel extends Model { protected $table = 'logs'; protected $primaryKey = 'id'; protected $returnType = 'array'; protected $useSoftDeletes = false; // this happens first, model removes all other fields from input data protected $allowedFields = [ 'date', 'time', 'reference', 'name', 'ip', 'location', 'browser', 'status' ]; protected $useTimestamps = true; protected $createdField = 'created_at'; protected $updatedField = 'updated_at'; protected $dateFormat = 'datetime'; protected $validationRules = []; // we need different rules for logs protected $dynamicRules = [ 'logs' => [ 'date' => 'required', 'time' => 'required', 'reference' => 'required', 'ip' => 'required', 'location' => 'required', 'browser' => 'required', 'status' => 'required' ] ]; protected $validationMessages = []; protected $skipValidation = false; //-------------------------------------------------------------------- /** * Retrieves validation rule */ public function getRule(string $rule) { return $this->dynamicRules[$rule]; } } ?> |
vi- EmailconfigModel.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
<?php /* * *** * Version: 1.0.0 * * Description of Auth Model * * @author Coders Mag * * @email info@codersmag.com * * *** */ namespace App\Models; use CodeIgniter\Model; class EmailconfigModel extends Model { protected $table = 'emailconfig'; protected $primaryKey = 'id'; protected $returnType = 'array'; protected $useSoftDeletes = false; // this happens first, model removes all other fields from input data protected $allowedFields = [ 'fromemail', 'fromname', 'protocol', 'host', 'username', 'security', 'port', 'password' ]; protected $useTimestamps = true; protected $createdField = 'created_at'; protected $updatedField = 'updated_at'; protected $dateFormat = 'datetime'; protected $validationRules = []; // we need different rules for logs protected $dynamicRules = [ 'emailconfig' => [ 'fromemail' => 'required', 'fromname' => 'required', 'protocol' => 'required', 'host' => 'required', 'username' => 'required', 'security' => 'required', 'port' => 'required', 'password' => 'required', ] ]; protected $validationMessages = []; protected $skipValidation = false; //-------------------------------------------------------------------- /** * Retrieves validation rule */ public function getRule(string $rule) { return $this->dynamicRules[$rule]; } } ?> |
Step 8: Create/Update controllers for user Auth
Create controllers files are named
UsersController.php, RegistrationController.php, LoginController.php, PasswordController.php, AccountController.php and SettingsController.php
inside “app/Auth/Controllers” folder. i- UsersController.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
<?php /* * *** * Version: 1.0.0 * * Description of Auth Controller * * @author Coders Mag * * @email info@codersmag.com * * *** */ namespace App\Controllers\Auth; use CodeIgniter\Controller; use Config\Email; use Config\Services; use App\Models\UserModel; use App\Models\LogsModel; class UsersController extends Controller { /** * Access to current session. * * @var \CodeIgniter\Session\Session */ protected $session; /** * Authentication settings. */ protected $config; //-------------------------------------------------------------------- public function __construct() { // start session $this->session = Services::session(); } //-------------------------------------------------------------------- /** * Displays users page. */ public function users() { // check if user is signed-in if not redirect to login page if (! $this->session->isLoggedIn) { return redirect()->to('login'); } // current year and month variable $ym = date("Y-m"); // load user model $users = new UserModel(); // getall users $allusers = $users->findAll(); // count all rows in users table $countusers = $users->countAll(); // count all active user in the last 30 days $newusers = $users->like("created_at", $ym)->countAllResults(); // count all active users $activeusers = $users->where('active', 1)->countAllResults(); // calculate active users in how many percents $percentofactiveusers = ($activeusers / $countusers) * 100; // load the view with session data return view('auth/users', [ 'userData' => $this->session->userData, 'data' => $allusers, 'usercount' => $countusers, 'newusers' => $newusers, 'percentofactiveusers' => $percentofactiveusers ]); } public function enable() { // get the user id $id = $this->request->uri->getSegment(3); $users = new UserModel(); $user = [ 'id' => $id, 'active' => 1, ]; if (! $users->save($user)) { return redirect()->back()->withInput()->with('errors', $users->errors()); } return redirect()->back()->with('success', lang('Auth.enableUser')); } public function edit() { // get the user id $id = $this->request->uri->getSegment(3); // load user model $users = new UserModel(); // get user data using the id $user = $users->where('id', $id)->first(); // load the view with session data return view('auth/edits/edit-user', [ 'userData' => $this->session->userData, 'user' => $user, ]); } public function update() { $rules = [ 'id' => 'required|is_natural', 'name' => 'required|alpha_space|min_length[2]', 'firstname' => 'required|alpha_space|min_length[2]', 'lastname' => 'required|alpha_space|min_length[2]', 'email' => 'required|valid_email|is_unique[users.email,id,{id}]', 'active' => 'required|integer', ]; if (! $this->validate($rules)) { return redirect()->back()->withInput()->with('errors', $this->validator->getErrors()); } $users = new UserModel(); $user = [ 'id' => $this->request->getPost('id'), 'name' => $this->request->getPost('name'), 'firstname' => $this->request->getPost('firstname'), 'lastname' => $this->request->getPost('lastname'), 'email' => $this->request->getPost('email'), 'active' => $this->request->getPost('active') ]; if (! $users->save($user)) { return redirect()->back()->withInput()->with('errors', $users->errors()); } return redirect()->back()->with('success', lang('Auth.updateSuccess')); } public function delete() { // get the user id $id = $this->request->uri->getSegment(3); // load user model $users = new UserModel(); // delete user using the id $users->delete($id); return redirect()->back()->with('success', lang('Auth.accountDeleted')); } public function createUser() { helper('text'); // save new user, validation happens in the model $users = new UserModel(); $getRule = $users->getRule('registration'); $users->setValidationRules($getRule); $user = [ 'firstname' => $this->request->getPost('firstname'), 'lastname' => $this->request->getPost('lastname'), 'name' => $this->request->getPost('name'), 'email' => $this->request->getPost('email'), 'password' => $this->request->getPost('password'), 'password_confirm' => $this->request->getPost('password_confirm'), 'activate_hash' => random_string('alnum', 32) ]; if (! $users->save($user)) { return redirect()->back()->withInput()->with('errors', $users->errors()); } // success return redirect()->back()->with('success', 'Success! You created a new account'); } public function userLogs() { // load logs model $logs = new LogsModel(); // get all user logs $userlogs = $logs->findAll(); return view('auth/user-logs', ['userData' => $this->session->userData, 'data' => $userlogs]); } } ?> |
ii- RegistrationController.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
<?php /* * *** * Version: 1.0.0 * * Description of Auth Controller * * @author Coders Mag * * @email info@codersmag.com * * *** */ namespace App\Controllers\Auth; use CodeIgniter\Controller; use Config\Email; use Config\Services; use App\Models\UserModel; class RegistrationController extends Controller { /** * Access to current session. * * @var \CodeIgniter\Session\Session */ protected $session; /** * Authentication settings. */ protected $config; //-------------------------------------------------------------------- public function __construct() { // start session $this->session = Services::session(); } //-------------------------------------------------------------------- /** * Displays register form. */ public function register() { if ($this->session->isLoggedIn) { return redirect()->to('account'); } return view('auth/register'); } //-------------------------------------------------------------------- /** * Attempt to register a new user. */ public function attemptRegister() { helper('text'); // save new user, validation happens in the model $users = new UserModel(); $getRule = $users->getRule('registration'); $users->setValidationRules($getRule); $user = [ 'firstname' => $this->request->getPost('firstname'), 'lastname' => $this->request->getPost('lastname'), 'name' => $this->request->getPost('name'), 'email' => $this->request->getPost('email'), 'password' => $this->request->getPost('password'), 'password_confirm' => $this->request->getPost('password_confirm'), 'activate_hash' => random_string('alnum', 32) ]; if (! $users->save($user)) { return redirect()->back()->withInput()->with('errors', $users->errors()); } // success return redirect()->to('login')->with('success', lang('Auth.registrationSuccess')); } //-------------------------------------------------------------------- /** * Activate account. */ public function activateAccount() { $users = new UserModel(); // check token $user = $users->where('activate_hash', $this->request->getGet('token')) ->where('active', 0) ->first(); // check user if exists if (is_null($user)) { return redirect()->to('login')->with('error', lang('Auth.activationNoUser')); } // update user account to active $updatedUser['id'] = $user['id']; $updatedUser['active'] = 1; $users->save($updatedUser); return redirect()->to('login')->with('success', lang('Auth.activationSuccess')); } } ?> |
iii- LoginController.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
<?php /* * *** * Version: 1.0.0 * * Description of Auth Controller * * @author Coders Mag * * @email info@codersmag.com * * *** */ namespace App\Controllers\Auth; use CodeIgniter\Controller; use Config\Email; use Config\Services; use App\Models\UserModel; use App\Models\LogsModel; class LoginController extends Controller { /** * Access to current session. * * @var \CodeIgniter\Session\Session */ protected $session; /** * Authentication settings. */ protected $config; //-------------------------------------------------------------------- public function __construct() { // start session $this->session = Services::session(); } //-------------------------------------------------------------------- /** * Displays login form or redirects if user is already logged in. */ public function login() { if ($this->session->isLoggedIn) { return redirect()->to('account'); } return view('auth/auth/login'); } //-------------------------------------------------------------------- /** * Attempts to verify user's credentials through POST request. */ public function attemptLogin() { // validate request $rules = [ 'email' => 'required|valid_email', 'password' => 'required|min_length[5]', ]; if (! $this->validate($rules)) { return redirect()->to('login')->withInput()->with('errors', $this->validator->getErrors()); } // check credentials $users = new UserModel(); $user = $users->where('email', $this->request->getPost('email'))->first(); if ( is_null($user) || ! password_verify($this->request->getPost('password'), $user['password_hash']) ) { return redirect()->to('login')->withInput()->with('error', lang('Auth.wrongCredentials')); } // check activation if (!$user['active']) { return redirect()->to('login')->withInput()->with('error', lang('Auth.notActivated')); } // login OK, save user data to session $this->session->set('isLoggedIn', true); $this->session->set('userData', [ 'id' => $user["id"], 'name' => $user["name"], 'firstname' => $user["firstname"], 'lastname' => $user["lastname"], 'email' => $user["email"], 'new_email' => $user["new_email"] ]); // save login info to user login logs for tracking // get user agent $agent = $this->request->getUserAgent(); // load logs model $logs = new LogsModel(); // logs data $userlog = [ 'date' => date("Y-m-d"), 'time' => date("H:i:s"), 'reference' => $user["id"], 'name' => $user["name"], 'ip' => $this->request->getIPAddress(), 'browser' => $agent->getBrowser(), 'status' => 'Success' ]; // logs to database $logs->save($userlog); return redirect()->to('account'); } //-------------------------------------------------------------------- /** * Log the user out. */ public function logout() { $this->session->remove(['isLoggedIn', 'userData']); return redirect()->to('login'); } } ?> |
vi- PasswordController.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
<?php /* * *** * Version: 1.0.0 * * Description of Auth Controller * * @author Coders Mag * * @email info@codersmag.com * * *** */ namespace App\Controllers\Auth; use CodeIgniter\Controller; use Config\Email; use Config\Services; use App\Models\UserModel; class PasswordController extends Controller { /** * Access to current session. * * @var \CodeIgniter\Session\Session */ protected $session; /** * Authentication settings. */ protected $config; //-------------------------------------------------------------------- public function __construct() { // start session $this->session = Services::session(); } //-------------------------------------------------------------------- public function forgotPassword() { if ($this->session->isLoggedIn) { return redirect()->to('account'); } return view('auth/auth/forgot'); } //-------------------------------------------------------------------- public function attemptForgotPassword() { // validate request if (! $this->validate(['email' => 'required|valid_email'])) { return redirect()->back()->with('error', lang('Auth.wrongEmail')); } // check if email exists in DB $users = new UserModel(); $user = $users->where('email', $this->request->getPost('email'))->first(); if (! $user) { return redirect()->back()->with('error', lang('Auth.wrongEmail')); } // check if email is already sent to prevent spam if (! empty($user['reset_expires']) && $user['reset_expires'] >= time()) { return redirect()->back()->with('error', lang('Auth.emailAlreadySent')); } // set reset hash and expiration helper('text'); $updatedUser['id'] = $user['id']; $updatedUser['reset_hash'] = random_string('alnum', 32); $updatedUser['reset_expires'] = time() + HOUR; $users->save($updatedUser); // send password reset e-mail helper('auth'); send_password_reset_email($this->request->getPost('email'), $updatedUser['reset_hash']); return redirect()->back()->with('success', lang('Auth.forgottenPasswordEmail')); } //-------------------------------------------------------------------- public function resetPassword() { // check reset hash and expiration $users = new UserModel(); $user = $users->where('reset_hash', $this->request->getGet('token')) ->where('reset_expires >', time()) ->first(); if (! $user) { return redirect()->to('login')->with('error', lang('Auth.invalidRequest')); } return view('auth/auth/reset'); } //-------------------------------------------------------------------- public function attemptResetPassword() { // validate request $rules = [ 'token' => 'required', 'password' => 'required|min_length[5]', 'password_confirm' => 'matches[password]' ]; if (! $this->validate($rules)) { return redirect()->back()->with('error', lang('Auth.passwordMismatch')); } // check reset hash, expiration $users = new UserModel(); $user = $users->where('reset_hash', $this->request->getPost('token')) ->where('reset_expires >', time()) ->first(); if (! $user) { return redirect()->to('login')->with('error', lang('Auth.invalidRequest')); } // update user password $updatedUser['id'] = $user['id']; $updatedUser['password'] = $this->request->getPost('password'); $updatedUser['reset_hash'] = null; $updatedUser['reset_expires'] = null; $users->save($updatedUser); // redirect to login return redirect()->to('login')->with('success', lang('Auth.passwordUpdateSuccess')); } } ?> |
v- AccountController.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
<?php /* * *** * Version: 1.0.0 * * Description of Auth Controller * * @author Coders Mag * * @email info@codersmag.com * * *** */ namespace App\Controllers\Auth; use CodeIgniter\Controller; use Config\Email; use Config\Services; use App\Models\UserModel; class AccountController extends Controller { /** * Access to current session. * * @var \CodeIgniter\Session\Session */ protected $session; /** * Authentication settings. */ protected $config; //-------------------------------------------------------------------- public function __construct() { // start session $this->session = Services::session(); } //-------------------------------------------------------------------- /** * Displays account settings. */ public function account() { if (! $this->session->isLoggedIn) { return redirect()->to('login'); } return view('auth/starter', [ 'userData' => $this->session->userData, ]); } //-------------------------------------------------------------------- /** * Displays profile page. */ public function profile() { if (! $this->session->isLoggedIn) { return redirect()->to('login'); } return view('auth/profile', [ 'userData' => $this->session->userData, ]); } //-------------------------------------------------------------------- /** * Updates regular account settings. */ public function updateProfile() { // update user, validation happens in model $users = new UserModel(); $getRule = $users->getRule('updateProfile'); $users->setValidationRules($getRule); $user = [ 'id' => $this->session->get('userData.id'), 'name' => $this->request->getPost('name'), 'firstname' => $this->request->getPost('firstname'), 'lastname' => $this->request->getPost('lastname'), 'email' => $this->request->getPost('email') ]; if (! $users->save($user)) { return redirect()->back()->withInput()->with('errors', $users->errors()); } // update session data $this->session->push('userData', $user); return redirect()->to('profile')->with('success', lang('Auth.updateSuccess')); } //-------------------------------------------------------------------- /** * Updates regular account settings. */ public function updateAccount() { // update user, validation happens in model $users = new UserModel(); $getRule = $users->getRule('updateAccount'); $users->setValidationRules($getRule); $user = [ 'id' => $this->session->get('userData.id'), 'name' => $this->request->getPost('name') ]; if (! $users->save($user)) { return redirect()->back()->withInput()->with('errors', $users->errors()); } // update session data $this->session->push('userData', $user); return redirect()->to('account')->with('success', lang('Auth.updateSuccess')); } //-------------------------------------------------------------------- /** * Handles password change. */ public function changePassword() { // validate request $rules = [ 'password' => 'required|min_length[5]', 'new_password' => 'required|min_length[5]', 'new_password_confirm' => 'required|matches[new_password]' ]; if (! $this->validate($rules)) { return redirect()->to('profile')->withInput() ->with('errors', $this->validator->getErrors()); } // check current password $users = new UserModel(); $user = $users->find($this->session->get('userData.id')); if ( ! $user || ! password_verify($this->request->getPost('password'), $user['password_hash']) ) { return redirect()->to('profile')->withInput()->with('error', lang('Auth.wrongCredentials')); } // update user's password $updatedUser['id'] = $this->session->get('userData.id'); $updatedUser['password'] = $this->request->getPost('new_password'); $users->save($updatedUser); // redirect to account with success message return redirect()->to('profile')->with('success', lang('Auth.passwordUpdateSuccess')); } //-------------------------------------------------------------------- /** * Deletes user account. */ public function deleteAccount() { // check current password $users = new UserModel(); $user = $users->find($this->session->get('userData.id')); if ( ! $user || ! password_verify($this->request->getPost('password'), $user['password_hash']) ) { return redirect()->back()->withInput()->with('error', lang('Auth.wrongCredentials')); } // delete account from DB $users->delete($this->session->get('userData.id')); // log out user $this->session->remove(['isLoggedIn', 'userData']); // redirect to register with success message return redirect()->to('register')->with('success', lang('Auth.accountDeleted')); } } ?> |
vi- SettingsController.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
<?php /* * *** * Version: 1.0.0 * * Description of Auth Controller * * @author Coders Mag * * @email info@codersmag.com * * *** */ namespace App\Controllers\Auth; use CodeIgniter\Controller; use Config\Email; use Config\Services; use App\Models\UserModel; use App\Models\SettingsModel; use App\Models\EmailconfigModel; class SettingsController extends Controller { /** * Access to current session. * * @var \CodeIgniter\Session\Session */ protected $session; //-------------------------------------------------------------------- public function __construct() { // start session $this->session = Services::session(); } //-------------------------------------------------------------------- /** * Displays settings page. */ public function settings() { $settings = new SettingsModel(); $emailconfig = new EmailconfigModel(); $system = $settings->where('id', 1)->first(); $email = $emailconfig->where('id', 1)->first(); return view('auth/settings', [ 'userData' => $this->session->userData, 'system' => $system, 'email' => $email ]); } public function updateSystem() { $rules = [ 'id' => 'required|is_natural', 'language' => 'required', 'timezone' => 'required', 'dateformat' => 'required', 'timeformat' => 'required', ]; if (! $this->validate($rules)) { return redirect()->back()->withInput()->with('errors', $this->validator->getErrors()); } $settings = new SettingsModel(); $system = [ 'id' => $this->request->getPost('id'), 'language' => $this->request->getPost('language'), 'timezone' => $this->request->getPost('timezone'), 'dateformat' => $this->request->getPost('dateformat'), 'timeformat' => $this->request->getPost('timeformat'), 'iprestriction' => $this->request->getPost('iprestriction'), ]; if (! $settings->save($system)) { return redirect()->back()->withInput()->with('errors', $settings->errors()); } return redirect()->back()->with('success', lang('Auth.updateSuccess')); } public function updateEmail() { $rules = [ 'id' => 'required|is_natural', 'fromname' => 'required', 'fromemail' => 'required', 'protocol' => 'required', 'host' => 'required', 'username' => 'required', 'security' => 'required', 'port' => 'required', ]; if (! $this->validate($rules)) { return redirect()->back()->withInput()->with('errors', $this->validator->getErrors()); } $emailconfig = new EmailconfigModel(); // set the password variable $hashedpass = null; // get the password text $password = $this->request->getPost('password'); // pass the encrypted text to hashedpass variable if ($password !== null) { $hashedpass = password_hash($password, PASSWORD_DEFAULT); // else value is null by default } $email = [ 'id' => $this->request->getPost('id'), 'fromname' => $this->request->getPost('fromname'), 'fromemail' => $this->request->getPost('fromemail'), 'protocol' => $this->request->getPost('protocol'), 'host' => $this->request->getPost('host'), 'username' => $this->request->getPost('username'), 'security' => $this->request->getPost('security'), 'port' => $this->request->getPost('port'), 'password' => $hashedpass ]; if (! $emailconfig->save($email)) { return redirect()->back()->withInput()->with('errors', $emailconfig->errors()); } return redirect()->back()->with('success', lang('Auth.updateSuccess')); } } ?> |
Step 9: Create views
Create views files are named
login.php, forgot.php and reset.php
inside “app/Views/auth/auth” folder. i- login.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
<?= $this->extend('auth/layouts/auth') ?> <?= $this->section('main') ?> <?= view('App\Views\auth\components\notifications') ?> <div class="card"> <div class="card-body text-center"> <div class="mb-4"> <h3>TechArise</h3> </div> <h6 class="mb-4 text-muted">Sign in to your account</h6> <form action="<?= site_url('login'); ?>" method="POST" accept-charset="UTF-8"> <?= csrf_field() ?> <div class="form-group"> <input name="email" type="email" class="form-control" placeholder="<?= lang('Auth.email') ?>" value="<?= old('email') ?>"> </div> <div class="form-group"> <input name="password" type="password" class="form-control" placeholder="<?= lang('Auth.password') ?>"> </div> <div class="form-group text-left"> <div class="custom-control custom-checkbox"> <input type="checkbox" name="remember" class="custom-control-input" id="remember-me"> <label class="custom-control-label" for="remember-me">Remember me</label> </div> </div> <button class="btn btn-primary shadow-2 mb-4"><?= lang('Auth.login') ?></button> </form> <p class="mb-2 text-muted"><a href="<?= site_url('forgot-password'); ?>"><?= lang('Auth.forgotYourPassword') ?></a></p> <p class="mb-0 text-muted">Don't have an account?<a href="<?= site_url('register'); ?>"> <?= lang('Auth.register') ?></a></p> </div> </div> <?= $this->endSection() ?> |
ii- forgot.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<?= $this->extend('auth/layouts/auth') ?> <?= $this->section('main') ?> <?= view('App\Views\auth\components\notifications') ?> <div class="card"> <div class="card-body text-center"> <div class="mb-4"> <h3>TechArise</h3> </div> <h6 class="mb-4 text-muted"><?= lang('Auth.forgottenPassword') ?></h6> <form action="<?= site_url('forgot-password'); ?>" method="POST" accept-charset="UTF-8" onsubmit="submitButton.disabled = true; return true;"> <?= csrf_field() ?> <div class="form-group"> <input type="email" class="form-control" placeholder="<?= lang('Auth.typeEmail') ?>" value="<?= old('email') ?>" required> </div> <button class="btn btn-primary shadow-2 mb-4"><?= lang('Auth.setNewPassword') ?></button> </form> </div> </div> <?= $this->endSection() ?> |
iii- reset.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<?= $this->extend('auth/layouts/auth') ?> <?= $this->section('main') ?> <h1><?= lang('Auth.resetPassword') ?></h1> <?= view('App\Views\auth\components\notifications') ?> <form method="POST" action="<?= site_url('reset-password'); ?>" accept-charset="UTF-8"> <?= csrf_field() ?> <p> <label><?= lang('Auth.newPassword') ?></label><br /> <input required type="password" name="password" value="" /> </p> <p> <label><?= lang('Auth.newPasswordAgain') ?></label><br /> <input required type="password" name="password_confirm" value="" /> </p> <p> <input type="hidden" name="token" value="<?= $_GET['token'] ?>" /> <button type="submit"><?= lang('Auth.resetPassword') ?></button> </p> </form> <?= $this->endSection() ?> |
Create views files are named
navbar.php and notifications.php
inside “app/Views/auth/components” folder. i- navbar.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top"> <a class="navbar-brand logo-brand" href="#"> <h2>TechArise</h2> </a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarsExampleDefault"> <ul class="navbar-nav mr-auto"> <li class="nav-item"> <a class="nav-link" href="<?= site_url('account') ?>">Dashboard</a> </li> <li class="nav-item"> <a class="nav-link" href="<?= site_url('users') ?>">Users</a> </li> <li class="nav-item"> <a class="nav-link" href="<?= site_url('users/logs') ?>">User Logs</a> </li> </ul> <ul class="navbar-nav flex-row ml-md-auto d-none d-md-flex"> <li class="nav-item dropdown"> <a class="nav-item nav-link dropdown-toggle mr-md-2" href="#" id="bd-versions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span class="text-capitalize"><?= $userData['name'] ?></span> </a> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="bd-versions"> <a class="dropdown-item" href="<?= site_url('profile') ?>"> My Profile</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="<?= site_url('settings') ?>"> Settings</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="<?= site_url('logout') ?>"> <?= lang('Auth.logout') ?> →</a> </div> </li> </ul> </div> </nav> |
ii- notifications.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
<?php if (session()->has('success')) : ?> <div class="alert alert-success mt-3 alert-dismissible fade show" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> <h4 class="alert-heading">Well done!</h4> <p><?= session('success') ?></p> </div> <?php endif ?> <?php if (session()->has('error')) : ?> <div class="alert alert-warning mt-3 alert-dismissible fade show" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> <h4 class="alert-heading">Sorry there was a problem!</h4> <p><?= session('error') ?></p> </div> <?php endif ?> <?php if (session()->has('errors')) : ?> <div class="alert alert-danger mt-3 alert-dismissible fade show" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> <h4 class="alert-heading">Sorry there were multiple errors!</h4> <ul class=""> <?php foreach (session('errors') as $error) : ?> <li><?= $error ?></li> <?php endforeach ?> </ul> </div> <?php endif ?> |
Create views files are named
edit-user.php
inside “app/Views/auth/edits” folder. i- edit-user.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
<!-- load main layout --> <?= $this->extend('auth/layouts/default') ?> <!-- load main content --> <?= $this->section('main') ?> <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-3"> <h1 class="h2">Edit user</h1> <div class="btn-toolbar mb-2 mb-md-0"> <a href="<?= site_url('users') ?>" class="btn btn-sm btn-secondary"><i class="fas fa-arrow-left"></i> Return</a> </div> </div> <div class="card p-3"> <form action="<?= site_url('users/update-user'); ?>" method="POST" accept-charset="UTF-8" onsubmit="Button.disabled = true; return true;"> <?= csrf_field() ?> <div class="form-group"> <label for="firstname">First name</label> <input class="form-control" required type="text" name="firstname" value="<?= $user['firstname'] ?>" /> </div> <div class="form-group"> <label for="lastname">Last name</label> <input class="form-control" required type="text" name="lastname" value="<?= $user['lastname'] ?>" /> </div> <div class="form-group"> <label for="name">Nickname</label> <input class="form-control" required type="text" name="name" value="<?= $user['name'] ?>" /> </div> <div class="form-group"> <label for="email">Email</label> <input class="form-control" required type="email" name="email" value="<?= $user['email'] ?>" /> </div> <div class="form-group"> <label for="active">Status</label> <select class="form-control" name="active" required> <?php if ($user['active'] === 1) : ?> <option value="1" selected>Enable</option> <?php else : ?> <option value="1">Enable</option> <?php endif ?> <?php if ($user['active'] === 0) : ?> <option value="0" selected>Disable</option> <?php else : ?> <option value="0">Disable</option> <?php endif ?> </select> </div> <div class="text-right"> <input name="id" type="hidden" value="<?= $user['id'] ?>" readonly/> <button type="submit" class="btn btn-primary" name="Button"><i class="fas fa-check-circle"></i> Update</button> </div> </form> </div> <?= $this->endSection() ?> |
Create views files are named
header.php, footer.php, activation.php and confirmation.php
inside “app/Views/auth/emails” folder. This file contains the header section of the emailtemplates.
i- header.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <style type="text/css"> img { border: none; -ms-interpolation-mode: bicubic; max-width: 100%; } body { width: 100%; max-width: 580px; background-color: #ffffff; font-family: sans-serif; font-size: 15px; color: #555; line-height: 22px; padding: 20px; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; } p { width: 100%; margin-bottom: 22px; clear: both; } </style> </head> |
This file contains the footer section of the emailtemplates
ii- footer.php
1 2 |
</body> </html> |
iii- activation.php
1 2 3 4 5 6 |
<p>Thank you for signing up on <?= base_url() ?>!</p> <p>Please click the following link to activate your account!</p> <p><a href="<?= base_url('activate-account') . '?token=' . $hash ?>"><?= base_url('activate-account') . '?token=' . $hash ?></a></p> <p>If you didn't register on this website, just ignore this email.</p> |
iv- confirmation.php
1 2 3 4 5 6 |
<p>Dear member of <?= base_url() ?>,</p> <p>please click the following link to confirm your new e-mail address!</p> <p><a href="<?= base_url('confirm-email') . '?token=' . $hash ?>"><?= base_url('confirm-email') . '?token=' . $hash ?></a></p> <p>If you didn't request this, just ignore this email.</p> |
Create views files are named
auth.php, default.php and default-table.php
inside “app/Views/auth/layouts” folder. i- auth.php
This file contains the header/footer section of the webpage. The Bootstrap library is used to provide a better UI
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" /> <meta name="viewport" content="width=device-width" /> <title>User Management Module | TechArise</title> <link rel="stylesheet" href="<?= base_url('vendor/bootstrap/css/bootstrap.min.css'); ?>"> <link rel="stylesheet" href="<?= base_url('css/auth.css'); ?>"> <link rel="stylesheet" href="<?= base_url('css/style.css'); ?>"> </head> <body> <div class="wrapper"> <div class="auth-content"> <?= $this->renderSection('main') ?> </div> </div> <script src="<?= base_url("vendor/jquery/jquery.min.js") ?>" type="text/javascript"></script> <script src="<?= base_url("vendor/bootstrap/js/bootstrap.min.js") ?>" type="text/javascript"></script> </body> </html> |
ii- default.php
This file contains the header/footer section of the webpage. The Bootstrap library is used to provide a better UI
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <meta name="generator" content=""> <title>User Management Module | TechArise</title> <!-- load extended styles --> <?= $this->renderSection('style') ?> <!-- default styles --> <link rel="stylesheet" href="<?= base_url('vendor/fontawesome/css/fontawesome.min.css'); ?>"> <link rel="stylesheet" href="<?= base_url('vendor/fontawesome/css/solid.min.css'); ?>"> <link rel="stylesheet" href="<?= base_url('vendor/fontawesome/css/brands.min.css'); ?>"> <link rel="stylesheet" href="<?= base_url('vendor/bootstrap/css/bootstrap.min.css'); ?>"> <link rel="stylesheet" href="<?= base_url('css/starter-template.css'); ?>"> <link rel="stylesheet" href="<?= base_url('css/style.css'); ?>"> </head> <body class="bg-light"> <!-- navbar --> <?= view('App\Views\auth\components\navbar') ?> <main role="main" class="container"> <!-- notifications --> <?= view('App\Views\auth\components\notifications') ?> <!-- load content from other views --> <?= $this->renderSection('main') ?> </main> <script src="<?= base_url("vendor/jquery/jquery.min.js") ?>" type="text/javascript"></script> <script src="<?= base_url("vendor/bootstrap/js/bootstrap.bundle.min.js") ?>" type="text/javascript"></script> <!-- load extended scripts --> <?= $this->renderSection('script') ?> </body> </html> |
iii- default-table.php
This file contains the header/footer section of the webpage. The Bootstrap library is used to provide a better UI
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <meta name="generator" content=""> <title>User Management Module | TechArise</title> <!-- load extended styles --> <?= $this->renderSection('style') ?> <!-- default styles --> <link rel="stylesheet" href="<?= base_url('vendor/fontawesome/css/fontawesome.min.css'); ?>"> <link rel="stylesheet" href="<?= base_url('vendor/fontawesome/css/solid.min.css'); ?>"> <link rel="stylesheet" href="<?= base_url('vendor/fontawesome/css/brands.min.css'); ?>"> <link rel="stylesheet" href="<?= base_url('vendor/bootstrap/css/bootstrap.min.css'); ?>"> <link rel="stylesheet" href="<?= base_url('vendor/datatables/datatables.css'); ?>"> <link rel="stylesheet" href="<?= base_url('css/starter-template.css'); ?>"> <link rel="stylesheet" href="<?= base_url('css/style.css'); ?>"> </head> <body class="bg-light"> <!-- load extended modals --> <?= $this->renderSection('modals') ?> <!-- navbar --> <?= view('App\Views\auth\components\navbar') ?> <main role="main" class="container"> <!-- notifications --> <?= view('App\Views\auth\components\notifications') ?> <!-- load content from other views --> <?= $this->renderSection('main') ?> </main> <script src="<?= base_url("vendor/jquery/jquery.min.js") ?>" type="text/javascript"></script> <script src="<?= base_url("vendor/bootstrap/js/bootstrap.bundle.min.js") ?>" type="text/javascript"></script> <script src="<?= base_url("vendor/datatables/datatables.min.js") ?>" type="text/javascript"></script> <!-- inline js code --> <script type="text/javascript"> $('#dataTables-table').DataTable({ responsive: true, pageLength: 15, lengthChange: false, searching: true, ordering: true }); </script> <!-- load extended scripts --> <?= $this->renderSection('script') ?> </body> </html> |
Create views files are named
add-user.php
inside “app/Views/auth/modals” folder. i- add-user.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
<div class="modal fade" id="createuserformmodal" tabindex="-1" role="dialog" aria-labelledby="createuserformmodal" aria-hidden="true"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="createuserformmodaltitle">Register a new user</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <form action="<?= site_url('users/create-user'); ?>" method="POST" accept-charset="UTF-8" onsubmit="registerButton.disabled = true; return true;"> <?= csrf_field() ?> <div class="form-group row"> <div class="col"> <label for="firstname">First name</label> <input class="form-control" required type="text" name="firstname" value="<?= old('firstname') ?>" placeholder="First name"/> </div> <div class="col"> <label for="lastname">Last name</label> <input class="form-control" required type="text" name="lastname" value="<?= old('lastname') ?>" placeholder="Last name"/> </div> </div> <div class="form-group"> <label for="name">Nickname</label> <input class="form-control" required type="text" name="name" value="<?= old('name') ?>" placeholder="Nickname"/> </div> <div class="form-group"> <label for="email">Email</label> <input class="form-control" required type="email" name="email" value="<?= old('email') ?>" placeholder="<?= lang('Auth.email') ?>"/> </div> <div class="form-group"> <label for="password">Password</label> <input class="form-control" required type="password" name="password" value="" placeholder="<?= lang('Auth.password') ?>" /> </div> <div class="form-group"> <input class="form-control" required type="password" name="password_confirm" value="" placeholder="Confirm Password" /> </div> <div class="text-right"> <button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fas fa-times-circle"></i> Close</button> <button type="submit" class="btn btn-primary" name="registerButton"><i class="fas fa-plus-circle"></i> <?= lang('Auth.register') ?></button> </div> </form> </div> </div> </div> </div> |
Create views files are named
edit-user.php, profile.php, register.php, settings.php, starter.php, user-logs.php and users.php
inside “app/Views/auth” folder. i- edit-user.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
<!-- load main layout --> <?= $this->extend('auth/layouts/default') ?> <!-- load main content --> <?= $this->section('main') ?> <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-3"> <h1 class="h2">Edit user</h1> <div class="btn-toolbar mb-2 mb-md-0"> <a href="<?= site_url('users') ?>" class="btn btn-sm btn-secondary"><i class="fas fa-arrow-left"></i> Return</a> </div> </div> <div class="card p-3"> <form action="<?= site_url('users/update-user'); ?>" method="POST" accept-charset="UTF-8" onsubmit="Button.disabled = true; return true;"> <?= csrf_field() ?> <div class="form-group"> <label for="firstname">First name</label> <input class="form-control" required type="text" name="firstname" value="<?= $user['firstname'] ?>" /> </div> <div class="form-group"> <label for="lastname">Last name</label> <input class="form-control" required type="text" name="lastname" value="<?= $user['lastname'] ?>" /> </div> <div class="form-group"> <label for="name">Nickname</label> <input class="form-control" required type="text" name="name" value="<?= $user['name'] ?>" /> </div> <div class="form-group"> <label for="email">Email</label> <input class="form-control" required type="email" name="email" value="<?= $user['email'] ?>" /> </div> <div class="form-group"> <label for="active">Status</label> <select class="form-control" name="active" required> <?php if ($user['active'] === 1) : ?> <option value="1" selected>Enable</option> <?php else : ?> <option value="1">Enable</option> <?php endif ?> <?php if ($user['active'] === 0) : ?> <option value="0" selected>Disable</option> <?php else : ?> <option value="0">Disable</option> <?php endif ?> </select> </div> <div class="text-right"> <input name="id" type="hidden" value="<?= $user['id'] ?>" readonly /> <button type="submit" class="btn btn-primary" name="Button"><i class="fas fa-check-circle"></i> Update</button> </div> </form> </div> <?= $this->endSection() ?> |
ii- profile.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
<?= $this->extend('auth/layouts/default') ?> <?= $this->section('main') ?> <div class="d-flex align-items-center p-3 my-3 text-white-50 bg-info rounded shadow-sm"> <svg width="48" height="48" viewBox="0 0 16 16" class="mr-3 bi bi-person-square text-light" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" d="M14 1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z" /> <path fill-rule="evenodd" d="M2 15v-1c0-1 1-4 6-4s6 3 6 4v1H2zm6-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" /> </svg> <div class="lh-100"> <h6 class="mb-0 text-white lh-100">My Profile</h6> <small>Active since 2023</small> </div> </div> <div class="card p-3 my-3"> <form action="<?= site_url('update-profile'); ?>" method="POST" accept-charset="UTF-8" onsubmit="updateProfile.disabled = true; return true;"> <?= csrf_field() ?> <h6 class="pb-2 mb-0 mt-4">Name</h6> <div class="form-group row mt-3"> <label class="col-sm-2 col-form-label">First Name</label> <div class="col-sm-10"> <input type="text" name="firstname" class="form-control col-md-6 text-capitalize" value="<?= $userData["firstname"] ?>"> </div> </div> <div class="form-group row"> <label class="col-sm-2 col-form-label">Last Name</label> <div class="col-sm-10"> <input type="text" name="lastname" class="form-control col-md-6 text-capitalize" value="<?= $userData["lastname"] ?>"> </div> </div> <div class="form-group row"> <label class="col-sm-2 col-form-label">Nickname</label> <div class="col-sm-10"> <input type="text" name="name" class="form-control col-md-6 text-capitalize" value="<?= $userData["name"] ?>"> </div> </div> <h6 class="pb-2 mb-0 mt-4">Contact Info</h6> <div class="form-group row mt-3"> <label class="col-sm-2 col-form-label">Email</label> <div class="col-sm-10"> <input type="text" name="email" class="form-control col-md-6 text-lowercase" value="<?= $userData["email"] ?>"> </div> </div> <div class="form-group row"> <div class="col-sm-10"> <button name="updateProfile" type="submit" class="btn btn-primary"><i class='fas fa-check-circle'></i> Update Profile</button> </div> </div> </form> </div> <div class="card p-3 my-3"> <form action="<?= site_url('change-password'); ?>" method="POST" accept-charset="UTF-8" onsubmit="changePassword.disabled = true; return true;"> <?= csrf_field() ?> <h6 class="pb-2 mb-0 mt-4">Login Access</h6> <div class="form-group row mt-3"> <label class="col-sm-2 col-form-label">Current Password</label> <div class="col-sm-10"> <input type="password" name="password" class="form-control col-md-6" value="" minlength="5" required> </div> </div> <div class="form-group row"> <label class="col-sm-2 col-form-label">New Password</label> <div class="col-sm-10"> <input type="password" name="new_password" class="form-control col-md-6" value="" minlength="5" required> </div> </div> <div class="form-group row"> <label class="col-sm-2 col-form-label">Confirm New Password</label> <div class="col-sm-10"> <input type="password" name="new_password_confirm" class="form-control col-md-6" value="" minlength="5" required> </div> </div> <div class="form-group row"> <div class="col-sm-10"> <button name="changePassword" type="submit" class="btn btn-primary"><i class="fa fa-key" aria-hidden="true"></i> Update Password</button> </div> </div> </form> </div> <div class="card p-3"> <form action="<?= site_url('delete-account') ?>" method="POST" accept-charset="UTF-8" onsubmit="deleteAccount.disabled = true; return true;"> <?= csrf_field() ?> <h6 class="pb-2 mb-0 mt-4">Account Removal</h6> <p><?= lang('Auth.deleteAccountInfo') ?></p> <div class="form-group row mt-3"> <label class="col-sm-2 col-form-label">Current Password</label> <div class="col-sm-10"> <input type="password" name="password" class="form-control col-md-6" value="" minlength="5" required> </div> </div> <div class="form-group row"> <div class="col-sm-10"> <button name="deleteAccount" type="submit" class="btn btn-danger" onclick="return confirm('<?= lang('Auth.areYouSure') ?>')"> <i class='fas fa-trash'></i> <?= lang('Auth.deleteAccount') ?></button> </div> </div> </form> </div> <?= $this->endSection() ?> |
iii- register.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
<?= $this->extend('auth/layouts/auth') ?> <?= $this->section('main') ?> <?= view('App\Views\auth\components\notifications') ?> <div class="card"> <div class="card-body text-center"> <div class="mb-4"> <h3>TechArise</h3> </div> <h6 class="mb-4 text-muted">Fill up the registration form!</h6> <form action="<?= site_url('register'); ?>" method="POST" accept-charset="UTF-8" onsubmit="registerButton.disabled = true; return true;"> <?= csrf_field() ?> <div class="form-group"> <input class="form-control" required type="text" name="firstname" value="<?= old('firstname') ?>" placeholder="First Name" /> </div> <div class="form-group"> <input class="form-control" required type="text" name="lastname" value="<?= old('lastname') ?>" placeholder="Last Name" /> </div> <div class="form-group"> <input class="form-control" required type="text" name="name" value="<?= old('name') ?>" placeholder="Nickname" /> </div> <div class="form-group"> <input class="form-control" required type="email" name="email" value="<?= old('email') ?>" placeholder="<?= lang('Auth.email') ?>" /> </div> <div class="form-group"> <input class="form-control" required type="password" name="password" value="" placeholder="<?= lang('Auth.password') ?>" /> </div> <div class="form-group"> <input class="form-control" required type="password" name="password_confirm" value="" placeholder="Confirm Password" /> </div> <button name="registerButton" class="btn btn-primary shadow-2 mb-4"><?= lang('Auth.register') ?></button> </form> <p class="mb-0 text-muted">Already registered? <a href="<?= site_url('login'); ?>"> <?= lang('Auth.login') ?></a></p> </div> </div> <?= $this->endSection() ?> |
vi- settings.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 |
<!-- load main layout --> <?= $this->extend('auth/layouts/default') ?> <!-- load main content --> <?= $this->section('main') ?> <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3"> <h1 class="h2">Settings</h1> </div> <div class="card p-3 my-3"> <form action="<?= site_url('settings-update-system'); ?>" method="POST" accept-charset="UTF-8" onsubmit="saveSystem.disabled = true; return true;"> <?= csrf_field() ?> <div class="form-row"> <div class="form-group col-md-12"> <h6 class="pb-2 mb-0 mt-4">System</h6> <p class="text-muted">Application settings, language, time zones and other environments.</p> </div> <div class="form-group col-md-6"> <label for="language" class="form-control-label">Default Language</label> <select class="form-control" name="language"> <option value="en" <?php if ($system['language'] == 'en') : ?> selected <?php endif ?>>English</option> <option value="es" <?php if ($system['language'] == 'es') : ?> selected <?php endif ?>>Spanish</option> <option value="fr" <?php if ($system['language'] == 'fr') : ?> selected <?php endif ?>>French</option> </select> </div> <div class="form-group col-md-6"> <label for="timezone" class="form-control-label">Time zone</label> <select class="form-control" name="timezone"> <option value="Pacific/Midway" <?php if ($system['timezone'] == 'Pacific/Midway') : ?> selected <?php endif ?>>(UTC -11:00) Pacific/Midway</option> <option value="Pacific/Niue" <?php if ($system['timezone'] == 'Pacific/Niue') : ?> selected <?php endif ?>>(UTC -11:00) Pacific/Niue</option> <option value="Pacific/Pago_Pago" <?php if ($system['timezone'] == 'Pacific/Pago_Pago') : ?> selected <?php endif ?>>(UTC -11:00) Pacific/Pago_Pago</option> <option value="America/Adak" <?php if ($system['timezone'] == 'America/Adak') : ?> selected <?php endif ?>>(UTC -10:00) America/Adak</option> <option value="Pacific/Honolulu" <?php if ($system['timezone'] == 'Pacific/Honolulu') : ?> selected <?php endif ?>>(UTC -10:00) Pacific/Honolulu</option> <option value="Pacific/Rarotonga" <?php if ($system['timezone'] == 'Pacific/Rarotonga') : ?> selected <?php endif ?>>(UTC -10:00) Pacific/Rarotonga</option> <option value="Pacific/Tahiti" <?php if ($system['timezone'] == 'Pacific/Tahiti') : ?> selected <?php endif ?>>(UTC -10:00) Pacific/Tahiti</option> <option value="Pacific/Marquesas" <?php if ($system['timezone'] == 'Pacific/Marquesas') : ?> selected <?php endif ?>>(UTC -09:30) Pacific/Marquesas</option> <option value="America/Anchorage" <?php if ($system['timezone'] == 'America/Anchorage') : ?> selected <?php endif ?>>(UTC -09:00) America/Anchorage</option> <option value="America/Juneau" <?php if ($system['timezone'] == 'America/Juneau') : ?> selected <?php endif ?>>(UTC -09:00) America/Juneau</option> <option value="America/Metlakatla" <?php if ($system['timezone'] == 'America/Metlakatla') : ?> selected <?php endif ?>>(UTC -09:00) America/Metlakatla</option> <option value="America/Nome" <?php if ($system['timezone'] == 'America/Nome') : ?> selected <?php endif ?>>(UTC -09:00) America/Nome</option> <option value="America/Sitka" <?php if ($system['timezone'] == 'America/Sitka') : ?> selected <?php endif ?>>(UTC -09:00) America/Sitka</option> <option value="America/Yakutat" <?php if ($system['timezone'] == 'America/Yakutat') : ?> selected <?php endif ?>>(UTC -09:00) America/Yakutat</option> <option value="Pacific/Gambier" <?php if ($system['timezone'] == 'Pacific/Gambier') : ?> selected <?php endif ?>>(UTC -09:00) Pacific/Gambier</option> <option value="America/Dawson" <?php if ($system['timezone'] == 'America/Dawson') : ?> selected <?php endif ?>>(UTC -08:00) America/Dawson</option> <option value="America/Los_Angeles" <?php if ($system['timezone'] == 'America/Los_Angeles') : ?> selected <?php endif ?>>(UTC -08:00) America/Los_Angeles</option> <option value="America/Tijuana" <?php if ($system['timezone'] == 'America/Tijuana') : ?> selected <?php endif ?>>(UTC -08:00) America/Tijuana</option> <option value="America/Vancouver" <?php if ($system['timezone'] == 'America/Vancouver') : ?> selected <?php endif ?>>(UTC -08:00) America/Vancouver</option> <option value="America/Whitehorse" <?php if ($system['timezone'] == 'America/Whitehorse') : ?> selected <?php endif ?>>(UTC -08:00) America/Whitehorse</option> <option value="Pacific/Pitcairn" <?php if ($system['timezone'] == 'Pacific/Pitcairn') : ?> selected <?php endif ?>>(UTC -08:00) Pacific/Pitcairn</option> <option value="America/Boise" <?php if ($system['timezone'] == 'America/Boise') : ?> selected <?php endif ?>>(UTC -07:00) America/Boise</option> <option value="America/Cambridge_Bay" <?php if ($system['timezone'] == 'America/Cambridge_Bay') : ?> selected <?php endif ?>>(UTC -07:00) America/Cambridge_Bay</option> <option value="America/Chihuahua" <?php if ($system['timezone'] == 'America/Chihuahua') : ?> selected <?php endif ?>>(UTC -07:00) America/Chihuahua</option> <option value="America/Creston" <?php if ($system['timezone'] == 'America/Creston') : ?> selected <?php endif ?>>(UTC -07:00) America/Creston</option> <option value="America/Dawson_Creek" <?php if ($system['timezone'] == 'America/Dawson_Creek') : ?> selected <?php endif ?>>(UTC -07:00) America/Dawson_Creek</option> <option value="America/Denver" <?php if ($system['timezone'] == 'America/Denver') : ?> selected <?php endif ?>>(UTC -07:00) America/Denver</option> <option value="America/Edmonton" <?php if ($system['timezone'] == 'America/Edmonton') : ?> selected <?php endif ?>>(UTC -07:00) America/Edmonton</option> <option value="America/Fort_Nelson" <?php if ($system['timezone'] == 'America/Fort_Nelson') : ?> selected <?php endif ?>>(UTC -07:00) America/Fort_Nelson</option> <option value="America/Hermosillo" <?php if ($system['timezone'] == 'America/Hermosillo') : ?> selected <?php endif ?>>(UTC -07:00) America/Hermosillo</option> <option value="America/Inuvik" <?php if ($system['timezone'] == 'America/Inuvik') : ?> selected <?php endif ?>>(UTC -07:00) America/Inuvik</option> <option value="America/Mazatlan" <?php if ($system['timezone'] == 'America/Mazatlan') : ?> selected <?php endif ?>>(UTC -07:00) America/Mazatlan</option> <option value="America/Ojinaga" <?php if ($system['timezone'] == 'America/Ojinaga') : ?> selected <?php endif ?>>(UTC -07:00) America/Ojinaga</option> <option value="America/Phoenix" <?php if ($system['timezone'] == 'America/Phoenix') : ?> selected <?php endif ?>>(UTC -07:00) America/Phoenix</option> <option value="America/Yellowknife" <?php if ($system['timezone'] == 'America/Yellowknife') : ?> selected <?php endif ?>>(UTC -07:00) America/Yellowknife</option> <option value="America/Bahia_Banderas" <?php if ($system['timezone'] == 'America/Bahia_Banderas') : ?> selected <?php endif ?>>(UTC -06:00) America/Bahia_Banderas</option> <option value="America/Belize" <?php if ($system['timezone'] == 'America/Belize') : ?> selected <?php endif ?>>(UTC -06:00) America/Belize</option> <option value="America/Chicago" <?php if ($system['timezone'] == 'America/Chicago') : ?> selected <?php endif ?>>(UTC -06:00) America/Chicago</option> <option value="America/Costa_Rica" <?php if ($system['timezone'] == 'America/Costa_Rica') : ?> selected <?php endif ?>>(UTC -06:00) America/Costa_Rica</option> <option value="America/El_Salvador" <?php if ($system['timezone'] == 'America/El_Salvador') : ?> selected <?php endif ?>>(UTC -06:00) America/El_Salvador</option> <option value="America/Guatemala" <?php if ($system['timezone'] == 'America/Guatemala') : ?> selected <?php endif ?>>(UTC -06:00) America/Guatemala</option> <option value="America/Indiana/Knox" <?php if ($system['timezone'] == 'America/Indiana') : ?> selected <?php endif ?>>(UTC -06:00) America/Indiana/Knox</option> <option value="America/Indiana/Tell_City" <?php if ($system['timezone'] == 'America/Indiana') : ?> selected <?php endif ?>>(UTC -06:00) America/Indiana/Tell_City</option> <option value="America/Managua" <?php if ($system['timezone'] == 'America/Managua') : ?> selected <?php endif ?>>(UTC -06:00) America/Managua</option> <option value="America/Matamoros" <?php if ($system['timezone'] == 'America/Matamoros') : ?> selected <?php endif ?>>(UTC -06:00) America/Matamoros</option> <option value="America/Menominee" <?php if ($system['timezone'] == 'America/Menominee') : ?> selected <?php endif ?>>(UTC -06:00) America/Menominee</option> <option value="America/Merida" <?php if ($system['timezone'] == 'America/Merida') : ?> selected <?php endif ?>>(UTC -06:00) America/Merida</option> <option value="America/Mexico_City" <?php if ($system['timezone'] == 'America/Mexico_City') : ?> selected <?php endif ?>>(UTC -06:00) America/Mexico_City</option> <option value="America/Monterrey" <?php if ($system['timezone'] == 'America/Monterrey') : ?> selected <?php endif ?>>(UTC -06:00) America/Monterrey</option> <option value="America/North_Dakota/Beulah" <?php if ($system['timezone'] == 'America/North_Dakota') : ?> selected <?php endif ?>>(UTC -06:00) America/North_Dakota/Beulah</option> <option value="America/North_Dakota/Center" <?php if ($system['timezone'] == 'America/North_Dakota') : ?> selected <?php endif ?>>(UTC -06:00) America/North_Dakota/Center</option> <option value="America/North_Dakota/New_Salem" <?php if ($system['timezone'] == 'America/North_Dakota') : ?> selected <?php endif ?>>(UTC -06:00) America/North_Dakota/New_Salem</option> <option value="America/Rainy_River" <?php if ($system['timezone'] == 'America/Rainy_River') : ?> selected <?php endif ?>>(UTC -06:00) America/Rainy_River</option> <option value="America/Rankin_Inlet" <?php if ($system['timezone'] == 'America/Rankin_Inlet') : ?> selected <?php endif ?>>(UTC -06:00) America/Rankin_Inlet</option> <option value="America/Regina" <?php if ($system['timezone'] == 'America/Regina') : ?> selected <?php endif ?>>(UTC -06:00) America/Regina</option> <option value="America/Resolute" <?php if ($system['timezone'] == 'America/Resolute') : ?> selected <?php endif ?>>(UTC -06:00) America/Resolute</option> <option value="America/Swift_Current" <?php if ($system['timezone'] == 'America/Swift_Current') : ?> selected <?php endif ?>>(UTC -06:00) America/Swift_Current</option> <option value="America/Tegucigalpa" <?php if ($system['timezone'] == 'America/Tegucigalpa') : ?> selected <?php endif ?>>(UTC -06:00) America/Tegucigalpa</option> <option value="America/Winnipeg" <?php if ($system['timezone'] == 'America/Winnipeg') : ?> selected <?php endif ?>>(UTC -06:00) America/Winnipeg</option> <option value="Pacific/Galapagos" <?php if ($system['timezone'] == 'Pacific/Galapagos') : ?> selected <?php endif ?>>(UTC -06:00) Pacific/Galapagos</option> <option value="America/Atikokan" <?php if ($system['timezone'] == 'America/Atikokan') : ?> selected <?php endif ?>>(UTC -05:00) America/Atikokan</option> <option value="America/Bogota" <?php if ($system['timezone'] == 'America/Bogota') : ?> selected <?php endif ?>>(UTC -05:00) America/Bogota</option> <option value="America/Cancun" <?php if ($system['timezone'] == 'America/Cancun') : ?> selected <?php endif ?>>(UTC -05:00) America/Cancun</option> <option value="America/Cayman" <?php if ($system['timezone'] == 'America/Cayman') : ?> selected <?php endif ?>>(UTC -05:00) America/Cayman</option> <option value="America/Detroit" <?php if ($system['timezone'] == 'America/Detroit') : ?> selected <?php endif ?>>(UTC -05:00) America/Detroit</option> <option value="America/Eirunepe" <?php if ($system['timezone'] == 'America/Eirunepe') : ?> selected <?php endif ?>>(UTC -05:00) America/Eirunepe</option> <option value="America/Guayaquil" <?php if ($system['timezone'] == 'America/Guayaquil') : ?> selected <?php endif ?>>(UTC -05:00) America/Guayaquil</option> <option value="America/Havana" <?php if ($system['timezone'] == 'America/Havana') : ?> selected <?php endif ?>>(UTC -05:00) America/Havana</option> <option value="America/Indiana/Indianapolis" <?php if ($system['timezone'] == 'America/Indiana') : ?> selected <?php endif ?>>(UTC -05:00) America/Indiana/Indianapolis</option> <option value="America/Indiana/Marengo" <?php if ($system['timezone'] == 'America/Indiana') : ?> selected <?php endif ?>>(UTC -05:00) America/Indiana/Marengo</option> <option value="America/Indiana/Petersburg" <?php if ($system['timezone'] == 'America/Indiana') : ?> selected <?php endif ?>>(UTC -05:00) America/Indiana/Petersburg</option> <option value="America/Indiana/Vevay" <?php if ($system['timezone'] == 'America/Indiana') : ?> selected <?php endif ?>>(UTC -05:00) America/Indiana/Vevay</option> <option value="America/Indiana/Vincennes" <?php if ($system['timezone'] == 'America/Indiana') : ?> selected <?php endif ?>>(UTC -05:00) America/Indiana/Vincennes</option> <option value="America/Indiana/Winamac" <?php if ($system['timezone'] == 'America/Indiana') : ?> selected <?php endif ?>>(UTC -05:00) America/Indiana/Winamac</option> <option value="America/Iqaluit" <?php if ($system['timezone'] == 'America/Iqaluit') : ?> selected <?php endif ?>>(UTC -05:00) America/Iqaluit</option> <option value="America/Jamaica" <?php if ($system['timezone'] == 'America/Jamaica') : ?> selected <?php endif ?>>(UTC -05:00) America/Jamaica</option> <option value="America/Kentucky/Louisville" <?php if ($system['timezone'] == 'America/Kentucky') : ?> selected <?php endif ?>>(UTC -05:00) America/Kentucky/Louisville</option> <option value="America/Kentucky/Monticello" <?php if ($system['timezone'] == 'America/Kentucky') : ?> selected <?php endif ?>>(UTC -05:00) America/Kentucky/Monticello</option> <option value="America/Lima" <?php if ($system['timezone'] == 'America/Lima') : ?> selected <?php endif ?>>(UTC -05:00) America/Lima</option> <option value="America/Nassau" <?php if ($system['timezone'] == 'America/Nassau') : ?> selected <?php endif ?>>(UTC -05:00) America/Nassau</option> <option value="America/New_York" <?php if ($system['timezone'] == 'America/New_York') : ?> selected <?php endif ?>>(UTC -05:00) America/New_York</option> <option value="America/Nipigon" <?php if ($system['timezone'] == 'America/Nipigon') : ?> selected <?php endif ?>>(UTC -05:00) America/Nipigon</option> <option value="America/Panama" <?php if ($system['timezone'] == 'America/Panama') : ?> selected <?php endif ?>>(UTC -05:00) America/Panama</option> <option value="America/Pangnirtung" <?php if ($system['timezone'] == 'America/Pangnirtung') : ?> selected <?php endif ?>>(UTC -05:00) America/Pangnirtung</option> <option value="America/Port-au-Prince" <?php if ($system['timezone'] == 'America/Port') : ?> selected <?php endif ?>>(UTC -05:00) America/Port-au-Prince</option> <option value="America/Rio_Branco" <?php if ($system['timezone'] == 'America/Rio_Branco') : ?> selected <?php endif ?>>(UTC -05:00) America/Rio_Branco</option> <option value="America/Thunder_Bay" <?php if ($system['timezone'] == 'America/Thunder_Bay') : ?> selected <?php endif ?>>(UTC -05:00) America/Thunder_Bay</option> <option value="America/Toronto" <?php if ($system['timezone'] == 'America/Toronto') : ?> selected <?php endif ?>>(UTC -05:00) America/Toronto</option> <option value="Pacific/Easter" <?php if ($system['timezone'] == 'Pacific/Easter') : ?> selected <?php endif ?>>(UTC -05:00) Pacific/Easter</option> <option value="America/Anguilla" <?php if ($system['timezone'] == 'America/Anguilla') : ?> selected <?php endif ?>>(UTC -04:00) America/Anguilla</option> <option value="America/Antigua" <?php if ($system['timezone'] == 'America/Antigua') : ?> selected <?php endif ?>>(UTC -04:00) America/Antigua</option> <option value="America/Aruba" <?php if ($system['timezone'] == 'America/Aruba') : ?> selected <?php endif ?>>(UTC -04:00) America/Aruba</option> <option value="America/Barbados" <?php if ($system['timezone'] == 'America/Barbados') : ?> selected <?php endif ?>>(UTC -04:00) America/Barbados</option> <option value="America/Blanc-Sablon" <?php if ($system['timezone'] == 'America/Blanc') : ?> selected <?php endif ?>>(UTC -04:00) America/Blanc-Sablon</option> <option value="America/Boa_Vista" <?php if ($system['timezone'] == 'America/Boa_Vista') : ?> selected <?php endif ?>>(UTC -04:00) America/Boa_Vista</option> <option value="America/Caracas" <?php if ($system['timezone'] == 'America/Caracas') : ?> selected <?php endif ?>>(UTC -04:00) America/Caracas</option> <option value="America/Curacao" <?php if ($system['timezone'] == 'America/Curacao') : ?> selected <?php endif ?>>(UTC -04:00) America/Curacao</option> <option value="America/Dominica" <?php if ($system['timezone'] == 'America/Dominica') : ?> selected <?php endif ?>>(UTC -04:00) America/Dominica</option> <option value="America/Glace_Bay" <?php if ($system['timezone'] == 'America/Glace_Bay') : ?> selected <?php endif ?>>(UTC -04:00) America/Glace_Bay</option> <option value="America/Goose_Bay" <?php if ($system['timezone'] == 'America/Goose_Bay') : ?> selected <?php endif ?>>(UTC -04:00) America/Goose_Bay</option> <option value="America/Grand_Turk" <?php if ($system['timezone'] == 'America/Grand_Turk') : ?> selected <?php endif ?>>(UTC -04:00) America/Grand_Turk</option> <option value="America/Grenada" <?php if ($system['timezone'] == 'America/Grenada') : ?> selected <?php endif ?>>(UTC -04:00) America/Grenada</option> <option value="America/Guadeloupe" <?php if ($system['timezone'] == 'America/Guadeloupe') : ?> selected <?php endif ?>>(UTC -04:00) America/Guadeloupe</option> <option value="America/Guyana" <?php if ($system['timezone'] == 'America/Guyana') : ?> selected <?php endif ?>>(UTC -04:00) America/Guyana</option> <option value="America/Halifax" <?php if ($system['timezone'] == 'America/Halifax') : ?> selected <?php endif ?>>(UTC -04:00) America/Halifax</option> <option value="America/Kralendijk" <?php if ($system['timezone'] == 'America/Kralendijk') : ?> selected <?php endif ?>>(UTC -04:00) America/Kralendijk</option> <option value="America/La_Paz" <?php if ($system['timezone'] == 'America/La_Paz') : ?> selected <?php endif ?>>(UTC -04:00) America/La_Paz</option> <option value="America/Lower_Princes" <?php if ($system['timezone'] == 'America/Lower_Princes') : ?> selected <?php endif ?>>(UTC -04:00) America/Lower_Princes</option> <option value="America/Manaus" <?php if ($system['timezone'] == 'America/Manaus') : ?> selected <?php endif ?>>(UTC -04:00) America/Manaus</option> <option value="America/Marigot" <?php if ($system['timezone'] == 'America/Marigot') : ?> selected <?php endif ?>>(UTC -04:00) America/Marigot</option> <option value="America/Martinique" <?php if ($system['timezone'] == 'America/Martinique') : ?> selected <?php endif ?>>(UTC -04:00) America/Martinique</option> <option value="America/Moncton" <?php if ($system['timezone'] == 'America/Moncton') : ?> selected <?php endif ?>>(UTC -04:00) America/Moncton</option> <option value="America/Montserrat" <?php if ($system['timezone'] == 'America/Montserrat') : ?> selected <?php endif ?>>(UTC -04:00) America/Montserrat</option> <option value="America/Port_of_Spain" <?php if ($system['timezone'] == 'America/Port_of_Spain') : ?> selected <?php endif ?>>(UTC -04:00) America/Port_of_Spain</option> <option value="America/Porto_Velho" <?php if ($system['timezone'] == 'America/Porto_Velho') : ?> selected <?php endif ?>>(UTC -04:00) America/Porto_Velho</option> <option value="America/Puerto_Rico" <?php if ($system['timezone'] == 'America/Puerto_Rico') : ?> selected <?php endif ?>>(UTC -04:00) America/Puerto_Rico</option> <option value="America/Santo_Domingo" <?php if ($system['timezone'] == 'America/Santo_Domingo') : ?> selected <?php endif ?>>(UTC -04:00) America/Santo_Domingo</option> <option value="America/St_Barthelemy" <?php if ($system['timezone'] == 'America/St_Barthelemy') : ?> selected <?php endif ?>>(UTC -04:00) America/St_Barthelemy</option> <option value="America/St_Kitts" <?php if ($system['timezone'] == 'America/St_Kitts') : ?> selected <?php endif ?>>(UTC -04:00) America/St_Kitts</option> <option value="America/St_Lucia" <?php if ($system['timezone'] == 'America/St_Lucia') : ?> selected <?php endif ?>>(UTC -04:00) America/St_Lucia</option> <option value="America/St_Thomas" <?php if ($system['timezone'] == 'America/St_Thomas') : ?> selected <?php endif ?>>(UTC -04:00) America/St_Thomas</option> <option value="America/St_Vincent" <?php if ($system['timezone'] == 'America/St_Vincent') : ?> selected <?php endif ?>>(UTC -04:00) America/St_Vincent</option> <option value="America/Thule" <?php if ($system['timezone'] == 'America/Thule') : ?> selected <?php endif ?>>(UTC -04:00) America/Thule</option> <option value="America/Tortola" <?php if ($system['timezone'] == 'America/Tortola') : ?> selected <?php endif ?>>(UTC -04:00) America/Tortola</option> <option value="Atlantic/Bermuda" <?php if ($system['timezone'] == 'Atlantic/Bermuda') : ?> selected <?php endif ?>>(UTC -04:00) Atlantic/Bermuda</option> <option value="America/St_Johns" <?php if ($system['timezone'] == 'America/St_Johns') : ?> selected <?php endif ?>>(UTC -03:30) America/St_Johns</option> <option value="America/Araguaina" <?php if ($system['timezone'] == 'America/Araguaina') : ?> selected <?php endif ?>>(UTC -03:00) America/Araguaina</option> <option value="America/Argentina/Buenos_Aires" <?php if ($system['timezone'] == 'America/Argentina') : ?> selected <?php endif ?>>(UTC -03:00) America/Argentina/Buenos_Aires</option> <option value="America/Argentina/Catamarca" <?php if ($system['timezone'] == 'America/Argentina') : ?> selected <?php endif ?>>(UTC -03:00) America/Argentina/Catamarca</option> <option value="America/Argentina/Cordoba" <?php if ($system['timezone'] == 'America/Argentina') : ?> selected <?php endif ?>>(UTC -03:00) America/Argentina/Cordoba</option> <option value="America/Argentina/Jujuy" <?php if ($system['timezone'] == 'America/Argentina') : ?> selected <?php endif ?>>(UTC -03:00) America/Argentina/Jujuy</option> <option value="America/Argentina/La_Rioja" <?php if ($system['timezone'] == 'America/Argentina') : ?> selected <?php endif ?>>(UTC -03:00) America/Argentina/La_Rioja</option> <option value="America/Argentina/Mendoza" <?php if ($system['timezone'] == 'America/Argentina') : ?> selected <?php endif ?>>(UTC -03:00) America/Argentina/Mendoza</option> <option value="America/Argentina/Rio_Gallegos" <?php if ($system['timezone'] == 'America/Argentina') : ?> selected <?php endif ?>>(UTC -03:00) America/Argentina/Rio_Gallegos</option> <option value="America/Argentina/Salta" <?php if ($system['timezone'] == 'America/Argentina') : ?> selected <?php endif ?>>(UTC -03:00) America/Argentina/Salta</option> <option value="America/Argentina/San_Juan" <?php if ($system['timezone'] == 'America/Argentina') : ?> selected <?php endif ?>>(UTC -03:00) America/Argentina/San_Juan</option> <option value="America/Argentina/San_Luis" <?php if ($system['timezone'] == 'America/Argentina') : ?> selected <?php endif ?>>(UTC -03:00) America/Argentina/San_Luis</option> <option value="America/Argentina/Tucuman" <?php if ($system['timezone'] == 'America/Argentina') : ?> selected <?php endif ?>>(UTC -03:00) America/Argentina/Tucuman</option> <option value="America/Argentina/Ushuaia" <?php if ($system['timezone'] == 'America/Argentina') : ?> selected <?php endif ?>>(UTC -03:00) America/Argentina/Ushuaia</option> <option value="America/Asuncion" <?php if ($system['timezone'] == 'America/Asuncion') : ?> selected <?php endif ?>>(UTC -03:00) America/Asuncion</option> <option value="America/Bahia" <?php if ($system['timezone'] == 'America/Bahia') : ?> selected <?php endif ?>>(UTC -03:00) America/Bahia</option> <option value="America/Belem" <?php if ($system['timezone'] == 'America/Belem') : ?> selected <?php endif ?>>(UTC -03:00) America/Belem</option> <option value="America/Campo_Grande" <?php if ($system['timezone'] == 'America/Campo_Grande') : ?> selected <?php endif ?>>(UTC -03:00) America/Campo_Grande</option> <option value="America/Cayenne" <?php if ($system['timezone'] == 'America/Cayenne') : ?> selected <?php endif ?>>(UTC -03:00) America/Cayenne</option> <option value="America/Cuiaba" <?php if ($system['timezone'] == 'America/Cuiaba') : ?> selected <?php endif ?>>(UTC -03:00) America/Cuiaba</option> <option value="America/Fortaleza" <?php if ($system['timezone'] == 'America/Fortaleza') : ?> selected <?php endif ?>>(UTC -03:00) America/Fortaleza</option> <option value="America/Godthab" <?php if ($system['timezone'] == 'America/Godthab') : ?> selected <?php endif ?>>(UTC -03:00) America/Godthab</option> <option value="America/Maceio" <?php if ($system['timezone'] == 'America/Maceio') : ?> selected <?php endif ?>>(UTC -03:00) America/Maceio</option> <option value="America/Miquelon" <?php if ($system['timezone'] == 'America/Miquelon') : ?> selected <?php endif ?>>(UTC -03:00) America/Miquelon</option> <option value="America/Montevideo" <?php if ($system['timezone'] == 'America/Montevideo') : ?> selected <?php endif ?>>(UTC -03:00) America/Montevideo</option> <option value="America/Paramaribo" <?php if ($system['timezone'] == 'America/Paramaribo') : ?> selected <?php endif ?>>(UTC -03:00) America/Paramaribo</option> <option value="America/Punta_Arenas" <?php if ($system['timezone'] == 'America/Punta_Arenas') : ?> selected <?php endif ?>>(UTC -03:00) America/Punta_Arenas</option> <option value="America/Recife" <?php if ($system['timezone'] == 'America/Recife') : ?> selected <?php endif ?>>(UTC -03:00) America/Recife</option> <option value="America/Santarem" <?php if ($system['timezone'] == 'America/Santarem') : ?> selected <?php endif ?>>(UTC -03:00) America/Santarem</option> <option value="America/Santiago" <?php if ($system['timezone'] == 'America/Santiago') : ?> selected <?php endif ?>>(UTC -03:00) America/Santiago</option> <option value="Antarctica/Palmer" <?php if ($system['timezone'] == 'Antarctica/Palmer') : ?> selected <?php endif ?>>(UTC -03:00) Antarctica/Palmer</option> <option value="Antarctica/Rothera" <?php if ($system['timezone'] == 'Antarctica/Rothera') : ?> selected <?php endif ?>>(UTC -03:00) Antarctica/Rothera</option> <option value="Atlantic/Stanley" <?php if ($system['timezone'] == 'Atlantic/Stanley') : ?> selected <?php endif ?>>(UTC -03:00) Atlantic/Stanley</option> <option value="America/Noronha" <?php if ($system['timezone'] == 'America/Noronha') : ?> selected <?php endif ?>>(UTC -02:00) America/Noronha</option> <option value="America/Sao_Paulo" <?php if ($system['timezone'] == 'America/Sao_Paulo') : ?> selected <?php endif ?>>(UTC -02:00) America/Sao_Paulo</option> <option value="Atlantic/South_Georgia" <?php if ($system['timezone'] == 'Atlantic/South_Georgia') : ?> selected <?php endif ?>>(UTC -02:00) Atlantic/South_Georgia</option> <option value="America/Scoresbysund" <?php if ($system['timezone'] == 'America/Scoresbysund') : ?> selected <?php endif ?>>(UTC -01:00) America/Scoresbysund</option> <option value="Atlantic/Azores" <?php if ($system['timezone'] == 'Atlantic/Azores') : ?> selected <?php endif ?>>(UTC -01:00) Atlantic/Azores</option> <option value="Atlantic/Cape_Verde" <?php if ($system['timezone'] == 'Atlantic/Cape_Verde') : ?> selected <?php endif ?>>(UTC -01:00) Atlantic/Cape_Verde</option> <option value="Africa/Abidjan" <?php if ($system['timezone'] == 'Africa/Abidjan') : ?> selected <?php endif ?>>(UTC -00:00) Africa/Abidjan</option> <option value="Africa/Accra" <?php if ($system['timezone'] == 'Africa/Accra') : ?> selected <?php endif ?>>(UTC -00:00) Africa/Accra</option> <option value="Africa/Bamako" <?php if ($system['timezone'] == 'Africa/Bamako') : ?> selected <?php endif ?>>(UTC -00:00) Africa/Bamako</option> <option value="Africa/Banjul" <?php if ($system['timezone'] == 'Africa/Banjul') : ?> selected <?php endif ?>>(UTC -00:00) Africa/Banjul</option> <option value="Africa/Bissau" <?php if ($system['timezone'] == 'Africa/Bissau') : ?> selected <?php endif ?>>(UTC -00:00) Africa/Bissau</option> <option value="Africa/Casablanca" <?php if ($system['timezone'] == 'Africa/Casablanca') : ?> selected <?php endif ?>>(UTC -00:00) Africa/Casablanca</option> <option value="Africa/Conakry" <?php if ($system['timezone'] == 'Africa/Conakry') : ?> selected <?php endif ?>>(UTC -00:00) Africa/Conakry</option> <option value="Africa/Dakar" <?php if ($system['timezone'] == 'Africa/Dakar') : ?> selected <?php endif ?>>(UTC -00:00) Africa/Dakar</option> <option value="Africa/El_Aaiun" <?php if ($system['timezone'] == 'Africa/El_Aaiun') : ?> selected <?php endif ?>>(UTC -00:00) Africa/El_Aaiun</option> <option value="Africa/Freetown" <?php if ($system['timezone'] == 'Africa/Freetown') : ?> selected <?php endif ?>>(UTC -00:00) Africa/Freetown</option> <option value="Africa/Lome" <?php if ($system['timezone'] == 'Africa/Lome') : ?> selected <?php endif ?>>(UTC -00:00) Africa/Lome</option> <option value="Africa/Monrovia" <?php if ($system['timezone'] == 'Africa/Monrovia') : ?> selected <?php endif ?>>(UTC -00:00) Africa/Monrovia</option> <option value="Africa/Nouakchott" <?php if ($system['timezone'] == 'Africa/Nouakchott') : ?> selected <?php endif ?>>(UTC -00:00) Africa/Nouakchott</option> <option value="Africa/Ouagadougou" <?php if ($system['timezone'] == 'Africa/Ouagadougou') : ?> selected <?php endif ?>>(UTC -00:00) Africa/Ouagadougou</option> <option value="Africa/Sao_Tome" <?php if ($system['timezone'] == 'Africa/Sao_Tome') : ?> selected <?php endif ?>>(UTC -00:00) Africa/Sao_Tome</option> <option value="America/Danmarkshavn" <?php if ($system['timezone'] == 'America/Danmarkshavn') : ?> selected <?php endif ?>>(UTC -00:00) America/Danmarkshavn</option> <option value="Antarctica/Troll" <?php if ($system['timezone'] == 'Antarctica/Troll') : ?> selected <?php endif ?>>(UTC -00:00) Antarctica/Troll</option> <option value="Atlantic/Canary" <?php if ($system['timezone'] == 'Atlantic/Canary') : ?> selected <?php endif ?>>(UTC -00:00) Atlantic/Canary</option> <option value="Atlantic/Faroe" <?php if ($system['timezone'] == 'Atlantic/Faroe') : ?> selected <?php endif ?>>(UTC -00:00) Atlantic/Faroe</option> <option value="Atlantic/Madeira" <?php if ($system['timezone'] == 'Atlantic/Madeira') : ?> selected <?php endif ?>>(UTC -00:00) Atlantic/Madeira</option> <option value="Atlantic/Reykjavik" <?php if ($system['timezone'] == 'Atlantic/Reykjavik') : ?> selected <?php endif ?>>(UTC -00:00) Atlantic/Reykjavik</option> <option value="Atlantic/St_Helena" <?php if ($system['timezone'] == 'Atlantic/St_Helena') : ?> selected <?php endif ?>>(UTC -00:00) Atlantic/St_Helena</option> <option value="Europe/Dublin" <?php if ($system['timezone'] == 'Europe/Dublin') : ?> selected <?php endif ?>>(UTC -00:00) Europe/Dublin</option> <option value="Europe/Guernsey" <?php if ($system['timezone'] == 'Europe/Guernsey') : ?> selected <?php endif ?>>(UTC -00:00) Europe/Guernsey</option> <option value="Europe/Isle_of_Man" <?php if ($system['timezone'] == 'Europe/Isle_of_Man') : ?> selected <?php endif ?>>(UTC -00:00) Europe/Isle_of_Man</option> <option value="Europe/Jersey" <?php if ($system['timezone'] == 'Europe/Jersey') : ?> selected <?php endif ?>>(UTC -00:00) Europe/Jersey</option> <option value="Europe/Lisbon" <?php if ($system['timezone'] == 'Europe/Lisbon') : ?> selected <?php endif ?>>(UTC -00:00) Europe/Lisbon</option> <option value="Europe/London" <?php if ($system['timezone'] == 'Europe/London') : ?> selected <?php endif ?>>(UTC -00:00) Europe/London</option> <option value="UTC" <?php if ($system['timezone'] == 'UTC"') : ?> selected <?php endif ?>>(UTC -00:00) UTC</option> <option value="Africa/Algiers" <?php if ($system['timezone'] == 'Africa/Algiers') : ?> selected <?php endif ?>>(UTC +01:00) Africa/Algiers</option> <option value="Africa/Bangui" <?php if ($system['timezone'] == 'Africa/Bangui') : ?> selected <?php endif ?>>(UTC +01:00) Africa/Bangui</option> <option value="Africa/Brazzaville" <?php if ($system['timezone'] == 'Africa/Brazzaville') : ?> selected <?php endif ?>>(UTC +01:00) Africa/Brazzaville</option> <option value="Africa/Ceuta" <?php if ($system['timezone'] == 'Africa/Ceuta') : ?> selected <?php endif ?>>(UTC +01:00) Africa/Ceuta</option> <option value="Africa/Douala" <?php if ($system['timezone'] == 'Africa/Douala') : ?> selected <?php endif ?>>(UTC +01:00) Africa/Douala</option> <option value="Africa/Kinshasa" <?php if ($system['timezone'] == 'Africa/Kinshasa') : ?> selected <?php endif ?>>(UTC +01:00) Africa/Kinshasa</option> <option value="Africa/Lagos" <?php if ($system['timezone'] == 'Africa/Lagos') : ?> selected <?php endif ?>>(UTC +01:00) Africa/Lagos</option> <option value="Africa/Libreville" <?php if ($system['timezone'] == 'Africa/Libreville') : ?> selected <?php endif ?>>(UTC +01:00) Africa/Libreville</option> <option value="Africa/Luanda" <?php if ($system['timezone'] == 'Africa/Luanda') : ?> selected <?php endif ?>>(UTC +01:00) Africa/Luanda</option> <option value="Africa/Malabo" <?php if ($system['timezone'] == 'Africa/Malabo') : ?> selected <?php endif ?>>(UTC +01:00) Africa/Malabo</option> <option value="Africa/Ndjamena" <?php if ($system['timezone'] == 'Africa/Ndjamena') : ?> selected <?php endif ?>>(UTC +01:00) Africa/Ndjamena</option> <option value="Africa/Niamey" <?php if ($system['timezone'] == 'Africa/Niamey') : ?> selected <?php endif ?>>(UTC +01:00) Africa/Niamey</option> <option value="Africa/Porto-Novo" <?php if ($system['timezone'] == 'Africa/Porto') : ?> selected <?php endif ?>>(UTC +01:00) Africa/Porto-Novo</option> <option value="Africa/Tunis" <?php if ($system['timezone'] == 'Africa/Tunis') : ?> selected <?php endif ?>>(UTC +01:00) Africa/Tunis</option> <option value="Arctic/Longyearbyen" <?php if ($system['timezone'] == 'Arctic/Longyearbyen') : ?> selected <?php endif ?>>(UTC +01:00) Arctic/Longyearbyen</option> <option value="Europe/Amsterdam" <?php if ($system['timezone'] == 'Europe/Amsterdam') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Amsterdam</option> <option value="Europe/Andorra" <?php if ($system['timezone'] == 'Europe/Andorra') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Andorra</option> <option value="Europe/Belgrade" <?php if ($system['timezone'] == 'Europe/Belgrade') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Belgrade</option> <option value="Europe/Berlin" <?php if ($system['timezone'] == 'Europe/Berlin') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Berlin</option> <option value="Europe/Bratislava" <?php if ($system['timezone'] == 'Europe/Bratislava') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Bratislava</option> <option value="Europe/Brussels" <?php if ($system['timezone'] == 'Europe/Brussels') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Brussels</option> <option value="Europe/Budapest" <?php if ($system['timezone'] == 'Europe/Budapest') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Budapest</option> <option value="Europe/Busingen" <?php if ($system['timezone'] == 'Europe/Busingen') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Busingen</option> <option value="Europe/Copenhagen" <?php if ($system['timezone'] == 'Europe/Copenhagen') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Copenhagen</option> <option value="Europe/Gibraltar" <?php if ($system['timezone'] == 'Europe/Gibraltar') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Gibraltar</option> <option value="Europe/Ljubljana" <?php if ($system['timezone'] == 'Europe/Ljubljana') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Ljubljana</option> <option value="Europe/Luxembourg" <?php if ($system['timezone'] == 'Europe/Luxembourg') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Luxembourg</option> <option value="Europe/Madrid" <?php if ($system['timezone'] == 'Europe/Madrid') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Madrid</option> <option value="Europe/Malta" <?php if ($system['timezone'] == 'Europe/Malta') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Malta</option> <option value="Europe/Monaco" <?php if ($system['timezone'] == 'Europe/Monaco') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Monaco</option> <option value="Europe/Oslo" <?php if ($system['timezone'] == 'Europe/Oslo') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Oslo</option> <option value="Europe/Paris" <?php if ($system['timezone'] == 'Europe/Paris') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Paris</option> <option value="Europe/Podgorica" <?php if ($system['timezone'] == 'Europe/Podgorica') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Podgorica</option> <option value="Europe/Prague" <?php if ($system['timezone'] == 'Europe/Prague') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Prague</option> <option value="Europe/Rome" <?php if ($system['timezone'] == 'Europe/Rome') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Rome</option> <option value="Europe/San_Marino" <?php if ($system['timezone'] == 'Europe/San_Marino') : ?> selected <?php endif ?>>(UTC +01:00) Europe/San_Marino</option> <option value="Europe/Sarajevo" <?php if ($system['timezone'] == 'Europe/Sarajevo') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Sarajevo</option> <option value="Europe/Skopje" <?php if ($system['timezone'] == 'Europe/Skopje') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Skopje</option> <option value="Europe/Stockholm" <?php if ($system['timezone'] == 'Europe/Stockholm') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Stockholm</option> <option value="Europe/Tirane" <?php if ($system['timezone'] == 'Europe/Tirane') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Tirane</option> <option value="Europe/Vaduz" <?php if ($system['timezone'] == 'Europe/Vaduz') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Vaduz</option> <option value="Europe/Vatican" <?php if ($system['timezone'] == 'Europe/Vatican') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Vatican</option> <option value="Europe/Vienna" <?php if ($system['timezone'] == 'Europe/Vienna') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Vienna</option> <option value="Europe/Warsaw" <?php if ($system['timezone'] == 'Europe/Warsaw') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Warsaw</option> <option value="Europe/Zagreb" <?php if ($system['timezone'] == 'Europe/Zagreb') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Zagreb</option> <option value="Europe/Zurich" <?php if ($system['timezone'] == 'Europe/Zurich') : ?> selected <?php endif ?>>(UTC +01:00) Europe/Zurich</option> <option value="Africa/Blantyre" <?php if ($system['timezone'] == 'Africa/Blantyre') : ?> selected <?php endif ?>>(UTC +02:00) Africa/Blantyre</option> <option value="Africa/Bujumbura" <?php if ($system['timezone'] == 'Africa/Bujumbura') : ?> selected <?php endif ?>>(UTC +02:00) Africa/Bujumbura</option> <option value="Africa/Cairo" <?php if ($system['timezone'] == 'Africa/Cairo') : ?> selected <?php endif ?>>(UTC +02:00) Africa/Cairo</option> <option value="Africa/Gaborone" <?php if ($system['timezone'] == 'Africa/Gaborone') : ?> selected <?php endif ?>>(UTC +02:00) Africa/Gaborone</option> <option value="Africa/Harare" <?php if ($system['timezone'] == 'Africa/Harare') : ?> selected <?php endif ?>>(UTC +02:00) Africa/Harare</option> <option value="Africa/Johannesburg" <?php if ($system['timezone'] == 'Africa/Johannesburg') : ?> selected <?php endif ?>>(UTC +02:00) Africa/Johannesburg</option> <option value="Africa/Kigali" <?php if ($system['timezone'] == 'Africa/Kigali') : ?> selected <?php endif ?>>(UTC +02:00) Africa/Kigali</option> <option value="Africa/Lubumbashi" <?php if ($system['timezone'] == 'Africa/Lubumbashi') : ?> selected <?php endif ?>>(UTC +02:00) Africa/Lubumbashi</option> <option value="Africa/Lusaka" <?php if ($system['timezone'] == 'Africa/Lusaka') : ?> selected <?php endif ?>>(UTC +02:00) Africa/Lusaka</option> <option value="Africa/Maputo" <?php if ($system['timezone'] == 'Africa/Maputo') : ?> selected <?php endif ?>>(UTC +02:00) Africa/Maputo</option> <option value="Africa/Maseru" <?php if ($system['timezone'] == 'Africa/Maseru') : ?> selected <?php endif ?>>(UTC +02:00) Africa/Maseru</option> <option value="Africa/Mbabane" <?php if ($system['timezone'] == 'Africa/Mbabane') : ?> selected <?php endif ?>>(UTC +02:00) Africa/Mbabane</option> <option value="Africa/Tripoli" <?php if ($system['timezone'] == 'Africa/Tripoli') : ?> selected <?php endif ?>>(UTC +02:00) Africa/Tripoli</option> <option value="Africa/Windhoek" <?php if ($system['timezone'] == 'Africa/Windhoek') : ?> selected <?php endif ?>>(UTC +02:00) Africa/Windhoek</option> <option value="Asia/Amman" <?php if ($system['timezone'] == 'Asia/Amman') : ?> selected <?php endif ?>>(UTC +02:00) Asia/Amman</option> <option value="Asia/Beirut" <?php if ($system['timezone'] == 'Asia/Beirut') : ?> selected <?php endif ?>>(UTC +02:00) Asia/Beirut</option> <option value="Asia/Damascus" <?php if ($system['timezone'] == 'Asia/Damascus') : ?> selected <?php endif ?>>(UTC +02:00) Asia/Damascus</option> <option value="Asia/Gaza" <?php if ($system['timezone'] == 'Asia/Gaza') : ?> selected <?php endif ?>>(UTC +02:00) Asia/Gaza</option> <option value="Asia/Hebron" <?php if ($system['timezone'] == 'Asia/Hebron') : ?> selected <?php endif ?>>(UTC +02:00) Asia/Hebron</option> <option value="Asia/Jerusalem" <?php if ($system['timezone'] == 'Asia/Jerusalem') : ?> selected <?php endif ?>>(UTC +02:00) Asia/Jerusalem</option> <option value="Asia/Nicosia" <?php if ($system['timezone'] == 'Asia/Nicosia') : ?> selected <?php endif ?>>(UTC +02:00) Asia/Nicosia</option> <option value="Europe/Athens" <?php if ($system['timezone'] == 'Europe/Athens') : ?> selected <?php endif ?>>(UTC +02:00) Europe/Athens</option> <option value="Europe/Bucharest" <?php if ($system['timezone'] == 'Europe/Bucharest') : ?> selected <?php endif ?>>(UTC +02:00) Europe/Bucharest</option> <option value="Europe/Chisinau" <?php if ($system['timezone'] == 'Europe/Chisinau') : ?> selected <?php endif ?>>(UTC +02:00) Europe/Chisinau</option> <option value="Europe/Helsinki" <?php if ($system['timezone'] == 'Europe/Helsinki') : ?> selected <?php endif ?>>(UTC +02:00) Europe/Helsinki</option> <option value="Europe/Kaliningrad" <?php if ($system['timezone'] == 'Europe/Kaliningrad') : ?> selected <?php endif ?>>(UTC +02:00) Europe/Kaliningrad</option> <option value="Europe/Kiev" <?php if ($system['timezone'] == 'Europe/Kiev') : ?> selected <?php endif ?>>(UTC +02:00) Europe/Kiev</option> <option value="Europe/Mariehamn" <?php if ($system['timezone'] == 'Europe/Mariehamn') : ?> selected <?php endif ?>>(UTC +02:00) Europe/Mariehamn</option> <option value="Europe/Riga" <?php if ($system['timezone'] == 'Europe/Riga') : ?> selected <?php endif ?>>(UTC +02:00) Europe/Riga</option> <option value="Europe/Sofia" <?php if ($system['timezone'] == 'Europe/Sofia') : ?> selected <?php endif ?>>(UTC +02:00) Europe/Sofia</option> <option value="Europe/Tallinn" <?php if ($system['timezone'] == 'Europe/Tallinn') : ?> selected <?php endif ?>>(UTC +02:00) Europe/Tallinn</option> <option value="Europe/Uzhgorod" <?php if ($system['timezone'] == 'Europe/Uzhgorod') : ?> selected <?php endif ?>>(UTC +02:00) Europe/Uzhgorod</option> <option value="Europe/Vilnius" <?php if ($system['timezone'] == 'Europe/Vilnius') : ?> selected <?php endif ?>>(UTC +02:00) Europe/Vilnius</option> <option value="Europe/Zaporozhye" <?php if ($system['timezone'] == 'Europe/Zaporozhye') : ?> selected <?php endif ?>>(UTC +02:00) Europe/Zaporozhye</option> <option value="Africa/Addis_Ababa" <?php if ($system['timezone'] == 'Africa/Addis_Ababa') : ?> selected <?php endif ?>>(UTC +03:00) Africa/Addis_Ababa</option> <option value="Africa/Asmara" <?php if ($system['timezone'] == 'Africa/Asmara') : ?> selected <?php endif ?>>(UTC +03:00) Africa/Asmara</option> <option value="Africa/Dar_es_Salaam" <?php if ($system['timezone'] == 'Africa/Dar_es_Salaam') : ?> selected <?php endif ?>>(UTC +03:00) Africa/Dar_es_Salaam</option> <option value="Africa/Djibouti" <?php if ($system['timezone'] == 'Africa/Djibouti') : ?> selected <?php endif ?>>(UTC +03:00) Africa/Djibouti</option> <option value="Africa/Juba" <?php if ($system['timezone'] == 'Africa/Juba') : ?> selected <?php endif ?>>(UTC +03:00) Africa/Juba</option> <option value="Africa/Kampala" <?php if ($system['timezone'] == 'Africa/Kampala') : ?> selected <?php endif ?>>(UTC +03:00) Africa/Kampala</option> <option value="Africa/Khartoum" <?php if ($system['timezone'] == 'Africa/Khartoum') : ?> selected <?php endif ?>>(UTC +03:00) Africa/Khartoum</option> <option value="Africa/Mogadishu" <?php if ($system['timezone'] == 'Africa/Mogadishu') : ?> selected <?php endif ?>>(UTC +03:00) Africa/Mogadishu</option> <option value="Africa/Nairobi" <?php if ($system['timezone'] == 'Africa/Nairobi') : ?> selected <?php endif ?>>(UTC +03:00) Africa/Nairobi</option> <option value="Antarctica/Syowa" <?php if ($system['timezone'] == 'Antarctica/Syowa') : ?> selected <?php endif ?>>(UTC +03:00) Antarctica/Syowa</option> <option value="Asia/Aden" <?php if ($system['timezone'] == 'Asia/Aden') : ?> selected <?php endif ?>>(UTC +03:00) Asia/Aden</option> <option value="Asia/Baghdad" <?php if ($system['timezone'] == 'Asia/Baghdad') : ?> selected <?php endif ?>>(UTC +03:00) Asia/Baghdad</option> <option value="Asia/Bahrain" <?php if ($system['timezone'] == 'Asia/Bahrain') : ?> selected <?php endif ?>>(UTC +03:00) Asia/Bahrain</option> <option value="Asia/Famagusta" <?php if ($system['timezone'] == 'Asia/Famagusta') : ?> selected <?php endif ?>>(UTC +03:00) Asia/Famagusta</option> <option value="Asia/Kuwait" <?php if ($system['timezone'] == 'Asia/Kuwait') : ?> selected <?php endif ?>>(UTC +03:00) Asia/Kuwait</option> <option value="Asia/Qatar" <?php if ($system['timezone'] == 'Asia/Qatar') : ?> selected <?php endif ?>>(UTC +03:00) Asia/Qatar</option> <option value="Asia/Riyadh" <?php if ($system['timezone'] == 'Asia/Riyadh') : ?> selected <?php endif ?>>(UTC +03:00) Asia/Riyadh</option> <option value="Europe/Istanbul" <?php if ($system['timezone'] == 'Europe/Istanbul') : ?> selected <?php endif ?>>(UTC +03:00) Europe/Istanbul</option> <option value="Europe/Kirov" <?php if ($system['timezone'] == 'Europe/Kirov') : ?> selected <?php endif ?>>(UTC +03:00) Europe/Kirov</option> <option value="Europe/Minsk" <?php if ($system['timezone'] == 'Europe/Minsk') : ?> selected <?php endif ?>>(UTC +03:00) Europe/Minsk</option> <option value="Europe/Moscow" <?php if ($system['timezone'] == 'Europe/Moscow') : ?> selected <?php endif ?>>(UTC +03:00) Europe/Moscow</option> <option value="Europe/Simferopol" <?php if ($system['timezone'] == 'Europe/Simferopol') : ?> selected <?php endif ?>>(UTC +03:00) Europe/Simferopol</option> <option value="Europe/Volgograd" <?php if ($system['timezone'] == 'Europe/Volgograd') : ?> selected <?php endif ?>>(UTC +03:00) Europe/Volgograd</option> <option value="Indian/Antananarivo" <?php if ($system['timezone'] == 'Indian/Antananarivo') : ?> selected <?php endif ?>>(UTC +03:00) Indian/Antananarivo</option> <option value="Indian/Comoro" <?php if ($system['timezone'] == 'Indian/Comoro') : ?> selected <?php endif ?>>(UTC +03:00) Indian/Comoro</option> <option value="Indian/Mayotte" <?php if ($system['timezone'] == 'Indian/Mayotte') : ?> selected <?php endif ?>>(UTC +03:00) Indian/Mayotte</option> <option value="Asia/Tehran" <?php if ($system['timezone'] == 'Asia/Tehran') : ?> selected <?php endif ?>>(UTC +03:30) Asia/Tehran</option> <option value="Asia/Baku" <?php if ($system['timezone'] == 'Asia/Baku') : ?> selected <?php endif ?>>(UTC +04:00) Asia/Baku</option> <option value="Asia/Dubai" <?php if ($system['timezone'] == 'Asia/Dubai') : ?> selected <?php endif ?>>(UTC +04:00) Asia/Dubai</option> <option value="Asia/Muscat" <?php if ($system['timezone'] == 'Asia/Muscat') : ?> selected <?php endif ?>>(UTC +04:00) Asia/Muscat</option> <option value="Asia/Tbilisi" <?php if ($system['timezone'] == 'Asia/Tbilisi') : ?> selected <?php endif ?>>(UTC +04:00) Asia/Tbilisi</option> <option value="Asia/Yerevan" <?php if ($system['timezone'] == 'Asia/Yerevan') : ?> selected <?php endif ?>>(UTC +04:00) Asia/Yerevan</option> <option value="Europe/Astrakhan" <?php if ($system['timezone'] == 'Europe/Astrakhan') : ?> selected <?php endif ?>>(UTC +04:00) Europe/Astrakhan</option> <option value="Europe/Samara" <?php if ($system['timezone'] == 'Europe/Samara') : ?> selected <?php endif ?>>(UTC +04:00) Europe/Samara</option> <option value="Europe/Saratov" <?php if ($system['timezone'] == 'Europe/Saratov') : ?> selected <?php endif ?>>(UTC +04:00) Europe/Saratov</option> <option value="Europe/Ulyanovsk" <?php if ($system['timezone'] == 'Europe/Ulyanovsk') : ?> selected <?php endif ?>>(UTC +04:00) Europe/Ulyanovsk</option> <option value="Indian/Mahe" <?php if ($system['timezone'] == 'Indian/Mahe') : ?> selected <?php endif ?>>(UTC +04:00) Indian/Mahe</option> <option value="Indian/Mauritius" <?php if ($system['timezone'] == 'Indian/Mauritius') : ?> selected <?php endif ?>>(UTC +04:00) Indian/Mauritius</option> <option value="Indian/Reunion" <?php if ($system['timezone'] == 'Indian/Reunion') : ?> selected <?php endif ?>>(UTC +04:00) Indian/Reunion</option> <option value="Asia/Kabul" <?php if ($system['timezone'] == 'Asia/Kabul') : ?> selected <?php endif ?>>(UTC +04:30) Asia/Kabul</option> <option value="Antarctica/Mawson" <?php if ($system['timezone'] == 'Antarctica/Mawson') : ?> selected <?php endif ?>>(UTC +05:00) Antarctica/Mawson</option> <option value="Asia/Aqtau" <?php if ($system['timezone'] == 'Asia/Aqtau') : ?> selected <?php endif ?>>(UTC +05:00) Asia/Aqtau</option> <option value="Asia/Aqtobe" <?php if ($system['timezone'] == 'Asia/Aqtobe') : ?> selected <?php endif ?>>(UTC +05:00) Asia/Aqtobe</option> <option value="Asia/Ashgabat" <?php if ($system['timezone'] == 'Asia/Ashgabat') : ?> selected <?php endif ?>>(UTC +05:00) Asia/Ashgabat</option> <option value="Asia/Atyrau" <?php if ($system['timezone'] == 'Asia/Atyrau') : ?> selected <?php endif ?>>(UTC +05:00) Asia/Atyrau</option> <option value="Asia/Dushanbe" <?php if ($system['timezone'] == 'Asia/Dushanbe') : ?> selected <?php endif ?>>(UTC +05:00) Asia/Dushanbe</option> <option value="Asia/Karachi" <?php if ($system['timezone'] == 'Asia/Karachi') : ?> selected <?php endif ?>>(UTC +05:00) Asia/Karachi</option> <option value="Asia/Oral" <?php if ($system['timezone'] == 'Asia/Oral') : ?> selected <?php endif ?>>(UTC +05:00) Asia/Oral</option> <option value="Asia/Samarkand" <?php if ($system['timezone'] == 'Asia/Samarkand') : ?> selected <?php endif ?>>(UTC +05:00) Asia/Samarkand</option> <option value="Asia/Tashkent" <?php if ($system['timezone'] == 'Asia/Tashkent') : ?> selected <?php endif ?>>(UTC +05:00) Asia/Tashkent</option> <option value="Asia/Yekaterinburg" <?php if ($system['timezone'] == 'Asia/Yekaterinburg') : ?> selected <?php endif ?>>(UTC +05:00) Asia/Yekaterinburg</option> <option value="Indian/Kerguelen" <?php if ($system['timezone'] == 'Indian/Kerguelen') : ?> selected <?php endif ?>>(UTC +05:00) Indian/Kerguelen</option> <option value="Indian/Maldives" <?php if ($system['timezone'] == 'Indian/Maldives') : ?> selected <?php endif ?>>(UTC +05:00) Indian/Maldives</option> <option value="Asia/Colombo" <?php if ($system['timezone'] == 'Asia/Colombo') : ?> selected <?php endif ?>>(UTC +05:30) Asia/Colombo</option> <option value="Asia/Kolkata" <?php if ($system['timezone'] == 'Asia/Kolkata') : ?> selected <?php endif ?>>(UTC +05:30) Asia/Kolkata</option> <option value="Asia/Kathmandu" <?php if ($system['timezone'] == 'Asia/Kathmandu') : ?> selected <?php endif ?>>(UTC +05:45) Asia/Kathmandu</option> <option value="Antarctica/Vostok" <?php if ($system['timezone'] == 'Antarctica/Vostok') : ?> selected <?php endif ?>>(UTC +06:00) Antarctica/Vostok</option> <option value="Asia/Almaty" <?php if ($system['timezone'] == 'Asia/Almaty') : ?> selected <?php endif ?>>(UTC +06:00) Asia/Almaty</option> <option value="Asia/Bishkek" <?php if ($system['timezone'] == 'Asia/Bishkek') : ?> selected <?php endif ?>>(UTC +06:00) Asia/Bishkek</option> <option value="Asia/Dhaka" <?php if ($system['timezone'] == 'Asia/Dhaka') : ?> selected <?php endif ?>>(UTC +06:00) Asia/Dhaka</option> <option value="Asia/Omsk" <?php if ($system['timezone'] == 'Asia/Omsk') : ?> selected <?php endif ?>>(UTC +06:00) Asia/Omsk</option> <option value="Asia/Qyzylorda" <?php if ($system['timezone'] == 'Asia/Qyzylorda') : ?> selected <?php endif ?>>(UTC +06:00) Asia/Qyzylorda</option> <option value="Asia/Thimphu" <?php if ($system['timezone'] == 'Asia/Thimphu') : ?> selected <?php endif ?>>(UTC +06:00) Asia/Thimphu</option> <option value="Asia/Urumqi" <?php if ($system['timezone'] == 'Asia/Urumqi') : ?> selected <?php endif ?>>(UTC +06:00) Asia/Urumqi</option> <option value="Indian/Chagos" <?php if ($system['timezone'] == 'Indian/Chagos') : ?> selected <?php endif ?>>(UTC +06:00) Indian/Chagos</option> <option value="Asia/Yangon" <?php if ($system['timezone'] == 'Asia/Yangon') : ?> selected <?php endif ?>>(UTC +06:30) Asia/Yangon</option> <option value="Indian/Cocos" <?php if ($system['timezone'] == 'Indian/Cocos') : ?> selected <?php endif ?>>(UTC +06:30) Indian/Cocos</option> <option value="Antarctica/Davis" <?php if ($system['timezone'] == 'Antarctica/Davis') : ?> selected <?php endif ?>>(UTC +07:00) Antarctica/Davis</option> <option value="Asia/Bangkok" <?php if ($system['timezone'] == 'Asia/Bangkok') : ?> selected <?php endif ?>>(UTC +07:00) Asia/Bangkok</option> <option value="Asia/Barnaul" <?php if ($system['timezone'] == 'Asia/Barnaul') : ?> selected <?php endif ?>>(UTC +07:00) Asia/Barnaul</option> <option value="Asia/Ho_Chi_Minh" <?php if ($system['timezone'] == 'Asia/Ho_Chi_Minh') : ?> selected <?php endif ?>>(UTC +07:00) Asia/Ho_Chi_Minh</option> <option value="Asia/Hovd" <?php if ($system['timezone'] == 'Asia/Hovd') : ?> selected <?php endif ?>>(UTC +07:00) Asia/Hovd</option> <option value="Asia/Jakarta" <?php if ($system['timezone'] == 'Asia/Jakarta') : ?> selected <?php endif ?>>(UTC +07:00) Asia/Jakarta</option> <option value="Asia/Krasnoyarsk" <?php if ($system['timezone'] == 'Asia/Krasnoyarsk') : ?> selected <?php endif ?>>(UTC +07:00) Asia/Krasnoyarsk</option> <option value="Asia/Novokuznetsk" <?php if ($system['timezone'] == 'Asia/Novokuznetsk') : ?> selected <?php endif ?>>(UTC +07:00) Asia/Novokuznetsk</option> <option value="Asia/Novosibirsk" <?php if ($system['timezone'] == 'Asia/Novosibirsk') : ?> selected <?php endif ?>>(UTC +07:00) Asia/Novosibirsk</option> <option value="Asia/Phnom_Penh" <?php if ($system['timezone'] == 'Asia/Phnom_Penh') : ?> selected <?php endif ?>>(UTC +07:00) Asia/Phnom_Penh</option> <option value="Asia/Pontianak" <?php if ($system['timezone'] == 'Asia/Pontianak') : ?> selected <?php endif ?>>(UTC +07:00) Asia/Pontianak</option> <option value="Asia/Tomsk" <?php if ($system['timezone'] == 'Asia/Tomsk') : ?> selected <?php endif ?>>(UTC +07:00) Asia/Tomsk</option> <option value="Asia/Vientiane" <?php if ($system['timezone'] == 'Asia/Vientiane') : ?> selected <?php endif ?>>(UTC +07:00) Asia/Vientiane</option> <option value="Indian/Christmas" <?php if ($system['timezone'] == 'Indian/Christmas') : ?> selected <?php endif ?>>(UTC +07:00) Indian/Christmas</option> <option value="Asia/Brunei" <?php if ($system['timezone'] == 'Asia/Brunei') : ?> selected <?php endif ?>>(UTC +08:00) Asia/Brunei</option> <option value="Asia/Choibalsan" <?php if ($system['timezone'] == 'Asia/Choibalsan') : ?> selected <?php endif ?>>(UTC +08:00) Asia/Choibalsan</option> <option value="Asia/Hong_Kong" <?php if ($system['timezone'] == 'Asia/Hong_Kong') : ?> selected <?php endif ?>>(UTC +08:00) Asia/Hong_Kong</option> <option value="Asia/Irkutsk" <?php if ($system['timezone'] == 'Asia/Irkutsk') : ?> selected <?php endif ?>>(UTC +08:00) Asia/Irkutsk</option> <option value="Asia/Kuala_Lumpur" <?php if ($system['timezone'] == 'Asia/Kuala_Lumpur') : ?> selected <?php endif ?>>(UTC +08:00) Asia/Kuala_Lumpur</option> <option value="Asia/Kuching" <?php if ($system['timezone'] == 'Asia/Kuching') : ?> selected <?php endif ?>>(UTC +08:00) Asia/Kuching</option> <option value="Asia/Macau" <?php if ($system['timezone'] == 'Asia/Macau') : ?> selected <?php endif ?>>(UTC +08:00) Asia/Macau</option> <option value="Asia/Makassar" <?php if ($system['timezone'] == 'Asia/Makassar') : ?> selected <?php endif ?>>(UTC +08:00) Asia/Makassar</option> <option value="Asia/Manila" <?php if ($system['timezone'] == 'Asia/Manila') : ?> selected <?php endif ?>>(UTC +08:00) Asia/Manila</option> <option value="Asia/Shanghai" <?php if ($system['timezone'] == 'Asia/Shanghai') : ?> selected <?php endif ?>>(UTC +08:00) Asia/Shanghai</option> <option value="Asia/Singapore" <?php if ($system['timezone'] == 'Asia/Singapore') : ?> selected <?php endif ?>>(UTC +08:00) Asia/Singapore</option> <option value="Asia/Taipei" <?php if ($system['timezone'] == 'Asia/Taipei') : ?> selected <?php endif ?>>(UTC +08:00) Asia/Taipei</option> <option value="Asia/Ulaanbaatar" <?php if ($system['timezone'] == 'Asia/Ulaanbaatar') : ?> selected <?php endif ?>>(UTC +08:00) Asia/Ulaanbaatar</option> <option value="Australia/Perth" <?php if ($system['timezone'] == 'Australia/Perth') : ?> selected <?php endif ?>>(UTC +08:00) Australia/Perth</option> <option value="Asia/Pyongyang" <?php if ($system['timezone'] == 'Asia/Pyongyang') : ?> selected <?php endif ?>>(UTC +08:30) Asia/Pyongyang</option> <option value="Australia/Eucla" <?php if ($system['timezone'] == 'Australia/Eucla') : ?> selected <?php endif ?>>(UTC +08:45) Australia/Eucla</option> <option value="Asia/Chita" <?php if ($system['timezone'] == 'Asia/Chita') : ?> selected <?php endif ?>>(UTC +09:00) Asia/Chita</option> <option value="Asia/Dili" <?php if ($system['timezone'] == 'Asia/Dili') : ?> selected <?php endif ?>>(UTC +09:00) Asia/Dili</option> <option value="Asia/Jayapura" <?php if ($system['timezone'] == 'Asia/Jayapura') : ?> selected <?php endif ?>>(UTC +09:00) Asia/Jayapura</option> <option value="Asia/Khandyga" <?php if ($system['timezone'] == 'Asia/Khandyga') : ?> selected <?php endif ?>>(UTC +09:00) Asia/Khandyga</option> <option value="Asia/Seoul" <?php if ($system['timezone'] == 'Asia/Seoul') : ?> selected <?php endif ?>>(UTC +09:00) Asia/Seoul</option> <option value="Asia/Tokyo" <?php if ($system['timezone'] == 'Asia/Tokyo') : ?> selected <?php endif ?>>(UTC +09:00) Asia/Tokyo</option> <option value="Asia/Yakutsk" <?php if ($system['timezone'] == 'Asia/Yakutsk') : ?> selected <?php endif ?>>(UTC +09:00) Asia/Yakutsk</option> <option value="Pacific/Palau" <?php if ($system['timezone'] == 'Pacific/Palau') : ?> selected <?php endif ?>>(UTC +09:00) Pacific/Palau</option> <option value="Australia/Darwin" <?php if ($system['timezone'] == 'Australia/Darwin') : ?> selected <?php endif ?>>(UTC +09:30) Australia/Darwin</option> <option value="Antarctica/DumontDUrville" <?php if ($system['timezone'] == 'Antarctica/DumontDUrville') : ?> selected <?php endif ?>>(UTC +10:00) Antarctica/DumontDUrville</option> <option value="Asia/Ust-Nera" <?php if ($system['timezone'] == 'Asia/Ust') : ?> selected <?php endif ?>>(UTC +10:00) Asia/Ust-Nera</option> <option value="Asia/Vladivostok" <?php if ($system['timezone'] == 'Asia/Vladivostok') : ?> selected <?php endif ?>>(UTC +10:00) Asia/Vladivostok</option> <option value="Australia/Brisbane" <?php if ($system['timezone'] == 'Australia/Brisbane') : ?> selected <?php endif ?>>(UTC +10:00) Australia/Brisbane</option> <option value="Australia/Lindeman" <?php if ($system['timezone'] == 'Australia/Lindeman') : ?> selected <?php endif ?>>(UTC +10:00) Australia/Lindeman</option> <option value="Pacific/Chuuk" <?php if ($system['timezone'] == 'Pacific/Chuuk') : ?> selected <?php endif ?>>(UTC +10:00) Pacific/Chuuk</option> <option value="Pacific/Guam" <?php if ($system['timezone'] == 'Pacific/Guam') : ?> selected <?php endif ?>>(UTC +10:00) Pacific/Guam</option> <option value="Pacific/Port_Moresby" <?php if ($system['timezone'] == 'Pacific/Port_Moresby') : ?> selected <?php endif ?>>(UTC +10:00) Pacific/Port_Moresby</option> <option value="Pacific/Saipan" <?php if ($system['timezone'] == 'Pacific/Saipan') : ?> selected <?php endif ?>>(UTC +10:00) Pacific/Saipan</option> <option value="Australia/Adelaide" <?php if ($system['timezone'] == 'Australia/Adelaide') : ?> selected <?php endif ?>>(UTC +10:30) Australia/Adelaide</option> <option value="Australia/Broken_Hill" <?php if ($system['timezone'] == 'Australia/Broken_Hill') : ?> selected <?php endif ?>>(UTC +10:30) Australia/Broken_Hill</option> <option value="Antarctica/Casey" <?php if ($system['timezone'] == 'Antarctica/Casey') : ?> selected <?php endif ?>>(UTC +11:00) Antarctica/Casey</option> <option value="Antarctica/Macquarie" <?php if ($system['timezone'] == 'Antarctica/Macquarie') : ?> selected <?php endif ?>>(UTC +11:00) Antarctica/Macquarie</option> <option value="Asia/Magadan" <?php if ($system['timezone'] == 'Asia/Magadan') : ?> selected <?php endif ?>>(UTC +11:00) Asia/Magadan</option> <option value="Asia/Sakhalin" <?php if ($system['timezone'] == 'Asia/Sakhalin') : ?> selected <?php endif ?>>(UTC +11:00) Asia/Sakhalin</option> <option value="Asia/Srednekolymsk" <?php if ($system['timezone'] == 'Asia/Srednekolymsk') : ?> selected <?php endif ?>>(UTC +11:00) Asia/Srednekolymsk</option> <option value="Australia/Currie" <?php if ($system['timezone'] == 'Australia/Currie') : ?> selected <?php endif ?>>(UTC +11:00) Australia/Currie</option> <option value="Australia/Hobart" <?php if ($system['timezone'] == 'Australia/Hobart') : ?> selected <?php endif ?>>(UTC +11:00) Australia/Hobart</option> <option value="Australia/Lord_Howe" <?php if ($system['timezone'] == 'Australia/Lord_Howe') : ?> selected <?php endif ?>>(UTC +11:00) Australia/Lord_Howe</option> <option value="Australia/Melbourne" <?php if ($system['timezone'] == 'Australia/Melbourne') : ?> selected <?php endif ?>>(UTC +11:00) Australia/Melbourne</option> <option value="Australia/Sydney" <?php if ($system['timezone'] == 'Australia/Sydney') : ?> selected <?php endif ?>>(UTC +11:00) Australia/Sydney</option> <option value="Pacific/Bougainville" <?php if ($system['timezone'] == 'Pacific/Bougainville') : ?> selected <?php endif ?>>(UTC +11:00) Pacific/Bougainville</option> <option value="Pacific/Efate" <?php if ($system['timezone'] == 'Pacific/Efate') : ?> selected <?php endif ?>>(UTC +11:00) Pacific/Efate</option> <option value="Pacific/Guadalcanal" <?php if ($system['timezone'] == 'Pacific/Guadalcanal') : ?> selected <?php endif ?>>(UTC +11:00) Pacific/Guadalcanal</option> <option value="Pacific/Kosrae" <?php if ($system['timezone'] == 'Pacific/Kosrae') : ?> selected <?php endif ?>>(UTC +11:00) Pacific/Kosrae</option> <option value="Pacific/Norfolk" <?php if ($system['timezone'] == 'Pacific/Norfolk') : ?> selected <?php endif ?>>(UTC +11:00) Pacific/Norfolk</option> <option value="Pacific/Noumea" <?php if ($system['timezone'] == 'Pacific/Noumea') : ?> selected <?php endif ?>>(UTC +11:00) Pacific/Noumea</option> <option value="Pacific/Pohnpei" <?php if ($system['timezone'] == 'Pacific/Pohnpei') : ?> selected <?php endif ?>>(UTC +11:00) Pacific/Pohnpei</option> <option value="Asia/Anadyr" <?php if ($system['timezone'] == 'Asia/Anadyr') : ?> selected <?php endif ?>>(UTC +12:00) Asia/Anadyr</option> <option value="Asia/Kamchatka" <?php if ($system['timezone'] == 'Asia/Kamchatka') : ?> selected <?php endif ?>>(UTC +12:00) Asia/Kamchatka</option> <option value="Pacific/Funafuti" <?php if ($system['timezone'] == 'Pacific/Funafuti') : ?> selected <?php endif ?>>(UTC +12:00) Pacific/Funafuti</option> <option value="Pacific/Kwajalein" <?php if ($system['timezone'] == 'Pacific/Kwajalein') : ?> selected <?php endif ?>>(UTC +12:00) Pacific/Kwajalein</option> <option value="Pacific/Majuro" <?php if ($system['timezone'] == 'Pacific/Majuro') : ?> selected <?php endif ?>>(UTC +12:00) Pacific/Majuro</option> <option value="Pacific/Nauru" <?php if ($system['timezone'] == 'Pacific/Nauru') : ?> selected <?php endif ?>>(UTC +12:00) Pacific/Nauru</option> <option value="Pacific/Tarawa" <?php if ($system['timezone'] == 'Pacific/Tarawa') : ?> selected <?php endif ?>>(UTC +12:00) Pacific/Tarawa</option> <option value="Pacific/Wake" <?php if ($system['timezone'] == 'Pacific/Wake') : ?> selected <?php endif ?>>(UTC +12:00) Pacific/Wake</option> <option value="Pacific/Wallis" <?php if ($system['timezone'] == 'Pacific/Wallis') : ?> selected <?php endif ?>>(UTC +12:00) Pacific/Wallis</option> <option value="Antarctica/McMurdo" <?php if ($system['timezone'] == 'Antarctica/McMurdo') : ?> selected <?php endif ?>>(UTC +13:00) Antarctica/McMurdo</option> <option value="Pacific/Auckland" <?php if ($system['timezone'] == 'Pacific/Auckland') : ?> selected <?php endif ?>>(UTC +13:00) Pacific/Auckland</option> <option value="Pacific/Enderbury" <?php if ($system['timezone'] == 'Pacific/Enderbury') : ?> selected <?php endif ?>>(UTC +13:00) Pacific/Enderbury</option> <option value="Pacific/Fakaofo" <?php if ($system['timezone'] == 'Pacific/Fakaofo') : ?> selected <?php endif ?>>(UTC +13:00) Pacific/Fakaofo</option> <option value="Pacific/Fiji" <?php if ($system['timezone'] == 'Pacific/Fiji') : ?> selected <?php endif ?>>(UTC +13:00) Pacific/Fiji</option> <option value="Pacific/Chatham" <?php if ($system['timezone'] == 'Pacific/Chatham') : ?> selected <?php endif ?>>(UTC +13:45) Pacific/Chatham</option> <option value="Pacific/Apia" <?php if ($system['timezone'] == 'Pacific/Apia') : ?> selected <?php endif ?>>(UTC +14:00) Pacific/Apia</option> <option value="Pacific/Kiritimati" <?php if ($system['timezone'] == 'Pacific/Kiritimati') : ?> selected <?php endif ?>>(UTC +14:00) Pacific/Kiritimati</option> <option value="Pacific/Tongatapu" <?php if ($system['timezone'] == 'Pacific/Tongatapu') : ?> selected <?php endif ?>>(UTC +14:00) Pacific/Tongatapu</option> </select> </div> <div class="form-group col-md-6"> <label for="dateformat" class="form-control-label">Date format</label> <select class="form-control" name="dateformat"> <option value="mm-dd-yyyy" <?php if ($system['dateformat'] == 'mm-dd-yyyy') : ?> selected <?php endif ?>>mm-dd-yyyy</option> <option value="dd-mm-yyyy" <?php if ($system['dateformat'] == 'dd-mm-yyyy') : ?> selected <?php endif ?>>dd-mm-yyyy</option> <option value="yyyy-mm-dd" <?php if ($system['dateformat'] == 'yyyy-mm-dd') : ?> selected <?php endif ?>>yyyy-mm-dd</option> </select> </div> <div class="form-group col-md-6"> <label for="timeformat" class="form-control-label">Time format</label> <select class="form-control" name="timeformat"> <option value="12" <?php if ($system['timeformat'] == '12') : ?> selected <?php endif ?>>12 hour (00:00 AM/PM)</option> <option value="24" <?php if ($system['timeformat'] == '24') : ?> selected <?php endif ?>>24 hour (24:00)</option> </select> </div> <div class="form-group col-md-12"> <label class="form-control-label">IP Restriction</label> <textarea class="form-control" name="iprestriction" rows="3" placeholder="Enter IP addresses, if more than one add comma after each IP address"><?= $system['iprestriction'] ?></textarea> </div> <div class="form-group"> <input type="hidden" name="id" value="1"> <button class="btn btn-primary" id="savesystem" type="submit"><i class="fa fa-paper-plane" aria-hidden="true"></i> Submit</button> </div> </div> </form> </div> <div class="card p-3 my-3"> <form action="<?= site_url('settings-update-email'); ?>" method="POST" accept-charset="UTF-8" onsubmit="saveEmail.disabled = true; return true;"> <?= csrf_field() ?> <div class="form-row"> <div class="form-group col-md-12"> <h6 class="pb-2 mb-0 mt-4">Email</h6> <p class="text-muted">Email SMTP settings, notifications and others related to email.</p> </div> <div class="form-group col-md-6"> <label for="fromname" class="form-control-label">Sender's Name</label> <input type="text" name="fromname" class="form-control" value="<?= $email['fromname'] ?>"> </div> <div class="form-group col-md-6"> <label for="fromemail" class="form-control-label">Sender's Email</label> <input type="text" name="fromemail" class="form-control" value="<?= $email['fromemail'] ?>"> </div> <div class="form-group col-md-4"> <label for="protocol" class="form-control-label">Protocol</label> <select name="protocol" class="form-control"> <option value="">Select Protocol</option> <option value="smtp" <?php if ($email['protocol'] == 'smtp') : ?> selected <?php endif ?>>SMTP</option> <option value="sendmail" <?php if ($email['protocol'] == 'sendmail') : ?> selected <?php endif ?>>Sendmail</option> <option value="phpmailer" <?php if ($email['protocol'] == 'phpmailer') : ?> selected <?php endif ?>>PHP Mailer</option> </select> </div> <div class="form-group col-md-4"> <label for="host" class="form-control-label">SMTP Host</label> <input type="text" name="host" class="form-control" value="<?= $email['host'] ?>"> </div> <div class="form-group col-md-4"> <label for="username" class="form-control-label">SMTP Username</label> <input type="text" name="username" class="form-control" value="<?= $email['username'] ?>"> </div> <div class="form-group col-md-4"> <label for="security" class="form-control-label">SMTP Security</label> <select name="security" class="form-control"> <option value="">Select SMTP Security</option> <option value="tls" <?php if ($email['security'] == 'tls') : ?> selected <?php endif ?>>TLS</option> <option value="ssl" <?php if ($email['security'] == 'ssl') : ?> selected <?php endif ?>>SSL</option> <option value="none" <?php if ($email['security'] == 'none') : ?> selected <?php endif ?>>None</option> </select> </div> <div class="form-group col-md-4"> <label for="port" class="form-control-label">SMTP Port</label> <input type="text" name="port" class="form-control" value="<?= $email['port'] ?>"> </div> <div class="form-group col-md-4"> <label for="password" class="form-control-label">SMTP Password</label> <input type="password" name="password" class="form-control"> </div> <div class="form-group"> <input type="hidden" name="id" value="1"> <button class="btn btn-primary" id="saveEmail" type="submit"><i class="fa fa-paper-plane" aria-hidden="true"></i> Submit</button> </div> </div> </form> </div> <?= $this->endSection() ?> |
v- starter.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content=""> <meta name="author" content=""> <meta name="generator" content=""> <title>User Management Module | TechArise</title> <link rel="stylesheet" href="<?= base_url('vendor/fontawesome/css/fontawesome.min.css'); ?>"> <link rel="stylesheet" href="<?= base_url('vendor/fontawesome/css/solid.min.css'); ?>"> <link rel="stylesheet" href="<?= base_url('vendor/fontawesome/css/brands.min.css'); ?>"> <link rel="stylesheet" href="<?= base_url('vendor/bootstrap/css/bootstrap.min.css'); ?>"> <link rel="stylesheet" href="<?= base_url('css/starter-template.css'); ?>"> <link rel="stylesheet" href="<?= base_url('css/style.css'); ?>"> </head> <body> <!-- main navigation --> <?= view('App\Views\auth\components\navbar') ?> <main role="main" class=""> <div class="jumbotron bg-light"> <div class="container heroe"> <h1 class="font-weight-normal text-center">Welcome <span class="text-capitalize"><?= $userData['name'] ?></span>!</h1> <h2 class="mt-4 font-weight-light text-center">You are logged in.</h2> </div> </div> </main> <footer class="footer-f"> <div class="copyrights"> <p class="mb-2 mt-2"> Copyright © 2011 - <?= date('Y') ?> TECHARISE.COM All rights reserved.</p> </div> </footer> <script src="<?= base_url("vendor/jquery/jquery.min.js") ?>" type="text/javascript"></script> <script src="<?= base_url("vendor/bootstrap/js/bootstrap.bundle.min.js") ?>" type="text/javascript"></script> </body> </html> |
vi- user-logs.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
<!-- load main layout with datatable --> <?= $this->extend('auth/layouts/default-table') ?> <!-- load main content --> <?= $this->section('main') ?> <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-3"> <h1 class="h2">Login Logs</h1> </div> <div class="card p-3"> <div class="table-responsive"> <table width="100%" class="table table-hover" id="dataTables-table" data-order='[[ 0, "desc" ]]'> <thead> <tr> <th>Date</th> <th>Time</th> <th>Name</th> <th>IP Address</th> <!-- <th>Location</th> --> <th>Browser</th> <th>Status</th> </tr> </thead> <tbody> <?php foreach ($data as $log) : ?> <tr> <td><?= $log['date'] ?></td> <td><?= $log['time'] ?></td> <td><?= $log['name'] ?></td> <td><?= $log['ip'] ?></td> <!-- <td>Philippines</td> --> <td><?= $log['browser'] ?></td> <td><?= $log['status'] ?></td> </tr> <?php endforeach; ?> </tbody> </table> </div> </div> <?= $this->endSection() ?> |
vii- users.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
<!-- load main layout with datatable --> <?= $this->extend('auth/layouts/default-table') ?> <!-- load modals --> <?= $this->section('modals') ?> <!-- create user modal form --> <?= view('App\Views\auth\modals\add-user') ?> <?= $this->endSection() ?> <!-- load main content --> <?= $this->section('main') ?> <div class="row"> <div class="col-sm-4"> <div class="card mt-3"> <div class="card-body"> <h5 class="card-title"><i class="fa fa-users" aria-hidden="true"></i> Total Users</h5> <h3 class="card-text"><?= $usercount ?></h3> </div> </div> </div> <div class="col-sm-4"> <div class="card mt-3"> <div class="card-body"> <h5 class="card-title"><i class="fa fa-user-plus" aria-hidden="true"></i> New Users</h5> <h3 class="card-text"><?= $newusers ?> <span class="text-small text-muted">(in last 30 days)</span></h3> </div> </div> </div> <div class="col-sm-4"> <div class="card mt-3"> <div class="card-body"> <h5 class="card-title"><i class="fa fa-users" aria-hidden="true"></i> Active Users</h5> <h3 class="card-text"><?= $percentofactiveusers ?>%</h3> </div> </div> </div> </div> <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-3"> <h1 class="h2">Users</h1> <div class="btn-toolbar mb-2 mb-md-0"> <button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#createuserformmodal"><i class="fas fa-user-plus"></i> Create User</button> </div> </div> <div class="card p-3"> <div class="table-responsive"> <table width="100%" class="table table-hover" id="dataTables-table" data-order='[[ 0, "asc" ]]'> <thead> <tr> <th>ID</th> <th>Name</th> <th>Email</th> <th>Status</th> <th></th> </tr> </thead> <tbody> <?php foreach ($data as $item) : ?> <tr> <td><?= $item['id'] ?></td> <td><?= $item['name'] ?></td> <td><?= $item['email'] ?></td> <td> <?php if ($item['active'] == 1) : ?> Active <?php else : ?> Disabled <?php endif ?> </td> <td class="text-right"> <?php if ($item['active'] == 0) : ?> <a class="btn btn-outline-secondary btn-sm" href="<?= site_url('users/enable/') . $item['id'] ?>"><i class="fas fa-user-check"></i> Enable</a> <?php endif ?> <a class="btn btn-outline-secondary btn-sm" href="<?= site_url('users/edit/') . $item['id'] ?>"><i class="fas fa-edit"></i> Edit</a> <a class="btn btn-outline-secondary btn-sm" href="<?= site_url('users/delete/') . $item['id'] ?>"><i class="fas fa-trash"></i> Delete</a> </td> </tr> <?php endforeach; ?> </tbody> </table> </div> </div> <?= $this->endSection() ?> |
Step 10: Run Application
1 |
php spark serve |
1 |
http://localhost:8080/ |
Conclusion
We learned how to create authentication and user management system features in the Codeigniter 4 Application.
However, this was just the beginning of the Codeigniter authentication and user management system example. You can extend and more components if required in the Codeigniter 4 Application