diff --git a/application/config/config.php b/application/config/config.php index c40ec889..2a7dfe80 100755 --- a/application/config/config.php +++ b/application/config/config.php @@ -23,7 +23,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); | a PHP script and you can easily do that on your own. | */ -$config['base_url'] = 'https://'.$_SERVER['SERVER_NAME'].'/backoffice'; +$config['base_url'] = '/';// 'https://'.$_SERVER['SERVER_NAME'].'/backoffice'; /* |-------------------------------------------------------------------------- diff --git a/application/config/database.php b/application/config/database.php index 8e493c59..afa220e2 100755 --- a/application/config/database.php +++ b/application/config/database.php @@ -77,8 +77,10 @@ $db['default'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'root', - 'password' => '@iLink@2025', - 'database' => 'iLink_preprod', + 'password' => 'songuinho', + 'database' => 'iLink_world', + // 'password' => '@iLink@2025', + // 'database' => 'iLink_preprod', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => FALSE, diff --git a/application/controllers/Gestion.php b/application/controllers/Gestion.php index 1ee6d02b..9728bcc0 100755 --- a/application/controllers/Gestion.php +++ b/application/controllers/Gestion.php @@ -2560,7 +2560,7 @@ class Gestion extends CI_Controller 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['pays'] = $this->user_model->getAllPays(); $data['game_pays'] = $this->user_model->getGameCountry(); $this->load->view('header_gestion', $data); $this->load->view('gestion_aggregators'); @@ -2568,6 +2568,81 @@ class Gestion extends CI_Controller } } + public function agency_banking(){ + if ($this->isLogged()) { + + $data['accounts'] = $this->user_model->getAllRequests(); + $data['alert'] = ""; + $data['active'] = "agency_banking"; + $data['game_pays'] = $this->user_model->getGameCountry(); + + $this->load->view('header_gestion', $data); + $this->load->view('gestion_agency_banking'); + $this->load->view('footer'); + } + } + + public function update_request_agency() { + $id = $this->input->post('id'); + + $data = $this->input->post(); + if (!$id) { + echo json_encode([ + 'success' => false, + 'message' => "ID manquant" + ]); + return; + } + + unset($data['id']); // on retire l'id pour éviter un update + + $response = $this->user_model->updateInfoAgency($id, $data); + if($response) { + echo json_encode([ + 'alert' => 'ok', + 'success' => 'ok', + 'message' => $this->lang->line('update_successfully') + ]); + } else { + echo json_encode([ + 'alert' => 'ok', + 'success' => 'false', + 'message' => $this->lang->line('update_failed_one_error_occurred') + ]); + } + } + + public function delete_request_agency() { + $id = $this->input->post('id'); + if(!$id){ + echo json_encode([ + 'success' => false, + 'message' => "ID manquant" + ]); + return; + } + + $response = $this->user_model->deleteInfoAgency($id); + if($response) { + echo json_encode([ + "alert"=> "ok", + "success"=> "ok", + "message"=> $this->lang->line("deletion_successfully") + ]); + }else{ + echo json_encode([ + "alert"=> "ok", + "success"=> "false", + "message"=> $this->lang->line("deletion_failed_one_error_occurred") + ]); + } + } + + public function get_account_data() { + $id = $this->input->post('id'); + $data = $this->user_model->get_account($id); + echo json_encode($data); + } } diff --git a/application/helpers/functions_helper.php b/application/helpers/functions_helper.php index bb5e4a62..06f30ce0 100755 --- a/application/helpers/functions_helper.php +++ b/application/helpers/functions_helper.php @@ -206,3 +206,27 @@ if (!function_exists('makeRequest')) { } } } + +function getStatusBadge($status, $lang) +{ + $label = $lang->line('status_'.$status); + + switch (strtolower($status)) { + + case 'pending': + return ''.$label.''; + + case 'active': + return ''.$label.''; + + case 'close': + return ''.$label.''; + + case 'rejected': + return ''.$label.''; + + default: + return ''.$status.''; + } +} + diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php index 6af004d3..58962262 100755 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -1083,4 +1083,21 @@ $lang['add_rate'] = "Add a rate"; $lang['channel'] = "Channel/Réseau"; $lang["select_country"] = "Select a country"; $lang["confirm_recharge_account"] = "Confirm account recharge"; +$lang["agency_banking"] = "Agency banking"; +$lang["lastname"] = "lastname"; +$lang["firstname"] = "firstname"; +$lang["account"] = "account"; +$lang["balance"] = "balance"; +$lang["status"] = "Status du compte"; +$lang["update_successfully"] = "Updated successfully"; +$lang["update_failed_one_error_occurred"] = "Update failed, one error occurred"; +$lang["deletion_successfully"] = "Deleted successfully"; +$lang["deletion_failed_one_error_occurred"] = "Deletion failed, one error occurred"; +$lang["management_bank_accounts"] = "Management of bank accounts"; +$lang["list_bank_accounts"] = "List of bank accounts"; +$lang['status_pending'] = 'Pending'; +$lang['status_active'] = 'Active'; +$lang['status_close'] = 'Closed'; +$lang['status_rejected'] = 'Rejected'; + ?> diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index dc544edb..e2abce04 100755 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -1091,4 +1091,21 @@ $lang['add_rate'] = "Ajouter un taux"; $lang['channel'] = "Cannal/Réseau"; $lang["select_country"] = "Sélectionner un pays"; $lang["confirm_recharge_account"] = "Confirmer le rechargement du compte"; +$lang["agency_banking"] = "Agence bancaire"; +$lang["lastname"] = "Nom"; +$lang["firstname"] = "Prénom"; +$lang["account"] = "Compte"; +$lang["balance"] = "Solde"; +$lang["status"] = "Statut"; +$lang["update_successfully"] = "Mise à jour effectuée avec succès"; +$lang["update_failed_one_error_occurred"] = "Mise à jour échouée, une erreur s'est produite"; +$lang["deletion_successfully"] = "Suppression effectuée avec succès"; +$lang["deletion_failed_one_error_occurred"] = "Une erreur s'est produite lors de la suppression"; +$lang["management_bank_accounts"] = "Gestion des comptes bancaires"; +$lang["list_bank_accounts"] = "Liste des comptes bancaires"; +$lang['status_pending'] = 'En attente'; +$lang['status_active'] = 'Actif'; +$lang['status_close'] = 'Fermé'; +$lang['status_rejected'] = 'Rejeté'; + ?> diff --git a/application/models/User_model.php b/application/models/User_model.php index fd9146ed..7d72750c 100755 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -2322,4 +2322,25 @@ class User_model extends CI_Model preg_match("/^enum\(\'(.*)\'\)$/", $type, $matches); return explode("','", $matches[1]); } + + function getAllRequests(){ + $result = $this->db->query("SELECT * FROM user_bank_accounts")->result(); + return $result; + } + + public function updateInfoAgency($id, $data) { + $this->db->where("id", $id); + return $this->db->update("user_bank_accounts", $data); + } + + public function deleteInfoAgency($id) { + $this->db->where("id", $id); + return $this->db->delete("user_bank_accounts"); + } + + public function get_account($id) { + return $this->db->where('id', $id) + ->get('user_bank_accounts') + ->row(); + } } diff --git a/application/views/gestion_agency_banking.php b/application/views/gestion_agency_banking.php new file mode 100755 index 00000000..dc9eeafa --- /dev/null +++ b/application/views/gestion_agency_banking.php @@ -0,0 +1,509 @@ + + + + + + Agency | Banking Management + ') ?>"> + + + + + + + +
+ +
+

+ lang->line('management_bank_accounts'); ?> +

+
+ +
+ +
+
+

lang->line('list_bank_accounts'); ?>

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDlang->line('lastname'); ?>lang->line('firstname'); ?>lang->line('account'); ?>IBANSwiftlang->line('reason') ?>Typelang->line('balance'); ?>lang->line('status'); ?>Actions
id ?>lastname ?>firstname ?>account_number ?>iban ?>swift_code ?>reason ?? '-' ?>account_type ?>balance,0,',',' ') ?> + status, $this->lang) ?> + + + + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/views/header_gestion.php b/application/views/header_gestion.php index 8056c1f1..d8738b46 100755 --- a/application/views/header_gestion.php +++ b/application/views/header_gestion.php @@ -190,6 +190,14 @@ lang->line('operators'); ?> + +
  • "> + + + lang->line('agency_banking'); ?> + +
  • +
  • "> lang->line('aggregators'); ?>