Introduction

URL: bok.itserver.biz
Tech Stack: CodeIgniter, PHP, SQL Server
Type: Banking application

BOK is an account registration application for Bank of Khartoum, it allows users to sign up, and agents to view and approve/reject their applications. After an application is approved, it is synced to the “staging server”.

Signup Form

The signup form has ten steps. All ten steps are defined below in the following document:

Admin Dashboard

Admin dashboard will allow agents (admins) to review the signup applications. The admin can accept or reject the applications. Once an application is opened by the admin, it will be locked to that admin for 24 hours, appear on top of other applications and a “continue review” caption will appear on it.

Customer Dashboard

User can log in using OTP and visit their dashboard. The dashboard has the option to view the form and edit it (if the application is rejected). After editing the form, they can resubmit the application for review.

Daily Support

Mr. Hamad and Ms. Habab (from BOK management team) are responsible for support, you may be asked to provide the following kinds of support:

Sync Application

  1. Get the National ID of the application
  2. Run the following query to ensure that the “AgentStatus” is set to “Accepted BY PB”:
SELECT
uf.AgentStatus,
bu.SyncDate,
FROM Bank_User bu
LEFT JOIN User_Form uf ON uf.User_id = bu.id
WHERE bu.NationalId IN ('<Enter the National ID>')
  • Run the following query to sync the application:
EXEC SyncAccounts '<Enter the National ID>'

Example:

For example, if you are asked to sync “123456789” NID, you will run the first query to make sure “Agent Status” is “Accepted By PB”

Then you will run the actual sync query:

EXEC SyncAccounts '123456789'

Activate users

You will be given the emails of users to activate. The activation is done by refreshing each with a new password.

  1. Make sure Python is installed on your user
  2. Open “E:\Faheem\processing\reset_password” folder in vs code.
  3. Add the usernames in “activate_users.csv”
  1. PB_Super_Admin will be updated with a random password, PB_Super_Admin_2 will be updated with the password we mentioned as parameter 2.
  2. Run “python activate_users.py”
  3. New user/passwords will be generated in updated-users.csv, while the SQL to create update these users will be generated in activate-users.sql
  4. Share the CSV file over email, and run the SQL on BOK’s SQL Server.

__ Function

__ (double underscore) is a global function defined to help you easily display data for both languages. Here is how it works:
1. Define your content
In locales.php, add your content to $_TEXT_RESOURCES array:

$_TEXT_RESOURCES = [
  'ResourceId' => ['text in English', 'Text in Arabic'],
];

2. Use it in your view/controller:

$result = __('@ResourceId'); // 'text in English' or Arabic according to selected language.

Lazy Loading

You can also pass a function instead of an array to implement lazy loading. The function will call the function and cache the result.

'LazyLoad' => function () {
   return ['text in English', 'text in Arabic'],
}

Resource Grouping

You can also use nested arrays to group related resources together, and use dot notation to access them.

'Group1' => [
   'Resource' => ['text in English', 'text in Arabic'],
]

Accessing this resource:

$result = __('@Group1.Resource');

Using Arrays as resources

You can also use arrays as resources, this could simplify using the English or Arabic version of dropdowns.

'ResourceList' => [
  '1' => ['English', 'Arabic'],
  '2' => ['English 2', 'Arabic 2'],
];

Assuming English is selected, accessing ResourceList will return the following array:

$result = __('@ResourceList');

[
  '1' => 'English',
  '2' => 'English 2'
]

This could be combined with callbacks to load values from the database:

'CountryCodes' => 
function getCountryCodes() {
    $db = $GLOBALS['CI_INSTANCE']->db;
    $data = $db->select('*')->from('Countries')->get()->result_array();

    // The following call will craft the array:
    return array_combine(array_column($data, 'id'), array_map(function ($arr) {
        return [$arr['english'], $arr['arabic']];
    }, $data));
}

A complete example to create a dropdown with country codes as values or (English/Arabic) names as display text:
locales.php

'CountryCodes' => 
function getCountryCodes() {
    $db = $GLOBALS['CI_INSTANCE']->db;
    $data = $db->select('*')->from('Countries')->get()->result_array();

    // The following call will craft the array:
    return array_combine(array_column($data, 'id'), array_map(function ($arr) {
        return [$arr['english'], $arr['arabic']];
    }, $data));
}

view.php

<select name="countryCodes" class="select-dropdown" style="width: 100%;">
    <?php
    foreach (__('@CountryCodes') as $countryCode => $label) { ?>
        <option value="<?= $countryCode; ?>" <?= $countryCode == set_value('countryCodes') ? 'selected' : '' ?>><?= $label; ?></option>
    <?php } ?>
</select>

Leave a Reply

Your email address will not be published. Required fields are marked *