+ Cancel credits requests in hypervisor panel
This commit is contained in:
parent
e622970e38
commit
b5357516d1
|
@ -21,15 +21,7 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
|
if ($this->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);
|
|
||||||
} else {
|
|
||||||
$count_d_traite = $this->user_model->getCountDemandeByStatut($this->session->userdata('member_code'), '1');
|
$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_no_traite = $this->user_model->getCountDemandeByStatut($this->session->userdata('member_code'), '0');
|
||||||
$count_d_no_canceled = $this->user_model->getCountDemandeByStatut($this->session->userdata('member_code'), '2');
|
$count_d_no_canceled = $this->user_model->getCountDemandeByStatut($this->session->userdata('member_code'), '2');
|
||||||
|
@ -68,15 +60,7 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
public function getAllUser_g()
|
public function getAllUser_g()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!$this->session->userdata('email')) {
|
if ($this->isLogged()) {
|
||||||
$this->session->set_flashdata('error', 'log in first');
|
|
||||||
|
|
||||||
$data['alert'] = "ok";
|
|
||||||
$data['message'] = "Login first!";
|
|
||||||
|
|
||||||
redirect('index.php', $data);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if ($this->input->post('ville')) {
|
if ($this->input->post('ville')) {
|
||||||
$this->session->set_userdata('current_ville', $this->input->post('ville'));
|
$this->session->set_userdata('current_ville', $this->input->post('ville'));
|
||||||
}
|
}
|
||||||
|
@ -111,17 +95,7 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
|
|
||||||
public function getAllSupervisor()
|
public function getAllSupervisor()
|
||||||
{
|
{
|
||||||
|
if ($this->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);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
/*$this->db->select('*');
|
/*$this->db->select('*');
|
||||||
$this->db->from('users');
|
$this->db->from('users');
|
||||||
$this->db->where('category','super');
|
$this->db->where('category','super');
|
||||||
|
@ -165,15 +139,7 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
|
|
||||||
public function getAllSupervisorPositions()
|
public function getAllSupervisorPositions()
|
||||||
{
|
{
|
||||||
if (!$this->session->userdata('email')) {
|
if ($this->isLogged()) {
|
||||||
$this->session->set_flashdata('error', 'log in first');
|
|
||||||
|
|
||||||
$data['alert'] = "ok";
|
|
||||||
$data['message'] = "Login first!";
|
|
||||||
|
|
||||||
|
|
||||||
redirect('index.php', $data);
|
|
||||||
} else {
|
|
||||||
$network = $this->session->userdata('network');
|
$network = $this->session->userdata('network');
|
||||||
$category = 'super';
|
$category = 'super';
|
||||||
|
|
||||||
|
@ -186,13 +152,7 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
|
|
||||||
public function getDemandes()
|
public function getDemandes()
|
||||||
{
|
{
|
||||||
|
if ($this->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);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$debut = $this->input->get("d");
|
$debut = $this->input->get("d");
|
||||||
$fin = $this->input->get("f");
|
$fin = $this->input->get("f");
|
||||||
|
@ -202,7 +162,7 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
$fin = Date('Y-m-d', strtotime($fin . "+1 day"));
|
$fin = Date('Y-m-d', strtotime($fin . "+1 day"));
|
||||||
|
|
||||||
$ville = $this->session->userdata('ville');
|
$ville = $this->session->userdata('ville');
|
||||||
$data['active'] = "demandes";
|
$data['active'] = "demandes_credits_entrantes";
|
||||||
$data['type'] = 'incoming';
|
$data['type'] = 'incoming';
|
||||||
$data['demand_type'] = 'credit';
|
$data['demand_type'] = 'credit';
|
||||||
$data['alert'] = "";
|
$data['alert'] = "";
|
||||||
|
@ -230,6 +190,94 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function demandsCancellation()
|
||||||
|
{
|
||||||
|
if ($this->isLogged()) {
|
||||||
|
|
||||||
|
$show = $this->input->get("show");
|
||||||
|
|
||||||
|
$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;
|
||||||
|
$fin = Date('Y-m-d', strtotime($fin . "+1 day"));
|
||||||
|
|
||||||
|
|
||||||
|
$data['active'] = "demandes_credits_annulation";
|
||||||
|
$data['type'] = 'incoming';
|
||||||
|
$data['demand_type'] = 'credit';
|
||||||
|
$data['alert'] = "";
|
||||||
|
$data['token'] = $this->session->userdata('token');
|
||||||
|
$data['email'] = $this->session->userdata('email');
|
||||||
|
$data['firstname'] = $this->session->userdata('firstname');
|
||||||
|
$data['lastname'] = $this->session->userdata('lastname');
|
||||||
|
$data['code_parrain'] = $this->session->userdata('code_parrain');
|
||||||
|
$data['phone'] = $this->session->userdata('phone');
|
||||||
|
$data['adresse'] = $this->session->userdata('adresse');
|
||||||
|
$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'));
|
||||||
|
|
||||||
|
if($show == 'history'){
|
||||||
|
$data['list'] = $this->user_model->getAllCanceledCreditsDemands($debut, $fin, $this->session->userdata('network_id'));
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$data['list'] = $this->user_model->getAllAcceptedCreditsDemands($debut, $fin, $this->session->userdata('network_id'));
|
||||||
|
$data['temp_moyen'] = $this->user_model->getTempsMoyenByNetwork($this->session->userdata('network_id'));
|
||||||
|
|
||||||
|
}
|
||||||
|
$data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code'));
|
||||||
|
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
|
||||||
|
$this->load->view('header_hyp', $data);
|
||||||
|
if($show == 'history'){
|
||||||
|
$this->load->view('historique_demande_credit_annulation');
|
||||||
|
}else{
|
||||||
|
$this->load->view('demande_credit_annulation');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->load->view('footer');
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function cancelCreditRequest(){
|
||||||
|
if ($this->isLogged()) {
|
||||||
|
$data = array(
|
||||||
|
'canceled_by_hypervisor' => 1 ,
|
||||||
|
'cancellation_date' => $this->user_model->getCurrentTimeByNetworkID($this->session->userdata('network_id'))
|
||||||
|
);
|
||||||
|
$id = $this->input->post('id_demand');
|
||||||
|
$query = $this->db->get_where('info_demandeCredits', ['demande_id' => $id]);
|
||||||
|
|
||||||
|
if($query->num_rows()>0){
|
||||||
|
$demand = $query->first_row();
|
||||||
|
|
||||||
|
// Debiter le compte de l'agent
|
||||||
|
$this->db->set('balance_princ', 'balance_princ-'.$demand->montant,false);
|
||||||
|
$this->db->where('id_networkAgent',$demand->network_agent_id);
|
||||||
|
$this->db->update('wallets');
|
||||||
|
|
||||||
|
// Credit le compte du parrain
|
||||||
|
$this->db->set('balance_princ', 'balance_princ+'.$demand->montant,false);
|
||||||
|
$this->db->where('id_networkAgent',$demand->network_parrain_id);
|
||||||
|
$this->db->update('wallets');
|
||||||
|
|
||||||
|
$this->db->where('id', $id);
|
||||||
|
$query = $this->db->update('demandeCredits', $data);
|
||||||
|
|
||||||
|
if ($query) {
|
||||||
|
echo json_encode("200");
|
||||||
|
} else {
|
||||||
|
echo json_encode("500");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
echo json_encode("404");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function addvilles()
|
public function addvilles()
|
||||||
{
|
{
|
||||||
$id = 1;
|
$id = 1;
|
||||||
|
@ -251,13 +299,7 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
|
|
||||||
public function getDemandesAd()
|
public function getDemandesAd()
|
||||||
{
|
{
|
||||||
|
if ($this->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);
|
|
||||||
} else {
|
|
||||||
$network = $this->session->userdata('network');
|
$network = $this->session->userdata('network');
|
||||||
$debut = $this->input->get("d");
|
$debut = $this->input->get("d");
|
||||||
$fin = $this->input->get("f");
|
$fin = $this->input->get("f");
|
||||||
|
@ -294,13 +336,7 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
// Wallet
|
// Wallet
|
||||||
public function wallet()
|
public function wallet()
|
||||||
{
|
{
|
||||||
if (!$this->session->userdata('email')) {
|
if ($this->isLogged()) {
|
||||||
$this->session->set_flashdata('error', 'log in first');
|
|
||||||
|
|
||||||
$data['alert'] = "ok";
|
|
||||||
$data['message'] = "Login first!";
|
|
||||||
$this->load->view('login', $data);
|
|
||||||
} else {
|
|
||||||
$id_network = $this->session->userdata('network_id');
|
$id_network = $this->session->userdata('network_id');
|
||||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
|
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
|
||||||
if ($data['hasWallet']) {
|
if ($data['hasWallet']) {
|
||||||
|
|
|
@ -590,4 +590,10 @@ $lang['unexpected_error'] = "An unexpected error has occurred";
|
||||||
$lang['operators_enabled_disabled'] = "Operator(s) enabled / disabled";
|
$lang['operators_enabled_disabled'] = "Operator(s) enabled / disabled";
|
||||||
$lang['backoffice_management'] = "Backoffice management";
|
$lang['backoffice_management'] = "Backoffice management";
|
||||||
$lang['number_of_members'] = "Number of members";
|
$lang['number_of_members'] = "Number of members";
|
||||||
|
$lang['cancellation_credit_requests'] = "Cancellation of credit requests";
|
||||||
|
$lang['cancellation'] = "Cancellation";
|
||||||
|
$lang['incoming_credits_requests_accepted'] = 'Incoming credit requests accepted';
|
||||||
|
$lang['history_canceled_credit_requests'] = "History of canceled credit requests";
|
||||||
|
$lang['cancellation_date'] = "Cancellation date";
|
||||||
|
$lang['receiver'] = "Receiver";
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -602,4 +602,10 @@ $lang['unexpected_error'] = "Une erreur innatendue s'est produite";
|
||||||
$lang['operators_enabled_disabled'] = "Opérateur(s) activée(s)/désactivée(s)";
|
$lang['operators_enabled_disabled'] = "Opérateur(s) activée(s)/désactivée(s)";
|
||||||
$lang['backoffice_management'] = "Gestion du backoffice";
|
$lang['backoffice_management'] = "Gestion du backoffice";
|
||||||
$lang['number_of_members'] = "Nombre de membres";
|
$lang['number_of_members'] = "Nombre de membres";
|
||||||
|
$lang['cancellation_credit_requests'] = "Annulation des demandes de crédits";
|
||||||
|
$lang['cancellation'] = "Annulation";
|
||||||
|
$lang['incoming_credits_requests_accepted'] = 'Demandes de crédits entrantes acceptées';
|
||||||
|
$lang['history_canceled_credit_requests'] = "Historique des demandes de crédits annulées";
|
||||||
|
$lang['cancellation_date'] = "Date d'annulation";
|
||||||
|
$lang['receiver'] = "Destinataire";
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -397,11 +397,7 @@ class User_model extends CI_Model
|
||||||
WHERE d.codeParrain='".$member_code."'
|
WHERE d.codeParrain='".$member_code."'
|
||||||
ORDER BY dateAjout");
|
ORDER BY dateAjout");
|
||||||
|
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCountDemande($codeParrain){
|
public function getCountDemande($codeParrain){
|
||||||
|
@ -556,11 +552,7 @@ class User_model extends CI_Model
|
||||||
LIMIT 5");
|
LIMIT 5");
|
||||||
}
|
}
|
||||||
|
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -664,11 +656,7 @@ class User_model extends CI_Model
|
||||||
LIMIT 5");
|
LIMIT 5");
|
||||||
}
|
}
|
||||||
|
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -696,11 +684,7 @@ class User_model extends CI_Model
|
||||||
LIMIT 5");
|
LIMIT 5");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($query->num_rows() > 0) {
|
return ($query->num_rows() > 0) ? $query : false ;
|
||||||
return $query;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -715,13 +699,7 @@ class User_model extends CI_Model
|
||||||
WHERE statut= '1' AND codeParrain='" . $codeParrain . "'
|
WHERE statut= '1' AND codeParrain='" . $codeParrain . "'
|
||||||
AND dateAjout BETWEEN '" . $debut . "' AND '" . $fin . "'");
|
AND dateAjout BETWEEN '" . $debut . "' AND '" . $fin . "'");
|
||||||
}
|
}
|
||||||
|
return ($query->num_rows() > 0) ? $query->row()->temps : false ;
|
||||||
if ($query->num_rows() > 0) {
|
|
||||||
return $query->row()->temps;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTempsMoyenDemandeSup($codeParrain){
|
public function getTempsMoyenDemandeSup($codeParrain){
|
||||||
|
@ -731,13 +709,7 @@ class User_model extends CI_Model
|
||||||
}else{
|
}else{
|
||||||
$query = $this->db->query("SELECT AVG(temps) AS temps FROM info_demandeCredits WHERE statut='1' AND codeMembre='".$codeParrain."'");
|
$query = $this->db->query("SELECT AVG(temps) AS temps FROM info_demandeCredits WHERE statut='1' AND codeMembre='".$codeParrain."'");
|
||||||
}
|
}
|
||||||
|
return ($query->num_rows() > 0) ? $query->row()->temps : false ;
|
||||||
if ($query->num_rows() > 0) {
|
|
||||||
return $query->row()->temps;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTempsMoyenByVille($codeParrain, $network)
|
public function getTempsMoyenByVille($codeParrain, $network)
|
||||||
|
@ -749,6 +721,13 @@ class User_model extends CI_Model
|
||||||
$query = $this->db->query("SELECT AVG(temps) AS temps FROM info_demandeCredits WHERE statut='1' AND codeParrain='" . $codeParrain . "' ");
|
$query = $this->db->query("SELECT AVG(temps) AS temps FROM info_demandeCredits WHERE statut='1' AND codeParrain='" . $codeParrain . "' ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ($query->num_rows() > 0) ? $query->row()->temps : false ;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTempsMoyenByNetwork($id_network)
|
||||||
|
{
|
||||||
|
$query = $this->db->query("SELECT AVG(temps) AS temps FROM info_demandeCredits WHERE statut='1' AND id_network='" . $id_network . "' ");
|
||||||
|
|
||||||
if ($query->num_rows() > 0) {
|
if ($query->num_rows() > 0) {
|
||||||
return $query->row()->temps;
|
return $query->row()->temps;
|
||||||
} else {
|
} else {
|
||||||
|
@ -765,13 +744,7 @@ class User_model extends CI_Model
|
||||||
$chain = $debut ? "AND date_creation BETWEEN '".$debut."' AND '".$fin."'" : "";
|
$chain = $debut ? "AND date_creation BETWEEN '".$debut."' AND '".$fin."'" : "";
|
||||||
$query = $this->db->query("SELECT AVG(TIMESTAMPDIFF(SECOND,date_creation,date_modified)) AS temps FROM info_demandesAdhesion WHERE etat=1 AND code_membre='".$codeParrain."'".$chain);
|
$query = $this->db->query("SELECT AVG(TIMESTAMPDIFF(SECOND,date_creation,date_modified)) AS temps FROM info_demandesAdhesion WHERE etat=1 AND code_membre='".$codeParrain."'".$chain);
|
||||||
}
|
}
|
||||||
|
return ($query->num_rows() > 0) ? $query->row()->temps : false ;
|
||||||
if($query->num_rows()>0){
|
|
||||||
return $query->row()->temps;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNetworkByHyp($codeHyp){
|
public function getNetworkByHyp($codeHyp){
|
||||||
|
@ -1453,11 +1426,7 @@ class User_model extends CI_Model
|
||||||
|
|
||||||
public function getActiveNetworks($country_id){
|
public function getActiveNetworks($country_id){
|
||||||
$query = $this->db->query("SELECT id,name FROM networks WHERE country_id ='".$country_id."' AND status = 1");
|
$query = $this->db->query("SELECT id,name FROM networks WHERE country_id ='".$country_id."' AND status = 1");
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_current_page_records($limit, $start,$pays,$hyper,$ville)
|
public function get_current_page_records($limit, $start,$pays,$hyper,$ville)
|
||||||
|
@ -1703,12 +1672,7 @@ class User_model extends CI_Model
|
||||||
ON child.code_parrain='".$codeHyp."'
|
ON child.code_parrain='".$codeHyp."'
|
||||||
WHERE child.category='super' AND dad.category='hyper' AND dad.code_membre='" . $codeHyp . "'
|
WHERE child.category='super' AND dad.category='hyper' AND dad.code_membre='" . $codeHyp . "'
|
||||||
");
|
");
|
||||||
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
if ($query->num_rows() > 0) {
|
|
||||||
return $query;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDemandesBySuper($debut, $fin, $code_parrain)
|
public function getDemandesBySuper($debut, $fin, $code_parrain)
|
||||||
|
@ -1718,13 +1682,7 @@ class User_model extends CI_Model
|
||||||
FROM info_demandeCredits AS d
|
FROM info_demandeCredits AS d
|
||||||
WHERE d.codeParrain='" . $code_parrain . "' AND d.dateAjout BETWEEN '" . $debut . "' AND '" . $fin . "'
|
WHERE d.codeParrain='" . $code_parrain . "' AND d.dateAjout BETWEEN '" . $debut . "' AND '" . $fin . "'
|
||||||
ORDER BY dateAjout");
|
ORDER BY dateAjout");
|
||||||
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
if ($query->num_rows() > 0) {
|
|
||||||
return $query;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getGameCountry(){
|
public function getGameCountry(){
|
||||||
|
@ -1734,11 +1692,7 @@ class User_model extends CI_Model
|
||||||
WHERE configGame.etat=1
|
WHERE configGame.etat=1
|
||||||
GROUP BY countries.id");
|
GROUP BY countries.id");
|
||||||
|
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCoutForQuota($pays,$quota_inf,$quota_sup){
|
public function getCoutForQuota($pays,$quota_inf,$quota_sup){
|
||||||
|
@ -1757,11 +1711,7 @@ class User_model extends CI_Model
|
||||||
FROM (SELECT users.lastname,users.phone,users.email,COUNT(*) AS total FROM game
|
FROM (SELECT users.lastname,users.phone,users.email,COUNT(*) AS total FROM game
|
||||||
INNER JOIN users ON game.id_parrain=users.id
|
INNER JOIN users ON game.id_parrain=users.id
|
||||||
WHERE `id_pays`=".$pays." GROUP BY `id_parrain` HAVING COUNT(*) >= 20) AS t");
|
WHERE `id_pays`=".$pays." GROUP BY `id_parrain` HAVING COUNT(*) >= 20) AS t");
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test($pays,$hyper,$ville){
|
public function test($pays,$hyper,$ville){
|
||||||
|
@ -1909,11 +1859,7 @@ class User_model extends CI_Model
|
||||||
$query = $this->db->query("SELECT *
|
$query = $this->db->query("SELECT *
|
||||||
FROM infos_transaction
|
FROM infos_transaction
|
||||||
WHERE `codeParrain`='".$codeMembre."'".$chain);
|
WHERE `codeParrain`='".$codeMembre."'".$chain);
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getInfosWalletAgentForHyper($id_network){
|
public function getInfosWalletAgentForHyper($id_network){
|
||||||
|
@ -1955,11 +1901,7 @@ class User_model extends CI_Model
|
||||||
INNER JOIN towns ON towns.id=agents.town_id
|
INNER JOIN towns ON towns.id=agents.town_id
|
||||||
".$where_clause;
|
".$where_clause;
|
||||||
//var_dump($statement);
|
//var_dump($statement);
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2039,11 +1981,7 @@ class User_model extends CI_Model
|
||||||
LEFT JOIN publiciteConfig ON countries.id=publiciteConfig.id_country AND publiciteConfig.id_config=2
|
LEFT JOIN publiciteConfig ON countries.id=publiciteConfig.id_country AND publiciteConfig.id_config=2
|
||||||
WHERE towns.status=1
|
WHERE towns.status=1
|
||||||
GROUP BY countries.id");
|
GROUP BY countries.id");
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2076,11 +2014,7 @@ class User_model extends CI_Model
|
||||||
WHERE child.category='geolocated' AND dad.category='super' AND dad.code_membre='".$codeSup."'
|
WHERE child.category='geolocated' AND dad.category='super' AND dad.code_membre='".$codeSup."'
|
||||||
");
|
");
|
||||||
|
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function nameOfCurrentGeolocatedUser_forSuper($geolocatedUser_memberCode){
|
public function nameOfCurrentGeolocatedUser_forSuper($geolocatedUser_memberCode){
|
||||||
|
@ -2097,21 +2031,13 @@ class User_model extends CI_Model
|
||||||
public function getAllActivatedNetworks(){
|
public function getAllActivatedNetworks(){
|
||||||
$query = $this->db->query("SELECT networks.name AS network,networks.status AS status,networks.id,countries.name AS country,networks.country_id , configWallet.id_network , configWallet.type FROM `networks`
|
$query = $this->db->query("SELECT networks.name AS network,networks.status AS status,networks.id,countries.name AS country,networks.country_id , configWallet.id_network , configWallet.type FROM `networks`
|
||||||
INNER JOIN countries ON networks.country_id=countries.id LEFT JOIN configWallet ON configWallet.id_network = networks.id WHERE status = 1");
|
INNER JOIN countries ON networks.country_id=countries.id LEFT JOIN configWallet ON configWallet.id_network = networks.id WHERE status = 1");
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getConfigWallet($id_network){
|
public function getConfigWallet($id_network){
|
||||||
$sql = "SELECT * FROM `configWallet` WHERE id_network = ?";
|
$sql = "SELECT * FROM `configWallet` WHERE id_network = ?";
|
||||||
$query = $this->db->query($sql , array($id_network));
|
$query = $this->db->query($sql , array($id_network));
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addConfigWallet($network_id , $type){
|
public function addConfigWallet($network_id , $type){
|
||||||
|
@ -2134,11 +2060,7 @@ class User_model extends CI_Model
|
||||||
public function getWallet($id_agent){
|
public function getWallet($id_agent){
|
||||||
$sql = "SELECT * FROM `wallet_agent` WHERE agent_id = ?";
|
$sql = "SELECT * FROM `wallet_agent` WHERE agent_id = ?";
|
||||||
$query = $this->db->query($sql , array($id_agent));
|
$query = $this->db->query($sql , array($id_agent));
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addWallet($id_agent){
|
public function addWallet($id_agent){
|
||||||
|
@ -2160,42 +2082,26 @@ class User_model extends CI_Model
|
||||||
$query = $this->db->query("SELECT *
|
$query = $this->db->query("SELECT *
|
||||||
FROM wallet_transaction
|
FROM wallet_transaction
|
||||||
WHERE `id_wallet`= '".$id_wallet."'");
|
WHERE `id_wallet`= '".$id_wallet."'");
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAgentiLinkTransactions($id_wallet){
|
public function getAgentiLinkTransactions($id_wallet){
|
||||||
$query = $this->db->query("SELECT *
|
$query = $this->db->query("SELECT *
|
||||||
FROM infos_ilink_transaction
|
FROM infos_ilink_transaction
|
||||||
WHERE `id_wallet_ag`= '".$id_wallet."'");
|
WHERE `id_wallet_ag`= '".$id_wallet."'");
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNetworkHyper($id_network){
|
public function getNetworkHyper($id_network){
|
||||||
$sql = "SELECT * FROM `hyper_infos` WHERE network_id = ?";
|
$sql = "SELECT * FROM `hyper_infos` WHERE network_id = ?";
|
||||||
$query = $this->db->query($sql , array($id_network));
|
$query = $this->db->query($sql , array($id_network));
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAllAgentsForNetwork($id_network){
|
public function getAllAgentsForNetwork($id_network){
|
||||||
$sql = "SELECT * FROM super_infos WHERE network_id = ?";
|
$sql = "SELECT * FROM super_infos WHERE network_id = ?";
|
||||||
$query = $this->db->query($sql , array($id_network));
|
$query = $this->db->query($sql , array($id_network));
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function reinitializeWallet($id_wallet){
|
public function reinitializeWallet($id_wallet){
|
||||||
|
@ -2209,11 +2115,7 @@ class User_model extends CI_Model
|
||||||
$query = $this->db->query("SELECT n.id AS id_network , n.name AS network,n.status AS status,c.name AS country,c.currency_name_fr, c.currency_name_en , c.currency_code, wp.id AS wallet_password FROM networks n
|
$query = $this->db->query("SELECT n.id AS id_network , n.name AS network,n.status AS status,c.name AS country,c.currency_name_fr, c.currency_name_en , c.currency_code, wp.id AS wallet_password FROM networks n
|
||||||
INNER JOIN countries_currencies c ON n.country_id=c.id INNER JOIN configWallet cw ON cw.id_network = n.id
|
INNER JOIN countries_currencies c ON n.country_id=c.id INNER JOIN configWallet cw ON cw.id_network = n.id
|
||||||
LEFT JOIN walletsPassword wp ON wp.network_id = n.id WHERE status = 1;");
|
LEFT JOIN walletsPassword wp ON wp.network_id = n.id WHERE status = 1;");
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addWalletPassword($network_id, $encrypted_password, $salt, $email)
|
public function addWalletPassword($network_id, $encrypted_password, $salt, $email)
|
||||||
|
@ -2246,11 +2148,7 @@ class User_model extends CI_Model
|
||||||
$query = $this->db->query("SELECT *
|
$query = $this->db->query("SELECT *
|
||||||
FROM infos_recharges
|
FROM infos_recharges
|
||||||
WHERE `network_id`=".$id_network.$chain);
|
WHERE `network_id`=".$id_network.$chain);
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addWalletRecharge($montant,$wallet_id){
|
public function addWalletRecharge($montant,$wallet_id){
|
||||||
|
@ -2313,11 +2211,7 @@ class User_model extends CI_Model
|
||||||
{
|
{
|
||||||
$sql = "SELECT * FROM `paliersConfigWallet` WHERE (`id` = ?);";
|
$sql = "SELECT * FROM `paliersConfigWallet` WHERE (`id` = ?);";
|
||||||
$query = $this->db->query($sql, array($id));
|
$query = $this->db->query($sql, array($id));
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deletePalierConfigWallet($type, $idConfig)
|
public function deletePalierConfigWallet($type, $idConfig)
|
||||||
|
@ -2386,11 +2280,7 @@ class User_model extends CI_Model
|
||||||
)
|
)
|
||||||
) AND code <> ? ;";
|
) AND code <> ? ;";
|
||||||
$query = $this->db->query($sql, array($code));
|
$query = $this->db->query($sql, array($code));
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Liste des monnaies pour les pays dont un wallet est actif
|
//Liste des monnaies pour les pays dont un wallet est actif
|
||||||
|
@ -2401,11 +2291,7 @@ class User_model extends CI_Model
|
||||||
)
|
)
|
||||||
) AND code <> ? ;";
|
) AND code <> ? ;";
|
||||||
$query = $this->db->query($sql, array($code));
|
$query = $this->db->query($sql, array($code));
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function insertExchangeRate($currency ,$rate){
|
public function insertExchangeRate($currency ,$rate){
|
||||||
|
@ -2417,11 +2303,7 @@ class User_model extends CI_Model
|
||||||
public function getExchangeRate($currency){
|
public function getExchangeRate($currency){
|
||||||
$sql = "SELECT * FROM `exchange_rate` WHERE `target_currency` = ?;";
|
$sql = "SELECT * FROM `exchange_rate` WHERE `target_currency` = ?;";
|
||||||
$query = $this->db->query($sql , array($currency));
|
$query = $this->db->query($sql , array($currency));
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateExchangeRate($currency,$rate){
|
public function updateExchangeRate($currency,$rate){
|
||||||
|
@ -2436,11 +2318,7 @@ class User_model extends CI_Model
|
||||||
SELECT distinct c.id FROM networks n INNER JOIN countries_currencies c ON n.country_id=c.id INNER JOIN configWallet cw ON cw.id_network = n.id WHERE status = 1
|
SELECT distinct c.id FROM networks n INNER JOIN countries_currencies c ON n.country_id=c.id INNER JOIN configWallet cw ON cw.id_network = n.id WHERE status = 1
|
||||||
);";
|
);";
|
||||||
$query = $this->db->query($sql);
|
$query = $this->db->query($sql);
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getActiveCountries(){
|
public function getActiveCountries(){
|
||||||
|
@ -2448,21 +2326,13 @@ class User_model extends CI_Model
|
||||||
SELECT distinct n.country_id FROM networks n WHERE n.status = 1
|
SELECT distinct n.country_id FROM networks n WHERE n.status = 1
|
||||||
);";
|
);";
|
||||||
$query = $this->db->query($sql);
|
$query = $this->db->query($sql);
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCountry($id){
|
public function getCountry($id){
|
||||||
$sql= "SELECT name FROM countries WHERE id = $id";
|
$sql= "SELECT name FROM countries WHERE id = $id";
|
||||||
$query = $this->db->query($sql);
|
$query = $this->db->query($sql);
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cancelCreditRequest($id_demand){
|
public function cancelCreditRequest($id_demand){
|
||||||
|
@ -2505,11 +2375,7 @@ class User_model extends CI_Model
|
||||||
public function getSimulateur($code){
|
public function getSimulateur($code){
|
||||||
$sql = "SELECT * FROM `simulateur` WHERE `code` = ?;";
|
$sql = "SELECT * FROM `simulateur` WHERE `code` = ?;";
|
||||||
$query = $this->db->query($sql , array($code));
|
$query = $this->db->query($sql , array($code));
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setSharingRate($network_id,$config_id,$rate, $url){
|
public function setSharingRate($network_id,$config_id,$rate, $url){
|
||||||
|
@ -2528,21 +2394,13 @@ class User_model extends CI_Model
|
||||||
public function getSharingRate($id_network ,$idConfig){
|
public function getSharingRate($id_network ,$idConfig){
|
||||||
$sql = "SELECT taux_partage , url FROM `paying_networks` WHERE `id_network` = ? AND id_configWallet = ? ;";
|
$sql = "SELECT taux_partage , url FROM `paying_networks` WHERE `id_network` = ? AND id_configWallet = ? ;";
|
||||||
$query = $this->db->query($sql , array($id_network,$idConfig));
|
$query = $this->db->query($sql , array($id_network,$idConfig));
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSharingRateByNetwork($id_network){
|
public function getSharingRateByNetwork($id_network){
|
||||||
$sql = "SELECT balance_com FROM `paying_networks` WHERE `id_network` = ? ;";
|
$sql = "SELECT balance_com FROM `paying_networks` WHERE `id_network` = ? ;";
|
||||||
$query = $this->db->query($sql , array($id_network));
|
$query = $this->db->query($sql , array($id_network));
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function countPayingNetworks($id_country ,$idConfig){
|
public function countPayingNetworks($id_country ,$idConfig){
|
||||||
|
@ -2550,21 +2408,13 @@ class User_model extends CI_Model
|
||||||
networks n ON n.country_id = c.id WHERE n.status = 1 AND c.id = ?
|
networks n ON n.country_id = c.id WHERE n.status = 1 AND c.id = ?
|
||||||
) AND id_configWallet = ? ;";
|
) AND id_configWallet = ? ;";
|
||||||
$query = $this->db->query($sql , array($id_country, $idConfig));
|
$query = $this->db->query($sql , array($id_country, $idConfig));
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getActiveNetworksByCountry($country_id , $network_id){
|
public function getActiveNetworksByCountry($country_id , $network_id){
|
||||||
$query = $this->db->query("SELECT networks.name , networks.id , configWallet.type FROM `networks` INNER JOIN countries ON networks.country_id=countries.id
|
$query = $this->db->query("SELECT networks.name , networks.id , configWallet.type FROM `networks` INNER JOIN countries ON networks.country_id=countries.id
|
||||||
INNER JOIN configWallet ON configWallet.id_network = networks.id WHERE status = 1 AND networks.id <> $network_id AND countries.id = $country_id");
|
INNER JOIN configWallet ON configWallet.id_network = networks.id WHERE status = 1 AND networks.id <> $network_id AND countries.id = $country_id");
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPayingNetworksByConfigWallet($id_config)
|
public function getPayingNetworksByConfigWallet($id_config)
|
||||||
|
@ -2595,11 +2445,7 @@ class User_model extends CI_Model
|
||||||
$query = $this->db->query("SELECT *
|
$query = $this->db->query("SELECT *
|
||||||
FROM infos_ilink_transaction
|
FROM infos_ilink_transaction
|
||||||
WHERE `network_emetteur`= '".$id_network."'");
|
WHERE `network_emetteur`= '".$id_network."'");
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCurrency($id_network){
|
public function getCurrency($id_network){
|
||||||
|
@ -2617,11 +2463,7 @@ class User_model extends CI_Model
|
||||||
$query = $this->db->query("SELECT *
|
$query = $this->db->query("SELECT *
|
||||||
FROM infos_transferts_commission
|
FROM infos_transferts_commission
|
||||||
WHERE `codeParrain`='".$codeMembre."'".$chain);
|
WHERE `codeParrain`='".$codeMembre."'".$chain);
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIlinkTransactionsSup($debut , $fin , $codeMembre){
|
public function getIlinkTransactionsSup($debut , $fin , $codeMembre){
|
||||||
|
@ -2629,11 +2471,7 @@ class User_model extends CI_Model
|
||||||
$query = $this->db->query("SELECT *
|
$query = $this->db->query("SELECT *
|
||||||
FROM infos_ilink_transaction
|
FROM infos_ilink_transaction
|
||||||
WHERE `code_parrain`='".$codeMembre."'".$chain);
|
WHERE `code_parrain`='".$codeMembre."'".$chain);
|
||||||
if($query->num_rows()>0){
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getInfosWalletAgentForSuper($codeMembre)
|
public function getInfosWalletAgentForSuper($codeMembre)
|
||||||
|
@ -2641,11 +2479,7 @@ class User_model extends CI_Model
|
||||||
$query = $this->db->query("SELECT *
|
$query = $this->db->query("SELECT *
|
||||||
FROM wallet_agent
|
FROM wallet_agent
|
||||||
WHERE `codeParrain`='" . $codeMembre . "'");
|
WHERE `codeParrain`='" . $codeMembre . "'");
|
||||||
if ($query->num_rows() > 0) {
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function insertRembourssementCompensation($montant, $id_network, $id_config)
|
public function insertRembourssementCompensation($montant, $id_network, $id_config)
|
||||||
|
@ -2671,11 +2505,7 @@ class User_model extends CI_Model
|
||||||
$query = $this->db->query("SELECT rp.* , n.name as network , cc.name as country , cc.currency_code FROM remboursemment_compensation rp
|
$query = $this->db->query("SELECT rp.* , n.name as network , cc.name as country , cc.currency_code FROM remboursemment_compensation rp
|
||||||
INNER JOIN networks n ON n.id = id_paying_network INNER JOIN countries_currencies cc ON cc.id = n.country_id
|
INNER JOIN networks n ON n.id = id_paying_network INNER JOIN countries_currencies cc ON cc.id = n.country_id
|
||||||
WHERE rp.id_network =" . $id_network . $chain);
|
WHERE rp.id_network =" . $id_network . $chain);
|
||||||
if ($query->num_rows() > 0) {
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Nano credit
|
// Nano credit
|
||||||
|
@ -2696,32 +2526,20 @@ class User_model extends CI_Model
|
||||||
$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,
|
$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`
|
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'");
|
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->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUsersGroups($id_network)
|
public function getUsersGroups($id_network)
|
||||||
{
|
{
|
||||||
$query = $this->db->query("SELECT * FROM infos_users_groups WHERE id_network = '" . $id_network . "'");
|
$query = $this->db->query("SELECT * FROM infos_users_groups WHERE id_network = '" . $id_network . "'");
|
||||||
if ($query->num_rows() > 0) {
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNanoCreditRates($idConfig, $type = 'nano_credit')
|
public function getNanoCreditRates($idConfig, $type = 'nano_credit')
|
||||||
{
|
{
|
||||||
$sql = "SELECT * FROM `paliersConfigNanoCredit` WHERE (`idConfig` = ? AND `type` = ? );";
|
$sql = "SELECT * FROM `paliersConfigNanoCredit` WHERE (`idConfig` = ? AND `type` = ? );";
|
||||||
$query = $this->db->query($sql, array($idConfig, $type));
|
$query = $this->db->query($sql, array($idConfig, $type));
|
||||||
if ($query->num_rows() > 0) {
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteNanoCreditRates($idConfig, $type = 'nano_credit')
|
public function deleteNanoCreditRates($idConfig, $type = 'nano_credit')
|
||||||
|
@ -2744,11 +2562,7 @@ class User_model extends CI_Model
|
||||||
$query = $this->db->query("SELECT *
|
$query = $this->db->query("SELECT *
|
||||||
FROM infos_users_demandes_credits
|
FROM infos_users_demandes_credits
|
||||||
WHERE `id_network`='" . $id_network . "'" . $chain);
|
WHERE `id_network`='" . $id_network . "'" . $chain);
|
||||||
if ($query->num_rows() > 0) {
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUsersSavings($debut, $fin, $id_network)
|
public function getUsersSavings($debut, $fin, $id_network)
|
||||||
|
@ -2757,10 +2571,40 @@ class User_model extends CI_Model
|
||||||
$query = $this->db->query("SELECT *
|
$query = $this->db->query("SELECT *
|
||||||
FROM infos_users_epargnes
|
FROM infos_users_epargnes
|
||||||
WHERE `id_network`='" . $id_network . "'" . $chain);
|
WHERE `id_network`='" . $id_network . "'" . $chain);
|
||||||
if ($query->num_rows() > 0) {
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
return $query;
|
}
|
||||||
} else {
|
|
||||||
return false;
|
public function getAllAcceptedCreditsDemands($debut, $fin, $id_network)
|
||||||
|
{
|
||||||
|
|
||||||
|
$query = $this->db->query("SELECT *
|
||||||
|
FROM info_demandeCredits AS d
|
||||||
|
WHERE d.id_network='" . $id_network . "' AND d.dateAjout BETWEEN '" . $debut . "' AND '" . $fin . "' AND statut = '1'
|
||||||
|
ORDER BY dateAjout");
|
||||||
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAllCanceledCreditsDemands($debut, $fin, $id_network)
|
||||||
|
{
|
||||||
|
|
||||||
|
$query = $this->db->query("SELECT *
|
||||||
|
FROM info_demandeCredits AS d
|
||||||
|
WHERE d.id_network='" . $id_network . "' AND d.cancellation_date BETWEEN '" . $debut . "' AND '" . $fin . "' AND canceled_by_hypervisor = '1'
|
||||||
|
ORDER BY cancellation_date");
|
||||||
|
return ($query->num_rows() > 0) ? $query : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Obtenir l'heure en fonction de l'id du reseau
|
||||||
|
public function getCurrentTimeByNetworkID($id_network){
|
||||||
|
$query = $this->db->query("SELECT code_country FROM countries c INNER JOIN networks n on n.country_id = c.id WHERE n.id = '$id_network'");
|
||||||
|
if($query->num_rows() > 0){
|
||||||
|
$country= $query->first_row();
|
||||||
|
$country_code = isset($country->code_country) ? $country->code_country : 'GA';
|
||||||
|
$timezone = \DateTimeZone::listIdentifiers(\DateTimeZone::PER_COUNTRY, $country_code);
|
||||||
|
$date = (sizeof($timezone) > 0) ? new \DateTime('now', new \DateTimeZone($timezone[0])) : new \DateTime();
|
||||||
|
return $date->format('Y-m-d H:i:s');
|
||||||
|
}else{
|
||||||
|
return date('Y-m-d H:i:s');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
// use Carbon\Carbon;
|
// use Carbon\Carbon;
|
||||||
|
$fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
|
||||||
|
|
||||||
function duree($time)
|
function duree($time)
|
||||||
{
|
{
|
||||||
|
@ -233,8 +234,6 @@
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$site_url = base_url();
|
|
||||||
$url = base_url('index.php/Listes_members/modif');
|
|
||||||
// output data of each row
|
// output data of each row
|
||||||
foreach ($result->result() as $row) {
|
foreach ($result->result() as $row) {
|
||||||
$num++;
|
$num++;
|
||||||
|
@ -257,7 +256,7 @@
|
||||||
echo "<tr>
|
echo "<tr>
|
||||||
<td> $row->phone</td>
|
<td> $row->phone</td>
|
||||||
<td >$origin </td>
|
<td >$origin </td>
|
||||||
<td > $row->montant</td>
|
<td >".$fmt->format($row->montant)."</td>
|
||||||
<td>" . $row->dateAjout . "</td>
|
<td>" . $row->dateAjout . "</td>
|
||||||
<td > " . $row->dateModif . "</td>
|
<td > " . $row->dateModif . "</td>
|
||||||
<td>$etat</td>
|
<td>$etat</td>
|
||||||
|
@ -325,8 +324,6 @@
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$site_url = base_url();
|
|
||||||
$url = base_url('index.php/Listes_members/modif');
|
|
||||||
// output data of each row
|
// output data of each row
|
||||||
foreach ($result->result() as $row) {
|
foreach ($result->result() as $row) {
|
||||||
$num++;
|
$num++;
|
||||||
|
@ -347,7 +344,7 @@
|
||||||
}
|
}
|
||||||
echo "<tr>
|
echo "<tr>
|
||||||
|
|
||||||
<td > $row->montant</td>
|
<td >".$fmt->format($row->montant)."</td>
|
||||||
<td>" . $row->dateAjout . "</td>
|
<td>" . $row->dateAjout . "</td>
|
||||||
<td > " . $row->dateModif . "</td>
|
<td > " . $row->dateModif . "</td>
|
||||||
<td>$etat</td>
|
<td>$etat</td>
|
||||||
|
@ -419,8 +416,7 @@
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$site_url = base_url();
|
|
||||||
$url = base_url('index.php/Listes_members/modif');
|
|
||||||
// output data of each row
|
// output data of each row
|
||||||
foreach ($result->result() as $row) {
|
foreach ($result->result() as $row) {
|
||||||
$num++;
|
$num++;
|
||||||
|
@ -434,7 +430,7 @@
|
||||||
<td>$num</td>
|
<td>$num</td>
|
||||||
<td>$row->agent</td>
|
<td>$row->agent</td>
|
||||||
<td>$superviseur</td>
|
<td>$superviseur</td>
|
||||||
<td>$row->montant</td>
|
<td>".$fmt->format($row->montant)."</td>
|
||||||
<td>" . $row->dateA . "</td>
|
<td>" . $row->dateA . "</td>
|
||||||
<td> " . $row->dateM . "</td>
|
<td> " . $row->dateM . "</td>
|
||||||
<td>" . duree($row->temps) . "</td>
|
<td>" . duree($row->temps) . "</td>
|
||||||
|
@ -499,8 +495,7 @@
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$site_url = base_url();
|
|
||||||
$url = base_url('index.php/Listes_members/modif');
|
|
||||||
// output data of each row
|
// output data of each row
|
||||||
foreach ($result->result() as $row) {
|
foreach ($result->result() as $row) {
|
||||||
$num++;
|
$num++;
|
||||||
|
@ -512,7 +507,7 @@
|
||||||
echo "<tr>
|
echo "<tr>
|
||||||
|
|
||||||
<td>$num</td>
|
<td>$num</td>
|
||||||
<td>$row->montant</td>
|
<td>".$fmt->format($row->montant)."</td>
|
||||||
<td>" . $row->dateA . "</td>
|
<td>" . $row->dateA . "</td>
|
||||||
<td> " . $row->dateM . "</td>
|
<td> " . $row->dateM . "</td>
|
||||||
<td>" . duree($row->temps) . "</td>
|
<td>" . duree($row->temps) . "</td>
|
||||||
|
@ -582,8 +577,7 @@
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$site_url = base_url();
|
|
||||||
$url = base_url('index.php/Listes_members/modif');
|
|
||||||
// output data of each row
|
// output data of each row
|
||||||
foreach ($result->result() as $row) {
|
foreach ($result->result() as $row) {
|
||||||
$num++;
|
$num++;
|
||||||
|
@ -597,7 +591,7 @@
|
||||||
<td>$num</td>
|
<td>$num</td>
|
||||||
<td>$row->agent</td>
|
<td>$row->agent</td>
|
||||||
<td>$superviseur</td>
|
<td>$superviseur</td>
|
||||||
<td>$row->montant</td>
|
<td>".$fmt->format($row->montant)."</td>
|
||||||
<td>" . $row->dateA . "</td>
|
<td>" . $row->dateA . "</td>
|
||||||
<td> " . $row->dateM . "</td>
|
<td> " . $row->dateM . "</td>
|
||||||
<td>" . duree($row->temps) . "</td>
|
<td>" . duree($row->temps) . "</td>
|
||||||
|
@ -662,8 +656,7 @@
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$site_url = base_url();
|
|
||||||
$url = base_url('index.php/Listes_members/modif');
|
|
||||||
// output data of each row
|
// output data of each row
|
||||||
foreach ($result->result() as $row) {
|
foreach ($result->result() as $row) {
|
||||||
$num++;
|
$num++;
|
||||||
|
@ -675,7 +668,7 @@
|
||||||
echo "<tr>
|
echo "<tr>
|
||||||
|
|
||||||
<td>$num</td>
|
<td>$num</td>
|
||||||
<td>$row->montant</td>
|
<td>".$fmt->format($row->montant)."</td>
|
||||||
<td>" . $row->dateA . "</td>
|
<td>" . $row->dateA . "</td>
|
||||||
<td> " . $row->dateM . "</td>
|
<td> " . $row->dateM . "</td>
|
||||||
<td>" . duree($row->temps) . "</td>
|
<td>" . duree($row->temps) . "</td>
|
||||||
|
@ -746,8 +739,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$site_url = base_url();
|
|
||||||
$url = base_url('index.php/Listes_members/modif');
|
|
||||||
// output data of each row
|
// output data of each row
|
||||||
foreach ($result->result() as $row) {
|
foreach ($result->result() as $row) {
|
||||||
$num++;
|
$num++;
|
||||||
|
@ -773,7 +765,7 @@
|
||||||
<td> $row->phone </td>
|
<td> $row->phone </td>
|
||||||
<td >$origin </td>
|
<td >$origin </td>
|
||||||
<td>$destination</td>
|
<td>$destination</td>
|
||||||
<td > $row->montant</td>
|
<td >".$fmt->format($row->montant)."</td>
|
||||||
<td>" . $row->dateAjout . "</td>
|
<td>" . $row->dateAjout . "</td>
|
||||||
<td> " . $row->dateModif . "</td>
|
<td> " . $row->dateModif . "</td>
|
||||||
<td>$etat</td>
|
<td>$etat</td>
|
||||||
|
@ -840,8 +832,7 @@
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$site_url = base_url();
|
|
||||||
$url = base_url('index.php/Listes_members/modif');
|
|
||||||
// output data of each row
|
// output data of each row
|
||||||
foreach ($result->result() as $row) {
|
foreach ($result->result() as $row) {
|
||||||
$num++;
|
$num++;
|
||||||
|
@ -855,7 +846,7 @@
|
||||||
<td>$num</td>
|
<td>$num</td>
|
||||||
<td>$row->emetteur</td>
|
<td>$row->emetteur</td>
|
||||||
<td>$superviseur</td>
|
<td>$superviseur</td>
|
||||||
<td>$row->montant</td>
|
<td>".$fmt->format($row->montant)."</td>
|
||||||
<td>" . $row->dateA . "</td>
|
<td>" . $row->dateA . "</td>
|
||||||
<td> " . $row->dateM . "</td>
|
<td> " . $row->dateM . "</td>
|
||||||
<td>" . duree($row->temps) . "</td>
|
<td>" . duree($row->temps) . "</td>
|
||||||
|
@ -935,7 +926,7 @@
|
||||||
<td>$num</td>
|
<td>$num</td>
|
||||||
<td>$row->emetteur</td>
|
<td>$row->emetteur</td>
|
||||||
<td>$superviseur</td>
|
<td>$superviseur</td>
|
||||||
<td>$row->montant</td>
|
<td>".$fmt->format($row->montant)."</td>
|
||||||
<td>" . $row->dateA . "</td>
|
<td>" . $row->dateA . "</td>
|
||||||
<td> " . $row->dateM . "</td>
|
<td> " . $row->dateM . "</td>
|
||||||
<td>" . duree($row->temps) . "</td>
|
<td>" . duree($row->temps) . "</td>
|
||||||
|
@ -1151,36 +1142,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(function () {
|
|
||||||
|
|
||||||
var start = moment().subtract(29, 'days');
|
|
||||||
var end = moment();
|
|
||||||
|
|
||||||
startDate = start;
|
|
||||||
endDate = end;
|
|
||||||
|
|
||||||
function cb(start, end) {
|
|
||||||
$('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
|
|
||||||
startDate = start;
|
|
||||||
endDate = end;
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#reportrange').daterangepicker({
|
|
||||||
startDate: start,
|
|
||||||
endDate: end,
|
|
||||||
ranges: {
|
|
||||||
'Today': [moment(), moment()],
|
|
||||||
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
|
||||||
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
|
|
||||||
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
|
|
||||||
'This Month': [moment().startOf('month'), moment().endOf('month')],
|
|
||||||
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
|
||||||
}
|
|
||||||
}, cb);
|
|
||||||
|
|
||||||
cb(start, end);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
const category = $('#picker').data('category');
|
const category = $('#picker').data('category');
|
||||||
|
@ -1210,36 +1171,3 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
|
||||||
$(document).on("click", ".cancelBtn", function () {
|
|
||||||
const id_demand = $(this).data('id-demand');
|
|
||||||
$.ajax({
|
|
||||||
url: '<?php echo base_url('index.php/Hyperviseur_dash/cancelCreditRequest')?>',
|
|
||||||
type: 'POST',
|
|
||||||
dataType: 'json',
|
|
||||||
data: {"id_demand": id_demand},
|
|
||||||
async: true,
|
|
||||||
success: function (data) {
|
|
||||||
if (data == '200') {
|
|
||||||
Swal.fire({
|
|
||||||
icon: 'success',
|
|
||||||
title: "<?php echo $this->lang->line('canceled_credit_request')?>",
|
|
||||||
text: "<?php echo $this->lang->line('informations_updated')?>",
|
|
||||||
timer: 3000
|
|
||||||
}).then(() => {
|
|
||||||
location.reload();
|
|
||||||
});
|
|
||||||
// alert("Les informations ont été mises à jour.") ? "" : location.reload();
|
|
||||||
} else {
|
|
||||||
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
error: function (resultat, statut, erreur) {
|
|
||||||
console.log(resultat + " " + erreur);
|
|
||||||
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
|
@ -0,0 +1,391 @@
|
||||||
|
<!-- DataTables -->
|
||||||
|
<link rel="stylesheet"
|
||||||
|
href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||||
|
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
|
||||||
|
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.6.2/css/buttons.dataTables.min.css">
|
||||||
|
<div class="content-wrapper">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// use Carbon\Carbon;
|
||||||
|
$fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
|
||||||
|
function duree($time)
|
||||||
|
{
|
||||||
|
$tabTemps = array("jours" => 86400,
|
||||||
|
"h" => 3600,
|
||||||
|
"m" => 60,
|
||||||
|
"s" => 1);
|
||||||
|
$result = "";
|
||||||
|
|
||||||
|
foreach ($tabTemps as $uniteTemps => $nombreSecondesDansUnite) {
|
||||||
|
|
||||||
|
$$uniteTemps = floor($time / $nombreSecondesDansUnite);
|
||||||
|
|
||||||
|
$time = $time % $nombreSecondesDansUnite;
|
||||||
|
|
||||||
|
if ($$uniteTemps > 0 || !empty($result)) {
|
||||||
|
|
||||||
|
$result .= $$uniteTemps . " $uniteTemps ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function dateDiff($date1, $date2,$class = null)
|
||||||
|
{
|
||||||
|
$diff = abs($date1 - $date2); // abs pour avoir la valeur absolute, ainsi éviter d'avoir une différence négative
|
||||||
|
$retour = array();
|
||||||
|
|
||||||
|
$tmp = $diff;
|
||||||
|
$second = $tmp % 60;
|
||||||
|
|
||||||
|
$tmp = floor(($tmp - $second) / 60);
|
||||||
|
$minute = $tmp % 60;
|
||||||
|
|
||||||
|
$tmp = floor(($tmp - $minute) / 60);
|
||||||
|
$heure = $tmp % 24;
|
||||||
|
|
||||||
|
$tmp = floor(($tmp - $heure) / 24);
|
||||||
|
$jour = $tmp;
|
||||||
|
|
||||||
|
return $class->lang->line('since').' ' . $jour . ' '.$class->lang->line('days').' ' . $heure . ' '.$class->lang->line('hours').' ' . $minute . ' '.$class->lang->line('minutes').' ' . $second . ' '.$class->lang->line('seconds');
|
||||||
|
}
|
||||||
|
|
||||||
|
function traitementTemps($time, $dateAjout , $class = null)
|
||||||
|
{
|
||||||
|
if ($time == null) {
|
||||||
|
$now = time();
|
||||||
|
$date2 = strtotime($dateAjout);
|
||||||
|
|
||||||
|
return dateDiff($now, $date2,$class);
|
||||||
|
} else {
|
||||||
|
return duree($time);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getDelayOfTreatmentInSeconds($time, $dateAjout){
|
||||||
|
if ($time == null) {
|
||||||
|
$now = time();
|
||||||
|
$date2 = strtotime($dateAjout);
|
||||||
|
return abs($now - $date2);
|
||||||
|
}else{
|
||||||
|
return $time ;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// function toLocateDate($date , $timezone){
|
||||||
|
// if($date){
|
||||||
|
// $carbon = Carbon::createFromFormat('Y-m-d H:i:s', $date, 'UTC');
|
||||||
|
// $carbon->setTimezone($timezone);
|
||||||
|
// return $carbon->toDateTimeString();
|
||||||
|
// }
|
||||||
|
// return $date;
|
||||||
|
// }
|
||||||
|
|
||||||
|
?>
|
||||||
|
<!-- Content Header (Page header) -->
|
||||||
|
<section class="content-header">
|
||||||
|
|
||||||
|
<h1>
|
||||||
|
<?php echo $this->lang->line('cancellation_credit_requests'); ?>
|
||||||
|
</h1>
|
||||||
|
<?php
|
||||||
|
$site_url = base_url();
|
||||||
|
|
||||||
|
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>
|
||||||
|
<?php echo $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">×</button>
|
||||||
|
<h4><i class="icon fa fa-check"></i> Success!</h4>
|
||||||
|
<?php echo $message; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</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-arrow-down"></i></span>
|
||||||
|
|
||||||
|
<div class="info-box-content">
|
||||||
|
<span class="info-box-text"><?php echo $this->lang->line('Temps moyen de traitement entrant'); ?> </span>
|
||||||
|
<span class="info-box-number">
|
||||||
|
<?php
|
||||||
|
if ($temp_moyen != false) {
|
||||||
|
if (duree($temp_moyen) == "") {
|
||||||
|
echo "0s";
|
||||||
|
} else {
|
||||||
|
echo duree($temp_moyen);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo $this->lang->line('Aucune demande traitée');
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<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"> <?php echo $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%"
|
||||||
|
type="text" name="daterange"
|
||||||
|
data-lang="<?php echo $this->session->userdata('site_lang') ?>"
|
||||||
|
data-type="<?php echo $demand_type ?>"
|
||||||
|
data-category="<?php echo $this->session->userdata('category') ?>"
|
||||||
|
value="<?php echo ($debut != null & $fin != null) ? $debut . ' - ' . $fin : '' ?>"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span> Format : <?php echo $this->session->userdata('site_lang') === 'french' ? 'Jour - Mois - Année ' : 'Year - Month - Day' ?> </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="box">
|
||||||
|
<div class="box-header with-border">
|
||||||
|
<h3 class="box-title"><?php echo $this->lang->line('incoming_credits_requests_accepted'); ?></h3>
|
||||||
|
<div class="box-tools">
|
||||||
|
<a class="btn btn-success" href="<?php echo current_url().'?show=history'?>">
|
||||||
|
<?php echo $this->lang->line('Historique'); ?>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="box-body" style="overflow-x:auto;">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$result = $list;
|
||||||
|
if ($result != false){
|
||||||
|
|
||||||
|
$numrows = $result->num_rows();
|
||||||
|
$num = 0;
|
||||||
|
if ($numrows > 0) {
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<table id="listeMembres1" class="table table-bordered table-striped table-modified">
|
||||||
|
<thead>
|
||||||
|
<?php
|
||||||
|
echo "<tr class='label-primary'>
|
||||||
|
|
||||||
|
<th>" . $this->lang->line('Emetteur') . "</th>
|
||||||
|
<th>" . $this->lang->line('receiver'). "</th>
|
||||||
|
<th>" . $this->lang->line('Montant') . "</th>
|
||||||
|
<th>" . $this->lang->line('Date de la demande') . "</th>
|
||||||
|
<th>" . $this->lang->line('Date de traitement') . "</th>
|
||||||
|
<th>" . $this->lang->line('Délai de traitement') . "</th>
|
||||||
|
<th>" . $this->lang->line('Délai de traitement')."(en minutes)" . "</th>
|
||||||
|
<th> Action </th>
|
||||||
|
</tr>";
|
||||||
|
|
||||||
|
?>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// output data of each row
|
||||||
|
foreach ($result->result() as $row) {
|
||||||
|
$num++;
|
||||||
|
$origin = $row->agent." | ".$row->phone;
|
||||||
|
$destination = $row->name_parrain." | ".$row->phone_parrain;
|
||||||
|
if ($row->codeMembre == $this->session->userdata('member_code')) {
|
||||||
|
$origin = $this->lang->line('Vous');
|
||||||
|
}
|
||||||
|
if ($row->codeParrain == $this->session->userdata('member_code')) {
|
||||||
|
$destination = $this->lang->line('Vous');
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "<tr>
|
||||||
|
<td >".$origin."</td>
|
||||||
|
<td >$destination</td>
|
||||||
|
<td>". $fmt->format($row->montant)."</td>
|
||||||
|
<td>" . $row->dateAjout . "</td>
|
||||||
|
<td > " . $row->dateModif . "</td>
|
||||||
|
<td>" . traitementTemps($row->temps, $row->dateAjout,$this) . "</td>"; ?>
|
||||||
|
<td><?= getDelayOfTreatmentInSeconds($row->temps, $row->dateAjout)/60 ?></td>
|
||||||
|
<td><button id="cancelDemand" class="btn btn-danger" data-id-demand="<?= $row->demande_id ?>" <?php if($row->canceled_by_hypervisor) echo "disabled" ?> ><?php echo $this->lang->line('cancel'); ?></button></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
echo $this->lang->line('Aucune demande');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo $this->lang->line('Aucune demande');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- jQuery 3 -->
|
||||||
|
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
|
||||||
|
<!-- Bootstrap 3.3.7 -->
|
||||||
|
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
|
||||||
|
<!-- DataTables -->
|
||||||
|
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
|
||||||
|
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
|
||||||
|
<!-- SlimScroll -->
|
||||||
|
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
|
||||||
|
<!-- FastClick -->
|
||||||
|
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
|
||||||
|
<!-- AdminLTE App -->
|
||||||
|
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
|
||||||
|
<!-- AdminLTE for demo purposes -->
|
||||||
|
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css"/>
|
||||||
|
<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/plug-ins/1.10.20/dataRender/datetime.js"></script>
|
||||||
|
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
|
||||||
|
<script src="<?php echo 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
|
||||||
|
|
||||||
|
$('#listeMembres1').DataTable({
|
||||||
|
"aaSorting": [[3, "desc"]],
|
||||||
|
"columnDefs": [{
|
||||||
|
targets: [3, 4],
|
||||||
|
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"targets": [ 6 ],
|
||||||
|
"visible": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
dom: 'Bfrtip',
|
||||||
|
"buttons": [
|
||||||
|
'pageLength',
|
||||||
|
{
|
||||||
|
extend: 'excelHtml5',
|
||||||
|
title: "<?=$this->lang->line('incoming_credits_requests_accepted')?>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'csvHtml5',
|
||||||
|
title: "<?=$this->lang->line('incoming_credits_requests_accepted')?>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdfHtml5',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'LEGAL',
|
||||||
|
title: "<?=$this->lang->line('incoming_credits_requests_accepted')?>"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var startDate;
|
||||||
|
var endDate;
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
const lang = $('#picker').data('lang');
|
||||||
|
$('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');
|
||||||
|
|
||||||
|
window.location.replace("<?php echo base_url('index.php/Hyperviseur_dash/demandsCancellation')?>" + "?d=" + debut + "&f=" + fin);
|
||||||
|
|
||||||
|
});
|
||||||
|
$('input[name="daterange"]').on('cancel.daterangepicker', function (ev, picker) {
|
||||||
|
//do something, like clearing an input
|
||||||
|
$('#daterange').val('');
|
||||||
|
window.location = "<?php echo current_url()?>";
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).on("click", "#cancelDemand", function () {
|
||||||
|
const id_demand = $(this).data('id-demand');
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo base_url('index.php/Hyperviseur_dash/cancelCreditRequest')?>',
|
||||||
|
type: 'POST',
|
||||||
|
dataType: 'json',
|
||||||
|
data: {"id_demand": id_demand},
|
||||||
|
async: true,
|
||||||
|
success: function (data) {
|
||||||
|
if (data == '200') {
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'success',
|
||||||
|
title: "<?php echo $this->lang->line('canceled_credit_request')?>",
|
||||||
|
text: "<?php echo $this->lang->line('informations_updated')?>",
|
||||||
|
timer: 3000
|
||||||
|
}).then(() => {
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
// alert("Les informations ont été mises à jour.") ? "" : location.reload();
|
||||||
|
} else {
|
||||||
|
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
error: function (resultat, statut, erreur) {
|
||||||
|
console.log(resultat + " " + erreur);
|
||||||
|
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -134,14 +134,34 @@
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
<li class="<?php if ($active == "demandes") {
|
<li class="<?= "treeview " . ((strpos($active, "demandes_credits") !== false) ? "active menu-open" : "") ?>"
|
||||||
echo "active ";
|
style="height: auto;">
|
||||||
} ?>">
|
<a href="#">
|
||||||
<a href="<?php echo base_url('index.php/Hyperviseur_dash/getDemandes') ?>">
|
<i class="fa fa-users"></i>
|
||||||
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Demandes de crédits'); ?></span>
|
<span><?php echo $this->lang->line('Demandes de crédits'); ?></span>
|
||||||
|
<span class="pull-right-container">
|
||||||
|
<i class="fa fa-angle-left pull-right"></i>
|
||||||
|
</span>
|
||||||
</a>
|
</a>
|
||||||
|
<ul class="treeview-menu"
|
||||||
|
style="<?= (strpos($active, "demandes_credits") !== false) ? "" : "display: none;" ?>">
|
||||||
|
<li class="<?php if ($active == "demandes_credits_entrantes") {
|
||||||
|
echo "active ";
|
||||||
|
} ?>">
|
||||||
|
<a href="<?php echo base_url('index.php/Hyperviseur_dash/getDemandes') ?>">
|
||||||
|
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Demandes de crédits'); ?></span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
<li class="<?php if ($active == "demandes_credits_annulation") {
|
||||||
|
echo "active ";
|
||||||
|
} ?>">
|
||||||
|
<a href="<?php echo base_url('index.php/Hyperviseur_dash/demandsCancellation') ?>"><i
|
||||||
|
class="fa fa-undo"></i><?php echo $this->lang->line('cancellation'); ?>
|
||||||
|
</a></li>
|
||||||
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="<?php if ($active == "demandesAd") {
|
<li class="<?php if ($active == "demandesAd") {
|
||||||
echo "active ";
|
echo "active ";
|
||||||
} ?>">
|
} ?>">
|
||||||
|
|
|
@ -0,0 +1,336 @@
|
||||||
|
<!-- DataTables -->
|
||||||
|
<link rel="stylesheet"
|
||||||
|
href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||||
|
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
|
||||||
|
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.6.2/css/buttons.dataTables.min.css">
|
||||||
|
<div class="content-wrapper">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// use Carbon\Carbon;
|
||||||
|
$fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
|
||||||
|
function duree($time)
|
||||||
|
{
|
||||||
|
$tabTemps = array("jours" => 86400,
|
||||||
|
"h" => 3600,
|
||||||
|
"m" => 60,
|
||||||
|
"s" => 1);
|
||||||
|
$result = "";
|
||||||
|
|
||||||
|
foreach ($tabTemps as $uniteTemps => $nombreSecondesDansUnite) {
|
||||||
|
|
||||||
|
$$uniteTemps = floor($time / $nombreSecondesDansUnite);
|
||||||
|
|
||||||
|
$time = $time % $nombreSecondesDansUnite;
|
||||||
|
|
||||||
|
if ($$uniteTemps > 0 || !empty($result)) {
|
||||||
|
|
||||||
|
$result .= $$uniteTemps . " $uniteTemps ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function dateDiff($date1, $date2,$class = null)
|
||||||
|
{
|
||||||
|
$diff = abs($date1 - $date2); // abs pour avoir la valeur absolute, ainsi éviter d'avoir une différence négative
|
||||||
|
$retour = array();
|
||||||
|
|
||||||
|
$tmp = $diff;
|
||||||
|
$second = $tmp % 60;
|
||||||
|
|
||||||
|
$tmp = floor(($tmp - $second) / 60);
|
||||||
|
$minute = $tmp % 60;
|
||||||
|
|
||||||
|
$tmp = floor(($tmp - $minute) / 60);
|
||||||
|
$heure = $tmp % 24;
|
||||||
|
|
||||||
|
$tmp = floor(($tmp - $heure) / 24);
|
||||||
|
$jour = $tmp;
|
||||||
|
|
||||||
|
return $class->lang->line('since').' ' . $jour . ' '.$class->lang->line('days').' ' . $heure . ' '.$class->lang->line('hours').' ' . $minute . ' '.$class->lang->line('minutes').' ' . $second . ' '.$class->lang->line('seconds');
|
||||||
|
}
|
||||||
|
|
||||||
|
function traitementTemps($time, $dateAjout , $class = null)
|
||||||
|
{
|
||||||
|
if ($time == null) {
|
||||||
|
$now = time();
|
||||||
|
$date2 = strtotime($dateAjout);
|
||||||
|
|
||||||
|
return dateDiff($now, $date2,$class);
|
||||||
|
} else {
|
||||||
|
return duree($time);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
<!-- Content Header (Page header) -->
|
||||||
|
<section class="content-header">
|
||||||
|
|
||||||
|
<h1>
|
||||||
|
<?php echo $this->lang->line('history_canceled_credit_requests'); ?>
|
||||||
|
</h1>
|
||||||
|
<?php
|
||||||
|
$site_url = base_url();
|
||||||
|
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>
|
||||||
|
<?php echo $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">×</button>
|
||||||
|
<h4><i class="icon fa fa-check"></i> Success!</h4>
|
||||||
|
<?php echo $message; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</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"> <?php echo $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%"
|
||||||
|
type="text" name="daterange"
|
||||||
|
data-lang="<?php echo $this->session->userdata('site_lang') ?>"
|
||||||
|
data-type="<?php echo $demand_type ?>"
|
||||||
|
data-category="<?php echo $this->session->userdata('category') ?>"
|
||||||
|
value="<?php echo ($debut != null & $fin != null) ? $debut . ' - ' . $fin : '' ?>"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span> Format : <?php echo $this->session->userdata('site_lang') === 'french' ? 'Jour - Mois - Année ' : 'Year - Month - Day' ?> </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="box">
|
||||||
|
<div class="box-body" style="overflow-x:auto;">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$result = $list;
|
||||||
|
if ($result != false){
|
||||||
|
|
||||||
|
$numrows = $result->num_rows();
|
||||||
|
$num = 0;
|
||||||
|
if ($numrows > 0) {
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<table id="listeMembres1" class="table table-bordered table-striped table-modified">
|
||||||
|
<thead>
|
||||||
|
<?php
|
||||||
|
echo "<tr class='label-primary'>
|
||||||
|
|
||||||
|
<th>" . $this->lang->line('Emetteur') . "</th>
|
||||||
|
<th>" . $this->lang->line('receiver'). "</th>
|
||||||
|
<th>" . $this->lang->line('Montant') . "</th>
|
||||||
|
<th>" . $this->lang->line('Date de la demande') . "</th>
|
||||||
|
<th>" . $this->lang->line('Date de traitement') . "</th>
|
||||||
|
<th>" . $this->lang->line('Délai de traitement') . "</th>
|
||||||
|
<th>" . $this->lang->line('cancellation_date') . "</th>
|
||||||
|
</tr>";
|
||||||
|
|
||||||
|
?>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// output data of each row
|
||||||
|
foreach ($result->result() as $row) {
|
||||||
|
$num++;
|
||||||
|
$origin = $row->agent." | ".$row->phone;
|
||||||
|
$destination = $row->name_parrain." | ".$row->phone_parrain;
|
||||||
|
if ($row->codeMembre == $this->session->userdata('member_code')) {
|
||||||
|
$origin = $this->lang->line('Vous');
|
||||||
|
}
|
||||||
|
if ($row->codeParrain == $this->session->userdata('member_code')) {
|
||||||
|
$destination = $this->lang->line('Vous');
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "<tr>
|
||||||
|
<td >".$origin."</td>
|
||||||
|
<td >$destination</td>
|
||||||
|
<td>". $fmt->format($row->montant)."</td>
|
||||||
|
<td>" . $row->dateAjout . "</td>
|
||||||
|
<td > " . $row->dateModif . "</td>
|
||||||
|
<td>" . traitementTemps($row->temps, $row->dateAjout,$this) . "</td>
|
||||||
|
<td>" . $row->cancellation_date. "</td>
|
||||||
|
|
||||||
|
"; ?>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
echo $this->lang->line('Aucune demande');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo $this->lang->line('Aucune demande');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- jQuery 3 -->
|
||||||
|
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
|
||||||
|
<!-- Bootstrap 3.3.7 -->
|
||||||
|
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
|
||||||
|
<!-- DataTables -->
|
||||||
|
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
|
||||||
|
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
|
||||||
|
<!-- SlimScroll -->
|
||||||
|
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
|
||||||
|
<!-- FastClick -->
|
||||||
|
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
|
||||||
|
<!-- AdminLTE App -->
|
||||||
|
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
|
||||||
|
<!-- AdminLTE for demo purposes -->
|
||||||
|
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
|
||||||
|
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css"/>
|
||||||
|
<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/plug-ins/1.10.20/dataRender/datetime.js"></script>
|
||||||
|
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
|
||||||
|
<script src="<?php echo 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
|
||||||
|
|
||||||
|
$('#listeMembres1').DataTable({
|
||||||
|
"aaSorting": [[6, "desc"]],
|
||||||
|
"columnDefs": [{
|
||||||
|
targets: [3, 4 ,6],
|
||||||
|
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('history_canceled_credit_requests')?>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'csvHtml5',
|
||||||
|
title: "<?=$this->lang->line('history_canceled_credit_requests')?>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
extend: 'pdfHtml5',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'LEGAL',
|
||||||
|
title: "<?=$this->lang->line('history_canceled_credit_requests')?>"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var startDate;
|
||||||
|
var endDate;
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
const lang = $('#picker').data('lang');
|
||||||
|
$('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');
|
||||||
|
|
||||||
|
window.location.replace("<?php echo base_url('index.php/Hyperviseur_dash/demandsCancellation?show=history')?>" + "&d=" + debut + "&f=" + fin);
|
||||||
|
|
||||||
|
});
|
||||||
|
$('input[name="daterange"]').on('cancel.daterangepicker', function (ev, picker) {
|
||||||
|
//do something, like clearing an input
|
||||||
|
$('#daterange').val('');
|
||||||
|
window.location = "<?php echo current_url()?>";
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).on("click", "#cancelDemand", function () {
|
||||||
|
const id_demand = $(this).data('id-demand');
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo base_url('index.php/Hyperviseur_dash/cancelCreditRequest')?>',
|
||||||
|
type: 'POST',
|
||||||
|
dataType: 'json',
|
||||||
|
data: {"id_demand": id_demand},
|
||||||
|
async: true,
|
||||||
|
success: function (data) {
|
||||||
|
if (data == '200') {
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'success',
|
||||||
|
title: "<?php echo $this->lang->line('canceled_credit_request')?>",
|
||||||
|
text: "<?php echo $this->lang->line('informations_updated')?>",
|
||||||
|
timer: 3000
|
||||||
|
}).then(() => {
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
// alert("Les informations ont été mises à jour.") ? "" : location.reload();
|
||||||
|
} else {
|
||||||
|
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
error: function (resultat, statut, erreur) {
|
||||||
|
console.log(resultat + " " + erreur);
|
||||||
|
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -14,8 +14,9 @@
|
||||||
"php": ">=5.4",
|
"php": ">=5.4",
|
||||||
"spatie/async": "^1.4",
|
"spatie/async": "^1.4",
|
||||||
"nesbot/carbon": "^2.33",
|
"nesbot/carbon": "^2.33",
|
||||||
"brick/money": "^0.4.5"
|
"brick/money": "^0.4.5",
|
||||||
},
|
"ext-intl": "*"
|
||||||
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"paragonie/random_compat": "Provides better randomness in PHP 5.x"
|
"paragonie/random_compat": "Provides better randomness in PHP 5.x"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue