Compare commits

...

10 Commits

Author SHA1 Message Date
root 15f0bca70c fix getNetworkHyper 2025-05-08 01:17:33 +01:00
espoir e0c289b867 simple commit before to switch on the master branch 2024-12-06 13:42:01 +00:00
Djery-Tom b07c36f55f feat: add commission config in hypervisor dashboard 2023-07-27 15:49:58 +01:00
Djery-Tom ca208a0daf feat: add config of "User - Retrait de carte vers autre wallet" in hypervisor wallet dashboard and aggregator rate config in admin dashboard 2023-07-13 09:34:23 +01:00
Djery-Tom c3c26f4852 - Upgrade to php8.0
- Enable recharge account in Nano Santé hypervisor
2023-06-07 20:53:49 +01:00
Djery-Tom cd821e567b Fix document fopen in modal 2023-03-16 11:05:49 +01:00
Djery-Tom d909e2f291 Fix bug while fetch admin campaign menu 2023-03-16 10:52:22 +01:00
Djery-Tom 322160a631 Add payment_period_days to customers openings accounts configuration 2022-12-19 17:03:39 +01:00
Djery-Tom 9384d0842f Implementation of customer account opening requests 2022-11-25 23:57:49 +01:00
Djery-Tom 103ca3ec2e Add payment aggregators settings to admin panel 2022-10-08 23:35:03 +01:00
2487 changed files with 7756 additions and 324 deletions

0
Doxyfile Normal file → Executable file
View File

View File

@ -0,0 +1,525 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
| WARNING: You MUST set this value!
|
| If it is not set, then CodeIgniter will try guess the protocol and path
| your installation, but due to security concerns the hostname will be set
| to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise.
| The auto-detection mechanism exists only for convenience during
| development and MUST NOT be used in production!
|
| If you need to allow multiple domains, remember that this file is still
| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = 'https://'.$_SERVER['SERVER_NAME'].'/backoffice/';
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = '';
/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string. The default setting of 'REQUEST_URI' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
| 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
| 'PATH_INFO' Uses $_SERVER['PATH_INFO']
|
| WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
*/
$config['uri_protocol'] = 'REQUEST_URI';
/*
|--------------------------------------------------------------------------
| URL suffix
|--------------------------------------------------------------------------
|
| This option allows you to add a suffix to all URLs generated by CodeIgniter.
| For more information please see the user guide:
|
| https://codeigniter.com/user_guide/general/urls.html
*/
$config['url_suffix'] = '';
/*
|--------------------------------------------------------------------------
| Default Language
|--------------------------------------------------------------------------
|
| This determines which set of language files should be used. Make sure
| there is an available translation if you intend to use something other
| than english.
|
*/
$config['language'] = 'english';
/*
|--------------------------------------------------------------------------
| Default Character Set
|--------------------------------------------------------------------------
|
| This determines which character set is used by default in various methods
| that require a character set to be provided.
|
| See http://php.net/htmlspecialchars for a list of supported charsets.
|
*/
$config['charset'] = 'UTF-8';
/*
|--------------------------------------------------------------------------
| Enable/Disable System Hooks
|--------------------------------------------------------------------------
|
| If you would like to use the 'hooks' feature you must enable it by
| setting this variable to TRUE (boolean). See the user guide for details.
|
*/
$config['enable_hooks'] = TRUE;
/*
|--------------------------------------------------------------------------
| Class Extension Prefix
|--------------------------------------------------------------------------
|
| This item allows you to set the filename/classname prefix when extending
| native libraries. For more information please see the user guide:
|
| https://codeigniter.com/user_guide/general/core_classes.html
| https://codeigniter.com/user_guide/general/creating_libraries.html
|
*/
$config['subclass_prefix'] = 'MY_';
/*
|--------------------------------------------------------------------------
| Composer auto-loading
|--------------------------------------------------------------------------
|
| Enabling this setting will tell CodeIgniter to look for a Composer
| package auto-loader script in application/vendor/autoload.php.
|
| $config['composer_autoload'] = TRUE;
|
| Or if you have your vendor/ directory located somewhere else, you
| can opt to set a specific path as well:
|
| $config['composer_autoload'] = '/path/to/vendor/autoload.php';
|
| For more information about Composer, please visit http://getcomposer.org/
|
| Note: This will NOT disable or override the CodeIgniter-specific
| autoloading (application/config/autoload.php)
*/
$config['composer_autoload'] = FCPATH.'vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify which characters are permitted within your URLs.
| When someone tries to submit a URL with disallowed characters they will
| get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
| The configured value is actually a regular expression character group
| and it will be executed as: ! preg_match('/^[<permitted_uri_chars>]+$/i
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
/*
|--------------------------------------------------------------------------
| Enable Query Strings
|--------------------------------------------------------------------------
|
| By default CodeIgniter uses search-engine friendly segment based URLs:
| example.com/who/what/where/
|
| You can optionally enable standard query string based URLs:
| example.com?who=me&what=something&where=here
|
| Options are: TRUE or FALSE (boolean)
|
| The other items let you set the query string 'words' that will
| invoke your controllers and its functions:
| example.com/index.php?c=controller&m=function
|
| Please note that some of the helpers won't work as expected when
| this feature is enabled, since CodeIgniter is designed primarily to
| use segment based URLs.
|
*/
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd';
/*
|--------------------------------------------------------------------------
| Allow $_GET array
|--------------------------------------------------------------------------
|
| By default CodeIgniter enables access to the $_GET array. If for some
| reason you would like to disable it, set 'allow_get_array' to FALSE.
|
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['allow_get_array'] = TRUE;
/*
|--------------------------------------------------------------------------
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
| 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors)
| 2 = Debug Messages
| 3 = Informational Messages
| 4 = All Messages
|
| You can also pass an array with threshold levels to show individual error types
|
| array(2) = Debug Messages, without Error Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 0;
/*
|--------------------------------------------------------------------------
| Error Logging Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/logs/ directory. Use a full server path with trailing slash.
|
*/
$config['log_path'] = '';
/*
|--------------------------------------------------------------------------
| Log File Extension
|--------------------------------------------------------------------------
|
| The default filename extension for log files. The default 'php' allows for
| protecting the log files via basic scripting, when they are to be stored
| under a publicly accessible directory.
|
| Note: Leaving it blank will default to 'php'.
|
*/
$config['log_file_extension'] = '';
/*
|--------------------------------------------------------------------------
| Log File Permissions
|--------------------------------------------------------------------------
|
| The file system permissions to be applied on newly created log files.
|
| IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal
| integer notation (i.e. 0700, 0644, etc.)
*/
$config['log_file_permissions'] = 0644;
/*
|--------------------------------------------------------------------------
| Date Format for Logs
|--------------------------------------------------------------------------
|
| Each item that is logged has an associated date. You can use PHP date
| codes to set your own date formatting
|
*/
$config['log_date_format'] = 'Y-m-d H:i:s';
/*
|--------------------------------------------------------------------------
| Error Views Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/views/errors/ directory. Use a full server path with trailing slash.
|
*/
$config['error_views_path'] = '';
/*
|--------------------------------------------------------------------------
| Cache Directory Path
|--------------------------------------------------------------------------
|
| Leave this BLANK unless you would like to set something other than the default
| application/cache/ directory. Use a full server path with trailing slash.
|
*/
$config['cache_path'] = '';
/*
|--------------------------------------------------------------------------
| Cache Include Query String
|--------------------------------------------------------------------------
|
| Whether to take the URL query string into consideration when generating
| output cache files. Valid options are:
|
| FALSE = Disabled
| TRUE = Enabled, take all query parameters into account.
| Please be aware that this may result in numerous cache
| files generated for the same page over and over again.
| array('q') = Enabled, but only take into account the specified list
| of query parameters.
|
*/
$config['cache_query_string'] = FALSE;
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| If you use the Encryption class, you must set an encryption key.
| See the user guide for more info.
|
| https://codeigniter.com/user_guide/libraries/encryption.html
|
*/
$config['encryption_key'] = '';
/*
|--------------------------------------------------------------------------
| Session Variables
|--------------------------------------------------------------------------
|
| 'sess_driver'
|
| The storage driver to use: files, database, redis, memcached
|
| 'sess_cookie_name'
|
| The session cookie name, must contain only [0-9a-z_-] characters
|
| 'sess_expiration'
|
| The number of SECONDS you want the session to last.
| Setting to 0 (zero) means expire when the browser is closed.
|
| 'sess_save_path'
|
| The location to save sessions to, driver dependent.
|
| For the 'files' driver, it's a path to a writable directory.
| WARNING: Only absolute paths are supported!
|
| For the 'database' driver, it's a table name.
| Please read up the manual for the format with other session drivers.
|
| IMPORTANT: You are REQUIRED to set a valid save path!
|
| 'sess_match_ip'
|
| Whether to match the user's IP address when reading the session data.
|
| WARNING: If you're using the database driver, don't forget to update
| your session table's PRIMARY KEY when changing this setting.
|
| 'sess_time_to_update'
|
| How many seconds between CI regenerating the session ID.
|
| 'sess_regenerate_destroy'
|
| Whether to destroy session data associated with the old session ID
| when auto-regenerating the session ID. When set to FALSE, the data
| will be later deleted by the garbage collector.
|
| Other session cookie settings are shared with the rest of the application,
| except for 'cookie_prefix' and 'cookie_httponly', which are ignored here.
|
*/
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
/*
|--------------------------------------------------------------------------
| Cookie Related Variables
|--------------------------------------------------------------------------
|
| 'cookie_prefix' = Set a cookie name prefix if you need to avoid collisions
| 'cookie_domain' = Set to .your-domain.com for site-wide cookies
| 'cookie_path' = Typically will be a forward slash
| 'cookie_secure' = Cookie will only be set if a secure HTTPS connection exists.
| 'cookie_httponly' = Cookie will only be accessible via HTTP(S) (no javascript)
|
| Note: These settings (with the exception of 'cookie_prefix' and
| 'cookie_httponly') will also affect sessions.
|
*/
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
/*
|--------------------------------------------------------------------------
| Standardize newlines
|--------------------------------------------------------------------------
|
| Determines whether to standardize newline characters in input data,
| meaning to replace \r\n, \r, \n occurrences with the PHP_EOL value.
|
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['standardize_newlines'] = FALSE;
/*
|--------------------------------------------------------------------------
| Global XSS Filtering
|--------------------------------------------------------------------------
|
| Determines whether the XSS filter is always active when GET, POST or
| COOKIE data is encountered
|
| WARNING: This feature is DEPRECATED and currently available only
| for backwards compatibility purposes!
|
*/
$config['global_xss_filtering'] = FALSE;
/*
|--------------------------------------------------------------------------
| Cross Site Request Forgery
|--------------------------------------------------------------------------
| Enables a CSRF cookie token to be set. When set to TRUE, token will be
| checked on a submitted form. If you are accepting user data, it is strongly
| recommended CSRF protection be enabled.
|
| 'csrf_token_name' = The token name
| 'csrf_cookie_name' = The cookie name
| 'csrf_expire' = The number in seconds the token should expire.
| 'csrf_regenerate' = Regenerate token on every submission
| 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks
*/
$config['csrf_protection'] = FALSE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
$config['csrf_regenerate'] = TRUE;
$config['csrf_exclude_uris'] = array();
/*
|--------------------------------------------------------------------------
| Output Compression
|--------------------------------------------------------------------------
|
| Enables Gzip output compression for faster page loads. When enabled,
| the output class will test whether your server supports Gzip.
| Even if it does, however, not all browsers support compression
| so enable only if you are reasonably sure your visitors can handle it.
|
| Only used if zlib.output_compression is turned off in your php.ini.
| Please do not use it together with httpd-level output compression.
|
| VERY IMPORTANT: If you are getting a blank page when compression is enabled it
| means you are prematurely outputting something to your browser. It could
| even be a line of whitespace at the end of one of your scripts. For
| compression to work, nothing can be sent before the output buffer is called
| by the output class. Do not 'echo' any values with compression enabled.
|
*/
$config['compress_output'] = FALSE;
/*
|--------------------------------------------------------------------------
| Master Time Reference
|--------------------------------------------------------------------------
|
| Options are 'local' or any PHP supported timezone. This preference tells
| the system whether to use your server's local time as the master 'now'
| reference, or convert it to the configured one timezone. See the 'date
| helper' page of the user guide for information regarding date handling.
|
*/
$config['time_reference'] = 'local';
/*
|--------------------------------------------------------------------------
| Rewrite PHP Short Tags
|--------------------------------------------------------------------------
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files. Options are TRUE or FALSE (boolean)
|
| Note: You need to have eval() enabled for this to work.
|
*/
$config['rewrite_short_tags'] = FALSE;
/*
|--------------------------------------------------------------------------
| Reverse Proxy IPs
|--------------------------------------------------------------------------
|
| If your server is behind a reverse proxy, you must whitelist the proxy
| IP addresses from which CodeIgniter should trust headers such as
| HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify
| the visitor's IP address.
|
| You can use both an array or a comma-separated list of proxy addresses,
| as well as specifying whole subnets. Here are a few examples:
|
| Comma-separated: '10.0.1.200,192.168.5.0/24'
| Array: array('10.0.1.200', '192.168.5.0/24')
*/
$config['proxy_ips'] = '';

View File

@ -87,11 +87,13 @@ defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest auto
/*
* Microservices constants
*/
define('WALLET_SERVICE_URL','https://ilink-app.com:8081');
define('WALLET_SERVICE_URL','https://test.ilink-app.com:8081');
define('WALLET_SERVICE_TOKEN','fywRtXSwEhHncwXaqn10wa9bJU9a63r2');
define('WALLET_SERVICE_EXTERNE_URL','https://ilink-app.com:8085');
define('WALLET_SERVICE_EXTERNE_URL','https://test.ilink-app.com:8085');
define('WALLET_SERVICE_EXTERNE_TOKEN','JeJMx6KNW1qo2h01rCVOLfX3f1nmcF2I');
define('NOTIFICATION_SERVICE_URL','https://ilink-app.com:8083');
define('NOTIFICATION_SERVICE_URL','https://test.ilink-app.com:8083');
define('NOTIFICATION_SERVICE_TOKEN','RfXvPQzQRgwpzQYPnLfWpZzgx4QseHlg');
define('NANO_SANTE_SERVICE_URL','https://ilink-app.com:8086');
define('NANO_SANTE_SERVICE_URL','https://test.ilink-app.com:8086');
define('NANO_SANTE_SERVICE_TOKEN','eStSQIoAfnTJ9nkCs0IJkJiKACxYVcQm');
define('USER_SERVICE_URL','https://test.ilink-app.com:8088');
define('USER_SERVICE_TOKEN','T3J0c9lQXPBs6UWebvPWWdnzqmqWOQM6');

View File

@ -1,5 +1,4 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
@ -78,7 +77,7 @@ $db['default'] = array(
'hostname' => 'localhost',
'username' => 'root',
'password' => 'vps@2017GA',
'database' => 'iLink_prod',
'database' => 'iLink_preprod',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,

View File

@ -0,0 +1,99 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the 'Database Connection'
| page of the User Guide.
|
| -------------------------------------------------------------------
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
| ['dsn'] The full DSN string describe a connection to the database.
| ['hostname'] The hostname of your database server.
| ['username'] The username used to connect to the database
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database driver. e.g.: mysqli.
| Currently supported:
| cubrid, ibase, mssql, mysql, mysqli, oci8,
| odbc, pdo, postgre, sqlite, sqlite3, sqlsrv
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Query Builder class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
| ['cachedir'] The path to the folder where cache files should be stored
| ['char_set'] The character set used in communicating with the database
| ['dbcollat'] The character collation used in communicating with the database
| NOTE: For MySQL and MySQLi databases, this setting is only used
| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
| (and in table creation queries made with DB Forge).
| There is an incompatibility in PHP with mysql_real_escape_string() which
| can make your site vulnerable to SQL injection if you are using a
| multi-byte character set and are running versions lower than these.
| Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
| ['encrypt'] Whether or not to use an encrypted connection.
|
| 'mysql' (deprecated), 'sqlsrv' and 'pdo/sqlsrv' drivers accept TRUE/FALSE
| 'mysqli' and 'pdo/mysql' drivers accept an array with the following options:
|
| 'ssl_key' - Path to the private key file
| 'ssl_cert' - Path to the public key certificate file
| 'ssl_ca' - Path to the certificate authority file
| 'ssl_capath' - Path to a directory containing trusted CA certificats in PEM format
| 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':')
| 'ssl_verify' - TRUE/FALSE; Whether verify the server certificate or not ('mysqli' only)
|
| ['compress'] Whether or not to use client compression (MySQL only)
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
| - good for ensuring strict SQL while developing
| ['ssl_options'] Used to set various SSL options that can be used when making SSL connections.
| ['failover'] array - A array with 0 or more data for connections if the main should fail.
| ['save_queries'] TRUE/FALSE - Whether to "save" all executed queries.
| NOTE: Disabling this will also effectively disable both
| $this->db->last_query() and profiling of DB queries.
| When you run a query, with this setting set to TRUE (default),
| CodeIgniter will store the SQL statement for debugging purposes.
| However, this may cause high memory usage, especially if you run
| a lot of SQL queries ... disable this to avoid that problem.
|
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
|
| The $query_builder variables lets you determine whether or not to load
| the query builder class.
*/
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => 'vps@2017GA',
'database' => 'iLink_preprod',
'wallet_service_url' => 'https://test.ilink-app.com:8081',
'wallet_service_externe_url' => 'https://test.ilink-app.com:8085',
'notification_service_url' => 'http://test.ilink-app.com:8083',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);

View File

@ -144,9 +144,9 @@ class Admin_dash extends CI_Controller
$agent_id = $this->session->userdata('current_hyper_id');
$taux = $data['hasWallet']->first_row();
$taux = $data['hasWallet'];
$data['idConfig'] = $taux->id;
if ($data['hasWallet']->first_row()->type == 'visa') {
if ($data['hasWallet']?->type == 'visa') {
$data['taux_client_r'] = $taux->taux_com_client_retrait;
$data['taux_client_d'] = $taux->taux_com_client_depot;
$data['taux_ag_r'] = $taux->taux_com_ag_retrait;
@ -179,7 +179,7 @@ class Admin_dash extends CI_Controller
}
$data["totalCommissionBanque"] = Money::of(round($totalCommissionBanque,2), $this->session->userdata('currency_code'), $context )->formatTo('fr_FR');
} elseif ($data['hasWallet']->first_row()->type == 'ilink') {
} elseif ($data['hasWallet']?->type == 'ilink') {
$transactions = $this->wallet_model->getNetworkIlinTransactions($id_network);
$data["transactions"] = array();
@ -226,9 +226,9 @@ class Admin_dash extends CI_Controller
$data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('current_hyper_member_code'));
$data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network);
$this->load->view('header', $data);
if ($data['hasWallet']->first_row()->type == 'visa')
if ($data['hasWallet']?->type == 'visa')
$this->load->view('gestion_wallet_hyp');
elseif ($data['hasWallet']->first_row()->type == 'ilink')
elseif ($data['hasWallet']?->type == 'ilink')
$this->load->view('gestion_wallet_ilink_hyp');
$this->load->view('footer');
}
@ -347,7 +347,7 @@ class Admin_dash extends CI_Controller
$data['currency_code'] = $this->session->userdata('currency_code');
$data['category'] = $this->session->userdata('category');
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
$data['network_id'] = $this->session->userdata('current_network_id');
if (isset($country)) {
$data['country_id'] = $country;
@ -395,7 +395,7 @@ class Admin_dash extends CI_Controller
$data['countries'][] = $country;
}
}
$taux = $data['hasWallet']->first_row();
$taux = $data['hasWallet'];
switch($config){
case 'paying_networks':
$this->load->view('header', $data);
@ -519,7 +519,7 @@ class Admin_dash extends CI_Controller
$data['currency_code'] = $this->session->userdata('currency_code');
$data['category'] = $this->session->userdata('category');
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
$res = $this->wallet_model->getWalletPassword($this->session->userdata('current_network_id'));
$data['walletPassword'] = $res ? $res->first_row() : null;
$data['networks'] = $this->wallet_model->getPayingNetworksByConfigWallet($data['idConfig']);
@ -562,7 +562,7 @@ class Admin_dash extends CI_Controller
} else {
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
$data['groups'] = $this->nano_credit_model->getUsersGroups($this->session->userdata('current_network_id'));
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
$data['rates'] = $this->nano_credit_model->getNanoCreditRates($data['idConfig']);
$data['taxes'] = $this->wallet_model->getTaxes($data['idConfig'], 'nano_credit');
$data['active'] = "nano_credit";
@ -578,7 +578,7 @@ class Admin_dash extends CI_Controller
$data['network_id'] = $this->session->userdata('current_network_id');
$data['country'] = $this->session->userdata('name_current_pays');
$data['currency_code'] = $this->session->userdata('currency_code');
$data['configWallet'] = $data['hasWallet']->first_row();
$data['configWallet'] = $data['hasWallet'];
$this->load->view('header', $data);
$this->load->view('nano_credit/gestion_nano_credit_hyp');
@ -606,10 +606,10 @@ class Admin_dash extends CI_Controller
$data['currency_code'] = $this->session->userdata('currency_code');
$data['category'] = $this->session->userdata('category');
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
switch ($config) {
case 'nano_credit':
$taux = $data['hasWallet']->first_row();
$taux = $data['hasWallet'];
$data['taux_ag_nano_credit'] = $taux->taux_com_ag_nano_credit;
$data['taux_sup_nano_credit'] = $taux->taux_com_sup_nano_credit;
$data['taux_hyp_nano_credit'] = $taux->taux_com_hyp_nano_credit;

View File

@ -1445,15 +1445,21 @@ class Gestion extends CI_Controller
}
$hyper = $this->wallet_model->getNetworkHyper($network_id)->first_row();
$data['walletHyper'] = $this->wallet_model->getWallet($hyper->agent_id);
$hyper = $this->wallet_model->getNetworkHyper($network_id);
if($hyper !== true && $hyper){
$hyper = $hyper->first_row();
$data['walletHyper'] = $this->wallet_model->getWallet($hyper->agent_id);
}else{
$data['walletHyper'] = null;
}
$data['network_id'] = $network_id;
$networkDetails = $this->user_model->getNetworkDetails($network_id);
if ($networkDetails) {
$data['network'] = $networkDetails->first_row()->network;
$data['country'] = $networkDetails->first_row()->country;
}
// $data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($network_id);
//$data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($network_id);
$data['active'] = "wallet";
$data['alert'] = "";
$data['game_pays'] = $this->user_model->getGameCountry();
@ -1572,24 +1578,34 @@ class Gestion extends CI_Controller
$this->insertPalier($plr_user_wallet_cash_national, "user_wallet_cash_national", $idConfig);
break;
case 'user_carte_wallet':
// $plr_user_cart_wallet_international = $_POST['plr_user_cart_wallet_international'] ?? null;
$plr_user_cart_wallet_international = $_POST['plr_user_cart_wallet_international'] ?? null;
$plr_user_cart_wallet_national = $_POST['plr_user_cart_wallet_national'] ?? null;
// $plr_user_cart_cash_international = $_POST['plr_user_cart_cash_international'] ?? null;
$plr_user_cart_cash_international = $_POST['plr_user_cart_cash_international'] ?? null;
$plr_user_cart_cash_national = $_POST['plr_user_cart_cash_national'] ?? null;
// $plr_hyp_user_cart_cash_international = $_POST['plr_hyp_user_cart_cash_international'] ?? null;
$plr_hyp_user_cart_cash_international = $_POST['plr_hyp_user_cart_cash_international'] ?? null;
$plr_hyp_user_cart_cash_national = $_POST['plr_hyp_user_cart_cash_national'] ?? null;
// $plr_bank_user_cart_cash_international = $_POST['plr_bank_user_cart_cash_international'] ?? null;
$plr_bank_user_cart_cash_international = $_POST['plr_bank_user_cart_cash_international'] ?? null;
$plr_bank_user_cart_cash_national = $_POST['plr_bank_user_cart_cash_national'] ?? null;
// $this->insertPalier($plr_user_cart_wallet_international, "user_cart_wallet_international", $idConfig,'paliers_commissions_wallet');
$this->insertPalier($plr_user_cart_wallet_international, "user_cart_wallet_international", $idConfig,'paliers_commissions_wallet');
$this->insertPalier($plr_user_cart_wallet_national, "user_cart_wallet_national", $idConfig ,'paliers_commissions_wallet');
// $this->insertPalier($plr_user_cart_cash_international, "user_cart_cash_international", $idConfig,'paliers_commissions_wallet');
$this->insertPalier($plr_user_cart_cash_international, "user_cart_cash_international", $idConfig,'paliers_commissions_wallet');
$this->insertPalier($plr_user_cart_cash_national, "user_cart_cash_national", $idConfig,'paliers_commissions_wallet');
// $this->insertPalier($plr_hyp_user_cart_cash_international, "hyp_user_cart_cash_international", $idConfig ,'paliers_commissions_wallet');
$this->insertPalier($plr_hyp_user_cart_cash_international, "hyp_user_cart_cash_international", $idConfig ,'paliers_commissions_wallet');
$this->insertPalier($plr_hyp_user_cart_cash_national, "hyp_user_cart_cash_national", $idConfig,'paliers_commissions_wallet');
// $this->insertPalier($plr_bank_user_cart_cash_international, "bank_user_cart_cash_international", $idConfig ,'paliers_commissions_wallet');
$this->insertPalier($plr_bank_user_cart_cash_international, "bank_user_cart_cash_international", $idConfig ,'paliers_commissions_wallet');
$this->insertPalier($plr_bank_user_cart_cash_national, "bank_user_cart_cash_national", $idConfig,'paliers_commissions_wallet');
break;
case 'user_cart_autre_wallet':
$plr_user_cart_autre_wallet_national = $_POST['plr_user_cart_autre_wallet_national'] ?? null;
$plr_bank_user_cart_autre_wallet_national = $_POST['plr_bank_user_cart_autre_wallet_national'] ?? null;
$plr_user_cart_autre_wallet_international = $_POST['plr_user_cart_autre_wallet_international'] ?? null;
$plr_bank_user_cart_autre_wallet_international = $_POST['plr_bank_user_cart_autre_wallet_international'] ?? null;
$this->insertPalier($plr_user_cart_autre_wallet_national, "user_cart_autre_wallet_national", $idConfig,'paliers_commissions_wallet');
$this->insertPalier($plr_bank_user_cart_autre_wallet_national, "bank_user_cart_autre_wallet_national", $idConfig ,'paliers_commissions_wallet');
$this->insertPalier($plr_user_cart_autre_wallet_international, "user_cart_autre_wallet_international", $idConfig,'paliers_commissions_wallet');
$this->insertPalier($plr_bank_user_cart_autre_wallet_international, "bank_user_cart_autre_wallet_international", $idConfig ,'paliers_commissions_wallet');
break;
case 'agent_remove_cash':
$plr_agent_wallet_cash_national = $_POST['plr_agent_wallet_cash_national'] ?? null;
@ -1922,8 +1938,6 @@ class Gestion extends CI_Controller
$string = file_get_contents("https://openexchangerates.org/api/latest.json?app_id=$api");
$json = json_decode($string, true);
$res = false;
foreach ($json['rates'] as $key => $value) {
if ($this->wallet_model->getExchangeRate($key))
$this->wallet_model->updateExchangeRate($key, $value);
@ -1932,9 +1946,9 @@ class Gestion extends CI_Controller
}
$res = true;
if ($res) {
echo json_encode("200");
echo json_encode(200);
} else {
echo json_encode("500");
echo json_encode(500);
}
@ -2035,7 +2049,8 @@ class Gestion extends CI_Controller
$this->users_group_details($data['network_id'], $this->input->get('group'));
} else {
$data['groups'] = $this->nano_credit_model->getUsersGroups($data['network_id']);
$data['configWallet'] = $this->wallet_model->getConfigWallet($data['network_id'])->first_row();
$configWallet = $this->wallet_model->getConfigWallet($data['network_id']);
$data['configWallet'] = is_array($configWallet) ? reset($configWallet) : $configWallet;
$networkDetails = $this->user_model->getNetworkDetails($data['network_id']);
if ($networkDetails) {
$data['network'] = $networkDetails->first_row()->network;
@ -2479,5 +2494,23 @@ class Gestion extends CI_Controller
}
}
public function aggregators()
{
if ($this->isLogged()) {
$data['active'] = "aggregators";
$data['alert'] = "";
$data['aggregators'] = $this->db->get_where('payment_aggregators')->result() ?? [];
foreach ($data['aggregators'] as $i => $aggregator){
$data['aggregators'][$i]->rates = $this->db->get_where('payment_aggregator_rates',['aggregator_id' => $aggregator->id])->result();
}
// $data['pays'] = $this->user_model->getAllPays();
$data['game_pays'] = $this->user_model->getGameCountry();
$this->load->view('header_gestion', $data);
$this->load->view('gestion_aggregators');
$this->load->view('footer');
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -63,7 +63,7 @@ class Hyperviseur_dash extends CI_Controller
$data['active'] = "geolocated";
$data['total_points'] = $this->user_model->getCoutGeolocatedUsersForHyper($this->session->userdata('member_code'), $this->session->userdata('current_ville'));
$data['map_title'] = $this->lang->line($data['hasWallet']->first_row()->type == 'ilink_sante' ? 'service_providers_to' :'utilisateurs géolocalisés à') . " " . $this->session->userdata('current_ville');
$data['map_title'] = $this->lang->line($data['hasWallet']?->type == 'ilink_sante' ? 'service_providers_to' :'utilisateurs géolocalisés à') . " " . $this->session->userdata('current_ville');
$data['positions'] = $this->user_model->getUsersGeolocatedPositionByVilleForHyp($this->session->userdata('current_ville'), $this->session->userdata('member_code'));
$data['latitude'] = $this->session->userdata('latitude');
$data['longitude'] = $this->session->userdata('longitude');
@ -78,7 +78,7 @@ class Hyperviseur_dash extends CI_Controller
$data['alert'] = "";
if($data['hasWallet']->first_row()->type == 'ilink_sante'){
if($data['hasWallet']?->type == 'ilink_sante'){
$nh_config = $this->nano_health_model->getConfig($data['network_id']);
$data['nh_config'] = $nh_config ? $nh_config->first_row() : null ;
$data['provider_classes'] = $this->nano_health_model->getProviderClasses($data['nh_config'] ? $data['nh_config']->id : null);
@ -453,9 +453,9 @@ class Hyperviseur_dash extends CI_Controller
$agent_id = $this->session->userdata('agent_id');
$taux = $data['hasWallet']->first_row();
$taux = $data['hasWallet'];
$data['idConfig'] = $taux->id;
if ($data['hasWallet']->first_row()->type == 'visa') {
if ($data['hasWallet']?->type == 'visa') {
$data['taux_client_r'] = $taux->taux_com_client_retrait;
$data['taux_client_d'] = $taux->taux_com_client_depot;
$data['taux_ag_r'] = $taux->taux_com_ag_retrait;
@ -491,7 +491,7 @@ class Hyperviseur_dash extends CI_Controller
$data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code'));
$data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network);
} else if ($data['hasWallet']->first_row()->type == 'ilink') {
} else if ($data['hasWallet']?->type == 'ilink') {
$transactions = $this->wallet_model->getNetworkIlinTransactions($id_network);
$data["transactions"] = array();
@ -507,7 +507,7 @@ class Hyperviseur_dash extends CI_Controller
$data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code'));
$data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network);
}else if($data['hasWallet']->first_row()->type == 'ilink_sante'){
}else if($data['hasWallet']?->type == 'ilink_sante'){
$nh_config = $this->nano_health_model->getConfig($id_network);
$data['nh_config'] = $nh_config ? $nh_config->first_row() : null ;
$data['config_id'] = $data['nh_config'] ? $data['nh_config']->id : null ;
@ -537,11 +537,11 @@ class Hyperviseur_dash extends CI_Controller
$data['currency_code'] = $this->session->userdata('currency_code');
$this->load->view('header_hyp', $data);
if ($data['hasWallet']->first_row()->type == 'visa')
if ($data['hasWallet']?->type == 'visa')
$this->load->view('gestion_wallet_hyp');
elseif ($data['hasWallet']->first_row()->type == 'ilink')
elseif ($data['hasWallet']?->type == 'ilink')
$this->load->view('gestion_wallet_ilink_hyp');
elseif ($data['hasWallet']->first_row()->type == 'ilink_sante')
elseif ($data['hasWallet']?->type == 'ilink_sante')
$this->load->view('nano_health/hyper/gestion_wallet');
$this->load->view('footer');
}
@ -1010,14 +1010,14 @@ class Hyperviseur_dash extends CI_Controller
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
$data['country'] = $this->session->userdata('current_pays');
$data['network_id'] = $this->session->userdata('network_id');
$data['countries'] = $this->wallet_model->getWalletsCountries();
$showResult = false;
$frais = 0;
$taxe = 0;
$config = $data['hasWallet']->first_row();
$config = $data['hasWallet'];
//Simulateur
$com_ag = $this->session->userdata('com_ag') ? $this->session->userdata('com_ag') : 0 ;
@ -1354,8 +1354,9 @@ class Hyperviseur_dash extends CI_Controller
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
$data['country'] = $this->session->userdata('current_pays');
$data['category'] = $this->session->userdata('category');
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
$data['network_id'] = $this->session->userdata('network_id');
$data['currency_code'] = $this->session->userdata('currency_code');
if (isset($country)) {
$data['country_id'] = $country;
$data['country'] = $this->wallet_model->getCountry($country)->first_row();
@ -1402,7 +1403,7 @@ class Hyperviseur_dash extends CI_Controller
$data['countries'][] = $country;
}
}
$taux = $data['hasWallet']->first_row();
$taux = $data['hasWallet'];
switch($config){
case 'paying_networks':
$this->load->view('header_hyp', $data);
@ -1432,20 +1433,30 @@ class Hyperviseur_dash extends CI_Controller
break;
case 'user_carte_wallet':
$data['plr_user_cart_wallet_national'] = $this->wallet_model->getPalierCommissionsWallet("user_cart_wallet_national", $data['idConfig']);
// $data['plr_user_cart_wallet_international'] = $this->wallet_model->getPalierCommissionsWallet("user_cart_wallet_international", $data['idConfig']);
$data['plr_user_cart_wallet_international'] = $this->wallet_model->getPalierCommissionsWallet("user_cart_wallet_international", $data['idConfig']);
$data['plr_user_cart_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("user_cart_cash_national", $data['idConfig']);
// $data['plr_user_cart_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("user_cart_cash_international", $data['idConfig']);
$data['plr_user_cart_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("user_cart_cash_international", $data['idConfig']);
$data['plr_hyp_user_cart_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("hyp_user_cart_cash_national", $data['idConfig']);
// $data['plr_hyp_user_cart_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("hyp_user_cart_cash_international", $data['idConfig']);
$data['plr_hyp_user_cart_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("hyp_user_cart_cash_international", $data['idConfig']);
$data['plr_bank_user_cart_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("bank_user_cart_cash_national", $data['idConfig']);
// $data['plr_bank_user_cart_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("bank_user_cart_cash_international", $data['idConfig']);
$data['plr_bank_user_cart_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("bank_user_cart_cash_international", $data['idConfig']);
$this->load->view('header_hyp', $data);
$this->load->view('config_wallet_ilink_hyp/user_carte_wallet');
break;
case 'user_cart_autre_wallet':
$data['plr_user_cart_autre_wallet_national'] = $this->wallet_model->getPalierCommissionsWallet("user_cart_autre_wallet_national", $data['idConfig']);
$data['plr_user_cart_autre_wallet_international'] = $this->wallet_model->getPalierCommissionsWallet("user_cart_autre_wallet_international", $data['idConfig']);
$data['plr_bank_user_cart_autre_wallet_national'] = $this->wallet_model->getPalierCommissionsWallet("bank_user_cart_autre_wallet_national", $data['idConfig']);
$data['plr_bank_user_cart_autre_wallet_international'] = $this->wallet_model->getPalierCommissionsWallet("bank_user_cart_autre_wallet_international", $data['idConfig']);
$this->load->view('header_hyp', $data);
$this->load->view('config_wallet_ilink_hyp/user_carte_autre_wallet');
break;
case 'agent_remove_cash':
$data['plr_agent_wallet_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("agent_wallet_cash_national", $data['idConfig']);
$data['plr_agent_wallet_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("agent_wallet_cash_international", $data['idConfig']);
@ -1517,6 +1528,15 @@ class Hyperviseur_dash extends CI_Controller
$this->load->view('header_hyp', $data);
$this->load->view('config_wallet_ilink_hyp/taxes');
break;
case 'customers_accounts':
$data['types'] = $this->db->select('t.* , p.name as parent')
->from('customer_account_types t')->join('customer_account_types p', 't.parent_id = p.id','left')->get()->result();
foreach ($data['types'] as $i => $type){
$data['types'][$i]->documents = $this->db->get_where('customer_account_type_documents',['account_type_id' => $type->id])->result();
}
$this->load->view('header_hyp', $data);
$this->load->view('config_wallet_ilink_hyp/customers_accounts');
break;
}
$this->load->view('footer');
}
@ -1533,7 +1553,7 @@ class Hyperviseur_dash extends CI_Controller
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
$data['country'] = $this->session->userdata('current_pays');
$data['category'] = $this->session->userdata('category');
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
$res = $this->wallet_model->getWalletPassword($this->session->userdata('network_id'));
$data['walletPassword'] = $res ? $res->first_row() : null;
$data['networks'] = $this->wallet_model->getPayingNetworksByConfigWallet($data['idConfig']);
@ -1576,7 +1596,7 @@ class Hyperviseur_dash extends CI_Controller
} else {
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
$data['groups'] = $this->nano_credit_model->getUsersGroups($this->session->userdata('network_id'));
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
$data['rates'] = $this->nano_credit_model->getNanoCreditRates($data['idConfig']);
$data['taxes'] = $this->wallet_model->getTaxes($data['idConfig'], 'nano_credit');
$data['active'] = "nano_credit";
@ -1584,7 +1604,7 @@ class Hyperviseur_dash extends CI_Controller
$data['network'] = $this->session->userdata('network');
$data['country'] = $this->session->userdata('current_pays');
$data['currency_code'] = $this->session->userdata('currency_code');
$data['configWallet'] = $data['hasWallet']->first_row();
$data['configWallet'] = $data['hasWallet'];
$data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays'));
$this->load->view('header_hyp', $data);
$this->load->view('nano_credit/gestion_nano_credit_hyp');
@ -1603,12 +1623,12 @@ class Hyperviseur_dash extends CI_Controller
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
$data['country'] = $this->session->userdata('current_pays');
$data['category'] = $this->session->userdata('category');
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
$data['network_id'] = $this->session->userdata('network_id');
switch ($config) {
case 'nano_credit':
$taux = $data['hasWallet']->first_row();
$taux = $data['hasWallet'];
$data['taux_ag_nano_credit'] = $taux->taux_com_ag_nano_credit;
$data['taux_sup_nano_credit'] = $taux->taux_com_sup_nano_credit;
$data['taux_hyp_nano_credit'] = $taux->taux_com_hyp_nano_credit;
@ -2072,6 +2092,9 @@ class Hyperviseur_dash extends CI_Controller
}else if($role == 'controllers'){
$data['active'] = "wallet_validating_controllers";
$data['role'] = 'CONTROLLER';
}else if($role == 'account_opening_agents'){
$data['active'] = "wallet_validating_account_opening_agents";
$data['role'] = 'OPENING_ACCOUNT_AGENT';
}else{
$data['active'] = "wallet_validating_agents";
$data['role'] = 'AGENT';
@ -2085,10 +2108,7 @@ class Hyperviseur_dash extends CI_Controller
$data['network_id'] = $this->session->userdata('network_id');
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
$nh_config = $this->nano_health_model->getConfig($data['network_id']);
$data['nh_config'] = $nh_config ? $nh_config->first_row() : null ;
$data['config_id'] = $data['nh_config'] ? $data['nh_config']->id : null ;
$data['agents'] = $this->db->get_where('nh_validating_agents',['nh_network_config_id' => $data['config_id'] , 'role' => $data['role']]);
$data['agents'] = $this->db->get_where('nh_validating_agents',['network_id' => $data['network_id'] , 'role' => $data['role']]);
$this->load->view('header_hyp', $data);
$this->load->view('nano_health/hyper/validating_agents');
@ -2135,6 +2155,56 @@ class Hyperviseur_dash extends CI_Controller
$this->load->view('footer');
}
}
public function storeCustomerAccountType(){
if($this->isLogged()) {
if (isset($_POST)) {
$id = $_POST['id'] ?? null ;
$exist = $this->db->get_where('customer_account_types', ['id !=' => $id ,'network_id' => $_POST['network_id'] , 'name' => $_POST['name']]);
if ($exist->num_rows() == 0) {
foreach ($_POST as $key => $value){
if(empty($value)){
$_POST[$key] = null;
}
}
if(!empty($id)){
$documents = $_POST['documents'] ?? [] ;
unset($_POST['documents']);
$this->db->where('id',$id);
$this->db->update('customer_account_types',$_POST);
$this->db->delete('customer_account_type_documents',['account_type_id' => $id]);
if(sizeof($documents) > 0){
$data = array_map(function ($document) use($id){
$row = [];
$row['name'] = $document[0];
$row['description'] = $document[1];
$row['account_type_id'] = $id;
return $row;
},$documents);
$this->db->insert_batch('customer_account_type_documents',$data);
}
}else{
$this->db->insert('customer_account_types',$_POST);
}
echo json_encode(['code' => 200]);
}else{
echo json_encode(['code'=> 419 , 'message' => $this->lang->line("name_already_used")]);
}
}
}
}
public function deleteCustomerAccountType(){
if($this->isLogged()) {
if (isset($_POST)) {
$this->db->delete('customer_account_types', ['id' => $_POST['id']]);
$this->db->delete('customer_account_type_documents', ['account_type_id' => $_POST['id']]);
echo json_encode(['code' => 200]);
}
}
}
}
class Operation

0
application/controllers/NanoHealthController.php Normal file → Executable file
View File

View File

@ -0,0 +1,109 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class OpeningAccountAgent extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('opening_account_model');
}
public function index()
{
if ($this->isLogged()){
$data['active'] = "dashboard";
$data['network_id'] = $data['id_network'] = $this->session->userdata('network_id');
if ($this->input->get('history')) {
$history_type = $this->input->get('history');
$id = $this->input->get('id');
if($history_type == 'requests' && !empty($id)){
$data['active'] = "requests";
$data['invoice'] = $this->opening_account_model->getInfosOpeningAccountRequestId($id);
$data['agent'] = $this->db->get_where('agent_plus',['code_membre'=> $data['invoice']->institution_code ?? null])->first_row();
$data['health_care_sheets'] = $this->db->get_where('nh_infos_health_care_sheets',['invoice_id'=> $id]);
$this->load->view('account_opening_agent/header', $data);
$this->load->view('account_opening_agent/infos_invoice', $data);
$this->load->view('footer');
}else{
$this->history($this->input->get('d'), $this->input->get('f'), $this->input->get('history'), $data);
}
}else{
$data['count_accepted'] = $this->opening_account_model->getCountRequests(null,$this->session->userdata('agent_id'), 'ACCEPTED');
$data['count_rejected'] = $this->opening_account_model->getCountRequests(null,$this->session->userdata('agent_id'), 'REJECTED');
$data['count_under_validation'] = $this->opening_account_model->getCountRequests($data['network_id'],null, 'UNDER_VALIDATION');
$this->load->view('account_opening_agent/header', $data);
$this->load->view('account_opening_agent/dashboard', $data);
$this->load->view('footer');
}
}
}
public function history($networkId , $startDate , $endDate , $type){
$format = $this->session->userdata('site_lang') === 'french' ? 'd-m-Y' : 'Y-m-d';
$data['startDate'] = $startDate ? date($format, strtotime($startDate)) : null;
$data['endDate'] = $endDate ? date($format, strtotime($endDate)) : null;
$endDate = Date('Y-m-d', strtotime($endDate . "+1 day"));
$data['active'] = "subscription_requests";
$data['network'] = $this->session->userdata('network');
$data['id_network'] = $this->session->userdata('network_id');
$data['country'] = $this->session->userdata('current_pays');
$data['category'] = $this->session->userdata('role');
// if ($type == 'customer_account_opening_requests'){
// $data['active'] = 'requests';
// }
$this->load->view('account_opening_agent/header', $data);
if ($type == 'customer_account_opening_requests')
$this->load->view('account_opening_agent/opening_account_requests');
$this->load->view('footer');
}
public function requests(){
if ($this->isLogged()) {
$data['id_network'] = $this->session->userdata('network_id');
$data['active'] = "requests";
$data['category'] = $this->session->userdata('role');
if ($this->input->get('history')) {
if ($this->input->get('id') !== null) {
$data['request'] = $this->opening_account_model->getInfosOpeningAccountRequestId($this->input->get('id'));
$data['user'] = $this->db->get_where('user_infos', ['user_id' => $data['subscription']->user_id ?? null])->first_row();
$data['documents'] = $this->opening_account_model->getOpeningAccountRequestDocuments($this->input->get('id'));
$this->load->view('account_opening_agent/header', $data);
$this->load->view('account_opening_agent/infos_opening_account_request');
$this->load->view('footer');
} else {
$this->history($data['id_network'], $this->input->get('d'), $this->input->get('f'), $this->input->get('history'));
}
}
}
}
public function treatRequest($request_id)
{
echo makeRequest('user-service', 'PUT','/customers_accounts_requests/'.$request_id, $_POST);
}
private function isLogged()
{
if (!$this->session->userdata('email')) {
$this->session->set_flashdata('error', 'log in first');
$data['alert'] = "ok";
$data['message'] = "Login first!";
redirect('index.php', $data);
return false;
}
return true;
}
}

View File

@ -0,0 +1,99 @@
<?php
class PaymentController extends CI_Controller
{
public function __construct()
{
parent::__construct();
}
public function storePaymentAggregator(){
if($this->isLogged()) {
if (isset($_POST)) {
$id = $_POST['id'] ?? null ;
$exist = $this->db->get_where('payment_aggregators', ['id !=' => $id , 'name' => $_POST['name']]);
if ($exist->num_rows() == 0) {
foreach ($_POST as $key => $value){
if(empty($value)){
$_POST[$key] = null;
}
}
$_POST['created_at'] = (new DateTime())->format('Y-m-d H:i:s');
$_POST['updated_at'] = (new DateTime())->format('Y-m-d H:i:s');
if(!empty($id)){
$rates = $_POST['rates'] ?? [] ;
unset($_POST['rates']);
$this->db->where('id',$id);
$this->db->update('payment_aggregators',$_POST);
$this->db->delete('payment_aggregator_rates',['aggregator_id' => $id]);
if(sizeof($rates) > 0){
$data = array_map(function ($rate) use($id){
$row = [];
$row['country'] = $rate[0];
$row['type'] = $rate[1];
$row['method'] = $rate[2];
$row['channel'] = $rate[3];
$row['rate'] = $rate[4];
$row['fixed_fees'] = $rate[5];
$row['fixed_fees_currency'] = $rate[6];
$row['aggregator_id'] = $id;
$row['created_at'] = (new DateTime())->format('Y-m-d H:i:s');
$row['updated_at'] = (new DateTime())->format('Y-m-d H:i:s');
return $row;
},$rates);
$this->db->insert_batch('payment_aggregator_rates',$data);
}
}else{
$this->db->insert('payment_aggregators',$_POST);
}
echo json_encode(['code' => 200]);
}else{
echo json_encode(['code'=> 419 , 'message' => $this->lang->line("name_already_used")]);
}
}
}
}
public function deletePaymentAggregator(){
if($this->isLogged()) {
if (isset($_POST)) {
$this->db->delete('payment_aggregators', ['id' => $_POST['id']]);
$this->db->delete('payment_aggregator_rates', ['aggregator_id' => $_POST['id']]);
echo json_encode(['code' => 200]);
}
}
}
public function enableAggregator()
{
if($this->isLogged()) {
if (isset($_POST)) {
$date = (new DateTime())->format('Y-m-d H:i:s');
$this->db->update('payment_aggregators',['status' => 0 , 'updated_at' => $date]);
$this->db->where('id',$_POST['id']);
$this->db->update('payment_aggregators',['status' => 1 , 'updated_at' => $date]);
echo json_encode(['code' => 200]);
}
}
}
public function isLogged()
{
if (!$this->session->userdata('email')) {
$this->session->set_flashdata('error', 'log in first');
$data['alert'] = "ok";
$data['message'] = "Login first!";
$this->load->view('login', $data);
return false;
}
return true;
}
}

View File

@ -231,9 +231,9 @@ class Superviseur_dash extends CI_Controller
foreach ($agents_g->result() as $row) {
$wallet = $this->wallet_model->getWallet($row->agent_id);
if ($wallet) {
if ($data['hasWallet']->first_row()->type == 'visa') {
if ($data['hasWallet']?->type == 'visa') {
$transactions = $this->user_model->getAgentTransactions($wallet->first_row()->wallet_id);
} else if ($data['hasWallet']->first_row()->type == 'ilink') {
} else if ($data['hasWallet']?->type == 'ilink') {
$transactions = $this->user_model->getAgentiLinkTransactions($wallet->first_row()->wallet_id);
}
if ($transactions) {
@ -252,7 +252,7 @@ class Superviseur_dash extends CI_Controller
$data["transactions"] = false;
}
if($data['hasWallet']->first_row()->type == 'ilink_sante') {
if($data['hasWallet']?->type == 'ilink_sante') {
$nh_config = $this->nano_health_model->getConfig($id_network);
$data['nh_config'] = $nh_config ? $nh_config->first_row() : null ;
$data['config_id'] = $data['nh_config'] ? $data['nh_config']->id : null ;
@ -277,11 +277,11 @@ class Superviseur_dash extends CI_Controller
$data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network);
// $data['geolocated_user'] = $this->user_model->getSuperNameAndCodeForSup($this->session->userdata('member_code'));
$this->load->view('header_sup', $data);
if ($data['hasWallet']->first_row()->type == 'visa')
if ($data['hasWallet']?->type == 'visa')
$this->load->view('gestion_wallet_sup');
elseif ($data['hasWallet']->first_row()->type == 'ilink')
elseif ($data['hasWallet']?->type == 'ilink')
$this->load->view('gestion_wallet_sup_ilink');
elseif ($data['hasWallet']->first_row()->type == 'ilink_sante')
elseif ($data['hasWallet']?->type == 'ilink_sante')
$this->load->view('nano_health/super/gestion_wallet');
$this->load->view('footer');
}

View File

@ -45,7 +45,7 @@
$data['adresse'] = $this->session->userdata('adresse');
$data['category'] = $this->session->userdata('category');
$data['network'] = $this->session->userdata('network');
$data['network_id'] =
$data['network_id'] =
$data['villes'] = $this->user_model->getVilleByUserGeo($data['network']);
$data['count_geo'] = $this->user_model->countUser("geolocated",$this->session->userdata('network'));
$data['count_sup'] = $this->user_model->countUser("super",$this->session->userdata('network'));
@ -74,11 +74,10 @@
'user_role' => $this->input->post('user_role')
);
// Pour les agents valideurs de iLink Santé
// Pour les agents valideurs de iLink Santé et iLink World
if($user_login['user_role'] == 2 && filter_var($user_login['user_email'], FILTER_VALIDATE_EMAIL)){
$sql = "SELECT nhd.* , n.name as network , n.id as network_id, cc.name as country, cc.currency_code
FROM nh_validating_agents nhd INNER JOIN nh_networks_configs nhc ON nhc.id = nhd.nh_network_config_id
INNER JOIN networks n ON n.id = nhc.network_id INNER JOIN countries_currencies cc ON cc.id = n.country_id WHERE nhd.email = ?";
FROM nh_validating_agents nhd INNER JOIN networks n ON n.id = nhd.network_id INNER JOIN countries_currencies cc ON cc.id = n.country_id WHERE nhd.email = ?";
$agent = $this->db->query($sql,[$user_login['user_email']]);
if($agent->num_rows()>0) {
$agent = $agent->first_row();
@ -99,6 +98,8 @@
redirect('ValidatingDoctor');
}else if($agent->role == 'CONTROLLER'){
redirect('ControllerDoctor');
}else if($agent->role == 'OPENING_ACCOUNT_AGENT'){
redirect('OpeningAccountAgent');
}else{
redirect('ValidatingAgent');
}

View File

@ -0,0 +1,55 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
use Brick\Money\Context\AutoContext;
use Brick\Money\CurrencyConverter;
use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider;
use Brick\Money\ExchangeRateProvider\PDOProvider;
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
use Brick\Money\Money;
class CustomerAccountOpeningRequests extends CI_Controller
{
private $context = null;
function __construct()
{
parent::__construct();
// Load member model
$this->load->model('pagination/CustomerAccountOpeningRequests_model', 'model');
}
function getLists()
{
$data = $row = array();
// Fetch member's records
$witData = $this->model->getRows($_POST);
$i = $_POST['start'];
$current_url = $_POST['currentURL'];
foreach ($witData as $row) {
$buttons = '<a href="'.$current_url.'?history=customer_account_opening_requests&id='.$row->id.'" class="btn btn-primary" > '.$this->lang->line('Voir plus...').'</a>';
$data[] = array($row->unique_id , $row->customer_account_type_name, $row->lastname , $row->firstname, $row->phone_number,
mb_strtoupper($this->lang->line($row->status),'UTF-8'), $row->created_at ,$buttons);
}
$output = array(
"draw" => $_POST['draw'],
"recordsTotal" => $this->model->countAll($_POST),
"recordsFiltered" => $this->model->countFiltered($_POST),
"data" => $data,
);
// Output to JSON format
echo json_encode($output);
}
}

View File

@ -67,22 +67,22 @@ class WalletIlinkTransaction extends CI_Controller
if ($row->destinataire_phone) {
$destinataire = $row->destinataire_phone . ' | ' . $row->destinataire_name;
} else {
$destinataire = ($row->id_destinataire ? $row->id_destinataire . ' | ' : '') . ($row->nom_destinataire ? $row->nom_destinataire : '') . (' ' . $row->prenom_destinataire ? $row->prenom_destinataire : '');
$destinataire = ($row->id_destinataire ? $row->id_destinataire . ' | ' : '') . ($row->nom_destinataire ?? '') . (' ' . $row->prenom_destinataire ? $row->prenom_destinataire : '');
}
if ($row->user_phone) {
$emetteur = $row->user_phone . ' | ' . $row->user;
} else {
$emetteur = ($row->nom_emetteur ? $row->nom_emetteur : '') . (' ' . $row->prenom_emetteur ? $row->prenom_emetteur : '');
$emetteur = ($row->nom_emetteur ?? '') . (' ' . $row->prenom_emetteur ? $row->prenom_emetteur : '');
}
$moneyNetFinal = Money::of(round($row->montant_net_final_country, 2), $row->final_currency ? $row->final_currency : 'XAF', $this->context);
$moneyNetFinal = Money::of(round($row->montant_net_final_country, 2), $row->final_currency ?? 'XAF', $this->context);
$data[] = array($row->id_transaction, $operation, $numero_carte, $moneyNetInit->formatTo('fr_FR'), $moneyNetFinal->formatTo('fr_FR'),
Money::of(round($row->part_reseau_payeur_final_country ? $row->part_reseau_payeur_final_country : 0, 2), $row->final_currency ? $row->final_currency : 'XAF', $this->context)->formatTo('fr_FR'),
Money::of(round($row->part_reseau_payeur_final_country ?? 0, 2), $row->final_currency ?? 'XAF', $this->context)->formatTo('fr_FR'),
$this->lang->line($row->status_reseau_payeur), $row->final_currency, $row->pays_init,$row->pays_final, Money::of(round($row->frais,2), $row->init_currency,$this->context)->formatTo('fr_FR'),
Money::of(round($row->taxe, 2),$row->init_currency,$this->context)->formatTo('fr_FR'),Money::of(round($row->commission_banque ? $row->commission_banque : 0, 2),$row->init_currency,$this->context)->formatTo('fr_FR'),
Money::of(round($row->commission_hyp ? $row->commission_hyp : 0, 2),$row->init_currency,$this->context)->formatTo('fr_FR'),Money::of(round($row->commission_sup ? $row->commission_sup : 0 , 2),$row->init_currency,$this->context)->formatTo('fr_FR'),
Money::of(round($row->commission_ag ? $row->commission_ag : 0, 2),$row->init_currency,$this->context)->formatTo('fr_FR'), $agent , $emetteur, $destinataire, $created);
Money::of(round($row->taxe, 2),$row->init_currency,$this->context)->formatTo('fr_FR'),Money::of(round($row->commission_banque ?? 0, 2),$row->init_currency,$this->context)->formatTo('fr_FR'),
Money::of(round($row->commission_hyp ?? 0, 2),$row->init_currency,$this->context)->formatTo('fr_FR'),Money::of(round($row->commission_sup ?? 0 , 2),$row->init_currency,$this->context)->formatTo('fr_FR'),
Money::of(round($row->commission_ag ?? 0, 2),$row->init_currency,$this->context)->formatTo('fr_FR'), $agent , $emetteur, $destinataire, $created);
}
$output = array(

58
application/helpers/functions_helper.php Normal file → Executable file
View File

@ -148,3 +148,61 @@ if (!function_exists('checkhashSSHA')) {
return base64_encode(sha1($password . $salt, true) . $salt);
}
}
if (!function_exists('makeRequest')) {
function makeRequest($service , $method , $path , $request_body = []){
if(empty($_SESSION['email'])) {
return json_encode(['status' => 401]);
}
switch ($service){
case 'user-service':
$baseUrl = USER_SERVICE_URL;
$token = USER_SERVICE_TOKEN;
break;
case 'nano-service':
$baseUrl = NANO_SANTE_SERVICE_URL;
$token = NANO_SANTE_SERVICE_TOKEN;
break;
case 'wallet-service':
$baseUrl = WALLET_SERVICE_URL;
$token = WALLET_SERVICE_TOKEN;
break;
default:
$baseUrl = '';
$token = '';
}
$url = $baseUrl.$path;
if($method == 'GET'){
$data = http_build_query($_POST);
$ch = curl_init($url."?".$data);
}else{
$ch = curl_init($url);
}
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
/* set the content type json */
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type:application/json',
'Authorization:'.$token,
'X-localization:'. $_SESSION['site_lang'] == 'french' ? 'fr' : 'en'
));
/* set return type json */
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$body = new \stdClass();
foreach ($request_body as $key => $value){
$body->{$key} = $value;
}
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));
/* execute request */
$result = curl_exec($ch);
/* close cURL resource */
curl_close($ch);
if ($result) {
return $result;
}else{
return json_encode(['status' => 500]);
}
}
}

View File

@ -363,7 +363,12 @@ $lang['rate_com_hyp_send_wallet_cart_ilink_national'] = "Hypervisor commission r
$lang['rate_com_hyp_send_wallet_cart_ilink_international'] = "Hypervisor commission rate on wallet-to-card transaction for iLink international user";
$lang['rate_com_bq_send_wallet_cart_ilink_national'] = "Bank commission rate on wallet-to-card transaction for national iLink user";
$lang['rate_com_bq_send_wallet_cart_ilink_international'] = "Bank commission rate on wallet-to-card transaction for iLink international user";
$lang['rate_com_user_cart_autre_wallet_national'] = "Customer commission rate for sending a card to another national wallet";
$lang['config_ilink_user_cart_autre_wallet'] = 'Sending card to another wallet';
$lang['rate_com_user_cart_autre_wallet_international'] = 'Customer commission rate on international money withdrawal operation';
$lang['rate_com_user_cart_autre_wallet_national'] = "Customer commission rate for national money withdrawal operations";
$lang['rate_com_bank_user_cart_autre_wallet_international'] = "Bank commission rate for international money withdrawal operations";
$lang['rate_com_bank_user_cart_autre_wallet_national'] = "Bank commission rate for national money withdrawal operations";
// Currency management
$lang ['currency'] = 'Currency';
@ -947,4 +952,114 @@ $lang['STOPPED'] = "Stopped";
$lang['profile_image'] = "Profile image";
$lang['open_wallet_at_mobile_login'] = "Open wallet at mobile login";
$lang['MODIFIED'] = "Modified";
$lang['opening_amount'] = "Opening amount";
$lang['name_already_used'] = "The name entered is already in use";
$lang['add_customer_account_type'] = 'Add a customer account type';
$lang['customer_account_type_created'] = "Customer account type created";
$lang['customer_account_type_updated'] = "Customer account type modified";
$lang['customer_account_type_deleted'] = "Customer account type deleted";
$lang['customer_account_types'] = 'customer account types';
$lang['customers_accounts_configuration'] = 'Configuration of opening customer accounts';
$lang['aggregators'] = "Aggregators";
$lang['payment_aggregators'] = "Payment aggregators";
$lang['add_aggregator'] = "Add an aggregator";
$lang['aggregator_updated'] = "Payment aggregator updated";
$lang['aggregator_deleted'] = "Payment aggregator deleted";
$lang['aggregator_created'] = "Payment aggregator created";
$lang['aggregator_activated'] = "Agrégateur de paiement activated" ;
$lang['delete_customer_account_type'] = 'Delete a customer account type';
$lang['no_customer_account_type'] = 'No customer account type';
$lang['no_parent'] = 'No parent';
$lang['documents_list'] = 'List of documents';
$lang['add_document'] = "Add document";
$lang['account_opening_agents'] = "Account opening agents";
$lang['manage_account_opening_agents'] = "Manage account opening agents";
$lang['account_opening_agent'] = "Account opening agent";
$lang['add_account_opening_agent'] = "Add an account opening agent";
$lang['account_opening_agent_updated'] = "Modified account opening agent";
$lang['account_opening_agent_deleted'] = "Deleted account opening agent";
$lang['account_opening_agent_created'] = "Customer account opening agent created";
$lang['customer_account_opening_requests'] = "Customer account opening requests";
$lang['accepted_opening_account_requests'] = "Accepted account opening requests";
$lang['rejected_opening_account_requests'] = "rejected account opening requests";
$lang['not_treated_opening_account_requests'] = "Account opening requests not processed";
$lang['customer_opening_account_requests_history'] = "History of customer account opening requests";
$lang['customer_account_opening_request'] = "Customer account opening request";
$lang['personal_details'] = "Personal information";
$lang['title'] = "Title";
$lang['spouse_name'] = "Marital name";
$lang['nationality'] = "Nationality";
$lang['birth_country'] = "Country of birth";
$lang['birth_city'] = "City of birth";
$lang['birth_locality'] = "Exact place of birth";
$lang['parent_informations'] = "Parent information";
$lang['father_lastname'] = "Father's name";
$lang['father_firstname'] = "Father's first name";
$lang['mother_birth_lastname'] = "Mother's birth name";
$lang['mother_firstname'] = "Mother's first name";
$lang['marital_status'] = "Marital status";
$lang['spouse_lastname'] = "Spouse's name";
$lang['spouse_firstname'] = "Spouse's first name";
$lang['employment_details'] = "Employer";
$lang['profession'] = "Profession";
$lang['business_activity'] = "Business sector";
$lang['sub_sector_business_activity'] = "Sub-sector of business";
$lang['tax_number'] = "Tax number";
$lang['security_number'] = "Social security number";
$lang['employee_number'] = "Employer's number";
$lang['function'] = "Function";
$lang['employee_name'] = "Employer's name";
$lang['employee_address'] = "Employer's address";
$lang['residential_details'] = "Residential status";
$lang['residential_status'] = "Resident status";
$lang['residential_country'] = "Country of residence";
$lang['residence_permit_number'] = "Residence permit number";
$lang['issued_date'] = "Date of issue";
$lang['expiry_date'] ="Expiration date";
$lang['address_justification_doc'] = "Proof of address";
$lang['geographic_address'] = "Geographic address";
$lang['po_box'] = "Postal address";
$lang['person_to_contact_in_case_of_needs_name'] = "Person to contact if needed";
$lang['identification'] = "Identity";
$lang['identification_document_type'] = "Identification document type";
$lang['identification_document_number'] = "Identification number";
$lang['issuance_city'] = "City of issuance";
$lang['issuance_country'] = "Issuing country";
$lang['guardianship'] = "Guardianship";
$lang['customer_under_guardianship'] = "Customer under guardianship? ";
$lang['guardian_fullname'] = "Guardian's first and last name";
$lang['recommendation'] = "Recommendation";
$lang['how_did_you_know_company'] = "How did you hear about the company? ";
$lang['introducer_fullname'] = "Introducer's first and last name";
$lang['know_your_customer'] = "Knowledge of the customer";
$lang['expected_service'] = "Expected service";
$lang['income_sources_and_frequency'] = "Income frequency and transaction limit";
$lang['business_partners'] = "Business relationship";
$lang['bank_references'] = "Bank references";
$lang['has_account_with_other_bank'] = "Do you have accounts with other banks?";
$lang['more_information_account_opening_request'] = "More information for the account opening request";
$lang['reject_subscription_account_opening_request'] = "Reject the account opening request";
$lang['has_operative_other_bank_account'] = "If yes, is the account operational?";
$lang['has_engagement_with_other_banks'] = "Do you have any engagements with other banks?";
$lang['exposed_person'] = "Exposed person";
$lang['is_politically_exposed_person'] = "Is the applicant a politically exposed person?";
$lang['is_politically_exposed_person_in_service'] = "In service?";
$lang['has_relationship_with_politically_exposed_person'] = "Is the applicant a politically exposed person relationship?";
$lang['relationship_with_politically_exposed_person'] = "If yes, list their names and the nature of the relationship.";
$lang['electronic_products'] = "Electronic products";
$lang['email_alerts'] = "Email Alerts";
$lang['e_statement_frequency'] = "Bank statement";
$lang['e_package'] = "E Package";
$lang['debit_card_type'] = "Debit card type";
$lang['opening_account_request_accepted'] = "Customer account opening request accepted";
$lang['opening_account_request_rejected'] = "The request to open an account has been rejected";
$lang['opening_account_request_more_information'] = "The request to open an account has been rejected";
$lang['payment_period_days'] = "Payment period (in days)";
$lang['required_payment_period_days'] = "Payment period is required";
$lang['ACCEPTED_UNPAID'] = "Accepted unpaid";
$lang['ACCEPTED_PAID'] = "Accepted paid";
$lang['fixed_fees'] = "Fixed expenses";
$lang['fixed_fees_currency'] = "Fixed fee currency";
$lang['add_rate'] = "Add a rate";
$lang['channel'] = "Channel/Réseau";
?>

View File

@ -375,7 +375,12 @@
$lang['rate_com_hyp_send_wallet_cart_ilink_international'] = "Taux de commission hyperviseur sur operation d'envoi de wallet vers carte pour utilisateur iLink international";
$lang['rate_com_bq_send_wallet_cart_ilink_national'] = "Taux de commission banque sur operation d'envoi de wallet vers carte pour utilisateur iLink national";
$lang['rate_com_bq_send_wallet_cart_ilink_international'] = "Taux de commission banque sur operation d'envoi de wallet vers carte pour utilisateur iLink international";
$lang['rate_com_user_cart_autre_wallet_national'] = "Taux de commission du client sur opération d'envoi de carte à un autre wallet national";
$lang['config_ilink_user_cart_autre_wallet'] = 'Envoi de carte vers autre wallet';
$lang['rate_com_user_cart_autre_wallet_international'] = "Taux de commission du client sur operation de retrait d'argent international";
$lang['rate_com_user_cart_autre_wallet_national'] = "Taux de commission du client sur operation de retrait d'argent national";
$lang['rate_com_bank_user_cart_autre_wallet_international'] = "Taux de commission de la banque sur operation de retrait d'argent international";
$lang['rate_com_bank_user_cart_autre_wallet_national'] = "Taux de commission de la banque sur operation de retrait d'argent national";
// Gestion de la monnaie
$lang['currency'] = 'Monnaie';
$lang['currency_code'] = 'Code de la monnaie';
@ -768,7 +773,6 @@ $lang['mail_body_validating_agent'] = "votre compte agent valideur a bien été
$lang['validating_agent_updated'] = "Agent valideur modifié";
$lang['validating_agent_deleted'] = "Agent valideur supprimé";
$lang['subscription_requests'] = "Demandes de souscriptions";
$lang['subscription_requests'] = "Demandes de souscriptions";
$lang['accepted_subscription_requests'] = "Demandes de souscriptions acceptées";
$lang['rejected_subscription_requests'] = "Demandes de souscriptions rejetées";
$lang['not_treated_subscription_requests'] = "Demandes de souscriptions non traitées";
@ -956,4 +960,114 @@ $lang['STOPPED'] = "Arretée";
$lang['profile_image'] = "Photo de profil";
$lang['open_wallet_at_mobile_login'] = "Ouverture du wallet à la connexion mobile";
$lang['MODIFIED'] = "Modifiée";
$lang['opening_amount'] = "Montant à l'ouverture";
$lang['name_already_used'] = "Le nom entré est déjà utilisé";
$lang['add_customer_account_type'] = 'Ajouter un type de compte client';
$lang['customer_account_type_created'] = "Type de compte client crée";
$lang['customer_account_type_updated'] = "Type de compte client modifié";
$lang['customer_account_type_deleted'] = "Type de compte client supprimé";
$lang['customer_account_types'] = 'Types de comptes clients';
$lang['customers_accounts_configuration'] = 'Configuration ouverture des comptes clients';
$lang['aggregators'] = "Agrégateurs";
$lang['payment_aggregators'] = "Agrégateurs de paiement";
$lang['add_aggregator'] = "Ajouter un agrégateur";
$lang['aggregator_updated'] = "Agrégateur de paiement mis à jour" ;
$lang['aggregator_deleted'] = "Agrégateur de paiement supprimé" ;
$lang['aggregator_created'] = "Agrégateur de paiement créé" ;
$lang['aggregator_activated'] = "Agrégateur de paiement activé" ;
$lang['delete_customer_account_type'] = "Supprimer un type de compte client";
$lang['no_customer_account_type'] = 'Aucun type de compte client';
$lang['no_parent'] = "Aucun parent";
$lang['documents_list'] = "Liste des documents";
$lang['add_document'] = "Ajouter document";
$lang['account_opening_agents'] = "Agents d'ouverture de compte";
$lang['manage_account_opening_agents'] = "Gestion des agents d'ouverture de compte client";
$lang['account_opening_agent'] = "Agent d'ouverture de compte";
$lang['add_account_opening_agent'] = "Ajouter un agent d'ouverture de compte client";
$lang['account_opening_agent_updated'] = "Agent d'ouverture de compte client modifié";
$lang['account_opening_agent_deleted'] = "Agent d'ouverture de compte client supprimé";
$lang['account_opening_agent_created'] = "Agent d'ouverture de compte client créé";
$lang['customer_account_opening_requests'] = "Demandes d'ouverture de compte client";
$lang['accepted_opening_account_requests'] = "Demandes d'ouverture de compte acceptées";
$lang['rejected_opening_account_requests'] = "Demandes d'ouverture de compte rejetées";
$lang['not_treated_opening_account_requests'] = "Demandes d'ouverture de compte non traitées";
$lang['customer_opening_account_requests_history'] = "Historique des demandes d'ouverture de compte client";
$lang['customer_account_opening_request'] = "Demande d'ouverture de compte client";
$lang['personal_details'] = "Informations personnelles";
$lang['title'] = "Titre";
$lang['spouse_name'] = "Nom Marital";
$lang['nationality'] = "Nationalité";
$lang['birth_country'] = "Pays de naissance";
$lang['birth_city'] = "Ville de naissance";
$lang['birth_locality'] = "Lieu exact de naissance";
$lang['parent_informations'] = "Informations des parents";
$lang['father_lastname'] = "Nom du père";
$lang['father_firstname'] = "Prénom du père";
$lang['mother_birth_lastname'] = "Nom de naissance de la mère";
$lang['mother_firstname'] = "Prénom de la mère";
$lang['marital_status'] = "Situation matrimoniale";
$lang['spouse_lastname'] = "Nom du conjoint";
$lang['spouse_firstname'] = "Prénom du conjoint";
$lang['employment_details'] = "Employeur";
$lang['profession'] = "Profession";
$lang['business_activity'] = "Secteur d'activité économique";
$lang['sub_sector_business_activity'] = "Sous secteur d'activité";
$lang['tax_number'] = "Numéro Fiscal";
$lang['security_number'] = "Numéro de sécurité sociale";
$lang['employee_number'] = "Numéro de l'employeur";
$lang['function'] = "Fonction";
$lang['employee_name'] = "Nom de l'employeur";
$lang['employee_address'] = "Addresse de l'employeur";
$lang['residential_details'] = "Status résidentiel";
$lang['residential_status'] = "Status de résident";
$lang['residential_country'] = "Pays de résidence";
$lang['residence_permit_number'] = "Numéro de permis de séjour";
$lang['issued_date'] ="Date de délivrance";
$lang['expiry_date'] ="Date d'expiration";
$lang['address_justification_doc'] = "Justificatif d'adresse";
$lang['geographic_address'] = "Adresse géographique";
$lang['po_box'] ="Adresse postale";
$lang['person_to_contact_in_case_of_needs_name'] = "Personne à contacter en cas de besoin";
$lang['identification'] = "Identité";
$lang['identification_document_type'] = "Type de pièce d'identification";
$lang['identification_document_number'] = "Numéro d'identification";
$lang['issuance_city'] = "Ville d'émission";
$lang['issuance_country'] = "Pays d'émission";
$lang['guardianship'] = "Tutelle";
$lang['customer_under_guardianship'] = "Client sous tutelle ? ";
$lang['guardian_fullname'] = "Nom(s) et Prénom(s) du tuteur";
$lang['recommendation'] = "Recommendation";
$lang['how_did_you_know_company'] = "Comment avez vous connu l'entreprise ? ";
$lang['introducer_fullname'] = "Nom(s) et Prénom(s) de l'introducteur";
$lang['know_your_customer'] = "Connaissance du client";
$lang['expected_service'] = "Service attendu";
$lang['income_sources_and_frequency'] = "Fréquence de revenus et Plafond des transactions";
$lang['business_partners'] = "Relation d'affaires";
$lang['bank_references'] = "Référence bancaires";
$lang['has_account_with_other_bank'] = "Avez vous des comptes avec d'autres banques ?";
$lang['more_information_account_opening_request'] = "Complément d'informations pour la demande d'ouverture de compte";
$lang['reject_subscription_account_opening_request'] = "Rejeter la demande d'ouverture de compte";
$lang['has_operative_other_bank_account'] = "Si oui, le compte est-il opérationnel ?";
$lang['has_engagement_with_other_banks'] = "Avez vous des engagements avec d'autres banques ?";
$lang['exposed_person'] = "Personne exposée";
$lang['is_politically_exposed_person'] = "Le demandeur est-il une personne politiquement exposée ?";
$lang['is_politically_exposed_person_in_service'] = "En service ?";
$lang['has_relationship_with_politically_exposed_person'] = "Le demandeur est-il une relation avec des personnes politiquement exposées ?";
$lang['relationship_with_politically_exposed_person'] = "Si oui, indiquez leurs noms et la nature de la relation";
$lang['electronic_products'] = "Produits électroniques";
$lang['email_alerts'] = "Alertes Email";
$lang['e_statement_frequency'] = "Relevé bancaire";
$lang['e_package'] = "E Package";
$lang['debit_card_type'] = "Type de carte de débit";
$lang['opening_account_request_accepted'] = "La demande d'ouverture de compte client été acceptée";
$lang['opening_account_request_rejected'] = "La demande d'ouverture de compte client été rejetée";
$lang['opening_account_request_more_information'] = "La demande d'ouverture de compte client en attente de complement d'informations";
$lang['payment_period_days'] = "Délai de paiement (en jours)";
$lang['required_payment_period_days'] = "Délai de paiement est obligatoire";
$lang['ACCEPTED_UNPAID'] = "Accepté Non payé";
$lang['ACCEPTED_PAID'] = "Acceptée payé";
$lang['fixed_fees'] = "Frais fixes";
$lang['fixed_fees_currency'] = "Monnaie des frais fixes";
$lang['add_rate'] = "Ajouter un taux";
$lang['channel'] = "Cannal/Réseau";
?>

0
application/models/Nano_credit_model.php Normal file → Executable file
View File

0
application/models/Nano_health_model.php Normal file → Executable file
View File

View File

@ -0,0 +1,32 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Created by PhpStorm.
* User: capp
* Date: 29/05/2018
* Time: 15:49
*/
class Opening_account_model extends CI_Model
{
public function getCountRequests($network_id , $validating_agent_id, $state){
$query = $this->db->from('customer_account_opening_requests')->where('status',$state);
if(!empty($validating_agent_id)){
$query = $query->where('validating_agent_id', $validating_agent_id);
}
if(!empty($network_id)){
$query = $query->where('network_id', $network_id);
}
return $query->count_all_results();
}
public function getInfosOpeningAccountRequestId($requestId){
return $this->db->get_where('infos_customer_account_opening_requests',['id' => $requestId])->first_row();
}
public function getOpeningAccountRequestDocuments($requestId){
return $this->db->get_where('customer_account_request_documents',['request_id' => $requestId])->result();
}
}

View File

@ -1270,9 +1270,9 @@ class User_model extends CI_Model
$query = $this->db->query("SELECT COUNT(*) AS c FROM `codeGenerer`
INNER JOIN `networks_agents` ON codeGenerer.id=networks_agents.codeGenerer_id
WHERE codeGenerer.date_creation>= '".$debut."' AND codeGenerer.date_creation<='".$fin."'
AND networks_agents.phone NOT LIKE '+241+241%' AND networks_agents.phone NOT LIKE '+2410000%' AND codeGenerer.code_parrain=
AND networks_agents.phone NOT LIKE '+241+241%' AND networks_agents.phone NOT LIKE '+2410000%' AND codeGenerer.code_parrain IN
(SELECT code_membre FROM codeGenerer WHERE category='super' AND
id=(SELECT codeGenerer_id FROM networks_agents WHERE network_id='".$id_network."' AND
id IN (SELECT codeGenerer_id FROM networks_agents WHERE network_id='".$id_network."' AND
agent_id IN (SELECT id FROM agents WHERE lastname='".$lastname."')
)
)
@ -1879,12 +1879,6 @@ class User_model extends CI_Model
return ($query->num_rows() > 0) ? $query : false;
}
public function getConfigWallet($id_network){
$sql = "SELECT * FROM `configWallet` WHERE id_network = ?";
$query = $this->db->query($sql , array($id_network));
return ($query->num_rows() > 0) ? $query : false;
}
public function addConfigWallet($network_id , $type){
$sql='INSERT INTO `configWallet` (`id_network`, `type`) VALUES (?,?);' ;
$query = $this->db->query($sql , array($network_id, $type));

17
application/models/Wallet_model.php Normal file → Executable file
View File

@ -27,7 +27,7 @@ class Wallet_model extends CI_Model
public function getConfigWallet($id_network){
$query = $this->db->get_where('configWallet' , ['id_network' => $id_network]);
return $query->num_rows() > 0 ? $query : false ;
return $query->num_rows() > 0 ? $query->first_row() : null ;
}
public function verifyConfigWalletInCountry($type, $country_id){
@ -262,22 +262,19 @@ class Wallet_model extends CI_Model
return $query->num_rows() > 0 ? $query : false ;
}
public function insertExchangeRate($currency ,$rate){
$sql = "INSERT INTO `exchange_rate` (`target_currency`, `exchange_rate`) VALUES ( ?, ?);";
$query = $this->db->query($sql , array($currency,$rate));
return $query;
public function insertExchangeRate($currency,$rate){
return $this->db->insert('exchange_rate',['target_currency' => $currency, 'exchange_rate' => $rate]);
}
public function getExchangeRate($currency){
$sql = "SELECT * FROM `exchange_rate` WHERE `target_currency` = ?;";
$query = $this->db->query($sql , array($currency));
$this->db->where('target_currency',$currency);
$query = $this->db->get('exchange_rate');
return $query->num_rows() > 0 ? $query : false ;
}
public function updateExchangeRate($currency,$rate){
$sql = "UPDATE `exchange_rate` SET `exchange_rate` = ? WHERE (`target_currency` = ?);";
$query = $this->db->query($sql , array($currency,$rate));
return $query;
$this->db->where('target_currency',$currency);
$this->db->update('exchange_rate',['target_currency' => $currency, 'exchange_rate' => $rate]);
}
//Liste des pays dont un wallet est actif

View File

@ -0,0 +1,99 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Created by PhpStorm.
* User: capp
* Date: 29/05/2018
* Time: 15:49
*/
class Nano_Credit_model extends CI_Model
{
// Nano credit
public function insertCreditLimit($limit_min, $limit_max, $has_nano_credit, $id_network)
{
$sql = "UPDATE `configWallet` SET `has_nano_credit` = ?, `limite_credit_min` = ? , `limite_credit_max` = ? WHERE (`id_network` = ? );";
return $this->db->query($sql, array($has_nano_credit, $limit_min, $limit_max, $id_network));
}
public function insertNanoCreditSharedRates($taux_ag, $taux_sup, $taux_hyp, $id_network)
{
$sql = "UPDATE `configWallet` SET `taux_com_ag_nano_credit` = ?, `taux_com_sup_nano_credit` = ? , `taux_com_hyp_nano_credit` = ? WHERE (`id_network` = ? );";
return $this->db->query($sql, array($taux_ag, $taux_sup, $taux_hyp, $id_network));
}
public function getAllIlinkWorldNetworks()
{
$query = $this->db->query("SELECT networks.name AS network,networks.status AS status,networks.id,cc.name AS country,networks.country_id , configWallet.id_network , configWallet.type,cc.currency_code,
configWallet.limite_credit_min , configWallet.limite_credit_max , configWallet.has_nano_credit FROM `networks`
INNER JOIN countries_currencies cc ON networks.country_id=cc.id LEFT JOIN configWallet ON configWallet.id_network = networks.id WHERE status = 1 AND configWallet.type = 'ilink'");
if ($query->num_rows() > 0) {
return $query;
} else {
return false;
}
}
public function getUsersGroups($id_network)
{
$query = $this->db->query("SELECT * FROM infos_users_groups WHERE id_network = '" . $id_network . "'");
if ($query->num_rows() > 0) {
return $query;
} else {
return false;
}
}
public function getNanoCreditRates($idConfig, $type = 'nano_credit')
{
$sql = "SELECT * FROM `paliersConfigNanoCredit` WHERE (`idConfig` = ? AND `type` = ? );";
$query = $this->db->query($sql, array($idConfig, $type));
if ($query->num_rows() > 0) {
return $query;
} else {
return false;
}
}
public function deleteNanoCreditRates($idConfig, $type = 'nano_credit')
{
$sql = "DELETE FROM `paliersConfigNanoCredit` WHERE (`idConfig` = ? AND `type` = ? );";
$query = $this->db->query($sql, array($idConfig, $type));
return $query;
}
public function addNanoCreditRates($idConfig, $duree, $valeur, $type = 'nano_credit')
{
$sql = "INSERT INTO `paliersConfigNanoCredit` (`duree_mois`, `taux`, `idConfig` ,`type`) VALUES (?,?,?,?);";
$query = $this->db->query($sql, array($duree, $valeur, $idConfig, $type));
return $query;
}
public function getUserDemandesCredit($debut, $fin, $id_network)
{
$chain = $debut ? " AND date_creation BETWEEN '" . $debut . "' AND '" . $fin . "'" : "";
$query = $this->db->query("SELECT *
FROM infos_users_demandes_credits
WHERE `id_network`='" . $id_network . "'" . $chain);
if ($query->num_rows() > 0) {
return $query;
} else {
return false;
}
}
public function getUsersSavings($debut, $fin, $id_network)
{
$chain = $debut ? " AND date_creation BETWEEN '" . $debut . "' AND '" . $fin . "'" : "";
$query = $this->db->query("SELECT *
FROM infos_users_epargnes
WHERE `id_network`='" . $id_network . "'" . $chain);
if ($query->num_rows() > 0) {
return $query;
} else {
return false;
}
}
}

View File

0
application/models/pagination/CareRequests_model.php Normal file → Executable file
View File

View File

@ -0,0 +1,109 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class CustomerAccountOpeningRequests_model extends CI_Model
{
function __construct()
{
// Set table name
$this->table = 'infos_customer_account_opening_requests';
// Set orderable column fields
$this->column_order = array('unique_id','customer_account_type_name', 'lastname','firstname', 'phone_number', 'status', 'created_at', null);
// Set searchable column fields
$this->column_search = array('unique_id','customer_account_type_name','lastname','firstname', 'phone_number', 'status', 'created_at');
// Set default order
$this->order = array('created_at' => 'desc');
}
/*
* Fetch members data from the database
* @param $_POST filter data based on the posted parameters
*/
public function getRows($postData)
{
$this->_get_datatables_query($postData);
if ($postData['length'] != -1) {
$this->db->limit($postData['length'], $postData['start']);
}
$query = $this->db->get();
return $query->result();
}
/*
* Count all records
*/
public function countAll($postData)
{
$this->db->from($this->table);
if(!empty($postData['id_network'])){
$this->db->where('network_id', $postData['id_network']);
}
if(!empty($postData['validating_agent_id'])){
$this->db->where('validating_agent_id', $postData['validating_agent_id']);
}
return $this->db->count_all_results();
}
/*
* Count records based on the filter params
* @param $_POST filter data based on the posted parameters
*/
public function countFiltered($postData)
{
$this->_get_datatables_query($postData);
$query = $this->db->get();
return $query->num_rows();
}
/*
* Perform the SQL queries needed for an server-side processing requested
* @param $_POST filter data based on the posted parameters
*/
private function _get_datatables_query($postData)
{
$this->db->from($this->table);
if(!empty($postData['id_network'])){
$this->db->where('network_id', $postData['id_network']);
}
if(!empty($postData['validating_agent_id'])){
$this->db->where('validating_agent_id', $postData['validating_agent_id']);
}
if (strlen($postData['startDate']) > 0 && strlen($postData['endDate']) > 0) {
$this->db->where('created_at >=', date('Y-m-d', strtotime($postData['startDate'])));
$this->db->where('created_at <', date('Y-m-d', strtotime($postData['endDate']. "+1 day")));
}
$i = 0;
// loop searchable columns
foreach ($this->column_search as $item) {
// if datatable send POST for search
if ($postData['search']['value']) {
// first loop
if ($i === 0) {
// open bracket
$this->db->group_start();
$this->db->like($item, $postData['search']['value']);
} else {
$this->db->or_like($item, $postData['search']['value']);
}
// last loop
if (count($this->column_search) - 1 == $i) {
// close bracket
$this->db->group_end();
}
}
$i++;
}
if (isset($postData['order'])) {
$this->db->order_by($this->column_order[$postData['order']['0']['column']], $postData['order']['0']['dir']);
} else if (isset($this->order)) {
$order = $this->order;
$this->db->order_by(key($order), $order[key($order)]);
}
}
}

0
application/models/pagination/DrugAndDevices_model.php Normal file → Executable file
View File

View File

View File

View File

0
application/models/pagination/Insurances_model.php Normal file → Executable file
View File

0
application/models/pagination/Invoices_model.php Normal file → Executable file
View File

View File

View File

View File

@ -0,0 +1,272 @@
<!-- Date Picker -->
<link rel="stylesheet" href="<?= base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
<!-- Daterange picker -->
<link rel="stylesheet" href="<?= base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>">
<!-- ChartJS -->
<script src="<?= base_url('bower_components/Chart.js/Chart.js') ?>"></script>
<?php
$month = time();
$months[]=convertDate(date("M"));
$label_months [] = date("M")." ".date("Y");
$years[]= date("Y");
for ($i = 1; $i <= 11; $i++) {
$month = strtotime('last month', $month);
$months [] = convertDate(date("M", $month));
$years[] = date("Y", $month);
$label_months [] = date("M", $month)." ".date("Y", $month);
}
/**
** Liste des souscriptions
**/
$date = date("Y");
$insuranceSubcriptions =array();
for ($i = 1; $i <= 12; $i++) {
$monthQuery = $this->db->query("SELECT id FROM customer_account_opening_requests
WHERE MONTH(created_at) = '".$months[$i-1]."' AND YEAR(created_at) = '".$years[$i-1]."'
AND network_id ='".$this->session->userdata('network_id')."'");
array_push($insuranceSubcriptions, $monthQuery->num_rows());
}
$careRequests = [];
// $date = date("Y");
//
// $demandes_data[] = '';
// $demandes_data =array();
// for ($i = 1; $i <= 12; $i++) {
// $demandes_query_mounth = $this->db->query("SELECT demande_id FROM info_demandeCredits
// WHERE MONTH(dateAjout) = '".$months[$i-1]."' AND YEAR(dateAjout) = ".$years[$i-1]."
// AND codeParrain='".$this->session->userdata('member_code')."'"
// );
// $demandes_data[] = $demandes_query_mounth->num_rows();
// }
//
// $demandes_query = $listdem;
//
// if($demandes_query!=false){
// $demandes=$demandes_query->num_rows();
// // Count networks for simple users
// $array_simple = array();
// $num = 0;
// if ($demandes > 0) {
// foreach($demandes_query->result() as $row) {
// $num++;
// $array_simple[] = $row->codeMembre;
// }
//
// $vals_simple = array_count_values($array_simple);
// //echo 'No. of NON Duplicate Items: '.count($vals_simple).'<br><br>';
// //print_r($vals_simple);
// $pieChart2 = array();
// foreach(array_keys($vals_simple) as $paramName2) {
// $color2 = dechex(rand(0x000000, 0xFFFFFF));
// $trash2 = array("value" => $vals_simple[$paramName2],
// "color" => "#".$color2,
// "highlight" => "#".$color2,
// "label" => $paramName2);
//
// $pieChart2[]= $trash2;
//
// }
// }
// }else{
$pieChart2 = array();
// }
/**
** Geolocated User Treatment
**/
// $users_geolocated_query = $list_geolocated_users;
// // Geolocated Users by month replace 2016 by NOW()
// $users_geolocated_data[] = '';
// $users_geolocated_data =array();
// for ($i = 1; $i <= 12; $i++) {
// $users_geolocated_query_january = $this->db->query("SELECT agent_id FROM super_infos
// WHERE MONTH(date_created) = '".$months[$i-1]."' AND YEAR(date_created) = ".$years[$i-1]."
// AND category='geolocated' AND code_parrain='".$this->session->userdata('member_code')."'");
// $users_geolocated_data[] = $users_geolocated_query_january->num_rows();
// }
//
// if($users_geolocated_query!=false){
//
// $users_geolocated=$users_geolocated_query->num_rows();
// //$users_geolocated_query = json_encode($users_geolocated_query->result());
// // Counts network for geolocated users
// $array_geolocated = array();
// $num = 0;
// if ($users_geolocated > 0) {
// foreach($users_geolocated_query->result() as $row) {
// $num++;
// $array_geolocated[] = date("M", strtotime($row->date_created));
// }
// $vals_geolocated = array_count_values($array_geolocated);
// //echo 'No. of NON Duplicate Items: '.count($vals_geolocated).'<br><br>';
// //print_r($vals_geolocated);
// $pieChart = array();
// foreach(array_keys($vals_geolocated) as $paramName) {
// $color = dechex(rand(0x000000, 0xFFFFFF));
// $trash = array("value" => $vals_geolocated[$paramName],
// "color" => "#".$color,
// "highlight" => "#".$color,
// "label" => $paramName);
//
// $pieChart[]= $trash;
// }
// }
// }else{
// $pieChart = array();
// }
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $this->lang->line('account_opening_agent'); ?>
<small><?= $this->lang->line('Tableau de bord'); ?></small>
</h1>
</section>
<section class="content">
<!-- Small boxes (Stat box) -->
<div class="row">
<div class="col-lg-3 col-md-4 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner">
<h3><?= $count_accepted ?? 0;?></h3>
<p><?= $this->lang->line('accepted_opening_account_requests'); ?></p>
</div>
<div class="icon">
<i class="ion ion-checkmark-circled"></i>
</div>
<a href="<?= base_url('OpeningAccountAgent/requests?history=insurance-subscriptions') ?>" class="small-box-footer"><?= $this->lang->line("Plus d'informations"); ?><i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-3 col-md-4 col-xs-6">
<!-- small box -->
<div class="small-box bg-orange">
<div class="inner">
<h3><?= $count_under_validation ?? 0;?></h3>
<p><?= $this->lang->line('not_treated_opening_account_requests'); ?></p>
</div>
<div class="icon">
<i class="ion ion-alert-circled"></i>
</div>
<a href="<?= base_url('OpeningAccountAgent/requests?history=insurance-subscriptions') ?>" class="small-box-footer"><?= $this->lang->line("Plus d'informations"); ?> <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-lg-3 col-md-4 col-xs-6">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<h3><?= $count_rejected ?? 0;?></h3>
<p><?= $this->lang->line("rejected_opening_account_requests"); ?></p>
</div>
<div class="icon">
<i class="ion ion-close-circled"></i>
</div>
<a href="<?= base_url('OpeningAccountAgent/requests?history=insurance-subscriptions') ?>" data-toggle="modal" data-target="#modal-default2" class="small-box-footer"><?= $this->lang->line("Plus d'informations"); ?> <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<div class="col-xs-12">
<!-- BAR CHART -->
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title"><?= $this->lang->line('customer_account_opening_requests'); ?></h3>
</div>
<div class="box-body">
<div class="chart">
<canvas id="barChart" style="height:230px"></canvas>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- <div class="col-xs-6">-->
<!-- <div class="box box-danger">-->
<!-- <div class="box-header with-border">-->
<!-- <h3 class="box-title">--><?php //echo $this->lang->line('subscription_requests'); ?><!--</h3>-->
<!-- </div>-->
<!-- <div class="box-body" id="chartAd">-->
<!-- <canvas id="pieChart" style="height:250px"></canvas>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
</div>
<!-- /.row -->
</section>
</div>
<!-- jQuery 3 -->
<script src="<?= base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- jQuery UI 1.11.4 -->
<script src="<?= base_url('bower_components/jquery-ui/jquery-ui.min.js') ?>"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
$.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Bootstrap 3.3.7 -->
<script src="<?= base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- Morris.js charts -->
<script src="<?= base_url('bower_components/raphael/raphael.min.js') ?>"></script>
<!-- Sparkline -->
<script src="<?= base_url('bower_components/jquery-sparkline/dist/jquery.sparkline.min.js') ?>"></script>
<!-- jvectormap -->
<script src="<?= base_url('plugins/jvectormap/jquery-jvectormap-1.2.2.min.js') ?>"></script>
<script src="<?= base_url('plugins/jvectormap/jquery-jvectormap-world-mill-en.js') ?>"></script>
<!-- jQuery Knob Chart -->
<script src="<?= base_url('bower_components/jquery-knob/dist/jquery.knob.min.js') ?>"></script>
<!-- daterangepicker -->
<script src="<?= base_url('bower_components/moment/min/moment.min.js') ?>"></script>
<script src="<?= base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
<!-- datepicker -->
<script src="<?= base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
<!-- Bootstrap WYSIHTML5 -->
<script src="<?= base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?= base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?= base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?= base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?= base_url('dist/js/demo.js') ?>"></script>
<!-- ChartJS -->
<script src="<?= base_url('bower_components/chart.js/Chart.js') ?>"></script>
<script >
var areaChartData = {
labels : <?= json_encode($label_months) ?>,
datasets: [
{
label : "<?= $this->lang->line('subscriptions') ?>",
fillColor : 'rgba(255, 162, 0, 1)',
strokeColor : 'rgba(255, 162, 0, 1)',
pointColor : 'rgba(255, 162, 0, 1)',
pointStrokeColor : '#ffa200',
pointHighlightFill : '#fff',
pointHighlightStroke: 'rgba(220,220,220,1)',
data: <?= json_encode($insuranceSubcriptions) ?>
}
]
};
</script>
<!-- Page script -->
<script src="<?= base_url('dist/js/custom.js') ?>"></script>

View File

@ -0,0 +1,130 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>iLink | <?= $this->lang->line('validating_agent');?></title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.7 -->
<link rel="stylesheet" href="<?= base_url('bower_components/bootstrap/dist/css/bootstrap.min.css') ?>">
<!-- Font Awesome -->
<link rel="stylesheet" href="<?= base_url('bower_components/font-awesome/css/font-awesome.min.css') ?>">
<!-- Ionicons -->
<link rel="stylesheet" href="<?= base_url('bower_components/Ionicons/css/ionicons.min.css') ?>">
<!-- Theme style -->
<link rel="stylesheet" href="<?= base_url('dist/css/AdminLTE.css') ?>">
<!-- AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="<?= base_url('dist/css/skins/_all-skins.min.css') ?>">
<link rel="shortcut icon" href="<?= base_url('favicon.ico') ?>" type="image/x-icon">
<link rel="icon" href="<?= base_url('favicon.ico') ?>" type="image/x-icon">
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style media="screen">
.img-dash {
height: 50px !important;
float: left !important;
padding: 1% !important;
}
.table_modified {
font-size: 11px !important;
}
</style>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<header class="main-header">
<!-- Logo -->
<a href="#" class="logo">
<!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini"><b>iLink</b></span>
<!-- logo for regular state and mobile devices -->
<span class="logo-lg">
<img class="img img-responsive img-dash" src="<?= base_url('images/logo.png') ?>">
<b>iLink</b> World
</span>
</a>
<!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top">
<!-- Sidebar toggle button-->
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
<span class="sr-only">Toggle navigation</span>
</a>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<!-- User Account: style can be found in dropdown.less -->
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<?= $this->lang->line('Bienvenue'); ?> <span class="hidden-xs"><b><?= $this->session->userdata('firstname').' '.$this->session->userdata('lastname');?></b></span>
</a>
<ul class="dropdown-menu">
<!-- User image -->
<li class="user-header">
<p>
<?= $this->session->userdata('network');?>
</p>
</li>
<li class="user-body">
<div class="row">
<div class="col-xs-6 text-center">
<?= $this->session->userdata('current_pays');?>
</div>
<div class="col-xs-6 text-center">
<?= $this->session->userdata('email');?>
</div>
</div>
<!-- /.row -->
</li>
<li class="user-footer">
<div class="pull-right">
<a href="<?= base_url('Users/logout') ?>" class="btn btn-default btn-flat"><?= $this->lang->line('Déconnexion'); ?></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
</nav>
</header>
<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
<!-- sidebar menu: : style can be found in sidebar.less -->
<ul class="sidebar-menu" data-widget="tree">
<li class="<?php if($active=="dashboard"){echo "active ";} ?>">
<a href="<?= base_url('OpeningAccountAgent') ?>">
<i class="fa fa-dashboard"></i> <span><?= $this->lang->line('Tableau de bord'); ?></span>
</a>
</li>
<li class="<?php if($active=="subscription_requests"){echo "active ";} ?>">
<a href="<?= base_url('OpeningAccountAgent/requests?history=customer_account_opening_requests') ?>">
<i class="fa fa-copy"></i>
<span><?= $this->lang->line('customer_account_opening_requests'); ?></span>
</a>
</li>
</ul>
</section>
<!-- /.sidebar -->
</aside>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,203 @@
<!-- DataTables -->
<link rel="stylesheet"
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.6.2/css/buttons.dataTables.min.css">
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
<div class="content-wrapper">
<?php
?>
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $this->lang->line('customer_opening_account_requests_history') ?>
<!-- <input type="button" class="btn btn-primary pull-right" id="Bactiver"-->
<!-- value="Activer/Désactiver le(s) réseau(x)" />-->
</h1>
</section>
<section class="content">
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-aqua"><i class="ion ion-android-time"></i></span>
<div class="info-box-content">
<span class="info-box-text"><?= $this->lang->line('Période') ?> </span>
<span class="info-box-number">
<input id="picker"
style="background: #fff; cursor: pointer; padding: 1px 1px; border: 1px solid #ccc; width: 100%"
data-category="<?= isset($category) ? $category : null ?>"
type="text" name="daterange"
data-lang="<?= $this->session->userdata('site_lang') ?>"
value="<?= ($startDate != null & $endDate != null) ? $startDate . ' - ' . $endDate : '' ?>"/>
</span>
<span> Format : <?= $this->session->userdata('site_lang') === 'french' ? 'Jour - Mois - Année ' : 'Year - Month - Day' ?> </span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('export_request_list') ?></h3>
<div class="box-tools">
</div>
</div>
<div class="box-body" style="overflow-x:auto;">
<table id="requests" class="table table-bordered table-striped">
<thead>
<tr>
<th align='center'><?=$this->lang->line('request_id')?></th>
<th>Type</th>
<th><?= $this->lang->line('Nom') ?></th>
<th><?= $this->lang->line('Prénom') ?></th>
<th><?= $this->lang->line('Contact') ?></th>
<th><?= $this->lang->line('state') ?></th>
<th>Date </th>
<th align='center'>Action</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?= base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?= base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?= base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?= base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- SlimScroll -->
<script src="<?= base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?= base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?= base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?= base_url('dist/js/demo.js') ?>"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment-with-locales.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.19/sorting/datetime-moment.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.20/dataRender/datetime.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.html5.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.print.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.colVis.min.js"></script>
<script src="<?= base_url('dist/js/sweetalert2.js') ?>"></script>
<script src="<?= base_url('bower_components/toastr/toastr.js') ?>"></script>
<script>
$(function () {
const lang = $('#picker').data('lang');
const format = lang === 'french' ? 'fr' : 'en';
moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date
var table = $('#requests').DataTable({
// Processing indicator
"processing": true,
"language": {
"processing": "<?= $this->lang->line('loading') ?>",
"emptyTable" : "<?= $this->lang->line('no_demand') ?>"
},
// DataTables server-side processing mode
"serverSide": true,
// Initial no order.
"order": [],
// Load data from an Ajax source
"ajax": {
"url": "<?= base_url('pagination/CustomerAccountOpeningRequests/getLists'); ?>",
"data":{
"startDate" : "<?= $startDate?>",
"endDate" : "<?= $endDate?>",
"id_network" : "<?= $id_network ?? null ?>",
"currentURL" : "<?= current_url()?>"
},
"type": "POST"
},
"aaSorting": [[6, "desc"]],
"columnDefs": [{
"targets": [6],
// "orderable": false,
render: $.fn.dataTable.render.moment( 'YYYY-MM-DD HH:mm:ss' , 'D MMMM YYYY HH:mm:ss', format)
}],
dom: 'Bfrtip',
"buttons": [
'pageLength',
{
"extend": 'excelHtml5',
title: "<?= $this->lang->line('customer_opening_account_requests_history') ?>",
},
{
extend: 'csvHtml5',
title: "<?= $this->lang->line('customer_opening_account_requests_history') ?>",
},
{
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'LEGAL',
title: "<?= $this->lang->line('customer_opening_account_requests_history') ?>",
trim: false,
"action": newexportaction
},
// 'colvis'
]
});
table.buttons().container()
.appendTo('#example_wrapper .col-sm-6:eq(0)');
});
</script>
<script type="text/javascript">
var startDate;
var endDate;
$(function () {
const lang = $('#picker').data('lang');
const category = $('#picker').data('category');
const id_network = "<?= $id_network ?? null ?>";
const ne = "<?=$network_agent_id ?? null ?>"
$('input[name="daterange"]').daterangepicker({
opens: 'left',
autoUpdateInput: false,
locale: {
format: lang === 'french' ? 'DD-MM-YYYY' : 'YYYY-MM-DD',
cancelLabel: 'Clear'
}
}, function (start, end, label) {
const debut = start.format('YYYY-MM-DD');
const fin = end.format('YYYY-MM-DD');
if(category)
window.location = "<?= current_url()?>" + "?history=care-requests" + "&d=" + debut + "&f=" + fin;
else
window.location = "<?= current_url()?>" + "?id="+id_network+"&history=care-requests" + "&d=" + debut + "&f=" + fin;
});
$('input[name="daterange"]').on('cancel.daterangepicker', function(ev, picker) {
//do something, like clearing an input
$('#daterange').val('');
if(category)
window.location = "<?= current_url()?>" + "?history=care-requests";
else
window.location = "<?= current_url()?>" + "?id="+id_network+"&history=care-requests";
});
});
</script>

View File

@ -17,7 +17,7 @@ extract($_POST);
//$showResult = false;
//$frais = 0;
//$taxe = 0;
//$config = $hasWallet->first_row();
//$config = $hasWallet;
////Simulateur
//$com_ag = $this->session->userdata('com_ag') ? $this->session->userdata('com_ag') : 0 ;

View File

@ -0,0 +1,452 @@
<link rel="stylesheet"
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $this->lang->line('customers_accounts_configuration')?>
</h1>
</section>
<?php
use Brick\Money\Context\AutoContext;
use Brick\Money\Money;
$context = new AutoContext();
?>
<section class="content">
<div class="row">
<div class="col-xs-8">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line( 'customer_account_types') ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<table id="customer_account_types" class="table table-bordered table-striped">
<thead>
<tr>
<th align='center'>#</th>
<th><?= $this->lang->line('Nom'); ?></th>
<th>Description</th>
<th>Parent</th>
<th><?= $this->lang->line('opening_amount'); ?></th>
<th><?= $this->lang->line('payment_period_days'); ?></th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach($types ?? [] as $i => $row) { ?>
<tr>
<td><?=$i+1?></td>
<td><?=$row->name?></td>
<td><?=$row->description?></td>
<td><?=$row->parent?></td>
<td><?= empty($row->opening_amount) ? '' : Money::of(round($row->opening_amount, 2), $currency_code ?? 'XAF', $context)->formatTo('fr_FR')?></td>
<td><?= $row->opening_amount_payment_period_days?></td>
<td>
<button class="btn btn-success edit-doc" data-id="<?=$row->id?>" data-name="<?=$row->name?>" data-description="<?=$row->description?>"
data-parent_id="<?=$row->parent_id?>" data-opening_amount="<?=$row->opening_amount?>" data-opening_amount_payment_period_days="<?=$row->opening_amount_payment_period_days?>">
<i class="fa fa-edit"></i>
</button>
<button data-toggle="modal" class="btn btn-danger delete-doc" data-id="<?=$row->id?>" >
<i class="fa fa-trash"></i>
</button>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('add_customer_account_type'); ?></h3>
</div>
<div class="box-body">
<form id="create-form" class="bottom-75 center-block">
<div class="form-group">
<label for="name"><?= $this->lang->line('Nom'); ?></label>
<input type="text" class="form-control input-lg" name="name" id="name" required>
</div>
<div class="form-group">
<label for="description">Description</label>
<textarea class="form-control input-lg" name="description" id="description"></textarea>
</div>
<div class="form-group">
<label for="opening_amount"><?= $this->lang->line('opening_amount'); ?></label>
<input type="number" value="" class="form-control input-lg" name="opening_amount" id="opening_amount">
</div>
<div class="form-group">
<label for="opening_amount_payment_period_days_u"><?= $this->lang->line('payment_period_days'); ?></label>
<input type="number" value="" class="form-control input-lg" name="opening_amount_payment_period_days" id="opening_amount_payment_period_days_u">
</div>
<div class="form-group">
<label class="col-form-label">Parent</label>
<select class="form-control input-lg" name="parent_id" >
<option value="0"> <?=$this->lang->line('no_parent')?> </option>
<?php foreach ($types ?? [] as $value) { ?>
<option value="<?=$value->id?>"> <?=$value->name?> </option>
<?php } ?>
</select>
</div>
<div class="form-group">
<input type="submit"
value="<?= $this->lang->line('save'); ?>"
class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="editModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title"><?= $this->lang->line('Mettre à jour des informations'); ?></h4>
</div>
<div class="modal-body">
<form id="update-form" class="bottom-75 center-block">
<div class="form-group">
<label for="name_u"><?= $this->lang->line('Nom'); ?></label>
<input type="text" class="form-control input-lg" name="name" id="name_u" required>
</div>
<div class="form-group">
<label for="description_u">Description</label>
<textarea class="form-control input-lg" name="description" id="description_u"></textarea>
</div>
<div class="form-group">
<label for="opening_amount_u"><?= $this->lang->line('opening_amount'); ?></label>
<input type="number" value="" class="form-control input-lg" name="opening_amount" id="opening_amount_u">
</div>
<div class="form-group">
<label for="opening_amount_payment_period_days_u"><?= $this->lang->line('payment_period_days'); ?></label>
<input type="number" value="" class="form-control input-lg" name="opening_amount_payment_period_days" id="opening_amount_payment_period_days_u">
</div>
<div class="form-group">
<label class="col-form-label">Parent</label>
<select class="form-control input-lg" name="parent_id" ></select>
</div>
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?= $this->lang->line('documents_list') ; ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new5"><i class="fa fa-plus"></i> <?= $this->lang->line('add_document') ; ?></button>
</div>
</div>
</div>
<table id="documents_list" class="table table-bordered">
<thead>
<tr>
<th><?= $this->lang->line('Nom') ; ?> </th>
<th>Description</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">
<?= $this->lang->line('save'); ?>
</button>
<button type="button" class="btn btn-default pull-right"
data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
</div>
</form>
</div>
</div>
</div>
</div>
<?php $this->load->view('include/delete_modal',['title' => $this->lang->line('delete_customer_account_type')]) ?>
<?php $this->load->view('include/loader') ?>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?= base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?= base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?= base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?= base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?= base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?= base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?= base_url('dist/js/adminlte.min.js') ?>"></script>
<script src="<?= base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="<?= base_url('dist/js/sweetalert2.js') ?>"></script>
<script>
// Taxes
const actions5 = '<a class="add add5" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>\n' +
' <a class="edit edit5" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>\n' +
' <a class="delete delete5" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>';
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
// Append table with add row form on add new button click
$(".new5").click(function(){
$(this).attr("disabled", "disabled");
var index = $("#documents_list tbody tr:last-child").index();
var row = "<tr> <td><input type='text' required class='form-control' name='name'></td> " +
"<td><input type='text' class='form-control' name='description'></td>" +
"<td>" + actions5 + "</td>" +
"</tr>";
$("#documents_list").append(row);
$("#documents_list tbody tr").eq(index + 1).find(".add, .edit").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
$(document).on("click", ".add5", function(){
var empty = false;
var input = $(this).parents("tr").find('input');
var select = $(this).parents("tr").find('select');
input.each(function(){
if(!$(this)[0].checkValidity()){
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else{
$(this).removeClass("error");
}
});
$(this).parents("tr").find(".error").first().focus();
if(!empty){
select.each(function(){
$(this).parent("td").html($(this).val());
});
input.each(function(){
$(this).parent("td").html($(this).val());
});
$(this).parents("tr").find(".add, .edit").toggle();
$(".new5").removeAttr("disabled");
}
});
// Edit row on edit button click
$(document).on("click", ".edit5", function(){
$(this).parents("tr").find("td:not(:last-child)").each(function(index){
if(index == 0)
$(this).html('<input type="text" required class="form-control" value="' + $(this).text() + '">');
if(index == 1)
$(this).html('<input type="text" required class="form-control" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add, .edit").toggle();
$(".new5").attr("disabled", "disabled");
});
// Delete row on delete button click
$(document).on("click", ".delete5", function(){
$(this).parents("tr").remove();
$(".new5").removeAttr("disabled");
});
});
</script>
<script>
toastr.options.closeButton = true;
toastr.options.closeMethod = 'fadeOut';
toastr.options.closeDuration = 5000;
toastr.options.closeEasing = 'swing';
$(function () {
$('#customer_account_types').DataTable({
"language": {
"processing": "<?= $this->lang->line('loading') ?>",
"emptyTable" : "<?= $this->lang->line('no_customer_account_type') ?>"
},
dom: 'Bfrtip',
});
})
var networkId = <?= $network_id ?>;
var selectedId = null
var types = <?= json_encode($types ?? []) ?>;
$(document).on("click", ".edit-doc", function () {
selectedId = $(this).data('id');
$("#update-form input[name='name']").val($(this).data('name'));
$("#update-form textarea[name='description']").val($(this).data('description'));
$("#update-form input[name='opening_amount']").val($(this).data('opening_amount'));
$("#update-form input[name='opening_amount_payment_period_days']").val($(this).data('opening_amount_payment_period_days'));
$("#update-form select[name='parent_id']").empty().append("<option value='0'>"+ "<?this->lang->line('no_parent')?>" + "</option>");
$.each(types, function (j, it) {
$("#update-form select[name='parent_id']").append(`<option value='${it.id}'>${it.name}</option>`);
});
$(`#update-form select[name='parent_id'] option[value='${selectedId}']`).remove();
$("#update-form select[name='parent_id']").val($(this).data('parent_id'));
// Load documents
$("#documents_list tbody").children().remove();
$.each(types, function (j, it) {
if(it.id == selectedId){
$.each(types[j].documents, function (j, doc) {
$('#documents_list').append('<tr>' +
'<td>' + (doc.name || '') + '</td>' +
'<td>' + (doc.description || '') + '</td>' +
'<td>' + actions5 + '</td>' +
'</tr>')
});
}
});
$('#editModal').modal('show');
});
$(document).on("click", ".delete-doc", function () {
selectedId = $(this).data('id');
$('#delete-modal').modal('show');
});
$("#update-form").submit(function () {
let openingAmount = $("input[name=opening_amount]",this).val();
let paymentPeriod = $("input[name=opening_amount_payment_period_days]",this).val();
if (openingAmount && !paymentPeriod){
toastr.warning("<?= $this->lang->line('required_payment_period_days')?>" , "<?= $this->lang->line('request_error')?>");
}else {
// Paliers
var documents = [];
$('#documents_list tr').has('td').each(function() {
var arrayItem = {};
$('td', $(this)).each(function(index, item) {
if(index < 2){
arrayItem[index] = $(item).html();
}
});
documents.push(arrayItem);
});
$.ajax({
url: '<?= base_url('Hyperviseur_dash/storeCustomerAccountType')?>',
type: 'post',
data: {
id: selectedId,
network_id : networkId,
name: $("input[name=name]",this).val(),
description: $("textarea[name=description]",this).val(),
opening_amount: $("input[name=opening_amount]",this).val(),
opening_amount_payment_period_days: $("input[name=opening_amount_payment_period_days]", this).val(),
parent_id : $("select[name=parent_id]",this).val(),
documents: documents
},
dataType: 'json',
success: function (data) {
if(data.code === 200){
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line('customer_account_type_updated')?>",
text:"<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
}else{
toastr.error(data.message , "<?= $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
});
}
event.preventDefault();
});
$("#create-form").submit(function (event) {
let openingAmount = $("input[name=opening_amount]",this).val();
let paymentPeriod = $("input[name=opening_amount_payment_period_days]",this).val();
if (openingAmount && !paymentPeriod){
toastr.warning("<?= $this->lang->line('required_payment_period_days')?>" , "<?= $this->lang->line('request_error')?>");
}else {
$.ajax({
url: '<?= base_url('Hyperviseur_dash/storeCustomerAccountType')?>',
type: 'post',
data: {
network_id: networkId,
name: $("input[name=name]", this).val(),
description: $("textarea[name=description]", this).val(),
opening_amount: $("input[name=opening_amount]", this).val(),
opening_amount_payment_period_days: $("input[name=opening_amount_payment_period_days]", this).val(),
parent_id: $("select[name=parent_id]", this).val()
},
dataType: 'json',
success: function (data) {
if (data.code === 200) {
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line('customer_account_type_created')?>",
text: "<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(() => {
location.reload();
});
} else {
toastr.error(data.message, "<?= $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?= $this->lang->line('error_message')?>", "<?= $this->lang->line('request_error')?>");
}
});
}
event.preventDefault();
});
$("#delete-btn").click(function () {
$.ajax({
url: '<?= base_url('Hyperviseur_dash/deleteCustomerAccountType')?>',
type: 'post',
data: {id: selectedId},
dataType: 'json',
success: function (data) {
if(data.code === 200){
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line('customer_account_type_deleted')?>",
text:"<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
}else{
toastr.error(data.message , "<?= $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
});
event.preventDefault();
});
</script>

View File

@ -0,0 +1,856 @@
<link rel="stylesheet"
href="<?= base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
<link rel="stylesheet" href="<?= base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>">
<link rel="stylesheet"
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
<?php
use Brick\Money\Context\CustomContext;
use Brick\Money\Money;
$context = new \Brick\Money\Context\AutoContext();
$fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $this->lang->line('config_user').' - '.$this->lang->line('config_ilink_user_cart_autre_wallet'); ?>
</h1>
<?php
if ($alert == "ok") {
if (!$success == "ok") {
?>
<div class='alert alert-danger alert-dismissible col-xs-6'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
<?= $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible col-xs-6">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?= $message; ?>
</div>
<?php
}
}
?>
</section>
<section class="content">
<div class="row">
<div class="col-lg-12">
<div class="margin">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-update"
style="width: 100%"><?= $this->lang->line('Modifier la configuration') ?></button>
</div>
</div>
</div>
<div class="callout callout-info">
<p>Note</p>
<h4><?= $this->lang->line('config_ilink_note') ?></h4>
</div>
<div class="row">
<div class="col-lg-6 col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('rate_com_user_cart_autre_wallet_international'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
<th>Min</th>
<th>Max</th>
<th>Taux (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
</tr>
<?php
if ($plr_user_cart_autre_wallet_international) {
foreach ($plr_user_cart_autre_wallet_international->result() as $row) {
echo "<tr>
<td>" . $fmt->format($row->min) . "</td>
<td>" . $fmt->format($row->max) . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('rate_com_user_cart_autre_wallet_national'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
<th>Min</th>
<th>Max</th>
<th>Taux (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
</tr>
<?php
if ($plr_user_cart_autre_wallet_national) {
foreach ($plr_user_cart_autre_wallet_national->result() as $row) {
echo "<tr>
<td>" . $fmt->format($row->min) . "</td>
<td>" . $fmt->format($row->max) . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
</div>
<div class="col-lg-6 col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('rate_com_bank_user_cart_autre_wallet_international'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
<th>Min</th>
<th>Max</th>
<th>Taux (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
</tr>
<?php
if ($plr_bank_user_cart_autre_wallet_international) {
foreach ($plr_bank_user_cart_autre_wallet_international->result() as $row) {
echo "<tr>
<td>" . $fmt->format($row->min) . "</td>
<td>" . $fmt->format($row->max) . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('rate_com_bank_user_cart_autre_wallet_national'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
<th>Min</th>
<th>Max</th>
<th>Taux (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
</tr>
<?php
if ($plr_bank_user_cart_autre_wallet_national) {
foreach ($plr_bank_user_cart_autre_wallet_national->result() as $row) {
echo "<tr>
<td>" . $fmt->format($row->min) . "</td>
<td>" . $fmt->format($row->max) . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
</div>
</div>
<div class="modal fade" id="modal-update">
<div class="modal-dialog" style="max-width: 1300px; width: 100%;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h3 class="modal-title"><?= $this->lang->line('Configuration du wallet'); ?></h3>
</div>
<div class="modal-body">
<form id="walletForm">
<div class="row">
<div class="col-lg-6">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?= $this->lang->line('rate_com_user_cart_autre_wallet_international'); ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new42"><i
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
</button>
</div>
</div>
</div>
<table id="user_cart_autre_wallet_international" class="table table-bordered">
<thead>
<tr>
<th>Min</th>
<th>Max</th>
<th><?= $this->lang->line('rate'); ?> (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if ($plr_user_cart_autre_wallet_international) {
foreach ($plr_user_cart_autre_wallet_international->result() as $row) {
echo "<tr>
<td>" . $row->min . "</td>
<td>" . $row->max . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
<td>
<a class="add add42" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit42" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
<a class="delete delete42" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?= $this->lang->line('rate_com_user_cart_autre_wallet_national'); ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new4"><i
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
</button>
</div>
</div>
</div>
<table id="user_cart_autre_wallet_national" class="table table-bordered">
<thead>
<tr>
<th>Min</th>
<th>Max</th>
<th><?= $this->lang->line('rate'); ?> (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if ($plr_user_cart_autre_wallet_national) {
foreach ($plr_user_cart_autre_wallet_national->result() as $row) {
echo "<tr>
<td>" . $row->min . "</td>
<td>" . $row->max . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
<td>
<a class="add add4" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit4" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
<a class="delete delete4" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
<div class="col-lg-6">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?= $this->lang->line('rate_com_bank_user_cart_autre_wallet_international'); ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new12"><i
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
</button>
</div>
</div>
</div>
<table id="bank_user_cart_autre_wallet_international" class="table table-bordered">
<thead>
<tr>
<th>Min</th>
<th>Max</th>
<th><?= $this->lang->line('rate'); ?> (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if ($plr_bank_user_cart_autre_wallet_international) {
foreach ($plr_bank_user_cart_autre_wallet_international->result() as $row) {
echo "<tr>
<td>" . $row->min . "</td>
<td>" . $row->max . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
<td>
<a class="add add12" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit12" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
<a class="delete delete12" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?= $this->lang->line('rate_com_bank_user_cart_autre_wallet_national'); ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new1"><i
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
</button>
</div>
</div>
</div>
<table id="bank_user_cart_autre_wallet_national" class="table table-bordered">
<thead>
<tr>
<th>Min</th>
<th>Max</th>
<th><?= $this->lang->line('rate'); ?> (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if ($plr_bank_user_cart_autre_wallet_national) {
foreach ($plr_bank_user_cart_autre_wallet_national->result() as $row) {
echo "<tr>
<td>" . $row->min . "</td>
<td>" . $row->max . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
<td>
<a class="add add1" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit1" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
<a class="delete delete1" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left"
data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
<button type="button" id="updateWallet" data-network-id="<?= $network_id ?>"
data-id-config="<?= $idConfig ?>"
class="btn btn-primary"><?= $this->lang->line('save'); ?></button>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?= base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?= base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?= base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?= base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?= base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?= base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?= base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?= base_url('dist/js/demo.js') ?>"></script>
<script src="<?= base_url('bower_components/moment/min/moment.min.js') ?>"></script>
<script src="<?= base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
<script src="<?= base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
<script src="<?= base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="<?= base_url('dist/js/sweetalert2.js') ?>"></script>
<script src="<?= base_url('dist/js/helpers.js') ?>"></script>
<script>
toastr.options.closeButton = true;
toastr.options.closeMethod = 'fadeOut';
toastr.options.closeDuration = 5000;
toastr.options.closeEasing = 'swing';
$('#updateWallet').click(function () {
const network_id = $(this).data('network-id');
const id_config = $(this).data('id-config');
if ($('#walletForm')[0].checkValidity()) {
// Paliers
let plr_user_cart_autre_wallet_national = getPaliersTable('user_cart_autre_wallet_national');
let plr_bank_user_cart_autre_wallet_national = getPaliersTable('bank_user_cart_autre_wallet_national');
let plr_user_cart_autre_wallet_international = getPaliersTable('user_cart_autre_wallet_international');
let plr_bank_user_cart_autre_wallet_international = getPaliersTable('bank_user_cart_autre_wallet_international');
$.ajax({
url: '<?= base_url('Gestion/config_wallet/update')?>',
type: 'POST',
dataType: 'json',
data: {
"type": "ilink",
"config": "user_cart_autre_wallet",
"network_id": network_id, "id_config": id_config,
"plr_user_cart_autre_wallet_national": plr_user_cart_autre_wallet_national,
"plr_bank_user_cart_autre_wallet_national": plr_bank_user_cart_autre_wallet_national,
"plr_user_cart_autre_wallet_international": plr_user_cart_autre_wallet_international,
"plr_bank_user_cart_autre_wallet_international": plr_bank_user_cart_autre_wallet_international,
},
success: function (data) {
if (data == '200') {
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line('wallet_update')?>",
text: "<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(() => {
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" :
} else {
toastr.error("<?= $this->lang->line('error_message')?>", "<?= $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?= $this->lang->line('error_message')?>", "<?= $this->lang->line('request_error')?>");
}
});
} else {
$('#walletForm')[0].reportValidity();
}
});
</script>
<script type="text/javascript">
// Paliers scripts
$(document).ready(function () {
$('[data-toggle="tooltip"]').tooltip();
/**
NATIONAUX
*/
// Table 4
var actions4 = $("#user_cart_autre_wallet_national td:last-child").html();
// Append table with add row form on add new button click
$(".new4").click(function () {
if (!actions4) {
actions4 = '<a class="add add4" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>\n' +
' <a class="edit edit4" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>\n' +
' <a class="delete delete4" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>';
}
$(this).attr("disabled", "disabled");
var index = $("#user_cart_autre_wallet_national tbody tr:last-child").index();
var row = '<tr>' +
'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' +
'<td><input type="number" required class="form-control" name="max" id="max"></td>' +
'<td><input type="number" required step="any" class="form-control" name="taux" id="taux"></td>' +
'<td><input type="number" min="1" class="form-control" name="plafond" id="plafond"></td>' +
'<td> ' + actions4 + '</td>' +
'</tr>';
$("#user_cart_autre_wallet_national").append(row);
$("#user_cart_autre_wallet_national tbody tr").eq(index + 1).find(".add4, .edit4").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
$(document).on("click", ".add4", function () {
var empty = false;
var input = $(this).parents("tr").find('input[type="number"]');
var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val());
var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val());
input.each(function () {
if ($(this).attr('id') == 'min') {
if (min >= max) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else if ($(this).attr('id') == 'max') {
if (max <= min) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else {
if (!$(this)[0].checkValidity()) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
}
});
$(this).parents("tr").find(".error").first().focus();
if (!empty) {
input.each(function () {
$(this).parent("td").html($(this).val());
});
$(this).parents("tr").find(".add4, .edit4").toggle();
$(".new4").removeAttr("disabled");
}
});
// Edit row on edit button click
$(document).on("click", ".edit4", function () {
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
if (index == 0)
$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">');
if (index == 1)
$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">');
if (index == 2)
$(this).html('<input type="number" required class="form-control" step="any" min="0" value="' + $(this).text() + '">');
if (index == 3)
$(this).html('<input type="number" class="form-control" min="1" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add4, .edit4").toggle();
$(".new4").attr("disabled", "disabled");
});
// Delete row on delete button click
$(document).on("click", ".delete4", function () {
$(this).parents("tr").remove();
$(".new4").removeAttr("disabled");
});
//Table 1
var actions1 = $("#bank_user_cart_autre_wallet_national td:last-child").html();
// Append table with add row form on add new button click
$(".new1").click(function () {
if (!actions1) {
actions1 = '<a class="add add1" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>\n' +
' <a class="edit edit1" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>\n' +
' <a class="delete delete1" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>';
}
$(this).attr("disabled", "disabled");
var index = $("#bank_user_cart_autre_wallet_national tbody tr:last-child").index();
var row = '<tr>' +
'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' +
'<td><input type="number" required class="form-control" name="max" id="max"></td>' +
'<td><input type="number" required class="form-control" min="0" step="any" name="taux" id="taux"></td>' +
'<td><input type="number" min="1" class="form-control" name="plafond" id="plafond"></td>' +
'<td> ' + actions1 + '</td>' +
'</tr>';
$("#bank_user_cart_autre_wallet_national").append(row);
$("#bank_user_cart_autre_wallet_national tbody tr").eq(index + 1).find(".add1, .edit1").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
$(document).on("click", ".add1", function () {
var empty = false;
var input = $(this).parents("tr").find('input[type="number"]');
var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val());
var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val());
input.each(function () {
if ($(this).attr('id') == 'min') {
if (min >= max) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else if ($(this).attr('id') == 'max') {
if (max <= min) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else {
if (!$(this)[0].checkValidity()) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
}
});
$(this).parents("tr").find(".error").first().focus();
if (!empty) {
input.each(function () {
$(this).parent("td").html($(this).val());
});
$(this).parents("tr").find(".add1, .edit1").toggle();
$(".new1").removeAttr("disabled");
}
});
// Edit row on edit button click
$(document).on("click", ".edit1", function () {
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
if (index == 0)
$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">');
if (index == 1)
$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">');
if (index == 2)
$(this).html('<input type="number" required class="form-control" step="any" min="0" value="' + $(this).text() + '">');
if (index == 3)
$(this).html('<input type="number" class="form-control" min="1" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add1, .edit1").toggle();
$(".new1").attr("disabled", "disabled");
});
// Delete row on delete button click
$(document).on("click", ".delete1", function () {
$(this).parents("tr").remove();
$(".new1").removeAttr("disabled");
});
// Paliers nationaux
/**
* INTERNATIONAUX
*/
// Table 4
var actions42 = $("#user_cart_autre_wallet_international td:last-child").html();
// Append table with add row form on add new button click
$(".new42").click(function () {
if (!actions42) {
actions42 = '<a class="add add42" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>\n' +
' <a class="edit edit42" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>\n' +
' <a class="delete delete42" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>';
}
$(this).attr("disabled", "disabled");
var index = $("#user_cart_autre_wallet_international tbody tr:last-child").index();
var row = '<tr>' +
'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' +
'<td><input type="number" required class="form-control" name="max" id="max"></td>' +
'<td><input type="number" required step="any" class="form-control" name="taux" id="taux"></td>' +
'<td><input type="number" min="1" class="form-control" name="plafond" id="plafond"></td>' +
'<td> ' + actions42 + '</td>' +
'</tr>';
$("#user_cart_autre_wallet_international").append(row);
$("#user_cart_autre_wallet_international tbody tr").eq(index + 1).find(".add42, .edit42").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
$(document).on("click", ".add42", function () {
var empty = false;
var input = $(this).parents("tr").find('input[type="number"]');
var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val());
var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val());
input.each(function () {
if ($(this).attr('id') == 'min') {
if (min >= max) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else if ($(this).attr('id') == 'max') {
if (max <= min) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else {
if (!$(this)[0].checkValidity()) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
}
});
$(this).parents("tr").find(".error").first().focus();
if (!empty) {
input.each(function () {
$(this).parent("td").html($(this).val());
});
$(this).parents("tr").find(".add42, .edit42").toggle();
$(".new42").removeAttr("disabled");
}
});
// Edit row on edit button click
$(document).on("click", ".edit42", function () {
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
if (index == 0)
$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">');
if (index == 1)
$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">');
if (index == 2)
$(this).html('<input type="number" required class="form-control" step="any" min="0" value="' + $(this).text() + '">');
if (index == 3)
$(this).html('<input type="number" class="form-control" min="1" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add42, .edit42").toggle();
$(".new42").attr("disabled", "disabled");
});
// Delete row on delete button click
$(document).on("click", ".delete42", function () {
$(this).parents("tr").remove();
$(".new42").removeAttr("disabled");
});
//Table 1
var actions12 = $("#bank_user_cart_autre_wallet_international td:last-child").html();
// Append table with add row form on add new button click
$(".new12").click(function () {
if (!actions12) {
actions12 = '<a class="add add12" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>\n' +
' <a class="edit edit12" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>\n' +
' <a class="delete delete12" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>';
}
$(this).attr("disabled", "disabled");
var index = $("#bank_user_cart_autre_wallet_international tbody tr:last-child").index();
var row = '<tr>' +
'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' +
'<td><input type="number" required class="form-control" name="max" id="max"></td>' +
'<td><input type="number" required class="form-control" min="0" step="any" name="taux" id="taux"></td>' +
'<td><input type="number" min="1" class="form-control" name="plafond" id="plafond"></td>' +
'<td> ' + actions12 + '</td>' +
'</tr>';
$("#bank_user_cart_autre_wallet_international").append(row);
$("#bank_user_cart_autre_wallet_international tbody tr").eq(index + 1).find(".add12, .edit12").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
$(document).on("click", ".add12", function () {
var empty = false;
var input = $(this).parents("tr").find('input[type="number"]');
var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val());
var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val());
input.each(function () {
if ($(this).attr('id') == 'min') {
if (min >= max) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else if ($(this).attr('id') == 'max') {
if (max <= min) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else {
if (!$(this)[0].checkValidity()) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
}
});
$(this).parents("tr").find(".error").first().focus();
if (!empty) {
input.each(function () {
$(this).parent("td").html($(this).val());
});
$(this).parents("tr").find(".add12, .edit12").toggle();
$(".new12").removeAttr("disabled");
}
});
// Edit row on edit button click
$(document).on("click", ".edit12", function () {
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
if (index == 0)
$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">');
if (index == 1)
$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">');
if (index == 2)
$(this).html('<input type="number" required class="form-control" step="any" min="0" value="' + $(this).text() + '">');
if (index == 3)
$(this).html('<input type="number" class="form-control" min="1" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add12, .edit12").toggle();
$(".new12").attr("disabled", "disabled");
});
// Delete row on delete button click
$(document).on("click", ".delete12", function () {
$(this).parents("tr").remove();
$(".new12").removeAttr("disabled");
});
});
</script>

View File

@ -97,6 +97,41 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
<!-- /.box-body -->
</div>
</div>
<div class="col-lg-6 col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('rate_com_user_cart_wallet_international'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
<th>Min</th>
<th>Max</th>
<th>Taux (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
</tr>
<?php
if ($plr_user_cart_wallet_international) {
foreach ($plr_user_cart_wallet_international->result() as $row) {
echo "<tr>
<td>" . $fmt->format($row->min) . "</td>
<td>" . $fmt->format($row->max) . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
</div>
</div>
<div class="row mt-5">
<div class="col-lg-6 col-xs-12">
<div class="box">
<div class="box-header">
@ -130,6 +165,39 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
<!-- /.box-body -->
</div>
</div>
<div class="col-lg-6 col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('rate_com_user_cart_cash_international'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
<th>Min</th>
<th>Max</th>
<th>Taux (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
</tr>
<?php
if ($plr_user_cart_cash_international) {
foreach ($plr_user_cart_cash_international->result() as $row) {
echo "<tr>
<td>" . $fmt->format($row->min) . "</td>
<td>" . $fmt->format($row->max) . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
</div>
</div>
<div class="row" style="margin-top: 20px">
<div class="col-lg-6 col-xs-12">
@ -165,6 +233,41 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
<!-- /.box-body -->
</div>
</div>
<div class="col-lg-6 col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('rate_com_hyp_remove_cart_ilink_international'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
<th>Min</th>
<th>Max</th>
<th>Taux (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
</tr>
<?php
if ($plr_hyp_user_cart_cash_international) {
foreach ($plr_hyp_user_cart_cash_international->result() as $row) {
echo "<tr>
<td>" . $fmt->format($row->min) . "</td>
<td>" . $fmt->format($row->max) . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
</div>
</div>
<div class="row" style="margin-top: 20px">
<div class="col-lg-6 col-xs-12">
<div class="box">
<div class="box-header">
@ -198,6 +301,39 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
<!-- /.box-body -->
</div>
</div>
<div class="col-lg-6 col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('rate_com_bq_remove_cart_ilink_international'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
<th>Min</th>
<th>Max</th>
<th>Taux (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
</tr>
<?php
if ($plr_bank_user_cart_cash_international) {
foreach ($plr_bank_user_cart_cash_international->result() as $row) {
echo "<tr>
<td>" . $fmt->format($row->min) . "</td>
<td>" . $fmt->format($row->max) . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
</div>
</div>
<div class="modal fade" id="modal-update">
@ -259,6 +395,55 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
</table>
</div>
</div>
<div class="col-lg-6">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?= $this->lang->line('rate_com_user_cart_wallet_international'); ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new12"><i
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
</button>
</div>
</div>
</div>
<table id="user_cart_wallet_international" class="table table-bordered">
<thead>
<tr>
<th>Min</th>
<th>Max</th>
<th><?= $this->lang->line('rate'); ?> (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if ($plr_user_cart_wallet_international) {
foreach ($plr_user_cart_wallet_international->result() as $row) {
echo "<tr>
<td>" . $row->min . "</td>
<td>" . $row->max . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
<td>
<a class="add add12" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit12" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
<a class="delete delete12" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
@ -269,7 +454,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new7"><i
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
</button>
</div>
</div>
@ -306,6 +491,53 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
</table>
</div>
</div>
<div class="col-lg-6">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?= $this->lang->line('rate_com_user_cart_cash_international'); ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new72"><i
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
</button>
</div>
</div>
</div>
<table id="user_cart_cash_international" class="table table-bordered">
<thead>
<tr>
<th>Min</th>
<th>Max</th>
<th><?= $this->lang->line('rate'); ?> (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if ($plr_user_cart_cash_international) {
foreach ($plr_user_cart_cash_international->result() as $row) {
echo "<tr>
<td>" . $row->min . "</td>
<td>" . $row->max . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
<td>
<a class="add add72" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit72" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
<a class="delete delete72" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE8722;</i></a>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
@ -355,6 +587,55 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
</table>
</div>
</div>
<div class="col-lg-6">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?= $this->lang->line('rate_com_hyp_remove_cart_ilink_international'); ?></label>
</div>
<div class="col-sm-42">
<button type="button" class="btn btn-info add-new new42"><i
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
</button>
</div>
</div>
</div>
<table id="hyp_user_cart_cash_international" class="table table-bordered">
<thead>
<tr>
<th>Min</th>
<th>Max</th>
<th><?= $this->lang->line('rate'); ?> (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if ($plr_hyp_user_cart_cash_international) {
foreach ($plr_hyp_user_cart_cash_international->result() as $row) {
echo "<tr>
<td>" . $row->min . "</td>
<td>" . $row->max . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
<td>
<a class="add add42" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit42" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE2542;</i></a>
<a class="delete delete42" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
@ -365,7 +646,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new5"><i
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
</button>
</div>
</div>
@ -402,6 +683,53 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
</table>
</div>
</div>
<div class="col-lg-6">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?= $this->lang->line('rate_com_bq_remove_cart_ilink_international'); ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new52"><i
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
</button>
</div>
</div>
</div>
<table id="bank_user_cart_cash_international" class="table table-bordered">
<thead>
<tr>
<th>Min</th>
<th>Max</th>
<th><?= $this->lang->line('rate'); ?> (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if ($plr_bank_user_cart_cash_international) {
foreach ($plr_bank_user_cart_cash_international->result() as $row) {
echo "<tr>
<td>" . $row->min . "</td>
<td>" . $row->max . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
<td>
<a class="add add52" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit52" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE2524;</i></a>
<a class="delete delete52" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
</form>
</div>
@ -454,16 +782,16 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
if ($('#walletForm')[0].checkValidity()) {
// Paliers
// let plr_hyp_user_cart_cash_international = getPaliersTable('hyp_user_cart_cash_international');
let plr_hyp_user_cart_cash_international = getPaliersTable('hyp_user_cart_cash_international');
let plr_hyp_user_cart_cash_national = getPaliersTable('hyp_user_cart_cash_national');
// let plr_user_cart_cash_international = getPaliersTable('user_cart_cash_international');
let plr_user_cart_cash_international = getPaliersTable('user_cart_cash_international');
let plr_user_cart_cash_national = getPaliersTable('user_cart_cash_national');
// let plr_user_cart_wallet_international = getPaliersTable('user_cart_wallet_international');
let plr_user_cart_wallet_international = getPaliersTable('user_cart_wallet_international');
let plr_user_cart_wallet_national = getPaliersTable('user_cart_wallet_national');
// let plr_bank_user_cart_cash_international = getPaliersTable('bank_user_cart_cash_international');
let plr_bank_user_cart_cash_international = getPaliersTable('bank_user_cart_cash_international');
let plr_bank_user_cart_cash_national = getPaliersTable('bank_user_cart_cash_national');
@ -478,7 +806,11 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
"plr_hyp_user_cart_cash_national": plr_hyp_user_cart_cash_national,
"plr_user_cart_cash_national": plr_user_cart_cash_national,
"plr_user_cart_wallet_national": plr_user_cart_wallet_national,
"plr_bank_user_cart_cash_national" : plr_bank_user_cart_cash_national
"plr_bank_user_cart_cash_national" : plr_bank_user_cart_cash_national,
"plr_hyp_user_cart_cash_international": plr_hyp_user_cart_cash_international,
"plr_user_cart_cash_international": plr_user_cart_cash_international,
"plr_user_cart_wallet_international": plr_user_cart_wallet_international,
"plr_bank_user_cart_cash_international": plr_bank_user_cart_cash_international
},
success: function (data) {
if (data == '200') {
@ -779,9 +1111,9 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
// Paliers nationaux
// Table 7
// Table 7
var actions7 = $("#user_cart_cash_national td:last-child").html();
// Append table with add row form on add new button click
// Append table with add row form on add new button click
$(".new7").click(function () {
if (!actions7) {
actions7 = '<a class="add add7" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE07B;</i></a>\n' +
@ -801,7 +1133,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
$("#user_cart_cash_national tbody tr").eq(index + 1).find(".add7, .edit7").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
// Add row on add button click
$(document).on("click", ".add7", function () {
var empty = false;
var input = $(this).parents("tr").find('input[type="number"]');
@ -844,7 +1176,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
$(".new7").removeAttr("disabled");
}
});
// Edit row on edit button click
// Edit row on edit button click
$(document).on("click", ".edit7", function () {
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
if (index == 0)
@ -864,5 +1196,354 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
$(this).parents("tr").remove();
$(".new7").removeAttr("disabled");
});
// Internationaux
//Table 12
var actions12 = $("#user_cart_wallet_international td:last-child").html();
// Append table with add row form on add new button click
$(".new12").click(function () {
if (!actions12) {
actions12 = '<a class="add add12" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>\n' +
' <a class="edit edit12" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>\n' +
' <a class="delete delete12" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>';
}
$(this).attr("disabled", "disabled");
var index = $("#user_cart_wallet_international tbody tr:last-child").index();
var row = '<tr>' +
'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' +
'<td><input type="number" required class="form-control" name="max" id="max"></td>' +
'<td><input type="number" required class="form-control" min="0" step="any" name="taux" id="taux"></td>' +
'<td><input type="number" min="1" class="form-control" name="plafond" id="plafond"></td>' +
'<td> ' + actions12 + '</td>' +
'</tr>';
$("#user_cart_wallet_international").append(row);
$("#user_cart_wallet_international tbody tr").eq(index + 1).find(".add12, .edit12").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
$(document).on("click", ".add12", function () {
var empty = false;
var input = $(this).parents("tr").find('input[type="number"]');
var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val());
var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val());
input.each(function () {
if ($(this).attr('id') == 'min') {
if (min >= max) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else if ($(this).attr('id') == 'max') {
if (max <= min) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else {
if (!$(this)[0].checkValidity()) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
}
});
$(this).parents("tr").find(".error").first().focus();
if (!empty) {
input.each(function () {
$(this).parent("td").html($(this).val());
});
$(this).parents("tr").find(".add12, .edit12").toggle();
$(".new12").removeAttr("disabled");
}
});
// Edit row on edit button click
$(document).on("click", ".edit12", function () {
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
if (index == 0)
$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">');
if (index == 1)
$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">');
if (index == 2)
$(this).html('<input type="number" required class="form-control" step="any" min="0" value="' + $(this).text() + '">');
if (index == 3)
$(this).html('<input type="number" class="form-control" min="1" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add12, .edit12").toggle();
$(".new12").attr("disabled", "disabled");
});
// Delete row on delete button click
$(document).on("click", ".delete12", function () {
$(this).parents("tr").remove();
$(".new12").removeAttr("disabled");
});
// Table 72
var actions72 = $("#user_cart_cash_international td:last-child").html();
// Append table with add row form on add new button click
$(".new72").click(function () {
if (!actions72) {
actions72 = '<a class="add add72" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE072B;</i></a>\n' +
' <a class="edit edit72" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>\n' +
' <a class="delete delete72" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE8722;</i></a>';
}
$(this).attr("disabled", "disabled");
var index = $("#user_cart_cash_international tbody tr:last-child").index();
var row = '<tr>' +
'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' +
'<td><input type="number" required class="form-control" name="max" id="max"></td>' +
'<td><input type="number" required step="any" class="form-control" name="taux" id="taux"></td>' +
'<td><input type="number" min="1" class="form-control" name="plafond" id="plafond"></td>' +
'<td> ' + actions72 + '</td>' +
'</tr>';
$("#user_cart_cash_international").append(row);
$("#user_cart_cash_international tbody tr").eq(index + 1).find(".add72, .edit72").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
$(document).on("click", ".add72", function () {
var empty = false;
var input = $(this).parents("tr").find('input[type="number"]');
var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val());
var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val());
input.each(function () {
if ($(this).attr('id') == 'min') {
if (min >= max) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else if ($(this).attr('id') == 'max') {
if (max <= min) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else {
if (!$(this)[0].checkValidity()) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
}
});
$(this).parents("tr").find(".error").first().focus();
if (!empty) {
input.each(function () {
$(this).parent("td").html($(this).val());
});
$(this).parents("tr").find(".add72, .edit72").toggle();
$(".new72").removeAttr("disabled");
}
});
// Edit row on edit button click
$(document).on("click", ".edit72", function () {
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
if (index == 0)
$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">');
if (index == 1)
$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">');
if (index == 2)
$(this).html('<input type="number" required class="form-control" step="any" min="0" value="' + $(this).text() + '">');
if (index == 3)
$(this).html('<input type="number" class="form-control" min="1" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add72, .edit72").toggle();
$(".new72").attr("disabled", "disabled");
});
// Delete row on delete button click
$(document).on("click", ".delete72", function () {
$(this).parents("tr").remove();
$(".new72").removeAttr("disabled");
});
// Table 42
var actions42 = $("#hyp_user_cart_cash_international td:last-child").html();
// Append table with add row form on add new button click
$(".new42").click(function () {
if (!actions42) {
actions42 = '<a class="add add42" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>\n' +
' <a class="edit edit42" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE2542;</i></a>\n' +
' <a class="delete delete42" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>';
}
$(this).attr("disabled", "disabled");
var index = $("#hyp_user_cart_cash_international tbody tr:last-child").index();
var row = '<tr>' +
'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' +
'<td><input type="number" required class="form-control" name="max" id="max"></td>' +
'<td><input type="number" required step="any" class="form-control" name="taux" id="taux"></td>' +
'<td><input type="number" min="1" class="form-control" name="plafond" id="plafond"></td>' +
'<td> ' + actions42 + '</td>' +
'</tr>';
$("#hyp_user_cart_cash_international").append(row);
$("#hyp_user_cart_cash_international tbody tr").eq(index + 1).find(".add42, .edit42").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
$(document).on("click", ".add42", function () {
var empty = false;
var input = $(this).parents("tr").find('input[type="number"]');
var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val());
var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val());
input.each(function () {
if ($(this).attr('id') == 'min') {
if (min >= max) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else if ($(this).attr('id') == 'max') {
if (max <= min) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else {
if (!$(this)[0].checkValidity()) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
}
});
$(this).parents("tr").find(".error").first().focus();
if (!empty) {
input.each(function () {
$(this).parent("td").html($(this).val());
});
$(this).parents("tr").find(".add42, .edit42").toggle();
$(".new42").removeAttr("disabled");
}
});
// Edit row on edit button click
$(document).on("click", ".edit42", function () {
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
if (index == 0)
$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">');
if (index == 1)
$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">');
if (index == 2)
$(this).html('<input type="number" required class="form-control" step="any" min="0" value="' + $(this).text() + '">');
if (index == 3)
$(this).html('<input type="number" class="form-control" min="1" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add42, .edit42").toggle();
$(".new42").attr("disabled", "disabled");
});
// Delete row on delete button click
$(document).on("click", ".delete42", function () {
$(this).parents("tr").remove();
$(".new42").removeAttr("disabled");
});
var actions52 = $("#bank_user_cart_cash_international td:last-child").html();
// Append table with add row form on add new button click
$(".new52").click(function () {
if (!actions52) {
actions52 = '<a class="add add52" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>\n' +
' <a class="edit edit52" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE2524;</i></a>\n' +
' <a class="delete delete52" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>';
}
$(this).attr("disabled", "disabled");
var index = $("#bank_user_cart_cash_international tbody tr:last-child").index();
var row = '<tr>' +
'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' +
'<td><input type="number" required class="form-control" name="max" id="max"></td>' +
'<td><input type="number" required step="any" class="form-control" name="taux" id="taux"></td>' +
'<td><input type="number" min="1" class="form-control" name="plafond" id="plafond"></td>' +
'<td> ' + actions52 + '</td>' +
'</tr>';
$("#bank_user_cart_cash_international").append(row);
$("#bank_user_cart_cash_international tbody tr").eq(index + 1).find(".add52, .edit52").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
$(document).on("click", ".add52", function () {
var empty = false;
var input = $(this).parents("tr").find('input[type="number"]');
var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val());
var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val());
input.each(function () {
if ($(this).attr('id') == 'min') {
if (min >= max) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else if ($(this).attr('id') == 'max') {
if (max <= min) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else {
if (!$(this)[0].checkValidity()) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
}
});
$(this).parents("tr").find(".error").first().focus();
if (!empty) {
input.each(function () {
$(this).parent("td").html($(this).val());
});
$(this).parents("tr").find(".add52, .edit52").toggle();
$(".new52").removeAttr("disabled");
}
});
// Edit row on edit button click
$(document).on("click", ".edit52", function () {
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
if (index == 0)
$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">');
if (index == 1)
$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">');
if (index == 2)
$(this).html('<input type="number" required class="form-control" step="any" min="0" value="' + $(this).text() + '">');
if (index == 3)
$(this).html('<input type="number" class="form-control" min="1" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add52, .edit52").toggle();
$(".new52").attr("disabled", "disabled");
});
// Delete row on delete button click
$(document).on("click", ".delete52", function () {
$(this).parents("tr").remove();
$(".new52").removeAttr("disabled");
});
});
</script>

View File

@ -0,0 +1,490 @@
<link rel="stylesheet"
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $this->lang->line('payment_aggregators') ; ?>
</h1>
</section>
<section class="content">
<div class="row">
<div class="col-xs-8">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('payment_aggregators'); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<table id="aggregators" class="table table-bordered table-striped">
<thead>
<tr>
<th align='center'>#</th>
<th><?= $this->lang->line('Nom'); ?></th>
<th align='center'><?= $this->lang->line('Adresse'); ?></th>
<th align='center'><?= $this->lang->line('Contact'); ?></th>
<th align='center'><?= $this->lang->line('Statut'); ?></th>
<th align='center'><?php echo $this->lang->line('Activer'); ?></th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
if(isset($aggregators)){
foreach ($aggregators as $i => $row) {
?>
<tr>
<td align='center'><?= $i+1?></td>
<td><?= $row->name ?></td>
<td align='center'><?=$row->address?></td>
<td align='center'><?=$row->phone?></td>
<td align='center'><?= $this->lang->line($row->status ? 'Active' : 'Inactive'); ?></td>
<td align='center'>
<input type='checkbox' value='<?=$row->id?>' <?= $row->status ? 'checked' : '' ?>>
</td>
<td>
<button class='btn btn-success edit-row' data-id="<?=$row->id?>" data-address="<?=$row->address?>" data-name="<?=$row->name?>"
data-email="<?=$row->email?>" data-phone="<?=$row->phone?>" >
<i class='fa fa-edit'></i>
</button>
<button data-toggle='modal' class='btn btn-danger delete-row' data-id="<?=$row->id?>">
<i class='fa fa-trash'></i>
</button>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<button type="button" class="btn btn-success" id="enableAggregator"><?php echo $this->lang->line('Activer/Désactiver'); ?></button>
</div>
</div>
</div>
<div class="col-xs-4">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('add_aggregator'); ?></h3>
</div>
<div class="box-body">
<form id="create-aggregator-form" class="bottom-75 center-block" method="post">
<div class="form-group">
<label for="name"><?= $this->lang->line('Nom'); ?></label>
<input type="text" class="form-control input-lg" name="name" required>
</div>
<div class="form-group">
<label for="email"><?= $this->lang->line('Email'); ?></label>
<input type="email" class="form-control input-lg" name="email" required>
</div>
<div class="form-group">
<label for="address"><?= $this->lang->line('Adresse'); ?></label>
<input type="text" class="form-control input-lg" name="address">
</div>
<div class="form-group">
<label for="contact"><?= $this->lang->line('Contact'); ?></label>
<input type="text" class="form-control input-lg" name="phone">
</div>
<div class="form-group">
<input type="submit"
value="<?= $this->lang->line('Ajouter'); ?>"
class="btn btn-primary">
</div>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="editModal">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title"><?= $this->lang->line('Mettre à jour des informations'); ?></h4>
</div>
<div class="modal-body">
<form id="update-form" method="post" class="bottom-75 center-block">
<div class="form-group">
<label><?= $this->lang->line('Nom'); ?></label>
<input type="text" class="form-control input-lg" name="name" required>
</div>
<div class="form-group">
<label><?= $this->lang->line('Email'); ?></label>
<input type="email" class="form-control input-lg" name="email" required>
</div>
<div class="form-group">
<label><?= $this->lang->line('Adresse'); ?></label>
<input type="text" class="form-control input-lg" name="address" >
</div>
<div class="form-group">
<label><?= $this->lang->line('Contact'); ?></label>
<input type="text" class="form-control input-lg" name="phone">
</div>
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?=$this->lang->line('rate')?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new5"><i class="fa fa-plus"></i> <?= $this->lang->line('add_rate') ; ?></button>
</div>
</div>
</div>
<table id="rates_list" class="table table-bordered">
<thead>
<tr>
<th><?= $this->lang->line('Pays')?> </th>
<th>Type</th>
<th>Methode</th>
<th><?=$this->lang->line('channel')?></th>
<th><?=$this->lang->line('rate')?></th>
<th><?=$this->lang->line('fixed_fees')?></th>
<th><?=$this->lang->line('fixed_fees_currency')?></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="form-group">
<input id="btn-update" type="submit"
value="<?= $this->lang->line('save'); ?>" class="btn btn-primary">
<button type="button" class="btn btn-default pull-right"
data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
</div>
</form>
</div>
</div>
</div>
</div>
<?php $this->load->view('include/delete_modal') ?>
<?php $this->load->view('include/loader') ?>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?= base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?= base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?= base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?= base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?= base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?= base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?= base_url('dist/js/adminlte.min.js') ?>"></script>
<script src="<?= base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="<?= base_url('dist/js/sweetalert2.js') ?>"></script>
<script>
// Taxes
const actions5 = '<a class="add add5" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>\n' +
' <a class="edit edit5" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>\n' +
' <a class="delete delete5" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>';
$(document).ready(function() {
$('[data-toggle="tooltip"]').tooltip();
// Append table with add row form on add new button click
$(".new5").click(function(){
$(this).attr("disabled", "disabled");
var index = $("#rates_list tbody tr:last-child").index();
var row = "<tr> <td><input type='text' required class='form-control' name='country'></td> " +
"<td><input type='text' required class='form-control' name='type'></td>" +
"<td><input type='text' required class='form-control' name='method'></td>" +
"<td><input type='text' class='form-control' name='channel'></td>" +
"<td><input type='number' required class='form-control' min='0' value='0' step='.1' name='rate'></td>" +
"<td><input type='number' class='form-control' min='0' step='.1' name='fixed_fees'></td>" +
"<td><input type='text' class='form-control' name='fixed_fees_currency'></td>" +
"<td>" + actions5 + "</td>" +
"</tr>";
$("#rates_list").append(row);
$("#rates_list tbody tr").eq(index + 1).find(".add5, .edit5").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
$(document).on("click", ".add5", function(){
var empty = false;
var input = $(this).parents("tr").find('input');
var select = $(this).parents("tr").find('select');
input.each(function(){
if(!$(this)[0].checkValidity()){
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else{
$(this).removeClass("error");
}
});
$(this).parents("tr").find(".error").first().focus();
if(!empty){
select.each(function(){
$(this).parent("td").html($(this).val());
});
input.each(function(){
$(this).parent("td").html($(this).val());
});
$(this).parents("tr").find(".add, .edit").toggle();
$(".new5").removeAttr("disabled");
}
});
// Edit row on edit button click
$(document).on("click", ".edit5", function(){
$(this).parents("tr").find("td:not(:last-child)").each(function(index){
if(index == 0)
$(this).html('<input type="text" required class="form-control" value="' + $(this).text() + '">');
if(index == 1)
$(this).html('<input type="text" required class="form-control" value="' + $(this).text() + '">');
if(index == 2)
$(this).html('<input type="text" required class="form-control" value="' + $(this).text() + '">');
if(index == 3)
$(this).html('<input type="text" class="form-control" value="' + $(this).text() + '">');
if(index == 4)
$(this).html('<input type="number" min="0" required class="form-control" step=".1" value="' + $(this).text() + '">');
if(index == 5)
$(this).html('<input type="number" min="0" class="form-control" step=".1" value="' + $(this).text() + '">');
if(index == 6)
$(this).html('<input type="text" class="form-control" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add, .edit").toggle();
$(".new5").attr("disabled", "disabled");
});
// Delete row on delete button click
$(document).on("click", ".delete5", function(){
$(this).parents("tr").remove();
$(".new5").removeAttr("disabled");
});
});
</script>
<script>
toastr.options.closeButton = true;
toastr.options.closeMethod = 'fadeOut';
toastr.options.closeDuration = 5000;
toastr.options.closeEasing = 'swing';
var selectedId = null
var checkedId = null
var aggregators = <?= json_encode($aggregators ?? []) ?>;
function showEnableButton() {
if($("#aggregators input:checked").length){
$('#enableAggregator').show();
$("#aggregators input:checked").each(function() {
checkedId = $(this).val()
});
}else{
$('#enableAggregator').hide();
checkedId = null
}
}
$(function () {
$('#aggregators').DataTable();
showEnableButton()
})
$('#aggregators').on('change', 'input[type=checkbox]', function(e) {
if(this.checked){
$("#aggregators").find("input[type=checkbox]").not(this).prop('checked', false);
}
showEnableButton()
});
$(document).on("click", ".edit-row", function () {
selectedId = $(this).data('id');
$("#update-form input[name='name']").val($(this).data('name'));
$("#update-form input[name='address']").val($(this).data('address'));
$("#update-form input[name='email']").val($(this).data('email'));
$("#update-form input[name='phone']").val($(this).data('phone'));
// Load rates
$("#rates_list tbody").children().remove();
$.each(aggregators, function (j, it) {
if(it.id == selectedId){
$.each(aggregators[j].rates, function (j, r) {
$('#rates_list').append('<tr>' +
'<td>' + (r.country || '') + '</td>' +
'<td>' + (r.type || '') + '</td>' +
'<td>' + (r.method || '') + '</td>' +
'<td>' + (r.channel || '') + '</td>' +
'<td>' + (r.rate || 0) + '</td>' +
'<td>' + (r.fixed_fees || '') + '</td>' +
'<td>' + (r.fixed_fees_currency || '') + '</td>' +
'<td>' + actions5 + '</td>' +
'</tr>')
});
}
});
$('#editModal').modal('show');
});
$(document).on("click", ".delete-row", function () {
selectedId = $(this).data('id');
$('#delete-modal').modal('show');
});
$("#update-form").submit(function () {
// Paliers
var rates = [];
$('#rates_list tr').has('td').each(function() {
var arrayItem = {};
$('td', $(this)).each(function(index, item) {
if(index < 7){
arrayItem[index] = $(item).html();
}
});
rates.push(arrayItem);
});
$.ajax({
url: '<?= base_url('PaymentController/storePaymentAggregator')?>',
type: 'post',
data: {
id: selectedId,
name: $("input[name=name]",this).val(),
address: $("input[name=address]",this).val(),
email: $("input[name=email]",this).val(),
phone: $("input[name=phone]",this).val(),
rates: rates
},
dataType: 'json',
success: function (data) {
if(data.code === 200){
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line('aggregator_updated')?>",
text:"<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
}else{
toastr.error(data.message , "<?= $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
});
event.preventDefault();
});
$("#create-aggregator-form").submit(function (event) {
$.ajax({
url: '<?= base_url('PaymentController/storePaymentAggregator')?>',
type: 'post',
data: {
name: $("input[name=name]",this).val(),
address: $("input[name=address]",this).val(),
email: $("input[name=email]",this).val(),
phone: $("input[name=phone]",this).val()
},
dataType: 'json',
success: function (data) {
if(data.code === 200){
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line('aggregator_created')?>",
text:"<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
}else{
toastr.error(data.message , "<?= $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
});
event.preventDefault();
});
$("#enableAggregator").click(function () {
$.ajax({
url: '<?= base_url('PaymentController/enableAggregator')?>',
type: 'post',
data: {id: checkedId},
dataType: 'json',
success: function (data) {
if(data.code === 200){
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line('aggregator_activated')?>",
text:"<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
}else{
toastr.error(data.message , "<?= $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
});
});
$("#delete-btn").click(function () {
$.ajax({
url: '<?= base_url('PaymentController/deletePaymentAggregator')?>',
type: 'post',
data: {id: selectedId},
dataType: 'json',
success: function (data) {
if(data.code === 200){
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line('aggregator_deleted')?>",
text:"<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
}else{
toastr.error(data.message , "<?= $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
});
event.preventDefault();
});
</script>

View File

@ -246,7 +246,7 @@ $converter = new CurrencyConverter($provider);
type: 'GET',
dataType: 'json',
success: function (data) {
if(data=='200'){
if(data===200){
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line('rates_update')?>",

View File

@ -422,13 +422,13 @@
<?php if ($row->status) {
$user_image = $row->user_image;
$user_image_file = @fopen($user_image ,'r');
$user_image_file = empty($user_image) ? null : @fopen($user_image ,'r');
$document_front = $row->document_image_front;
$document_front_file = @fopen($document_front ,'r');
$document_front_file = empty($document_front) ? null : @fopen($document_front ,'r');
$document_back = $row->document_image_back;
$document_back_file = @fopen($document_back ,'r');
$document_back_file = empty($document_back) ? null : @fopen($document_back ,'r');
?>
<label class="text-center text-muted" style="padding: 10px"> Identification </label>
<div class="row">
@ -641,13 +641,13 @@
</div>
<?php if ($row->status) {
$user_image = $row->user_image;
$user_image_file = @fopen($user_image ,'r');
$user_image_file = empty($user_image) ? null : @fopen($user_image ,'r');
$document_front = $row->document_image_front;
$document_front_file = @fopen($document_front ,'r');
$document_front_file = empty($document_front) ? null : @fopen($document_front ,'r');
$document_back = $row->document_image_back;
$document_back_file = @fopen($document_back ,'r');
$document_back_file = empty($document_back) ? null : @fopen($document_back ,'r');
?>
<label class="text-center text-muted" style="padding: 10px"> Identification </label>
<div class="row">

View File

@ -354,7 +354,7 @@ if ($transactions) {
<script>
$(function () {
$('#example1').DataTable();
})
</script>

View File

@ -254,23 +254,29 @@ $context = new \Brick\Money\Context\AutoContext();
</div>
</div>
<div class="row">
<div class="col-lg-4">
<div class="col-lg-3">
<div class="margin">
<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#rechargeAccount"><?= $this->lang->line('recharge_hypervisor_account') ?> </button>
</div>
</div>
<div class="col-lg-4">
<div class="col-lg-3">
<div class="margin">
<a class="btn btn-info" href="<?= current_url().($network_id ? '?config=taxes' : '')?>"
style="width: 100%"><?= $this->lang->line('edit_tax') ?></a>
</div>
</div>
<div class="col-lg-4">
<div class="col-lg-3">
<div class="margin">
<a href="<?= current_url().($network_id ? '?config=paying_networks' : '')?>" class="btn btn-success"
style="width: 100%"><?= $this->lang->line('edit_paying_and_transmitting_networks') ?></a>
</div>
</div>
<div class="col-lg-3">
<div class="margin">
<a href="<?= current_url().($network_id ? '?config=customers_accounts' : '')?>" class="btn btn-primary"
style="width: 100%"><?= $this->lang->line('customers_accounts_configuration') ?></a>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-3 col-xs-6">
@ -311,8 +317,15 @@ $context = new \Brick\Money\Context\AutoContext();
</div>
</a>
</div>
</div>
<div class="row">
<div class="col-lg-3 col-xs-6">
<a class="small-box bg-yellow-active"
href="<?= current_url() . ($network_id ? '?config=user_cart_autre_wallet' : '') ?>">
<div class="inner">
<h5><?= $this->lang->line('config_user')?></h5>
<h4><?= $this->lang->line('config_ilink_user_cart_autre_wallet') ?></h4>
</div>
</a>
</div>
<div class="col-lg-3 col-xs-6">
<a class="small-box bg-blue-active"
href="<?= current_url() . ($network_id ? '?config=agent_remove_cash' : '') ?>">
@ -464,58 +477,8 @@ $context = new \Brick\Money\Context\AutoContext();
</div>
</div>
</div>
<div class="modal fade" id="rechargeAccount" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title"><?= $this->lang->line('recharge_hypervisor_account'); ?></h3>
</div>
<div class="modal-body">
<?php if ($walletPassword != null) { ?>
<form id="rechargeAccountForm">
<div class="form-group">
<label for="montant" class="col-form-label"><?= $this->lang->line('Montant') ?></label>
<input type="text" required class="form-control" id="montant" name="montant" >
</div>
<!-- <div class="form-group">-->
<!-- <label for="password" class="col-form-label">--><?php //echo $this->lang->line('mot de passe') ?><!--</label>-->
<!-- <input type="password" required class="form-control" name="password" id="password">-->
<!-- </div>-->
<div class="form-group">
<label><?= $this->lang->line('mot de passe') ?></label>
<div class="input-group" id="show_hide_password">
<input class="form-control" name="password" id="password" type="password">
<div class="input-group-addon">
<a href=""><i class="fa fa-eye-slash" aria-hidden="true"></i></a>
</div>
</div>
</div>
<div class="clearfix">
<a href="#" id="resetPassword" class="pull-right forgot-password" data-wallet_password_id="<?= $walletPassword->id ?>" data-network="<?= $network ?>" data-country="<?= $country ?>"
data-email="<?= $walletPassword->email ?>">
<?= $this->lang->line('i_forgot_password') ?>
</a>
</div>
</form>
<?php }else{ ?>
<div class="text-center">
<h4> <?= $this->lang->line('no_wallet_password') ?></h4>
<a href="<?= base_url('Hyperviseur_dash/walletPassword') ?>" alt="" class="btn btn-primary"><?= $this->lang->line('click_here') ?></a>
</div>
<?php } ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
<?php if ($walletPassword != null) { ?>
<button type="button" class="btn btn-primary" data-wallet_id="<?= $wallet_id ?>" data-salt="<?= $walletPassword->salt ?>" data-encrypted_password="<?= $walletPassword->encrypted_password ?>" id="rechargeWallet" >
<?= $this->lang->line('recharge'); ?>
</button>
<?php }?>
</div>
</div>
</div>
</div>
</section>
<?php $this->load->view('include/recharge_account_modal',['walletPassword' => $walletPassword, 'network' => $network, 'country' => $country, 'wallet_id' => $wallet_id]) ?>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?= base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
@ -541,39 +504,6 @@ $context = new \Brick\Money\Context\AutoContext();
<script src="<?= base_url('bower_components/chart.js/Chart.js') ?>"></script>
<script src="<?= base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="<?= base_url('dist/js/sweetalert2.js') ?>"></script>
<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.5.4"></script>
<script>
$(function () {
$('#example1').DataTable();
anElement = new AutoNumeric('#montant', '', {digitGroupSeparator: ' ', decimalPlaces:'0', minimumValue : '1' , maximumValue: '99999999999999999999999999'});
$("#show_hide_password a").on('click', function(event) {
event.preventDefault();
if($('#show_hide_password input').attr("type") == "text"){
$('#show_hide_password input').attr('type', 'password');
$('#show_hide_password i').addClass( "fa-eye-slash" );
$('#show_hide_password i').removeClass( "fa-eye" );
}else if($('#show_hide_password input').attr("type") == "password"){
$('#show_hide_password input').attr('type', 'text');
$('#show_hide_password i').removeClass( "fa-eye-slash" );
$('#show_hide_password i').addClass( "fa-eye" );
}
});
// $('#example1').DataTable({
// "aLengthMenu": [[5, 10, 15, -1], [5, 10, 5, "All"]],
// "iDisplayLength": 5
// });
// $('#example2').DataTable({
// 'paging' : true,
// 'lengthChange': false,
// 'searching' : false,
// 'ordering' : true,
// 'info' : true,
// 'autoWidth' : false
// })
})
</script>
<script>
var areaChartData = {
@ -657,57 +587,7 @@ $context = new \Brick\Money\Context\AutoContext();
});
});
$('#rechargeWallet').click(function () {
const wallet_id = $(this).data('wallet_id');
const salt = $(this).data('salt');
const encrypted_password = $(this).data('encrypted_password');
if ($('#rechargeAccountForm')[0].checkValidity()) {
const montant = anElement.getNumber(); //parseFloat($('#montant').val());
const password = $('#password').val();
$.ajax({
url: '<?= base_url('Hyperviseur_dash/recharge_wallet')?>',
type: 'POST',
dataType: 'json',
data: {
"wallet_id": wallet_id,
"montant": montant ,
"password": password,
"salt" : salt,
"encrypted_password" : encrypted_password
},
success: function (data) {
if(data=='200'){
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line('account_recharged')?>",
text: "<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" :
}else if(data == '400'){
toastr.error("<?= $this->lang->line('incorrect_password')?>" , "<?= $this->lang->line('request_error')?>");
}else{
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
});
} else {
$('#rechargeAccountForm')[0].reportValidity();
}
});
</script>
<!-- Page script -->
<script src="<?= base_url('dist/js/custom.js') ?>"></script>

View File

@ -169,7 +169,7 @@
</li>
<?php if (($hasWallet->first_row()->type == 'ilink') && ($hasWallet->first_row()->has_nano_credit)) { ?>
<?php if (($hasWallet?->type == 'ilink') && ($hasWallet?->has_nano_credit)) { ?>
<li class="<?php if ($active == "nano_credit") {
echo "active";
} ?>">

View File

@ -104,7 +104,7 @@
<ul class="sidebar-menu" data-widget="tree">
<?php if ($hasWallet) {
?>
<?php if ($hasWallet->first_row()->type == 'ilink_sante') { ?>
<?php if ($hasWallet?->type == 'ilink_sante') { ?>
<li class="<?php if ($active == "wallet_health_care_sheets") {
echo "active";
} ?>">

View File

@ -190,6 +190,11 @@
<i class="fa fa-building"></i> <span><?= $this->lang->line('operators'); ?></span>
</a>
</li>
<li class="<?php if($active=="aggregators"){echo "active";} ?>">
<a href="<?php echo base_url('index.php/Gestion/aggregators') ?>">
<i class="ion ion-cash"></i> <span><?php echo $this->lang->line('aggregators'); ?></span>
</a>
</li>
<li class="<?php if($active=="settings"){echo "active";} ?>">
<a href="<?= base_url('Gestion/settings') ?>">
<i class="ion ion-settings"></i> <span><?= $this->lang->line('settings'); ?></span>

View File

@ -140,7 +140,7 @@
} ?>">
<a href="#" data-toggle="modal" data-target="#modal-default">
<i class="fa fa-users"></i>
<span><?= $this->lang->line($hasWallet->first_row()->type == 'ilink_sante' ? 'service_providers' : 'Utilisateurs géolocalisés'); ?></span>
<span><?= $this->lang->line($hasWallet?->type == 'ilink_sante' ? 'service_providers' : 'Utilisateurs géolocalisés'); ?></span>
</a>
</li>
@ -152,7 +152,7 @@
</a>
</li>
<?php if ($hasWallet->first_row()->type != 'ilink_sante') { ?>
<?php if ($hasWallet?->type != 'ilink_sante') { ?>
<li class="<?= "treeview " . ((strpos($active, "demandes_credits") !== false) ? "active menu-open" : "") ?>"
style="height: auto;">
<a href="#">
@ -191,7 +191,7 @@
</a>
</li>
<?php } ?>
<?php if ($hasWallet) { ?>
<?php if ($hasWallet && $hasWallet?->type) { ?>
<li class="<?= "treeview " . ((strpos($active, "wallet_") !== false) ? "active menu-open" : "") ?>"
style="height: auto;">
<a href="#">
@ -211,7 +211,17 @@
<span>Wallet<?php //echo $this->lang->line('Game'); ?></span>
</a>
</li>
<?php if ($hasWallet->first_row()->type == 'ilink_sante') { ?>
<?php if ($hasWallet?->type == 'ilink') { ?>
<li class="<?php if ($active == "wallet_validating_account_opening_agents") {
echo "active";
} ?>">
<a href="<?= base_url('Hyperviseur_dash/validating_agents/account_opening_agents') ?>">
<i class="fa fa-users"></i>
<span><?= $this->lang->line('account_opening_agents'); ?></span>
</a>
</li>
<?php } ?>
<?php if ($hasWallet?->type == 'ilink_sante') { ?>
<li class="<?php if ($active == "wallet_drugs_and_devices") {
echo "active";
} ?>">
@ -289,7 +299,7 @@
</li>
<?php if (($hasWallet->first_row()->type == 'ilink') && ($hasWallet->first_row()->has_nano_credit)) { ?>
<?php if (($hasWallet?->type == 'ilink') && ($hasWallet?->has_nano_credit)) { ?>
<li class="<?php if ($active == "nano_credit") {
echo "active";
} ?>">
@ -316,7 +326,7 @@
</a>
</li>
<?php if (($hasWallet) && ($hasWallet->first_row()->type == 'ilink')) { ?>
<?php if (($hasWallet) && ($hasWallet?->type == 'ilink')) { ?>
<li class="<?php if ($active == "documentation") {
echo "active";
} ?>">

View File

@ -118,7 +118,7 @@
</a>
</li>
</li>
<?php if($hasWallet->first_row()->type != 'ilink_sante') { ?>
<?php if($hasWallet?->type != 'ilink_sante') { ?>
<li class="<?= "treeview " . ((strpos($active, "demandes_credits") !== false) ? "active menu-open" : "") ?>"
style="height: auto;">
<a href="#">
@ -162,7 +162,7 @@
</a>
</li>
<?php if (($hasWallet->first_row()->type == 'ilink') && ($hasWallet->first_row()->has_nano_credit)) { ?>
<?php if (($hasWallet?->type == 'ilink') && ($hasWallet?->has_nano_credit)) { ?>
<li class="<?php if ($active == "nano_credit") {
echo "active";
} ?>">

View File

@ -131,7 +131,7 @@ if($users_geolocated_query!=false){
<div class="inner">
<h3><?= $count_geo;?></h3>
<p><?= $this->lang->line($hasWallet->first_row()->type == 'ilink_sante' ? 'service_providers' : 'Utilisateurs géolocalisés'); ?></p>
<p><?= $this->lang->line($hasWallet?->type == 'ilink_sante' ? 'service_providers' : 'Utilisateurs géolocalisés'); ?></p>
</div>
<div class="icon">
<i class="ion ion-location"></i>
@ -154,7 +154,7 @@ if($users_geolocated_query!=false){
<a href="<?= base_url('Hyperviseur_dash/getAllSupervisor') ?>" class="small-box-footer"><?= $this->lang->line("Plus d'informations"); ?> <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<?php if($hasWallet->first_row()->type != 'ilink_sante') { ?>
<?php if($hasWallet?->type != 'ilink_sante') { ?>
<div class="col-lg-2 col-md-4 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
@ -232,7 +232,7 @@ if($users_geolocated_query!=false){
</div>
</div>
<div class="row">
<?php if($hasWallet->first_row()->type != 'ilink_sante') { ?>
<?php if($hasWallet?->type != 'ilink_sante') { ?>
<div class="col-xs-6">
<!-- DONUT CHART -->
<div class="box box-danger">
@ -251,7 +251,7 @@ if($users_geolocated_query!=false){
<!-- DONUT CHART -->
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title"><?= $this->lang->line( $hasWallet->first_row()->type == 'ilink_sante' ? 'service_providers_per_town' : "Utilisateurs géolocalisés par ville"); ?></h3>
<h3 class="box-title"><?= $this->lang->line( $hasWallet?->type == 'ilink_sante' ? 'service_providers_per_town' : "Utilisateurs géolocalisés par ville"); ?></h3>
</div>
<div class="box-body" id="chart">
<canvas id="pieChart" style="height:250px"></canvas>
@ -341,7 +341,7 @@ if($users_geolocated_query!=false){
Pie = JSON.parse(Pie);
}
<?php if($hasWallet->first_row()->type != 'ilink_sante') { ?>
<?php if($hasWallet?->type != 'ilink_sante') { ?>
var Pie2 = '<?= json_encode($pieChart2) ?>';
if(Pie2==='[]') {
var select = document.getElementById('chart2');

0
application/views/include/delete_modal.php Normal file → Executable file
View File

0
application/views/include/loader.php Normal file → Executable file
View File

View File

@ -0,0 +1,125 @@
<div class="modal fade" id="rechargeAccount" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title"><?= $this->lang->line('recharge_hypervisor_account'); ?></h3>
</div>
<div class="modal-body">
<?php if ($walletPassword != null) { ?>
<form id="rechargeAccountForm">
<div class="form-group">
<label for="montant" class="col-form-label"><?= $this->lang->line('Montant') ?></label>
<input type="text" required class="form-control" id="montant" name="montant" >
</div>
<!-- <div class="form-group">-->
<!-- <label for="password" class="col-form-label">--><?php //echo $this->lang->line('mot de passe') ?><!--</label>-->
<!-- <input type="password" required class="form-control" name="password" id="password">-->
<!-- </div>-->
<div class="form-group">
<label><?= $this->lang->line('mot de passe') ?></label>
<div class="input-group" id="show_hide_password">
<input class="form-control" name="password" id="password" type="password">
<div class="input-group-addon">
<a href=""><i class="fa fa-eye-slash" aria-hidden="true"></i></a>
</div>
</div>
</div>
<div class="clearfix">
<a href="#" id="resetPassword" class="pull-right forgot-password" data-wallet_password_id="<?= $walletPassword->id ?>" data-network="<?= $network ?>" data-country="<?= $country ?>"
data-email="<?= $walletPassword->email ?>">
<?= $this->lang->line('i_forgot_password') ?>
</a>
</div>
</form>
<?php }else{ ?>
<div class="text-center">
<h4> <?= $this->lang->line('no_wallet_password') ?></h4>
<a href="<?= base_url('Hyperviseur_dash/walletPassword') ?>" alt="" class="btn btn-primary"><?= $this->lang->line('click_here') ?></a>
</div>
<?php } ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
<?php if ($walletPassword != null) { ?>
<button type="button" class="btn btn-primary" data-wallet_id="<?= $wallet_id ?>" data-salt="<?= $walletPassword->salt ?>" data-encrypted_password="<?= $walletPassword->encrypted_password ?>" id="rechargeWallet" >
<?= $this->lang->line('recharge'); ?>
</button>
<?php }?>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.5.4"></script>
<script>
$(function () {
$('#example1').DataTable();
anElement = new AutoNumeric('#montant', '', {digitGroupSeparator: ' ', decimalPlaces:'0', minimumValue : '1' , maximumValue: '99999999999999999999999999'});
$("#show_hide_password a").on('click', function(event) {
event.preventDefault();
if($('#show_hide_password input').attr("type") == "text"){
$('#show_hide_password input').attr('type', 'password');
$('#show_hide_password i').addClass( "fa-eye-slash" );
$('#show_hide_password i').removeClass( "fa-eye" );
}else if($('#show_hide_password input').attr("type") == "password"){
$('#show_hide_password input').attr('type', 'text');
$('#show_hide_password i').removeClass( "fa-eye-slash" );
$('#show_hide_password i').addClass( "fa-eye" );
}
});
$('#rechargeWallet').click(function () {
const wallet_id = $(this).data('wallet_id');
const salt = $(this).data('salt');
const encrypted_password = $(this).data('encrypted_password');
if ($('#rechargeAccountForm')[0].checkValidity()) {
const montant = anElement.getNumber(); //parseFloat($('#montant').val());
const password = $('#password').val();
$.ajax({
url: '<?= base_url('Hyperviseur_dash/recharge_wallet')?>',
type: 'POST',
dataType: 'json',
data: {
"wallet_id": wallet_id,
"montant": montant ,
"password": password,
"salt" : salt,
"encrypted_password" : encrypted_password
},
success: function (data) {
if(data=='200'){
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line('account_recharged')?>",
text: "<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" :
}else if(data == '400'){
toastr.error("<?= $this->lang->line('incorrect_password')?>" , "<?= $this->lang->line('request_error')?>");
}else{
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
});
} else {
$('#rechargeAccountForm')[0].reportValidity();
}
});
})
</script>

View File

@ -26,7 +26,7 @@
<!-- value="Activer/Désactiver le(s) réseau(x)" />-->
</h1>
<?php
if ($alert == "ok") {
@ -317,35 +317,3 @@
});
</script>
<script>
$(document).on("click", "#cancel", function () {
const id_transaction = $(this).data('id-transaction');
$.ajax({
url: '<?= base_url('Gestion/cancelIlinkTransation')?>',
type: 'POST',
dataType: 'json',
data: {"id_transaction": id_transaction},
async: true,
success: function (data) {
if (data) {
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line('canceled_transaction')?>",
text: "<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(() => {
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" : location.reload();
} else {
toastr.error("<?= $this->lang->line('error_message')?>", "<?= $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, erreur) {
console.log(resultat + " " + erreur);
toastr.error("<?= $this->lang->line('error_message')?>", "<?= $this->lang->line('request_error')?>");
}
});
});
</script>

0
application/views/nano_credit/historique_savings.php Normal file → Executable file
View File

0
application/views/nano_health/agent/scripts.php Normal file → Executable file
View File

View File

@ -97,8 +97,11 @@ $careRequests = [];
</div>
</div>
<div class="row">
<div class="margin">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-update"
<div class="col-lg-4">
<button type="button" class="btn btn-primary btn-block margin" data-toggle="modal" data-target="#rechargeAccount"><?= $this->lang->line('recharge_hypervisor_account') ?> </button>
</div>
<div class="col-lg-8">
<button type="button" class="btn btn-primary margin" data-toggle="modal" data-target="#modal-update"
style="width: 100%"><?= $this->lang->line('Modifier la configuration') ?></button>
</div>
</div>
@ -819,6 +822,9 @@ $careRequests = [];
<?php $this->load->view('include/delete_modal',['title' => $this->lang->line('delete_provider_class'), 'id' => 'class']) ?>
<?php $this->load->view('include/loader') ?>
</section>
<?php $this->load->view('include/recharge_account_modal',['walletPassword' => $walletPassword, 'network' => $network, 'country' => $country, 'wallet_id' => $wallet_id]) ?>
</div>
<!-- jQuery 3 -->
<script src="<?= base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
@ -1292,7 +1298,7 @@ $careRequests = [];
});
</script>
<script type="text/javascript">
$(document).ready(function () {
$('[data-toggle="tooltip"]').tooltip();
@ -1399,7 +1405,7 @@ $careRequests = [];
$(this).parents("tr").remove();
$(".new1").removeAttr("disabled");
});
//Months Grid
var actions2 = $("#months_prices_grid td:last-child").html();

View File

@ -11,6 +11,9 @@
case 'CONTROLLER':
$title1 ='manage_controllers_doctors';
break;
case 'OPENING_ACCOUNT_AGENT':
$title1 ='manage_account_opening_agents';
break;
default:
$title1 = 'manage_validating_agents';
}
@ -34,6 +37,9 @@
case 'CONTROLLER':
$title2 ='controllers_doctors';
break;
case 'OPENING_ACCOUNT_AGENT':
$title2 ='account_opening_agents';
break;
default:
$title2 = 'validating_agents';
}
@ -99,6 +105,9 @@
case 'CONTROLLER':
$title3 ='add_controller_doctor';
break;
case 'OPENING_ACCOUNT_AGENT':
$title3 ='add_account_opening_agent';
break;
default:
$title3 = 'add_validating_agent';
}
@ -205,7 +214,7 @@
$('#agents').DataTable();
})
var idConfig = <?= $config_id ?>;
var networkId = "<?=$network_id ?>"
var selectedId = null
$(document).on("click", ".edit", function () {
@ -231,6 +240,9 @@
case 'CONTROLLER':
$title4 ='controller_doctor_updated';
break;
case 'OPENING_ACCOUNT_AGENT':
$title4 ='account_opening_agent_updated';
break;
default:
$title4 = 'validating_agent_updated';
}
@ -279,6 +291,9 @@
case 'CONTROLLER':
$title5 ='controller_doctor_created';
break;
case 'OPENING_ACCOUNT_AGENT':
$title5 ='account_opening_agent_created';
break;
default:
$title5 = 'validating_agent_created';
}
@ -289,7 +304,7 @@
url: '<?= base_url('NanoHealthController/createValidatingAgent')?>',
type: 'post',
data: {
nh_network_config_id : idConfig,
network_id : networkId,
lastname: $("input[name=lastname]",this).val(),
firstname: $("input[name=firstname]",this).val(),
email: $("input[name=email]",this).val(),
@ -328,6 +343,9 @@
case 'CONTROLLER':
$title6 ='controller_doctor_deleted';
break;
case 'OPENING_ACCOUNT_AGENT':
$title6 ='account_opening_agent_deleted';
break;
default:
$title6 = 'validating_agent_deleted';
}

View File

@ -7,14 +7,14 @@
<div class="modal-body">
<?php
$profile_image = $row->profile_image;
$profile_image_file = @fopen($profile_image,'r');
$profile_image_file = empty($profile_image) ? null : @fopen($profile_image,'r');
if($row->affiliation == 'CHILD') {
$birthdate_proof_doc = $row->birthdate_proof_doc;
$birthdate_proof_doc_file = @fopen($birthdate_proof_doc ,'r');
$birthdate_proof_doc_file = empty($birthdate_proof_doc) ? null : @fopen($birthdate_proof_doc ,'r');
$justice_doc = $row->justice_doc;
$justice_doc_file = @fopen($justice_doc ,'r');
$justice_doc_file = empty($justice_doc) ? null : @fopen($justice_doc ,'r');
?>
<div class="row text-center" style="justify-content: center; display: flex;">
@ -43,13 +43,13 @@
<?php } else {
$marriage_certificate_doc = $row->marriage_certificate_doc;
$marriage_certificate_doc_file = @fopen($marriage_certificate_doc,'r');
$marriage_certificate_doc_file = empty($marriage_certificate_doc) ? null : @fopen($marriage_certificate_doc,'r');
$id_document_front = $row->id_document_front;
$id_document_front_file = @fopen($id_document_front ,'r');
$id_document_front = $row->id_document_front;
$id_document_front_file = empty($id_document_front) ? null : @fopen($id_document_front ,'r');
$id_document_back = $row->id_document_back;
$id_document_back_file = @fopen($id_document_front ,'r');
$id_document_back = $row->id_document_back;
$id_document_back_file = empty($id_document_front) ? null : @fopen($id_document_back ,'r');
?>

View File

@ -60,7 +60,6 @@
"jquery-ui": "1.11.4",
"toastr": "^2.1.3",
"js-xlsx": "^0.16.8",
"file-saver": "^2.0.4",
"google-material-icons": "^2.2.1"
"file-saver": "^2.0.4"
}
}

View File

@ -11,7 +11,7 @@
"source": "https://github.com/bcit-ci/CodeIgniter"
},
"require": {
"php": ">=7.0",
"php": ">=8.0",
"spatie/async": "^1.4",
"nesbot/carbon": "^2.33",
"brick/money": "^0.4.5",

0
dist/css/custom/levels-table.css vendored Normal file → Executable file
View File

0
dist/css/theme.css vendored Normal file → Executable file
View File

0
dist/fontawesome/LICENSE.txt vendored Normal file → Executable file
View File

0
dist/fontawesome/css/all.css vendored Normal file → Executable file
View File

0
dist/fontawesome/css/all.min.css vendored Normal file → Executable file
View File

0
dist/fontawesome/css/brands.css vendored Normal file → Executable file
View File

0
dist/fontawesome/css/brands.min.css vendored Normal file → Executable file
View File

0
dist/fontawesome/css/fontawesome.css vendored Normal file → Executable file
View File

0
dist/fontawesome/css/fontawesome.min.css vendored Normal file → Executable file
View File

0
dist/fontawesome/css/regular.css vendored Normal file → Executable file
View File

0
dist/fontawesome/css/regular.min.css vendored Normal file → Executable file
View File

0
dist/fontawesome/css/solid.css vendored Normal file → Executable file
View File

0
dist/fontawesome/css/solid.min.css vendored Normal file → Executable file
View File

0
dist/fontawesome/css/svg-with-js.css vendored Normal file → Executable file
View File

0
dist/fontawesome/css/svg-with-js.min.css vendored Normal file → Executable file
View File

0
dist/fontawesome/css/v4-shims.css vendored Normal file → Executable file
View File

0
dist/fontawesome/css/v4-shims.min.css vendored Normal file → Executable file
View File

0
dist/fontawesome/js/all.js vendored Normal file → Executable file
View File

0
dist/fontawesome/js/all.min.js vendored Normal file → Executable file
View File

0
dist/fontawesome/js/brands.js vendored Normal file → Executable file
View File

0
dist/fontawesome/js/brands.min.js vendored Normal file → Executable file
View File

0
dist/fontawesome/js/fontawesome.js vendored Normal file → Executable file
View File

0
dist/fontawesome/js/fontawesome.min.js vendored Normal file → Executable file
View File

0
dist/fontawesome/js/regular.js vendored Normal file → Executable file
View File

0
dist/fontawesome/js/regular.min.js vendored Normal file → Executable file
View File

0
dist/fontawesome/js/solid.js vendored Normal file → Executable file
View File

0
dist/fontawesome/js/solid.min.js vendored Normal file → Executable file
View File

0
dist/fontawesome/js/v4-shims.js vendored Normal file → Executable file
View File

0
dist/fontawesome/js/v4-shims.min.js vendored Normal file → Executable file
View File

0
dist/fontawesome/less/_animated.less vendored Normal file → Executable file
View File

0
dist/fontawesome/less/_bordered-pulled.less vendored Normal file → Executable file
View File

0
dist/fontawesome/less/_core.less vendored Normal file → Executable file
View File

0
dist/fontawesome/less/_fixed-width.less vendored Normal file → Executable file
View File

0
dist/fontawesome/less/_icons.less vendored Normal file → Executable file
View File

Some files were not shown because too many files have changed in this diff Show More