diff --git a/application/controllers/Gestion.php b/application/controllers/Gestion.php index e5f87e8c..863b63ba 100755 --- a/application/controllers/Gestion.php +++ b/application/controllers/Gestion.php @@ -1,5 +1,6 @@ load->model('wallet_model'); $this->load->model('nano_credit_model'); - date_default_timezone_set ($this->session->userdata('timezone')); + if($this->session->userdata('timezone')) + date_default_timezone_set ($this->session->userdata('timezone')); } public function index() @@ -1542,7 +1544,7 @@ class Gestion extends CI_Controller $this->historique($network_id,$this->input->get('d'),$this->input->get('f'),$this->input->get('history')); }else{ $taux = $this->user_model->getTaux($network_id); - $data['currency'] = $this->user_model->getCurrency($network_id); + $data['currency'] = $this->wallet_model->getCurrency($network_id); if ($taux != null) { $taux = $taux->first_row(); $data['idConfig'] = $taux->id; @@ -1567,17 +1569,17 @@ class Gestion extends CI_Controller $data['totalCommissionBanque'] = $totalCommissionBanque ; } elseif ($taux->type == 'ilink'){ - $data['plr_user_wallet_wallet'] = $this->user_model->getPalierConfigWallet("user_wallet_wallet_international", $data['idConfig']); - $data['plr_user_wallet_cash'] = $this->user_model->getPalierConfigWallet("user_wallet_cash_international", $data['idConfig']); - $data['plr_agent_depot_wallet_ilink'] = $this->user_model->getPalierConfigWallet("agent_depot_wallet_ilink_international" , $data['idConfig']); - $data['plr_agent_depot_autre_wallet'] = $this->user_model->getPalierConfigWallet("agent_depot_autre_wallet_international" , $data['idConfig']); - $data['plr_agent_cash_cash'] = $this->user_model->getPalierConfigWallet("agent_cash_cash_international", $data['idConfig']); + $data['plr_user_wallet_wallet'] = $this->wallet_model->getPalierConfigWallet("user_wallet_wallet_international", $data['idConfig']); + $data['plr_user_wallet_cash'] = $this->wallet_model->getPalierConfigWallet("user_wallet_cash_international", $data['idConfig']); + $data['plr_agent_depot_wallet_ilink'] = $this->wallet_model->getPalierConfigWallet("agent_depot_wallet_ilink_international" , $data['idConfig']); + $data['plr_agent_depot_autre_wallet'] = $this->wallet_model->getPalierConfigWallet("agent_depot_autre_wallet_international" , $data['idConfig']); + $data['plr_agent_cash_cash'] = $this->wallet_model->getPalierConfigWallet("agent_cash_cash_international", $data['idConfig']); - $data['plr_user_wallet_wallet_national'] = $this->user_model->getPalierConfigWallet("user_wallet_wallet_national", $data['idConfig']); - $data['plr_user_wallet_cash_national'] = $this->user_model->getPalierConfigWallet("user_wallet_cash_national", $data['idConfig']); - $data['plr_agent_depot_wallet_ilink_national'] = $this->user_model->getPalierConfigWallet("agent_depot_wallet_ilink_national" , $data['idConfig']); - $data['plr_agent_depot_autre_wallet_national'] = $this->user_model->getPalierConfigWallet("agent_depot_autre_wallet_national" , $data['idConfig']); - $data['plr_agent_cash_cash_national'] = $this->user_model->getPalierConfigWallet("agent_cash_cash_national", $data['idConfig']); + $data['plr_user_wallet_wallet_national'] = $this->wallet_model->getPalierConfigWallet("user_wallet_wallet_national", $data['idConfig']); + $data['plr_user_wallet_cash_national'] = $this->wallet_model->getPalierConfigWallet("user_wallet_cash_national", $data['idConfig']); + $data['plr_agent_depot_wallet_ilink_national'] = $this->wallet_model->getPalierConfigWallet("agent_depot_wallet_ilink_national" , $data['idConfig']); + $data['plr_agent_depot_autre_wallet_national'] = $this->wallet_model->getPalierConfigWallet("agent_depot_autre_wallet_national" , $data['idConfig']); + $data['plr_agent_cash_cash_national'] = $this->wallet_model->getPalierConfigWallet("agent_cash_cash_national", $data['idConfig']); $data['taxes'] = $this->wallet_model->getTaxes($data['idConfig']); @@ -1604,7 +1606,7 @@ class Gestion extends CI_Controller $data['taux_hyp_r_cart_ilink'] = $taux->taux_com_hyp_retrait_carte_cash_ilink; $data['taux_bq_r_cart_ilink'] = $taux->taux_com_banque_retrait_carte_cash_ilink; - $data['transactions'] = $this->user_model->getNetworkIlinTransactions($network_id); + $data['transactions'] = $this->wallet_model->getNetworkIlinTransactions($network_id); $totalCommissionBanque = 0; if ($data['transactions']) { foreach ($data['transactions']->result() as $trans) { @@ -1614,15 +1616,15 @@ class Gestion extends CI_Controller $data["totalCommissionBanque"] = $totalCommissionBanque; }elseif ($taux->type == 'autre') { - $res = $this->user_model->getSharingRateByNetwork($network_id); + $res = $this->wallet_model->getSharingRateByNetwork($network_id); $data['commission'] = $res ? $res->first_row()->balance_com : 0 ; } - $hyper = $this->user_model->getNetworkHyper($network_id)->first_row(); - $data['walletHyper'] = $this->user_model->getWallet($hyper->agent_id); + $hyper = $this->wallet_model->getNetworkHyper($network_id)->first_row(); + $data['walletHyper'] = $this->wallet_model->getWallet($hyper->agent_id); $data['network_id'] = $network_id; $networkDetails = $this->user_model->getNetworkDetails($network_id); if($networkDetails){ @@ -1652,7 +1654,7 @@ class Gestion extends CI_Controller $data['active'] = "wallet"; $data['alert'] = ""; $data['game_pays'] = $this->user_model->getGameCountry(); - $data['networks'] = $this->user_model->getAllActivatedNetworks(); + $data['networks'] = $this->wallet_model->getAllActivatedNetworks(); $this->load->view('header_gestion', $data); $this->load->view('gestion_wallets'); $this->load->view('footer'); @@ -1669,7 +1671,7 @@ class Gestion extends CI_Controller $type = $_POST['type']; if($method == 'create') { - $res = $this->user_model->addConfigWallet($network_id , $type); + $res = $this->wallet_model->addConfigWallet($network_id , $type); // if($res) // $this->generateAllWallets($network_id); @@ -1687,7 +1689,7 @@ class Gestion extends CI_Controller $taux_bq_r = $_POST['taux_bq_r']; $frais_d = $_POST['frais_d']; - $res = $this->user_model->updateConfigWallet($network_id , $taux_client_r , $taux_client_d , $taux_ag_r ,$taux_ag_d , $taux_sup_r , $taux_sup_d, $taux_bq_r , $taux_bq_d , $frais_d); + $res = $this->wallet_model->updateConfigWallet($network_id , $taux_client_r , $taux_client_d , $taux_ag_r ,$taux_ag_d , $taux_sup_r , $taux_sup_d, $taux_bq_r , $taux_bq_d , $frais_d); }else if ($type == 'ilink'){ $idConfig = $_POST['id_config']; @@ -1717,7 +1719,7 @@ class Gestion extends CI_Controller $this->insertPalier($plr_user_wallet_wallet_national,"user_wallet_wallet_national", $idConfig); break; case 'user_wallet_carte': - $this->user_model->updateConfigWalletIlink_u_w_cart($rows['taux_u_w_cart'],$rows['taux_hyp_s_wallet_cart_ilink'],$rows['taux_bq_s_wallet_cart_ilink'],$idConfig); + $this->wallet_model->updateConfigWalletIlink_u_w_cart($rows['taux_u_w_cart'],$rows['taux_hyp_s_wallet_cart_ilink'],$rows['taux_bq_s_wallet_cart_ilink'],$idConfig); break; case 'user_wallet_cash': $plr_user_wallet_cash = isset($_POST['plr_user_wallet_cash']) ? $_POST['plr_user_wallet_cash'] : null ; @@ -1726,18 +1728,18 @@ class Gestion extends CI_Controller $this->insertPalier($plr_user_wallet_cash_national,"user_wallet_cash_national", $idConfig); break; case 'user_carte_wallet': - $this->user_model->updateConfigWalletIlink_u_c_w($rows['taux_u_c_w'],$rows['taux_u_c_c'], $rows['taux_hyp_r_cart_ilink'],$rows['taux_bq_r_cart_ilink'],$idConfig); + $this->wallet_model->updateConfigWalletIlink_u_c_w($rows['taux_u_c_w'],$rows['taux_u_c_c'], $rows['taux_hyp_r_cart_ilink'],$rows['taux_bq_r_cart_ilink'],$idConfig); break; case 'agent_remove_cash': - $this->user_model->updateConfigWalletIlink_a_r_c($rows['taux_ag_r_c'],$rows['taux_sup_r_c'], + $this->wallet_model->updateConfigWalletIlink_a_r_c($rows['taux_ag_r_c'],$rows['taux_sup_r_c'], $rows['taux_hyp_r_c'],$idConfig); break; case 'agent_remove_carte_cash': - $this->user_model->updateConfigWalletIlink_a_r_cart($rows['taux_ag_cart_c'], $rows['taux_ag_r_cart'],$rows['taux_sup_r_cart'], + $this->wallet_model->updateConfigWalletIlink_a_r_cart($rows['taux_ag_cart_c'], $rows['taux_ag_r_cart'],$rows['taux_sup_r_cart'], $rows['taux_hyp_r_cart'],$rows['taux_bq_r_cart'],$idConfig); break; case 'agent_send_cash_carte': - $this->user_model->updateConfigWalletIlink_a_s_cc($rows['taux_ag_d_c_c'],$rows['taux_ag_d_c'],$rows['taux_sup_d_c'],$rows['taux_hyp_d_c'],$rows['taux_bq_d_c'],$idConfig); + $this->wallet_model->updateConfigWalletIlink_a_s_cc($rows['taux_ag_d_c_c'],$rows['taux_ag_d_c'],$rows['taux_sup_d_c'],$rows['taux_hyp_d_c'],$rows['taux_bq_d_c'],$idConfig); break; case 'agent_send_cash_canal': $plr_agent_depot_wallet_ilink = isset($_POST['plr_agent_depot_wallet_ilink']) ? $_POST['plr_agent_depot_wallet_ilink'] : null; @@ -1756,7 +1758,7 @@ class Gestion extends CI_Controller $this->insertPalier($plr_agent_depot_autre_wallet_national,"agent_depot_autre_wallet_national", $idConfig); $this->insertPalier($plr_agent_cash_cash_national,"agent_cash_cash_national", $idConfig); - $this->user_model->updateConfigWalletIlink_a_s_c($rows['taux_ag_s_c'],$rows['taux_sup_s_c'],$rows['taux_hyp_s_c'],$idConfig); + $this->wallet_model->updateConfigWalletIlink_a_s_c($rows['taux_ag_s_c'],$rows['taux_sup_s_c'],$rows['taux_hyp_s_c'],$idConfig); break; } @@ -1795,9 +1797,9 @@ class Gestion extends CI_Controller private function insertPalier($palier , $name , $idConfig){ - $exist = $this->user_model->getPalierConfigWallet($name , $idConfig); + $exist = $this->wallet_model->getPalierConfigWallet($name , $idConfig); if($exist){ - $this->user_model->deletePalierConfigWallet($name , $idConfig); + $this->wallet_model->deletePalierConfigWallet($name , $idConfig); } if($palier) { @@ -1807,7 +1809,7 @@ class Gestion extends CI_Controller foreach ($array as $key => $value) { $row[] = $value; } - $this->user_model->addPalierConfigWallet($name, $idConfig, $row[0], $row[1], $row[2]); + $this->wallet_model->addPalierConfigWallet($name, $idConfig, $row[0], $row[1], $row[2]); } } } @@ -1815,9 +1817,9 @@ class Gestion extends CI_Controller private function insertTaxes($palier, $idConfig, $categorie) { - $exist = $this->user_model->getTaxes($idConfig, $categorie); + $exist = $this->wallet_model->getTaxes($idConfig, $categorie); if ($exist) { - $this->user_model->deleteTaxes($idConfig, $categorie); + $this->wallet_model->deleteTaxes($idConfig, $categorie); } if ($palier) { @@ -1828,9 +1830,9 @@ class Gestion extends CI_Controller $row[] = $value; } if ($categorie == 'wallet') - $this->user_model->addTaxe($idConfig, $row[0], $row[1], $row[2], $row[3]); + $this->wallet_model->addTaxe($idConfig, $row[0], $row[1], $row[2], $row[3]); else - $this->user_model->addTaxe($idConfig, $row[0], $row[1], $row[2], 'national', $categorie); + $this->wallet_model->addTaxe($idConfig, $row[0], $row[1], $row[2], 'national', $categorie); } } } @@ -1840,7 +1842,7 @@ class Gestion extends CI_Controller if($this->isLogged()){ if (isset($_POST)) { $network_id = $_POST['network_id']; - $res = $this->user_model->deleteConfigWallet($network_id); + $res = $this->wallet_model->deleteConfigWallet($network_id); if ($res != false) { echo json_encode("200"); } else { @@ -1874,16 +1876,16 @@ class Gestion extends CI_Controller $pool = Pool::create(); $pool->add(function () use ($network_id) { // Fetch all agents , hyperviseur , superviseur - $f_agents = $this->user_model->getAllAgentsForNetwork($network_id) ; + $f_agents = $this->wallet_model->getAllAgentsForNetwork($network_id) ; if ($f_agents){ foreach($f_agents->result() AS $row){ //Create wallet if it not exist - $res = $this->user_model->getWallet($row->agent_id); + $res = $this->wallet_model->getWallet($row->agent_id); if($res){ // Reinitialize the wallet -// $this->user_model->reinitializeWallet($res->first_row()->wallet_id); +// $this->wallet_model->reinitializeWallet($res->first_row()->wallet_id); }else{ - $this->user_model->addWallet($row->agent_id); + $this->wallet_model->addWallet($row->agent_id); } } } @@ -1906,13 +1908,13 @@ class Gestion extends CI_Controller if ($type == 'transaction') $data['transactions'] = $this->user_model->getTransactions($startDate, $endDate, $network_id); else if ($type == 'transaction_ilink') - $data['transactions'] = $this->user_model->getIlinkTransactions($startDate, $endDate, $network_id); + $data['transactions'] = $this->wallet_model->getIlinkTransactions($startDate, $endDate, $network_id); else - $data['transactions'] = $this->user_model->getRecharges($startDate, $endDate, $network_id); + $data['transactions'] = $this->wallet_model->getRecharges($startDate, $endDate, $network_id); $data['active'] = "wallet"; $data['alert'] = ""; - $data['networks'] = $this->user_model->getAllActivatedNetworks(); + $data['networks'] = $this->wallet_model->getAllActivatedNetworks(); $data['game_pays'] = $this->user_model->getGameCountry(); $networkDetails = $this->user_model->getNetworkDetails($network_id); if($networkDetails){ @@ -1950,13 +1952,13 @@ class Gestion extends CI_Controller $data['currency_name_fr'] = $networkDetails->first_row()->currency_name_fr; $data['currency_name_en'] = $networkDetails->first_row()->currency_name_en; - $data['currencies'] = $this->user_model->getWalletsCountriesCurrencies($data['currency_code']); + $data['currencies'] = $this->wallet_model->getWalletsCountriesCurrencies($data['currency_code']); $this->load->view('header_gestion', $data); $this->load->view('gestion_monnaie'); $this->load->view('footer'); }else{ - $data['networks'] = $this->user_model->getAllActivatedWalletNetworks(); + $data['networks'] = $this->wallet_model->getAllActivatedWalletNetworks(); $this->load->view('header_gestion', $data); $this->load->view('gestion_monnaies'); @@ -1975,10 +1977,10 @@ class Gestion extends CI_Controller $res= false; foreach ($json['rates'] as $key => $value) { - if($this->user_model->getExchangeRate($key)) - $this->user_model->updateExchangeRate($key , $value); + if($this->wallet_model->getExchangeRate($key)) + $this->wallet_model->updateExchangeRate($key , $value); else - $this->user_model->insertExchangeRate($key , $value); + $this->wallet_model->insertExchangeRate($key , $value); } $res = true; if ($res) { @@ -2080,7 +2082,7 @@ class Gestion extends CI_Controller if ($this->input->get('history')) { $this->historique_nano_credit($data['network_id'], $this->input->get('d'), $this->input->get('f'), $this->input->get('history')); } else { - $data['groups'] = $this->user_model->getUsersGroups($data['network_id']); + $data['groups'] = $this->nano_credit_model->getUsersGroups($data['network_id']); $data['configWallet'] = $this->wallet_model->getConfigWallet($data['network_id'])->first_row(); $networkDetails = $this->user_model->getNetworkDetails($data['network_id']); if ($networkDetails) { @@ -2089,17 +2091,17 @@ class Gestion extends CI_Controller $data['currency_code'] = $networkDetails->first_row()->currency_code; } - $data['rates_nano_credit'] = $this->user_model->getNanoCreditRates($data['configWallet']->id); - $data['taxes_nano_credit'] = $this->user_model->getTaxes($data['configWallet']->id, 'nano_credit'); + $data['rates_nano_credit'] = $this->nano_credit_model->getNanoCreditRates($data['configWallet']->id); + $data['taxes_nano_credit'] = $this->wallet_model->getTaxes($data['configWallet']->id, 'nano_credit'); - $data['rates_epargne'] = $this->user_model->getNanoCreditRates($data['configWallet']->id, 'epargne'); - $data['taxes_epargne'] = $this->user_model->getTaxes($data['configWallet']->id, 'epargne'); + $data['rates_epargne'] = $this->nano_credit_model->getNanoCreditRates($data['configWallet']->id, 'epargne'); + $data['taxes_epargne'] = $this->wallet_model->getTaxes($data['configWallet']->id, 'epargne'); $this->load->view('header_gestion', $data); $this->load->view('nano_credit/gestion_nano_credit_admin'); $this->load->view('footer'); } } else { - $data['networks'] = $this->user_model->getAllIlinkWorldNetworks(); + $data['networks'] = $this->nano_credit_model->getAllIlinkWorldNetworks(); $this->load->view('header_gestion', $data); $this->load->view('nano_credit/gestion_nano_credits'); $this->load->view('footer'); @@ -2118,13 +2120,13 @@ class Gestion extends CI_Controller $endDate = Date('Y-m-d', strtotime($endDate . "+1 day")); if ($type == 'nano_credit') { - $data['transactions'] = $this->user_model->getUserDemandesCredit($startDate, $endDate, $network_id); + $data['transactions'] = $this->nano_credit_model->getUserDemandesCredit($startDate, $endDate, $network_id); } else if ($type == 'savings') { - $data['transactions'] = $this->user_model->getIlinkTransactions($startDate, $endDate, $network_id); + $data['transactions'] = $this->wallet_model->getIlinkTransactions($startDate, $endDate, $network_id); } $data['active'] = "nano_credit"; $data['alert'] = ""; - $data['networks'] = $this->user_model->getAllActivatedNetworks(); + $data['networks'] = $this->wallet_model->getAllActivatedNetworks(); $data['game_pays'] = $this->user_model->getGameCountry(); $networkDetails = $this->user_model->getNetworkDetails($network_id); if ($networkDetails) { @@ -2148,7 +2150,7 @@ class Gestion extends CI_Controller if (isset($_POST)) { $id_network = $_POST['id_network']; - $this->user_model->insertCreditLimit(0, 0, '1', $id_network); + $this->nano_credit_model->insertCreditLimit(0, 0, '1', $id_network); $res = true; if ($res) { @@ -2166,7 +2168,7 @@ class Gestion extends CI_Controller if (isset($_POST)) { $id_network = $_POST['id_network']; - $this->user_model->insertCreditLimit(0, 0, '0', $id_network); + $this->nano_credit_model->insertCreditLimit(0, 0, '0', $id_network); $res = true; if ($res) { @@ -2178,5 +2180,62 @@ class Gestion extends CI_Controller } } + public function regulations() + { + + if($this->isLogged()){ + $data['active'] = "regulations"; + $data['alert'] = ""; + $data['game_pays'] = $this->user_model->getGameCountry(); + + if ($this->input->get('id')) { + + $network_id = $this->input->get('id'); + $networkDetails = $this->user_model->getNetworkDetails($network_id); + $data['network'] = $networkDetails->first_row()->network; + $data['country'] = $networkDetails->first_row()->country; + $data['currency_code'] = $networkDetails->first_row()->currency_code; + $data['currency_name_fr'] = $networkDetails->first_row()->currency_name_fr; + $data['currency_name_en'] = $networkDetails->first_row()->currency_name_en; + + $data['currencies'] = $this->wallet_model->getWalletsCountriesCurrencies($data['currency_code']); + $this->load->view('header_gestion', $data); + $this->load->view('gestion_monnaie'); + $this->load->view('footer'); + }else{ + + $data['countries'] = $this->wallet_model->getRegulationsCountries(); + + $this->load->view('header_gestion', $data); + $this->load->view('gestion_reglementations'); + $this->load->view('footer'); + } + } + } + + public function setRegulationsLimits(){ + if ($this->isLogged()) { + if (isset($_POST)) { + + $country_id = $_POST['country_id']; + $max_day = $_POST['max_day']; + $max_week = $_POST['max_week']; + $max_month = $_POST['max_month']; + $limits = $this->wallet_model->getRegulationsLimits($country_id); + if($limits){ + $this->wallet_model->updateRegulationsLimits($country_id,$max_day,$max_week,$max_month); + }else{ + $this->wallet_model->insertRegulationsLimits($country_id,$max_day,$max_week,$max_month); + } + $res = true; + if ($res) { + echo json_encode("200"); + } else { + echo json_encode("500"); + } + } + } + } + } diff --git a/application/controllers/Hyperviseur_dash.php b/application/controllers/Hyperviseur_dash.php index c26040b7..4fbcb392 100755 --- a/application/controllers/Hyperviseur_dash.php +++ b/application/controllers/Hyperviseur_dash.php @@ -1,14 +1,9 @@ load->model('wallet_model'); $this->load->model('nano_credit_model'); - date_default_timezone_set($this->session->userdata('timezone')); + if($this->session->userdata('timezone')) + date_default_timezone_set($this->session->userdata('timezone')); } public function index() @@ -54,7 +50,7 @@ class Hyperviseur_dash extends CI_Controller $data['adresse'] = $this->session->userdata('adresse'); $data['category'] = $this->session->userdata('category'); $data['network'] = $this->session->userdata('network'); - $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); + $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); $data['count_geo'] = $this->user_model->countUserGeoForHyp($this->session->userdata('member_code')); $data['count_sup'] = $this->user_model->countUser("super", 'all', $this->session->userdata('member_code')); @@ -101,7 +97,7 @@ class Hyperviseur_dash extends CI_Controller $data['adresse'] = $this->session->userdata('adresse'); $data['category'] = $this->session->userdata('category'); $data['network'] = $this->session->userdata('network'); - $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); + $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); $data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code')); $data['alert'] = ""; @@ -157,7 +153,7 @@ class Hyperviseur_dash extends CI_Controller $data['category'] = $this->session->userdata('category'); $data['network'] = $this->session->userdata('network'); $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); - $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); + $data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code')); $data['alert'] = ""; $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); @@ -220,7 +216,7 @@ class Hyperviseur_dash extends CI_Controller $data['category'] = $this->session->userdata('category'); $data['network'] = $this->session->userdata('network'); $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); - $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); + $data['tab_fastDemande'] = $this->user_model->getRangeASCDemandesByNetwork($debut, $fin, $this->session->userdata('member_code'), $this->session->userdata('current_demande_ville')); $data['tab_slowDemande'] = $this->user_model->getRangeDESCDemandesByNetwork($debut, $fin, $this->session->userdata('member_code'), $this->session->userdata('current_demande_ville')); $data['list'] = $this->user_model->getDemandesBySuper($debut, $fin, $this->session->userdata('member_code')); @@ -285,7 +281,7 @@ class Hyperviseur_dash extends CI_Controller $data['temp_moyen'] = $this->user_model->getTempsMoyenAd($debut, $fin, $this->session->userdata('member_code')); $data['list'] = $this->user_model->getDemandesAdForSuper($debut, $fin, $this->session->userdata('member_code')); $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); - $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); + $data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code')); $data['type'] = $this->lang->line('Adhésion'); $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); @@ -344,7 +340,7 @@ class Hyperviseur_dash extends CI_Controller $totalCommissionBanque = 0; if ($agents_g) { foreach ($agents_g->result() as $row) { - $wallet = $this->user_model->getWallet($row->agent_id); + $wallet = $this->wallet_model->getWallet($row->agent_id); if ($wallet) { $transactions = $this->user_model->getAgentTransactions($wallet->first_row()->wallet_id); if ($transactions) { @@ -361,7 +357,7 @@ class Hyperviseur_dash extends CI_Controller } elseif ($data['hasWallet']->first_row()->type == 'ilink') { - $transactions = $this->user_model->getNetworkIlinTransactions($id_network); + $transactions = $this->wallet_model->getNetworkIlinTransactions($id_network); $data["transactions"] = array(); $totalCommissionBanque = 0; if ($transactions) { @@ -375,10 +371,10 @@ class Hyperviseur_dash extends CI_Controller } //Create wallet if it not exist - $res = $this->user_model->getWallet($agent_id); + $res = $this->wallet_model->getWallet($agent_id); if ($res == false) { $this->user_model->addWallet($agent_id); - $res = $this->user_model->getWallet($agent_id); + $res = $this->wallet_model->getWallet($agent_id); } $row = $res->first_row(); @@ -388,7 +384,7 @@ class Hyperviseur_dash extends CI_Controller $data['curreny_code'] = $this->session->userdata('currency_code'); - $res = $this->user_model->getWalletPassword($id_network); + $res = $this->wallet_model->getWalletPassword($id_network); $data['walletPassword'] = $res ? $res->first_row() : null; $data['alert'] = ""; $data['active'] = "wallet_wallet"; @@ -445,15 +441,15 @@ class Hyperviseur_dash extends CI_Controller $networkDetails = $this->user_model->getNetworkDetails($network_id); $data['currency_name_fr'] = $networkDetails->first_row()->currency_name_fr; $data['currency_name_en'] = $networkDetails->first_row()->currency_name_en; - $data['transactions'] = $this->user_model->getIlinkTransactions($startDate, $endDate, $network_id); + $data['transactions'] = $this->wallet_model->getIlinkTransactions($startDate, $endDate, $network_id); } else if ($type == 'commission_transfer') - $data['transactions'] = $this->user_model->getCommissionTransfers($startDate, $endDate, $this->session->userdata('member_code')); + $data['transactions'] = $this->wallet_model->getCommissionTransfers($startDate, $endDate, $this->session->userdata('member_code')); else if ($type == 'balance_statement') $data['wallets'] = $this->user_model->getInfosWalletAgentForHyper($this->session->userdata('network_id')); else if ($type == 'refund_history') - $data['refunds'] = $this->user_model->getRefunds($startDate, $endDate, $network_id); + $data['refunds'] = $this->wallet_model->getRefunds($startDate, $endDate, $network_id); else - $data['transactions'] = $this->user_model->getRecharges($startDate, $endDate, $network_id); + $data['transactions'] = $this->wallet_model->getRecharges($startDate, $endDate, $network_id); $data['active'] = "wallet_wallet"; $data['alert'] = ""; @@ -463,7 +459,7 @@ class Hyperviseur_dash extends CI_Controller $data['network'] = $this->session->userdata('network'); $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); $data['networks'] = $this->user_model->getActiveNetwork(); - $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); + $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); $data['country'] = $this->session->userdata('current_pays'); $data['category'] = $this->session->userdata('category'); @@ -495,11 +491,11 @@ class Hyperviseur_dash extends CI_Controller $data['network'] = $this->session->userdata('network'); $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); $data['networks'] = $this->user_model->getActiveNetwork(); - $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); + $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); $data['country'] = $this->session->userdata('current_pays'); $data['network_id'] = $this->session->userdata('network_id'); - $res = $this->user_model->getWalletPassword($this->session->userdata('network_id')); + $res = $this->wallet_model->getWalletPassword($this->session->userdata('network_id')); $data['walletPassword'] = $res ? $res->first_row() : null; $this->load->view('header_hyp', $data); $this->load->view('wallet_password'); @@ -532,9 +528,9 @@ class Hyperviseur_dash extends CI_Controller if ($this->email->send()) { if ($wallet_password_id == null) - $this->user_model->addWalletPassword($network_id, $encrypted_password, $salt, $email); + $this->wallet_model->addWalletPassword($network_id, $encrypted_password, $salt, $email); else - $this->user_model->updateWalletPassword($wallet_password_id, $encrypted_password, $salt, $email); + $this->wallet_model->updateWalletPassword($wallet_password_id, $encrypted_password, $salt, $email); $res = true; } else { // show_error($this->email->print_debugger()); @@ -595,7 +591,7 @@ class Hyperviseur_dash extends CI_Controller $this->email->message($this->lang->line('mot de passe') . ' : ' . $password); if ($this->email->send()) { - $this->user_model->updateWalletPassword($wallet_password_id, $encrypted_password, $salt); + $this->wallet_model->updateWalletPassword($wallet_password_id, $encrypted_password, $salt); $res = true; } else { // show_error($this->email->print_debugger()); @@ -624,8 +620,8 @@ class Hyperviseur_dash extends CI_Controller $hash = base64_encode(sha1($password . $salt, true) . $salt); if ($encrypted_password == $hash) { - $this->user_model->updateWalletBalance($montant, $wallet_id); - $res = $this->user_model->addWalletRecharge($montant, $wallet_id); + $this->wallet_model->updateWalletBalance($montant, $wallet_id); + $res = $this->wallet_model->addWalletRecharge($montant, $wallet_id); $code = $res ? '200' : '500'; } else { $code = '400'; @@ -651,7 +647,7 @@ class Hyperviseur_dash extends CI_Controller $hash = base64_encode(sha1($password . $salt, true) . $salt); if ($encrypted_password == $hash) { - $res = $this->user_model->insertRembourssementCompensation($montant, $id_network, $id_config); + $res = $this->wallet_model->insertRembourssementCompensation($montant, $id_network, $id_config); $code = $res ? '200' : '401'; } else { $code = '400'; @@ -674,12 +670,12 @@ class Hyperviseur_dash extends CI_Controller $data['network'] = $this->session->userdata('network'); $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); $data['networks'] = $this->user_model->getActiveNetwork(); - $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); + $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); $data['idConfig'] = $data['hasWallet']->first_row()->id; $data['country'] = $this->session->userdata('current_pays'); $data['network_id'] = $this->session->userdata('network_id'); - $data['countries'] = $this->user_model->getWalletsCountries(); + $data['countries'] = $this->wallet_model->getWalletsCountries(); $showResult = false; $frais = 0; $taxe = 0; @@ -701,19 +697,19 @@ class Hyperviseur_dash extends CI_Controller $code = $this->input->post('code'); - $taxes = $this->user_model->getTaxes($data['idConfig']); + $taxes = $this->wallet_model->getTaxes($data['idConfig']); - $plr_user_wallet_wallet = $this->user_model->getPalierConfigWallet("user_wallet_wallet_international", $data['idConfig']); - $plr_user_wallet_cash = $this->user_model->getPalierConfigWallet("user_wallet_cash_international", $data['idConfig']); - $plr_agent_depot_wallet_ilink = $this->user_model->getPalierConfigWallet("agent_depot_wallet_ilink_international" , $data['idConfig']); - $plr_agent_depot_autre_wallet = $this->user_model->getPalierConfigWallet("agent_depot_autre_wallet_international" , $data['idConfig']); - $plr_agent_cash_cash = $this->user_model->getPalierConfigWallet("agent_cash_cash_international", $data['idConfig']); + $plr_user_wallet_wallet = $this->wallet_model->getPalierConfigWallet("user_wallet_wallet_international", $data['idConfig']); + $plr_user_wallet_cash = $this->wallet_model->getPalierConfigWallet("user_wallet_cash_international", $data['idConfig']); + $plr_agent_depot_wallet_ilink = $this->wallet_model->getPalierConfigWallet("agent_depot_wallet_ilink_international" , $data['idConfig']); + $plr_agent_depot_autre_wallet = $this->wallet_model->getPalierConfigWallet("agent_depot_autre_wallet_international" , $data['idConfig']); + $plr_agent_cash_cash = $this->wallet_model->getPalierConfigWallet("agent_cash_cash_international", $data['idConfig']); - $plr_user_wallet_wallet_national= $this->user_model->getPalierConfigWallet("user_wallet_wallet_national", $data['idConfig']); - $plr_user_wallet_cash_national = $this->user_model->getPalierConfigWallet("user_wallet_cash_national", $data['idConfig']); - $plr_agent_depot_wallet_ilink_national = $this->user_model->getPalierConfigWallet("agent_depot_wallet_ilink_national" , $data['idConfig']); - $plr_agent_depot_autre_wallet_national = $this->user_model->getPalierConfigWallet("agent_depot_autre_wallet_national" , $data['idConfig']); - $plr_agent_cash_cash_national = $this->user_model->getPalierConfigWallet("agent_cash_cash_national", $data['idConfig']); + $plr_user_wallet_wallet_national= $this->wallet_model->getPalierConfigWallet("user_wallet_wallet_national", $data['idConfig']); + $plr_user_wallet_cash_national = $this->wallet_model->getPalierConfigWallet("user_wallet_cash_national", $data['idConfig']); + $plr_agent_depot_wallet_ilink_national = $this->wallet_model->getPalierConfigWallet("agent_depot_wallet_ilink_national" , $data['idConfig']); + $plr_agent_depot_autre_wallet_national = $this->wallet_model->getPalierConfigWallet("agent_depot_autre_wallet_national" , $data['idConfig']); + $plr_agent_cash_cash_national = $this->wallet_model->getPalierConfigWallet("agent_cash_cash_national", $data['idConfig']); $plr_user_wallet_wallet = $plr_user_wallet_wallet ? $plr_user_wallet_wallet->result() : []; $plr_user_wallet_cash = $plr_user_wallet_cash ? $plr_user_wallet_cash->result() : []; @@ -1018,7 +1014,7 @@ class Hyperviseur_dash extends CI_Controller $data['email'] = $this->session->userdata('email'); $data['network'] = $this->session->userdata('network'); $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); - $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); + $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); $data['country'] = $this->session->userdata('current_pays'); $data['category'] = $this->session->userdata('category'); @@ -1026,13 +1022,13 @@ class Hyperviseur_dash extends CI_Controller $data['network_id'] = $this->session->userdata('network_id'); if (isset($country)) { $data['country_id'] = $country; - $data['country'] = $this->user_model->getCountry($country)->first_row(); - $res = $this->user_model->getActiveNetworksByCountry($country,$this->session->userdata('network_id')); + $data['country'] = $this->wallet_model->getCountry($country)->first_row(); + $res = $this->wallet_model->getActiveNetworksByCountry($country,$this->session->userdata('network_id')); $data['networks'] = []; if($res){ $result = $res->result(); foreach ($result as $network){ - $res = $this->user_model->getSharingRate($network->id , $data['idConfig']); + $res = $this->wallet_model->getSharingRate($network->id , $data['idConfig']); if($res){ $network->rate = $res->first_row()->taux_partage; $network->url = $res->first_row()->url; @@ -1048,12 +1044,12 @@ class Hyperviseur_dash extends CI_Controller $this->load->view('footer'); return; } - $res = $this->user_model->getWalletsCountries(); + $res = $this->wallet_model->getWalletsCountries(); $data['countries'] = []; if($res){ $result = $res->result(); foreach ($result as $country){ - $res = $this->user_model->countPayingNetworks($country->id, $data['idConfig']); + $res = $this->wallet_model->countPayingNetworks($country->id, $data['idConfig']); if($res){ $country->total = $res->first_row()->total; }else{ @@ -1069,8 +1065,8 @@ class Hyperviseur_dash extends CI_Controller $this->load->view('gestion_wallet_ilink_config_paying_networks'); break; case 'user_wallet_wallet': - $data['plr_user_wallet_wallet'] = $this->user_model->getPalierConfigWallet("user_wallet_wallet_international", $data['idConfig']); - $data['plr_user_wallet_wallet_national'] = $this->user_model->getPalierConfigWallet("user_wallet_wallet_national", $data['idConfig']); + $data['plr_user_wallet_wallet'] = $this->wallet_model->getPalierConfigWallet("user_wallet_wallet_international", $data['idConfig']); + $data['plr_user_wallet_wallet_national'] = $this->wallet_model->getPalierConfigWallet("user_wallet_wallet_national", $data['idConfig']); $this->load->view('header_hyp', $data); $this->load->view('config_wallet_ilink_hyp/user_wallet_wallet'); break; @@ -1082,8 +1078,8 @@ class Hyperviseur_dash extends CI_Controller $this->load->view('config_wallet_ilink_hyp/user_wallet_carte'); break; case 'user_wallet_cash': - $data['plr_user_wallet_cash'] = $this->user_model->getPalierConfigWallet("user_wallet_cash_international", $data['idConfig']); - $data['plr_user_wallet_cash_national'] = $this->user_model->getPalierConfigWallet("user_wallet_cash_national", $data['idConfig']); + $data['plr_user_wallet_cash'] = $this->wallet_model->getPalierConfigWallet("user_wallet_cash_international", $data['idConfig']); + $data['plr_user_wallet_cash_national'] = $this->wallet_model->getPalierConfigWallet("user_wallet_cash_national", $data['idConfig']); $this->load->view('header_hyp', $data); $this->load->view('config_wallet_ilink_hyp/user_wallet_cash'); break; @@ -1125,13 +1121,13 @@ class Hyperviseur_dash extends CI_Controller $data['taux_sup_s_c'] = $taux->taux_com_sup_envoi_cash; $data['taux_hyp_s_c'] = $taux->taux_com_hyp_envoi_cash; - $data['plr_agent_depot_wallet_ilink'] = $this->user_model->getPalierConfigWallet("agent_depot_wallet_ilink_international" , $data['idConfig']); - $data['plr_agent_depot_autre_wallet'] = $this->user_model->getPalierConfigWallet("agent_depot_autre_wallet_international" , $data['idConfig']); - $data['plr_agent_cash_cash'] = $this->user_model->getPalierConfigWallet("agent_cash_cash_international", $data['idConfig']); + $data['plr_agent_depot_wallet_ilink'] = $this->wallet_model->getPalierConfigWallet("agent_depot_wallet_ilink_international" , $data['idConfig']); + $data['plr_agent_depot_autre_wallet'] = $this->wallet_model->getPalierConfigWallet("agent_depot_autre_wallet_international" , $data['idConfig']); + $data['plr_agent_cash_cash'] = $this->wallet_model->getPalierConfigWallet("agent_cash_cash_international", $data['idConfig']); - $data['plr_agent_depot_wallet_ilink_national'] = $this->user_model->getPalierConfigWallet("agent_depot_wallet_ilink_national" , $data['idConfig']); - $data['plr_agent_depot_autre_wallet_national'] = $this->user_model->getPalierConfigWallet("agent_depot_autre_wallet_national" , $data['idConfig']); - $data['plr_agent_cash_cash_national'] = $this->user_model->getPalierConfigWallet("agent_cash_cash_national", $data['idConfig']); + $data['plr_agent_depot_wallet_ilink_national'] = $this->wallet_model->getPalierConfigWallet("agent_depot_wallet_ilink_national" , $data['idConfig']); + $data['plr_agent_depot_autre_wallet_national'] = $this->wallet_model->getPalierConfigWallet("agent_depot_autre_wallet_national" , $data['idConfig']); + $data['plr_agent_cash_cash_national'] = $this->wallet_model->getPalierConfigWallet("agent_cash_cash_national", $data['idConfig']); $this->load->view('header_hyp', $data); $this->load->view('config_wallet_ilink_hyp/agent_send_cash_canal'); break; @@ -1154,14 +1150,14 @@ class Hyperviseur_dash extends CI_Controller $data['email'] = $this->session->userdata('email'); $data['network'] = $this->session->userdata('network'); $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); - $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); +// $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; - $res = $this->user_model->getWalletPassword($this->session->userdata('network_id')); + $res = $this->wallet_model->getWalletPassword($this->session->userdata('network_id')); $data['walletPassword'] = $res ? $res->first_row() : null; - $data['networks'] = $this->user_model->getPayingNetworksByConfigWallet($data['idConfig']); + $data['networks'] = $this->wallet_model->getPayingNetworksByConfigWallet($data['idConfig']); $this->load->view('header_hyp', $data); $this->load->view('gestion_wallet_ilink_paying_network_account'); @@ -1175,7 +1171,7 @@ class Hyperviseur_dash extends CI_Controller $config_id = $_POST['config_id']; $rate = $_POST['rate']; $url = $_POST['url']; - $res = $this->user_model->setSharingRate($network_id, $config_id, $rate, $url); + $res = $this->wallet_model->setSharingRate($network_id, $config_id, $rate, $url); if ($res) { echo json_encode("200"); @@ -1195,11 +1191,13 @@ class Hyperviseur_dash extends CI_Controller $this->historique_nano_credit($data['network_id'], $this->input->get('d'), $this->input->get('f'), $this->input->get('history')); } elseif ($this->input->get('config')) { $this->config_nano_credit($this->input->get('config')); + } elseif ($this->input->get('group')) { + $this->users_group_details($this->input->get('group')); } else { $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); - $data['groups'] = $this->user_model->getUsersGroups($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['rates'] = $this->user_model->getNanoCreditRates($data['idConfig']); + $data['rates'] = $this->nano_credit_model->getNanoCreditRates($data['idConfig']); $data['taxes'] = $this->wallet_model->getTaxes($data['idConfig'], 'nano_credit'); $data['active'] = "nano_credit"; $data['alert'] = ""; @@ -1261,7 +1259,7 @@ class Hyperviseur_dash extends CI_Controller private function historique_nano_credit($network_id, $startDate, $endDate, $type) { - $data['configWallet'] = $this->wallet_model->getConfigWallet($network_id); +// $data['configWallet'] = $this->wallet_model->getConfigWallet($network_id); $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; @@ -1282,8 +1280,8 @@ class Hyperviseur_dash extends CI_Controller $data['network'] = $this->session->userdata('network'); $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); $data['networks'] = $this->user_model->getActiveNetwork(); - $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); - $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); +// + $data['hasWallet'] = $data['configWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); $data['country'] = $this->session->userdata('current_pays'); $data['category'] = $this->session->userdata('category'); @@ -1375,6 +1373,43 @@ class Hyperviseur_dash extends CI_Controller } } } + + private function users_group_details($group_code) + { + $data['active'] = "nano_credit"; + $data['alert'] = ""; + $data['firstname'] = $this->session->userdata('firstname'); + $data['lastname'] = $this->session->userdata('lastname'); + $data['email'] = $this->session->userdata('email'); + $data['network'] = $this->session->userdata('network'); + $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); + $data['networks'] = $this->user_model->getActiveNetwork(); + $data['currency_code'] = $this->session->userdata('currency_code'); + + $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['members'] = $this->nano_credit_model->getGroupMembers($group_code); + $data['group'] = $this->nano_credit_model->getGroup($group_code); + + //Calcul de la capacite d'emprunt + $CE = 0; + if($data['members']){ + $sommeCredits = 0; + $sommeEpargnes = 0; + foreach ($data['members']->result() as $user){ + $sommeCredits += $user->balance_credit; + $sommeEpargnes += $user->balance_epargne; + } + $CE = $sommeEpargnes - $sommeCredits; + } + + $data['CE'] = $CE; + $data['group_code'] = $group_code; + $this->load->view('header_hyp', $data); + $this->load->view('nano_credit/users_group_detail'); + $this->load->view('footer'); + } } class Operation diff --git a/application/controllers/Superviseur_dash.php b/application/controllers/Superviseur_dash.php index 287de4ce..bc47f28f 100755 --- a/application/controllers/Superviseur_dash.php +++ b/application/controllers/Superviseur_dash.php @@ -3,18 +3,20 @@ use Brick\Money\Context\AutoContext; use Brick\Money\Money; -defined('BASEPATH') OR exit('No direct script access allowed'); +defined('BASEPATH') or exit('No direct script access allowed'); class Superviseur_dash extends CI_Controller { - public function __construct(){ + public function __construct() + { parent::__construct(); $this->load->model('wallet_model'); $this->load->model('nano_credit_model'); $this->load->model('Users_simple'); $this->load->model('User_model'); - date_default_timezone_set ($this->session->userdata('timezone')); + if($this->session->userdata('timezone')) + date_default_timezone_set($this->session->userdata('timezone')); } public function index() @@ -30,8 +32,8 @@ class Superviseur_dash extends CI_Controller $count_g = $this->User_model->geolocatedCountByParrain($this->session->userdata('member_code')); $count_d = $this->User_model->getCountDemande($this->session->userdata('member_code')); - $count_d_traite = $this->User_model->getCountDemandeByStatut($this->session->userdata('member_code'),1); - $count_d_no_traite = $this->User_model->getCountDemandeByStatut($this->session->userdata('member_code'),0); + $count_d_traite = $this->User_model->getCountDemandeByStatut($this->session->userdata('member_code'), 1); + $count_d_no_traite = $this->User_model->getCountDemandeByStatut($this->session->userdata('member_code'), 0); $data['list_geolocated_users'] = $this->user_model->getUsersGeolocatedForSup($this->session->userdata('member_code')); @@ -62,7 +64,8 @@ class Superviseur_dash extends CI_Controller /** * Affiche la table des points agents du superviseur */ - public function getAllUser_g(){ + public function getAllUser_g() + { if (!$this->session->userdata('email')) { $this->session->set_flashdata('error', 'log in first'); @@ -72,17 +75,16 @@ class Superviseur_dash extends CI_Controller redirect('index.php', $data); - } - else { + } else { - $position = $this->user_model->getAllpositions($this->session->userdata('network'),'geolocated',$this->session->userdata('member_code')); + $position = $this->user_model->getAllpositions($this->session->userdata('network'), 'geolocated', $this->session->userdata('member_code')); $data['active'] = "geolocated"; - $data['positions']= $position; + $data['positions'] = $position; $numberGeo = $this->user_model->getNumberGeoBySuper($this->session->userdata('member_code')); - if($numberGeo!=false){ + if ($numberGeo != false) { $data['numberGeo'] = $numberGeo; - }else{ + } else { $data['numberGeo'] = ""; } $data['map_title'] = $this->lang->line('Utilisateurs géolocalisés'); @@ -111,7 +113,8 @@ class Superviseur_dash extends CI_Controller /** * Affiche les demandes de credits */ - public function getDemandes(){ + public function getDemandes() + { if (!$this->session->userdata('email')) { $this->session->set_flashdata('error', 'log in first'); @@ -169,7 +172,8 @@ class Superviseur_dash extends CI_Controller /** * Afficher les demandes d'adhesion */ - public function getDemandesAd(){ + public function getDemandesAd() + { if (!$this->session->userdata('email')) { $this->session->set_flashdata('error', 'log in first'); @@ -180,9 +184,9 @@ class Superviseur_dash extends CI_Controller $network = $this->session->userdata('network'); $debut = $this->input->get("d"); $fin = $this->input->get("f"); - $format = $this->session->userdata('site_lang') === 'french' ? 'd-m-Y' : 'Y-m-d' ; - $data['debut'] = $debut ? date($format, strtotime($debut)) : null ; - $data['fin'] = $fin ?date($format, strtotime($fin)): null ; + $format = $this->session->userdata('site_lang') === 'french' ? 'd-m-Y' : 'Y-m-d'; + $data['debut'] = $debut ? date($format, strtotime($debut)) : null; + $data['fin'] = $fin ? date($format, strtotime($fin)) : null; $data['active'] = "demandesAd"; $data['alert'] = ""; $data['demand_type'] = 'adhesion'; @@ -195,11 +199,11 @@ class Superviseur_dash extends CI_Controller $data['adresse'] = $this->session->userdata('adresse'); $data['category'] = $this->session->userdata('category'); $data['network'] = $this->session->userdata('network'); - $data['tab_fastDemande'] = $this->user_model->getRangeASCDemandesAd($debut, $fin ,$this->session->userdata('member_code')); - $data['tab_slowDemande'] = $this->user_model->getRangeDESCDemandesAd($debut, $fin ,$this->session->userdata('member_code')); + $data['tab_fastDemande'] = $this->user_model->getRangeASCDemandesAd($debut, $fin, $this->session->userdata('member_code')); + $data['tab_slowDemande'] = $this->user_model->getRangeDESCDemandesAd($debut, $fin, $this->session->userdata('member_code')); $data['mydem'] = $this->user_model->getDemandesHyperForSuper($this->session->userdata('member_code')); - $data['temp_moyen'] = $this->user_model->getTempsMoyenAd($debut, $fin ,$this->session->userdata('member_code')); - $data['list'] = $this->user_model->getDemandesAdForSuper($debut, $fin ,$this->session->userdata('member_code')); + $data['temp_moyen'] = $this->user_model->getTempsMoyenAd($debut, $fin, $this->session->userdata('member_code')); + $data['list'] = $this->user_model->getDemandesAdForSuper($debut, $fin, $this->session->userdata('member_code')); $data['type'] = $this->lang->line('Adhésion'); $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); $data['geolocated_user'] = $this->user_model->getSuperNameAndCodeForSup($this->session->userdata('member_code')); @@ -210,7 +214,8 @@ class Superviseur_dash extends CI_Controller } // Wallet - public function wallet(){ + public function wallet() + { if (!$this->session->userdata('email')) { $this->session->set_flashdata('error', 'log in first'); @@ -231,42 +236,42 @@ class Superviseur_dash extends CI_Controller } else { $context = new AutoContext(); //Create wallet if it not exist - $res = $this->user_model->getWallet($agent_id ); - if($res == false){ - if($data['hasWallet']){ - $this->user_model->addWallet($agent_id ); + $res = $this->wallet_model->getWallet($agent_id); + if ($res == false) { + if ($data['hasWallet']) { + $this->user_model->addWallet($agent_id); } } - $res = $this->user_model->getWallet($agent_id); - if ($res!=null){ + $res = $this->wallet_model->getWallet($agent_id); + if ($res != null) { $row = $res->first_row(); - $data["commission"] = Money::of(round($row->balance_com,2), $this->session->userdata('currency_code'),$context)->formatTo('fr_FR'); - $data["principal"] = Money::of(round($row->balance_princ,2), $this->session->userdata('currency_code'),$context)->formatTo('fr_FR'); + $data["commission"] = Money::of(round($row->balance_com, 2), $this->session->userdata('currency_code'), $context)->formatTo('fr_FR'); + $data["principal"] = Money::of(round($row->balance_princ, 2), $this->session->userdata('currency_code'), $context)->formatTo('fr_FR'); $agents_g = $this->user_model->getUsersGeolocatedForSup($this->session->userdata('member_code')); $data['agents_g'] = $agents_g; //Fetch all transactions of any geolocated agent of the network $data["transactions"] = array(); - if($agents_g){ - foreach($agents_g->result() AS $row){ - $wallet = $this->user_model->getWallet($row->agent_id); - if($wallet){ + if ($agents_g) { + foreach ($agents_g->result() as $row) { + $wallet = $this->wallet_model->getWallet($row->agent_id); + if ($wallet) { if ($data['hasWallet']->first_row()->type == 'visa') { $transactions = $this->user_model->getAgentTransactions($wallet->first_row()->wallet_id); } elseif ($data['hasWallet']->first_row()->type == 'ilink') { $transactions = $this->user_model->getAgentiLinkTransactions($wallet->first_row()->wallet_id); } - if($transactions){ - foreach($transactions->result() AS $trans){ - $trans->agent_id = $row->agent_id ; // Add agent id to transaction - array_push( $data['transactions'], $trans); + if ($transactions) { + foreach ($transactions->result() as $trans) { + $trans->agent_id = $row->agent_id; // Add agent id to transaction + array_push($data['transactions'], $trans); } } } } } - }else{ + } else { $data["commission"] = "N/A"; $data["principal"] = "N/A"; $data["totalCommissionBanque"] = "N/A"; @@ -287,12 +292,12 @@ class Superviseur_dash extends CI_Controller $data['category'] = $this->session->userdata('category'); $data['network'] = $this->session->userdata('network'); $data['network_id'] = $id_network; - $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'],$this->session->userdata('current_pays')); + $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); $data['pays'] = $this->user_model->getAllGameCountries(); $data['networks'] = $this->user_model->getActiveNetwork(); $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); +// $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') $this->load->view('gestion_wallet_sup'); elseif ($data['hasWallet']->first_row()->type == 'ilink') @@ -313,9 +318,9 @@ class Superviseur_dash extends CI_Controller if ($type == 'transaction') $data['transactions'] = $this->user_model->getTransactionsSup($startDate, $endDate, $codeMembre); else if ($type == 'transaction_ilink') - $data['transactions'] = $this->user_model->getIlinkTransactionsSup($startDate, $endDate, $codeMembre); + $data['transactions'] = $this->wallet_model->getIlinkTransactionsSup($startDate, $endDate, $codeMembre); else if ($type == 'commission_transfer') - $data['transactions'] = $this->user_model->getCommissionTransfers($startDate, $endDate, $this->session->userdata('member_code')); + $data['transactions'] = $this->wallet_model->getCommissionTransfers($startDate, $endDate, $this->session->userdata('member_code')); else if ($type == 'balance_statement') $data['wallets'] = $this->user_model->getInfosWalletAgentForSuper($codeMembre); @@ -344,4 +349,54 @@ class Superviseur_dash extends CI_Controller $this->load->view('config_wallet_ilink_hyp/etat_soldes'); $this->load->view('footer'); } + + public function nano_credit() + { + if ($this->isLogged()) { + $data['network_id'] = $network_id = $this->session->userdata('network_id'); + + $startDate = $this->input->get('d'); + $endDate = $this->input->get('f'); + + $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['currency_code'] = $this->session->userdata('currency_code'); + + $data['transactions'] = $this->nano_credit_model->getUserDemandesCreditForSuper($startDate, $endDate, $this->session->userdata('member_code')); + + $data['active'] = "nano_credit"; + $data['alert'] = ""; + $data['firstname'] = $this->session->userdata('firstname'); + $data['lastname'] = $this->session->userdata('lastname'); + $data['email'] = $this->session->userdata('email'); + $data['network'] = $this->session->userdata('network'); + $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); + $data['networks'] = $this->user_model->getActiveNetwork(); + $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); + $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['geolocated_user'] = $this->user_model->getSuperNameAndCodeForSup($this->session->userdata('member_code')); + + $this->load->view('header_sup', $data); + $this->load->view('nano_credit/historique_nano_credit'); + $this->load->view('footer'); + } + } + + private 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; + } + } diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php index ba764bfb..3dd40316 100755 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -485,4 +485,21 @@ $lang['savings_history'] = 'Savings history'; $lang['export_savings_demands_history'] = "Export savings requests"; $lang['modify_sharing_rates'] = 'Modify sharing rates'; $lang['nano_credit_configuration'] = 'Nano Credit configuration'; +$lang['cassation_date'] = 'Cassation date'; +$lang['borrowing_capacity'] = "Borrowing capacity"; +$lang['group_members'] = "Members of the group"; +$lang['principal_account'] = "Main account"; +$lang['credit_account'] = "Credit account"; +$lang['savings_account'] = "Savings account"; +$lang['subscription_date'] = "Membership date"; +$lang['number_of_users'] = "Number of users"; +$lang['regulations'] = "Regulations"; +$lang['management_regulatory'] = "Regulatory management"; +$lang['max_amount_per_day'] = "Maximum amount per day"; +$lang['max_amount_per_week'] = "Maximum amount per week"; +$lang['max_amount_per_month'] = "Maximum amount per month"; +$lang['define_the_limits'] = "Define the limits"; +$lang['regulations_updated'] = 'Regulatory limits updated'; +$lang['refunded_amount'] = "Amount refunded"; +$lang['remains_to_be_reimbursed'] = "Remainder to reimburse" ?> diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index 9f3b58dd..40dfed68 100755 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -497,5 +497,21 @@ $lang['savings_history'] = 'Historique des épargnes'; $lang['export_savings_demands_history'] = "Exporter les demandes d'épargne"; $lang['modify_sharing_rates'] = 'Modifier les taux de partage'; $lang['nano_credit_configuration'] = 'Configuration du Nano Crédit'; -$lang['cassation_date'] = 'Date de cassation' +$lang['cassation_date'] = 'Date de cassation'; +$lang['borrowing_capacity'] = "Capacité d'emprunt"; +$lang['group_members'] = "Membres du groupe"; +$lang['principal_account'] = "Compte principal"; +$lang['credit_account'] = "Compte crédit"; +$lang['savings_account'] = "Compte épargne"; +$lang['subscription_date'] = "Date d'adhésion"; +$lang['number_of_users'] = "Nombre d'utilisateurs"; +$lang['regulations'] = "Réglementations"; +$lang['management_regulatory'] = "Gestion réglementaire"; +$lang['max_amount_per_day'] = "Montant maximum par jour"; +$lang['max_amount_per_week'] = "Montant maximum par semaine"; +$lang['max_amount_per_month'] = "Montant maximum par mois"; +$lang['define_the_limits'] = "Definir les limites"; +$lang['regulations_updated'] = 'Limites réglementaires mis à jour'; +$lang['refunded_amount'] = "Montant remboursé"; +$lang['remains_to_be_reimbursed'] = "Reste à rembourser" ?> diff --git a/application/models/Nano_credit_model.php b/application/models/Nano_credit_model.php index a025d559..f14eb10b 100644 --- a/application/models/Nano_credit_model.php +++ b/application/models/Nano_credit_model.php @@ -84,6 +84,19 @@ class Nano_Credit_model extends CI_Model } } + public function getUserDemandesCreditForSuper($debut, $fin, $codeParrain) + { + $chain = $debut ? " AND date_creation BETWEEN '" . $debut . "' AND '" . $fin . "'" : ""; + $query = $this->db->query("SELECT * + FROM infos_users_demandes_credits + WHERE `codeParrain`='" . $codeParrain . "'" . $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 . "'" : ""; @@ -96,4 +109,28 @@ class Nano_Credit_model extends CI_Model return false; } } + + public function getGroupMembers($group_code){ + $query = $this->db->query("SELECT + CASE + WHEN u.id = ug.id_createur THEN 'creator' + WHEN u.id = id_sponsor1 or u.id = id_sponsor2 or u.id = id_sponsor3 THEN 'sponsor' + ELSE 'member' + END as role, + u.* , wu.balance , ug.* FROM users u inner JOIN users_groups ug on u.group_id = ug.id INNER JOIN wallets_users wu ON wu.idUser = u.id where ug.code_groupe = '" . $group_code . "'"); + if ($query->num_rows() > 0) { + return $query; + } else { + return false; + } + } + + public function getGroup($group_code){ + $query = $this->db->query("SELECT * FROM infos_users_groups WHERE code_groupe = '" . $group_code . "'"); + if ($query->num_rows() > 0) { + return $query->first_row(); + } else { + return false; + } + } } diff --git a/application/models/Wallet_model.php b/application/models/Wallet_model.php index a06a0532..efc0494a 100644 --- a/application/models/Wallet_model.php +++ b/application/models/Wallet_model.php @@ -825,4 +825,37 @@ class Wallet_model extends CI_Model return false; } } + + // Gestion reglementaire + + public function getRegulationsCountries(){ + $query = $this->db->query("SELECT distinct cc.id , cc.name as country , cc.currency_code, r.id_country, r.montant_max_jour, r.montant_max_hebdo, r.montant_max_mensuel FROM networks n +INNER JOIN countries_currencies cc ON n.country_id= cc.id INNER JOIN configWallet cw ON cw.id_network = n.id LEFT JOIN regulations r ON r.id_country = cc.id;"); + if ($query->num_rows() > 0) { + return $query; + } else { + return false; + } + } + + public function getRegulationsLimits($id_country){ + $query = $this->db->query("SELECT * FROM regulations WHERE id_country ='" . $id_country . "'"); + if ($query->num_rows() > 0) { + return $query->first_row(); + } else { + return false; + } + } + + public function insertRegulationsLimits($id_country, $max_day , $max_week , $max_month){ + $sql = "INSERT INTO `regulations` (`id_country`, `montant_max_jour`, `montant_max_hebdo`, `montant_max_mensuel`) VALUES (?,?, ?, ?);"; + $query = $this->db->query($sql , array($id_country,$max_day,$max_week,$max_month)); + return $query; + } + + public function updateRegulationsLimits($id_country, $max_day , $max_week , $max_month){ + $sql = "UPDATE `regulations` SET `montant_max_jour` = ? , `montant_max_hebdo` = ? , `montant_max_mensuel` = ? WHERE (`id_country` = ?);"; + $query = $this->db->query($sql , array($max_day,$max_week,$max_month,$id_country)); + return $query; + } } diff --git a/application/views/gestion_reglementations.php b/application/views/gestion_reglementations.php new file mode 100755 index 00000000..df8a4832 --- /dev/null +++ b/application/views/gestion_reglementations.php @@ -0,0 +1,240 @@ + + + + + +
+ +
+ +

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

+ +
+ +

Erreur!

+ +
+ + +
+ +

Success!

+ +
+ + +
+ +
+
+
+
+
+

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

+
+
+ + num_rows(); + $num = 0; + if ($numrows > 0) { + ?> + + + + + + + + + + + + + result() as $row) { + $num ++; + //$member_code = randomString1(10); + echo " + + "; + ?> + + + + + + + + + + +
lang->line('Pays'); ?>lang->line('max_amount_per_day'); ?>lang->line('max_amount_per_week'); ?>lang->line('max_amount_per_month'); ?> Action
$num$row->country id_country) echo Money::of(round($row->montant_max_jour, 2), $row->currency_code, $context)->formatTo('fr_FR') ?>id_country) echo Money::of(round($row->montant_max_hebdo, 2), $row->currency_code, $context)->formatTo('fr_FR') ?>id_country) echo Money::of(round($row->montant_max_mensuel, 2), $row->currency_code, $context)->formatTo('fr_FR'); ?> + +
+ + lang->line('Aucun pays'); + } + }else { + echo $this->lang->line('Aucun pays'); + } + ?> +
+
+
+
+ + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/views/gestion_wallet_ilink_config_paying_network.php b/application/views/gestion_wallet_ilink_config_paying_network.php index 654e6321..76296c40 100755 --- a/application/views/gestion_wallet_ilink_config_paying_network.php +++ b/application/views/gestion_wallet_ilink_config_paying_network.php @@ -227,7 +227,7 @@ } else { $('#rateForm'+num)[0].reportValidity(); } - ; + }); diff --git a/application/views/header_gestion.php b/application/views/header_gestion.php index e14a1787..be7cd173 100755 --- a/application/views/header_gestion.php +++ b/application/views/header_gestion.php @@ -170,6 +170,14 @@ lang->line('currency'); ?> + +
  • "> + + lang->line('regulations'); ?> + +
  • diff --git a/application/views/header_sup.php b/application/views/header_sup.php index 86a79774..78768a3d 100755 --- a/application/views/header_sup.php +++ b/application/views/header_sup.php @@ -159,6 +159,16 @@ Walletlang->line('Game'); ?> + + first_row()->type == 'ilink') { ?> +
  • "> + + Nano credit + +
  • + diff --git a/application/views/historique_transactions_ilink.php b/application/views/historique_transactions_ilink.php index f12114e1..97088267 100755 --- a/application/views/historique_transactions_ilink.php +++ b/application/views/historique_transactions_ilink.php @@ -8,15 +8,14 @@ setTimezone($timezone); @@ -155,7 +154,7 @@ use Brick\Money\Money; lang->line('recipient_id')?> Date session->userdata('category') != 'super') { ?> - Action + @@ -203,12 +202,12 @@ use Brick\Money\Money; ".toLocateDate($row->date,$this->session->userdata('timezone')).""; ?> session->userdata('category') != 'super') { ?> - - - + +id_transaction ?> +canceled) echo "disabled" ?> +lang->line('cancel') ?> + + diff --git a/application/views/nano_credit/gestion_nano_credit_hyp.php b/application/views/nano_credit/gestion_nano_credit_hyp.php index 67979657..e30784f3 100755 --- a/application/views/nano_credit/gestion_nano_credit_hyp.php +++ b/application/views/nano_credit/gestion_nano_credit_hyp.php @@ -128,11 +128,10 @@ $context = new \Brick\Money\Context\AutoContext(); " . $this->lang->line('Nom') . " " . $this->lang->line('creator') . " " . $this->lang->line('credit_limit') . " - Sponsor 1 - Sponsor 2 - Sponsor 3 Status - " . $this->lang->line('created_date') . ""; + " . $this->lang->line('number_of_users') . " + " . $this->lang->line('created_date') . " + Action "; ?> @@ -145,9 +144,7 @@ $context = new \Brick\Money\Context\AutoContext(); " . $row->nom . " " . $row->createur . " " . Money::of(round($row->limite_credit, 2), $row->currency_code, $context)->formatTo('fr_FR') . " - " . $row->sponsor1 . " - " . $row->sponsor2 . " - " . $row->sponsor3 . ""; + "; ?> actif) { @@ -164,7 +161,14 @@ $context = new \Brick\Money\Context\AutoContext(); + nombre_utilisateurs?> + date_creation ?> + + id_network) echo "disabled"?> > + lang->line('Voir plus...'); ?> + + lang->line('state') ?> lang->line('caution_type') ?> lang->line('duration') ?> - lang->line('Montant') ?> + lang->line('refunded_amount') ?> + lang->line('remains_to_be_reimbursed') ?> lang->line('interest') ?> lang->line('tax') ?> lang->line('agent_name') ?> @@ -162,6 +162,7 @@ " . strtoupper($row->etat) . " " . strtoupper($row->type_caution) . " " . strtoupper($row->duree_mois) . " + " . Money::of(round($row->montant_rembourse, 2), $currency_code, $context)->formatTo('fr_FR') . " " . $moneyNet->formatTo('fr_FR') . " " . Money::of(round($row->interet, 2), $currency_code, $context)->formatTo('fr_FR') . " " . Money::of(round($row->taxe, 2), $currency_code, $context)->formatTo('fr_FR') . " @@ -235,9 +236,9 @@ const format = lang === 'french' ? 'fr' : 'en'; moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date var table = $('#transactions').DataTable({ - "aaSorting": [[12, "desc"]], + "aaSorting": [[13, "desc"]], "columnDefs": [{ - targets: [10, 11, 12], + targets: [11, 12, 13], render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format) }], dom: 'Bfrtip', @@ -299,8 +300,13 @@ }, function (start, end, label) { const debut = start.format('YYYY-MM-DD'); const fin = end.format('YYYY-MM-DD'); - if (category) - window.location = "" + "?history=nano_credit" + "&d=" + debut + "&f=" + fin; + if (category){ + if(category == 'super') + window.location = "" + "?d=" + debut + "&f=" + fin; + else + window.location = "" + "?history=nano_credit" + "&d=" + debut + "&f=" + fin; + + } else window.location = "" + "?id=118&history=nano_credit" + "&d=" + debut + "&f=" + fin; @@ -309,8 +315,12 @@ $('input[name="daterange"]').on('cancel.daterangepicker', function (ev, picker) { //do something, like clearing an input $('#daterange').val(''); - if (category) - window.location = "" + "?history=nano_credit"; + if (category){ + if(category == 'super') + window.location = ""; + else + window.location = "" + "?history=nano_credit"; + } else window.location = "" + "?id=118&history=nano_credit"; }); diff --git a/application/views/nano_credit/users_group_detail.php b/application/views/nano_credit/users_group_detail.php new file mode 100755 index 00000000..77b8f124 --- /dev/null +++ b/application/views/nano_credit/users_group_detail.php @@ -0,0 +1,304 @@ + + + + + + + + +
    + +
    + +

    + Nano crédit +

    + +
    + +

    Erreur!

    + +
    + + +
    + +

    Success!

    + +
    + + + +
    + +
    +
    +
    +
    +
    +

    formatTo('fr_FR') ?>

    +

    lang->line('borrowing_capacity') ?>

    +
    +
    + +
    +
    +
    + +
    +
    +
    +

    limite_credit, 2), $currency_code, $context)->formatTo('fr_FR') ?>

    +

    lang->line('credit_limit') ?>

    +
    +
    + +
    +
    +
    + +
    +
    +
    +

    nombre_utilisateurs ?>

    +

    lang->line('number_of_users') ?>

    +
    +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    +

    createur ?>

    +

    lang->line('creator') ?>

    +
    +
    +
    + +
    +
    +
    +

    sponsor1 ?>

    +

    Sponsor 1

    +
    +
    +
    + +
    +
    +
    +

    sponsor2 ?>

    +

    Sponsor 2

    +
    +
    +
    + +
    +
    +
    +

    sponsor3 ?>

    +

    Sponsor 3

    +
    +
    +
    + +
    + +
    +
    +
    +
    +

    + lang->line('group_members') . ' - ' . $group->nom?>

    + +
    +
    + + + + " . 'Role' . " + + + + + + + "; + + ?> + + + + result() as $row) { ?> + + role == 'creator') { + ?> + + role == 'sponsor') { + ?> + + + + + + + + " . $row->lastname . ' ' . $row->firstname . " + + + + + + + "; + ?> + + + +
    " . $this->lang->line('Nom') . "" . $this->lang->line('Téléphone') . "" . $this->lang->line('Adresse') . "" . $this->lang->line('principal_account') . "" . $this->lang->line('credit_account') . "" . $this->lang->line('savings_account') . "" . $this->lang->line('subscription_date') . "
    + lang->line('creator') ?> + + Sponsor + + lang->line('Membre') ?> + " . $row->phone . "" . $row->adresse . "" . Money::of(round($row->balance, 2), $currency_code, $context)->formatTo('fr_FR') . "" . Money::of(round($row->balance_credit, 2), $currency_code, $context)->formatTo('fr_FR') . "" . Money::of(round($row->balance_epargne, 2), $currency_code, $context)->formatTo('fr_FR') . "" . $row->date_adhesion . "
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +