diff --git a/application/controllers/Doctor_password.php b/application/controllers/Agent_password.php similarity index 82% rename from application/controllers/Doctor_password.php rename to application/controllers/Agent_password.php index c55ee143..8feb9f5a 100755 --- a/application/controllers/Doctor_password.php +++ b/application/controllers/Agent_password.php @@ -1,7 +1,7 @@ db->get_where('nh_validating_doctors',['token' => $this->input->get('token')]); + $db_token = $this->db->get_where('nh_validating_agents',['token' => $this->input->get('token')]); if($db_token->num_rows() > 0 ){ $this->session->set_userdata('token', $this->input->get('token')); - $this->load->view('admin_update_password',['isValidatingDoctor' => true]); + $this->load->view('admin_update_password',['isValidatingAgent' => true]); }else{ echo "Ce lien a déjà expiré"; } @@ -40,18 +40,18 @@ class Doctor_password extends CI_Controller $salt = $hash["salt"]; // salt $this->db->where('token' , $this->session->userdata('token')); - $res = $this->db->update('nh_validating_doctors',['password' => $encrypted_password, 'salt' => $salt]); + $res = $this->db->update('nh_validating_agents',['password' => $encrypted_password, 'salt' => $salt]); if($res==true){ $new_token = null; do { $new_token = bin2hex(openssl_random_pseudo_bytes(16)); - $tokenExist = $this->db->get_where('nh_validating_doctors',['token' => $new_token]); + $tokenExist = $this->db->get_where('nh_validating_agents',['token' => $new_token]); } while ($tokenExist->num_rows() > 0); $this->db->where('token' , $this->session->userdata('token')); - $res_token = $this->db->update('nh_validating_doctors',['token'=>$new_token]); + $res_token = $this->db->update('nh_validating_agents',['token'=>$new_token]); if($res_token==true){ $data['alert'] = 'password'; diff --git a/application/controllers/Hyperviseur_dash.php b/application/controllers/Hyperviseur_dash.php index 22dffb1e..7d08038c 100755 --- a/application/controllers/Hyperviseur_dash.php +++ b/application/controllers/Hyperviseur_dash.php @@ -531,7 +531,7 @@ class Hyperviseur_dash extends CI_Controller $data['refunds'] = $this->wallet_model->getRefunds($startDate, $endDate, $network_id); else if ($type == 'commission_payments') $data['payments'] = $this->wallet_model->getCommissionPayments($startDate, $endDate, $network_id); - else if ($type == 'insurance-subscriptions'){ + else if ($type == 'insurance-subscriptions' || $type == 'insurance-insured'){ } else{ @@ -552,6 +552,10 @@ class Hyperviseur_dash extends CI_Controller $data['id_network'] = $network_id; $data['parrain_id'] = $parrainId; + if($type == 'insurance-insured'){ + $data['active'] = "wallet_insured"; + } + $this->load->view('header_hyp', $data); if ($type == 'transaction') $this->load->view('historique_transactions'); @@ -569,6 +573,8 @@ class Hyperviseur_dash extends CI_Controller $this->load->view('config_wallet_ilink_hyp/historique_commission_payements'); else if ($type == 'insurance-subscriptions') $this->load->view('nano_health/hyper/insurances_subscriptions.php'); + else if ($type == 'insurance-insured') + $this->load->view('nano_health/hyper/insurances_insured.php'); else $this->load->view('historique_recharges'); $this->load->view('footer'); @@ -1929,10 +1935,17 @@ class Hyperviseur_dash extends CI_Controller } } - public function validating_doctors(){ + public function validating_agents($role = null){ if ($this->isLogged()) { - $data['active'] = "wallet_validating_doctors"; $data['alert'] = ""; + if($role == 'doctors'){ + $data['active'] = "wallet_validating_doctors"; + $data['role'] = 'DOCTOR'; + }else{ + $data['active'] = "wallet_validating_agents"; + $data['role'] = 'AGENT'; + } + $data['network'] = $this->session->userdata('network'); $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); @@ -1944,10 +1957,10 @@ class Hyperviseur_dash extends CI_Controller $nh_config = $this->nano_health_model->getConfig($data['network_id']); $data['nh_config'] = $nh_config ? $nh_config->first_row() : null ; $data['config_id'] = $data['nh_config'] ? $data['nh_config']->id : null ; - $data['doctors'] = $this->db->get_where('nh_validating_doctors',['nh_network_config_id' => $data['config_id']]); + $data['agents'] = $this->db->get_where('nh_validating_agents',['nh_network_config_id' => $data['config_id'] , 'role' => $data['role']]); $this->load->view('header_hyp', $data); - $this->load->view('nano_health/hyper/validating_doctors'); + $this->load->view('nano_health/hyper/validating_agents'); $this->load->view('footer'); } } diff --git a/application/controllers/NanoHealthController.php b/application/controllers/NanoHealthController.php index 4d61605d..f5392a81 100644 --- a/application/controllers/NanoHealthController.php +++ b/application/controllers/NanoHealthController.php @@ -70,30 +70,30 @@ class NanoHealthController extends CI_Controller } } - public function createValidatingDoctor() + public function createValidatingAgent() { if($this->isLogged()) { if (isset($_POST)) { - $emailExist = $this->db->get_where('nh_validating_doctors', ['email' => $_POST['email']]); + $emailExist = $this->db->get_where('nh_validating_agents', ['email' => $_POST['email']]); if ($emailExist->num_rows() == 0) { do { $token = bin2hex(openssl_random_pseudo_bytes(16)); - $tokenExist = $this->db->get_where('nh_validating_doctors',['token' => $token]); + $tokenExist = $this->db->get_where('nh_validating_agents',['token' => $token]); } while ($tokenExist->num_rows() > 0); $_POST['token'] = $token; - $query = $this->db->insert('nh_validating_doctors', $_POST); + $query = $this->db->insert('nh_validating_agents', $_POST); if ($query) { - $link = base_url("Doctor_password/?token=" . $token); + $link = base_url("Agent_password/?token=" . $token); $this->load->library('email'); $this->email->from('noreply@ilink-app.com', 'iLink World'); $this->email->to($_POST['email']); - $this->email->subject($this->lang->line("mail_title_validating_doctor")); - $this->email->message($_POST['firstname'] . ' ' . $_POST['lastname'] . ' ' . $this->lang->line("mail_body_validating_doctor") . ' ' . $link); + $this->email->subject($this->lang->line($_POST['role'] == 'DOCTOR' ? "mail_title_validating_doctor" : "mail_title_validating_agent")); + $this->email->message($_POST['firstname'] . ' ' . $_POST['lastname'] . ' ' . $this->lang->line($_POST['role'] == 'DOCTOR' ? "mail_body_validating_doctor" : "mail_body_validating_agent") . ' ' . $link); $this->email->send(); @@ -108,14 +108,14 @@ class NanoHealthController extends CI_Controller } } - public function updateValidatingDoctor() + public function updateValidatingAgent() { if($this->isLogged()) { if (isset($_POST)) { - $emailExist = $this->db->get_where('nh_validating_doctors', ['id !=' => $_POST['id'], 'email' => $_POST['email']]); + $emailExist = $this->db->get_where('nh_validating_agents', ['id !=' => $_POST['id'], 'email' => $_POST['email']]); if ($emailExist->num_rows() == 0) { $this->db->where('id',$_POST['id']); - $this->db->update('nh_validating_doctors',$_POST); + $this->db->update('nh_validating_agents',$_POST); echo json_encode(['code' => 200]); }else{ echo json_encode(['code'=> 419 , 'message' => $this->lang->line("L'email entré est déjà utilisé")]); @@ -124,10 +124,10 @@ class NanoHealthController extends CI_Controller } } - public function deleteValidatingDoctor(){ + public function deleteValidatingAgent(){ if($this->isLogged()) { if (isset($_POST)) { - $this->db->delete('nh_validating_doctors', ['id' => $_POST['id']]); + $this->db->delete('nh_validating_agents', ['id' => $_POST['id']]); echo json_encode(['code' => 200]); } } @@ -179,6 +179,7 @@ class NanoHealthController extends CI_Controller curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $body = new \stdClass(); $body->agent_id = $this->input->post('agent_id'); + $body->nh_validating_agent_id = $this->input->post('nh_validating_agent_id'); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); /* execute request */ @@ -213,6 +214,7 @@ class NanoHealthController extends CI_Controller curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $body = new \stdClass(); $body->agent_id = $this->input->post('agent_id'); + $body->nh_validating_agent_id = $this->input->post('nh_validating_agent_id'); $body->reason = $this->input->post('reason'); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); diff --git a/application/controllers/Users.php b/application/controllers/Users.php index 96d2f483..1e4a775d 100755 --- a/application/controllers/Users.php +++ b/application/controllers/Users.php @@ -74,26 +74,32 @@ 'user_role' => $this->input->post('user_role') ); - // Pour les medecins valideurs de iLink Santé + // Pour les agents valideurs de iLink Santé if($user_login['user_role'] == 2 && filter_var($user_login['user_email'], FILTER_VALIDATE_EMAIL)){ $sql = "SELECT nhd.* , n.name as network , n.id as network_id, cc.name as country, cc.currency_code - FROM nh_validating_doctors nhd INNER JOIN nh_networks_configs nhc ON nhc.id = nhd.nh_network_config_id + FROM nh_validating_agents nhd INNER JOIN nh_networks_configs nhc ON nhc.id = nhd.nh_network_config_id INNER JOIN networks n ON n.id = nhc.network_id INNER JOIN countries_currencies cc ON cc.id = n.country_id WHERE nhd.email = ?"; - $doctor = $this->db->query($sql,[$user_login['user_email']]); - if($doctor->num_rows()>0) { - $doctor = $doctor->first_row(); - $encrypted_password = $doctor->password; - $hash = checkhashSSHA($doctor->salt,$user_login['user_password']); + $agent = $this->db->query($sql,[$user_login['user_email']]); + if($agent->num_rows()>0) { + $agent = $agent->first_row(); + $encrypted_password = $agent->password; + $hash = checkhashSSHA($agent->salt,$user_login['user_password']); if ($encrypted_password == $hash) { - $this->session->set_userdata('email', $doctor->email); - $this->session->set_userdata('firstname', $doctor->firstname); - $this->session->set_userdata('lastname', $doctor->lastname); - $this->session->set_userdata('phone', $doctor->email); - $this->session->set_userdata('currency_code', $doctor->currency_code); - $this->session->set_userdata('network', $doctor->network); - $this->session->set_userdata('network_id', $doctor->network_id); - $this->session->set_userdata('current_pays', $doctor->country); - redirect('ValidatingDoctor'); + $this->session->set_userdata('agent_id', $agent->id); + $this->session->set_userdata('email', $agent->email); + $this->session->set_userdata('firstname', $agent->firstname); + $this->session->set_userdata('lastname', $agent->lastname); + $this->session->set_userdata('phone', $agent->email); + $this->session->set_userdata('role', $agent->role); + $this->session->set_userdata('currency_code', $agent->currency_code); + $this->session->set_userdata('network', $agent->network); + $this->session->set_userdata('network_id', $agent->network_id); + $this->session->set_userdata('current_pays', $agent->country); + if($agent->role == 'DOCTOR'){ + redirect('ValidatingDoctor'); + }else{ + redirect('ValidatingAgent'); + } } } }else{ diff --git a/application/controllers/ValidatingAgent.php b/application/controllers/ValidatingAgent.php new file mode 100755 index 00000000..e30f99be --- /dev/null +++ b/application/controllers/ValidatingAgent.php @@ -0,0 +1,80 @@ +load->model('nano_health_model'); + } + + public function index(){ + if ($this->isLogged()){ + $data['active'] = "dashboard"; + $data['agent_id'] = $this->session->userdata('agent_id'); + $data['acceptedRequests'] = $this->nano_health_model->getNhValidatingAgentSubscriptionHistory($data['agent_id'], 'ACCEPTED'); + $data['rejectedRequests'] = $this->nano_health_model->getNhValidatingAgentSubscriptionHistory($data['agent_id'], 'REJECTED'); + $data['untreatedRequests'] = $this->nano_health_model->getNhInsurancesSubscriptionCount('UNDER_VALIDATION'); + + $this->load->view('nano_health/validating_agent/header', $data); + $this->load->view('nano_health/validating_agent/dashboard', $data); + $this->load->view('footer'); + } + } + + public function requests(){ + if ($this->isLogged()) { + $data['id_network'] = $this->session->userdata('network_id'); + $data['active'] = "subscription_requests"; + $data['category'] = $this->session->userdata('role'); + + if ($this->input->get('history')) { + if ($this->input->get('id') !== null) { + $data['insurance_subscription_id'] = $this->input->get('id'); + $data['subscription'] = $this->nano_health_model->getInfosInsuranceSubscriptionById($this->input->get('id')); + $data['beneficiaries'] = $this->db->get_where('nh_insurances_having_rights', ['insurance_subscription_id' => $data['insurance_subscription_id']]); + $data['user'] = $this->db->get_where('user_infos', ['user_id' => $data['subscription']->user_id ?? null])->first_row(); + $this->load->view('nano_health/validating_agent/header', $data); + $this->load->view('nano_health/hyper/infos_insurance_subscription'); + $this->load->view('footer'); + return; + } else { + $this->history($data['id_network'], $this->input->get('d'), $this->input->get('f'), $this->input->get('history')); + } + } + return; + } + } + + public function history($networkId , $startDate , $endDate , $type){ + + $format = $this->session->userdata('site_lang') === 'french' ? 'd-m-Y' : 'Y-m-d'; + $data['startDate'] = $startDate ? date($format, strtotime($startDate)) : null; + $data['endDate'] = $endDate ? date($format, strtotime($endDate)) : null; + $endDate = Date('Y-m-d', strtotime($endDate . "+1 day")); + + $data['active'] = "subscription_requests"; + $data['network'] = $this->session->userdata('network'); + $data['id_network'] = $this->session->userdata('network_id'); + $data['country'] = $this->session->userdata('current_pays'); + $data['category'] = $this->session->userdata('role'); + + $this->load->view('nano_health/validating_agent/header', $data); + $this->load->view('nano_health/hyper/insurances_subscriptions.php'); + $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!"; + + redirect('index.php', $data); + return false; + } + return true; + } +} diff --git a/application/controllers/pagination/InsuranceSubscription.php b/application/controllers/pagination/InsuranceSubscription.php index af2bc35e..13e97fd4 100755 --- a/application/controllers/pagination/InsuranceSubscription.php +++ b/application/controllers/pagination/InsuranceSubscription.php @@ -61,7 +61,7 @@ class InsuranceSubscription extends CI_Controller $bonus_amount = Money::of(round($row->total_bonus_amount, 2), $row->currency_code, $this->context)->formatTo('fr_FR'); $data[] = array($i,$row->insurance_subscription_id, $row->lastname, $row->phone, $row->number_of_months, $row->number_of_beneficiaries, - $bonus_amount, strtoupper($this->lang->line($row->state)), $row->created_at, + $bonus_amount, mb_strtoupper($this->lang->line($row->state) ,'UTF-8'), $row->created_at, ' '.$this->lang->line('Voir plus...').''); } diff --git a/application/controllers/pagination/Insurances.php b/application/controllers/pagination/Insurances.php new file mode 100755 index 00000000..23147f9f --- /dev/null +++ b/application/controllers/pagination/Insurances.php @@ -0,0 +1,79 @@ +load->model('pagination/Insurances_model', 'model'); + + // set to whatever your rates are relative to + $baseCurrency = 'USD'; + + // use your own credentials, or re-use your existing PDO connection + $pdo = new PDO('mysql:host=' . $this->db->hostname . ';dbname=' . $this->db->database, $this->db->username, $this->db->password); + + $configuration = new PDOProviderConfiguration(); + + $configuration->tableName = 'exchange_rate'; + $configuration->exchangeRateColumnName = 'exchange_rate'; + $configuration->targetCurrencyColumnName = 'target_currency'; + $configuration->sourceCurrencyCode = $baseCurrency; + + // this provider loads exchange rates from your database + $provider = new PDOProvider($pdo, $configuration); + + // this provider calculates exchange rates relative to the base currency + $provider = new BaseCurrencyProvider($provider, $baseCurrency); + + // this currency converter can now handle any currency pair + $this->converter = new CurrencyConverter($provider); + $this->context = new AutoContext(); + + } + + + function getLists() + { + $data = $row = array(); + + // Fetch member's records + $witData = $this->model->getRows($_POST); + + $i = $_POST['start']; + $current_url = $_POST['currentURL']; + foreach ($witData as $row) { + $i++; + + $bonus_amount = Money::of(round($row->total_bonus_amount, 2), $row->currency_code, $this->context)->formatTo('fr_FR'); + + $data[] = array($row->insurance_subscription_id, $row->insured_id , $row->lastname, $row->phone, $row->number_of_months, $row->number_of_beneficiaries, + $bonus_amount, mb_strtoupper($this->lang->line($row->state) ,'UTF-8'), $row->created_at, + ' '.$this->lang->line('Voir plus...').''); + } + + $output = array( + "draw" => $_POST['draw'], + "recordsTotal" => $this->model->countAll($_POST), + "recordsFiltered" => $this->model->countFiltered($_POST), + "data" => $data, + ); + + // Output to JSON format + echo json_encode($output); + } + +} diff --git a/application/controllers/pagination/WalletIlinkTransaction.php b/application/controllers/pagination/WalletIlinkTransaction.php index fa4637df..8b0f619d 100755 --- a/application/controllers/pagination/WalletIlinkTransaction.php +++ b/application/controllers/pagination/WalletIlinkTransaction.php @@ -58,7 +58,7 @@ class WalletIlinkTransaction extends CI_Controller $i++; $created = $row->date ; //date('jS M Y', strtotime($row->date)); // $status = ($row->status == 1)?'Active':'Inactive'; - $operation = strtoupper($row->acteur) . ' - ' . ($this->session->userdata('site_lang') === 'french' ? $row->operation_fr : $row->operation_en); + $operation = mb_strtoupper($row->acteur,'UTF-8') . ' - ' . ($this->session->userdata('site_lang') === 'french' ? $row->operation_fr : $row->operation_en); $numero_carte = join(" ", str_split($row->numero_carte, 4)); diff --git a/application/controllers/pagination/WalletTransaction.php b/application/controllers/pagination/WalletTransaction.php index a435951e..2df8e632 100755 --- a/application/controllers/pagination/WalletTransaction.php +++ b/application/controllers/pagination/WalletTransaction.php @@ -54,7 +54,7 @@ class WalletTransaction extends CI_Controller $disabled = $row->canceled ? "disabled" : ""; $disabled1 = $row->deleted ? "disabled" : ""; - $data[] = array($row->id,strtoupper($type), join(" ", str_split($row->numCarte, 4)), $fmt->format($net), ($row->type_transac == 'credit' ? $fmt->format($banque) : ""), + $data[] = array($row->id,mb_strtoupper($type,'UTF-8'), join(" ", str_split($row->numCarte, 4)), $fmt->format($net), ($row->type_transac == 'credit' ? $fmt->format($banque) : ""), $fmt->format( $row->commission_banque), $fmt->format( $row->commission_hyp), $fmt->format( $row->commission_sup), $fmt->format( $row->commission_ag), $row->agent ,$row->parrain, $row->date_created, ' first_row()->type == 'ilink_sante') { ?> -
  • "> - +
  • "> + lang->line('validating_doctors'); ?>
  • +
  • "> + + + lang->line('validating_agents'); ?> + +
  • +
  • "> + + + lang->line('insured'); ?> + +
  • $row->id - ".strtoupper($type)." + ".mb_strtoupper($type,'UTF-8')." ".join(" ", str_split($row->numCarte, 4))." ".$fmt->format($net)." ".($row->type_transac == 'credit' ? $fmt->format($banque) : "")." diff --git a/application/views/nano_credit/historique_nano_credit.php b/application/views/nano_credit/historique_nano_credit.php index 4c2e0f7f..f75e54b6 100755 --- a/application/views/nano_credit/historique_nano_credit.php +++ b/application/views/nano_credit/historique_nano_credit.php @@ -150,7 +150,7 @@ $row->id_demande " . $this->lang->line($row->etat) . " " . $this->lang->line($row->type_caution) . " - " . strtoupper($row->duree_mois) . " + " . mb_strtoupper($row->duree_mois,'UTF-8') . " " . 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') . " diff --git a/application/views/nano_credit/historique_savings.php b/application/views/nano_credit/historique_savings.php index a1cecea1..07c55126 100644 --- a/application/views/nano_credit/historique_savings.php +++ b/application/views/nano_credit/historique_savings.php @@ -141,7 +141,7 @@ echo " $row->id_epargne " . $this->lang->line($row->etat) . " - " . strtoupper($row->duree_mois) . " + " . mb_strtoupper($row->duree_mois,'UTF-8') . " " . $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') . " diff --git a/application/views/nano_health/admin/gestion_wallet.php b/application/views/nano_health/admin/gestion_wallet.php index d616f94a..14099ea7 100755 --- a/application/views/nano_health/admin/gestion_wallet.php +++ b/application/views/nano_health/admin/gestion_wallet.php @@ -55,7 +55,7 @@ $context = new \Brick\Money\Context\AutoContext();

    lang->line('Gestion des wallets'). ' '. $network .' - '.$country; ?> - +

    -

    lang->line('Gestion des wallets'). ' '. $network .' - '.$country; ?>

    - -
    - -

    Erreur!

    - -
    - - -
    - -

    Success!

    - -
    - -
    diff --git a/application/views/nano_health/hyper/infos_insurance_subscription.php b/application/views/nano_health/hyper/infos_insurance_subscription.php index 8dcf757a..b59a17f1 100755 --- a/application/views/nano_health/hyper/infos_insurance_subscription.php +++ b/application/views/nano_health/hyper/infos_insurance_subscription.php @@ -62,30 +62,6 @@ $this->converter = new CurrencyConverter($provider); $this->context = new AutoContext(); $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); - $site_url = base_url(); - - if ($alert == "ok") { - - if (!$success == "ok") { - ?> -
    - -

    Erreur!

    - -
    - - -
    - -

    Success!

    - -
    - - @@ -409,7 +385,7 @@ 'pageLength', { "extend": 'excelHtml5', - title: "lang->line('taxes_list') . ' :: ' . $this->lang->line('subscription_detail') . ' - ' . $insurance_subscription_id?>", + title: "lang->line('beneficiaries') . ' :: ' . $this->lang->line('subscription_detail') . ' - ' . $insurance_subscription_id?>", // exportOptions: { // columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] // }, @@ -417,7 +393,7 @@ for (var i = 0; i < data.body.length; i++) { for (var j = 0; j < data.body[i].length; j++) { // data.body[i][j] = '\u200C' + data.body[i][j]; - if ([4, 5].includes(j)) { + if ([5].includes(j)) { // Get the value and strip the non numeric characters // var value = $(this).text(); value = data.body[i][j].replace(',', ".") @@ -429,13 +405,13 @@ }, { extend: 'csvHtml5', - title: "lang->line('taxes_list') . ' :: ' . $this->lang->line('subscription_detail') . ' - ' . $insurance_subscription_id?>", + title: "lang->line('beneficiaries') . ' :: ' . $this->lang->line('subscription_detail') . ' - ' . $insurance_subscription_id?>", }, { extend: 'pdfHtml5', orientation: 'landscape', pageSize: 'LEGAL', - title: "lang->line('taxes_list') . ' :: ' . $this->lang->line('subscription_detail') . ' - ' . $insurance_subscription_id?>", + title: "lang->line('beneficiaries') . ' :: ' . $this->lang->line('subscription_detail') . ' - ' . $insurance_subscription_id?>", }, // 'colvis' ] @@ -449,7 +425,11 @@ dataType: 'json', data: { "subscription_id": "id ?>", - "agent_id": "session->userdata('agent_id') ?>", + + "nh_validating_agent_id": "session->userdata('agent_id') ?>", + + "agent_id": "session->userdata('agent_id') ?>", + }, success: function (data) { // console.log('data',data); @@ -487,7 +467,11 @@ dataType: 'json', data: { "subscription_id": "id ?>", - "agent_id": "session->userdata('agent_id') ?>", + + "nh_validating_agent_id": "session->userdata('agent_id') ?>", + + "agent_id": "session->userdata('agent_id') ?>", + "reason": reason }, success: function (data) { diff --git a/application/views/nano_health/hyper/insurances_insured.php b/application/views/nano_health/hyper/insurances_insured.php new file mode 100755 index 00000000..a5a27b5b --- /dev/null +++ b/application/views/nano_health/hyper/insurances_insured.php @@ -0,0 +1,235 @@ + + + + + +
    + + +
    +

    + lang->line('manage_insured') ?> + + +

    +
    +
    +
    +
    +
    + +
    + lang->line('Période') ?> + + + + + Format : session->userdata('site_lang') === 'french' ? 'Jour - Mois - Année ' : 'Year - Month - Day' ?> +
    +
    +
    + + +
    +
    +
    +
    +
    +

    lang->line('export_transaction_history') ?>

    +
    +
    + + + + + + + + + + + + + + + + +
    lang->line('souscription_id') ?>lang->line('insured_id') ?>lang->line('Nom') ?>lang->line('Contact') ?>lang->line('number_of_months') ?>lang->line('number_of_beneficiaries') ?>lang->line('bonus_amount') ?>lang->line('state') ?>DateAction
    +
    +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/views/nano_health/hyper/insurances_subscriptions.php b/application/views/nano_health/hyper/insurances_subscriptions.php index 8b3c4e23..c05533f2 100755 --- a/application/views/nano_health/hyper/insurances_subscriptions.php +++ b/application/views/nano_health/hyper/insurances_subscriptions.php @@ -9,39 +9,12 @@ ?>
    -

    - lang->line('Gestion des wallets') ; echo ' '.$network.' - '.$country + lang->line('Gestion des wallets') ; echo ' '.$network.' - '.$country .' :: '.$this->lang->line('subscriptions_history'); ?>

    - -
    - -

    Erreur!

    - -
    - - -
    - -

    Success!

    - -
    - -
    @@ -168,7 +141,7 @@ 'pageLength', { "extend": 'excelHtml5', - title: "lang->line('Historique des subscriptions') ?>", + title: "lang->line('subscriptions_history') ?>", // exportOptions: { // columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] // }, @@ -176,7 +149,7 @@ for (var i = 0; i < data.body.length; i++) { for (var j = 0; j < data.body[i].length; j++) { // data.body[i][j] = '\u200C' + data.body[i][j]; - if ([3, 4, 5,].includes(j)) { + if ([6].includes(j)) { // Get the value and strip the non numeric characters // var value = $(this).text(); value = data.body[i][j].replace(',', ".") @@ -190,15 +163,12 @@ }, { extend: 'csvHtml5', - title: "lang->line('Historique des subscriptions') ?>", - exportOptions: { - columns: [0, 1, 2, 3, 4, 5, 6, 7, 8] - }, + title: "lang->line('subscriptions_history') ?>", customizeData: function (data) { for (var i = 0; i < data.body.length; i++) { for (var j = 0; j < data.body[i].length; j++) { // data.body[i][j] = '\u200C' + data.body[i][j]; - if ([3, 4, 5, 10, 11, 12, 13, 14,15].includes(j)) { + if ([6].includes(j)) { // Get the value and strip the non numeric characters // var value = $(this).text(); value = data.body[i][j].replace(',', ".") @@ -214,10 +184,7 @@ extend: 'pdfHtml5', orientation: 'landscape', pageSize: 'LEGAL', - title: "lang->line('Historique des subscriptions') ?>", - exportOptions: { - columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] - }, + title: "lang->line('Hsubscriptions_history') ?>", trim: false, "action": newexportaction }, @@ -267,35 +234,3 @@ }); - diff --git a/application/views/nano_health/hyper/validating_doctors.php b/application/views/nano_health/hyper/validating_agents.php similarity index 86% rename from application/views/nano_health/hyper/validating_doctors.php rename to application/views/nano_health/hyper/validating_agents.php index 1698f9c6..d04b0e06 100755 --- a/application/views/nano_health/hyper/validating_doctors.php +++ b/application/views/nano_health/hyper/validating_agents.php @@ -5,33 +5,8 @@

    - lang->line('manage_validating_doctors'); ?> + lang->line( $role == 'DOCTOR' ? 'manage_validating_doctors' : 'manage_validating_agents') ; ?>

    - -
    - -

    Erreur!

    - -
    - - -
    - -

    Success!

    - -
    - -
    @@ -39,10 +14,10 @@
    -

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

    +

    lang->line($role == 'DOCTOR' ? 'validating_doctors' : 'validating_agents'); ?>

    - +
    @@ -56,8 +31,8 @@ result() as $i => $row) { + if(isset($agents)){ + foreach ($agents->result() as $i => $row) { $statut = $this->lang->line('Non confirmé'); if (isset($row->salt)) { $statut = $this->lang->line("Confirmé"); @@ -93,10 +68,10 @@
    -

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

    +

    lang->line($role == 'DOCTOR' ? 'add_validating_doctor': 'add_validating_agent'); ?>

    - +
    @@ -192,7 +167,7 @@ toastr.options.closeEasing = 'swing'; $(function () { - $('#doctors').DataTable(); + $('#agents').DataTable(); }) var idConfig = ; @@ -215,7 +190,7 @@ $("#update-form").submit(function () { $.ajax({ - url: '', + url: '', type: 'post', data: { id: selectedId, @@ -229,7 +204,7 @@ if(data.code === 200){ Swal.fire({ icon: 'success', - title: "lang->line('validating_doctor_updated')?>", + title: "lang->line($role == 'DOCTOR' ? 'validating_doctor_updated' : 'validating_agent_updated')?>", text:"lang->line('informations_updated')?>", timer: 3000 }).then(()=>{ @@ -248,24 +223,25 @@ event.preventDefault(); }); - $("#create-doctor-form").submit(function (event) { + $("#create-agent-form").submit(function (event) { $.ajax({ - url: '', + url: '', type: 'post', data: { nh_network_config_id : idConfig, lastname: $("input[name=lastname]",this).val(), firstname: $("input[name=firstname]",this).val(), email: $("input[name=email]",this).val(), - phone: $("input[name=phone]",this).val() + phone: $("input[name=phone]",this).val(), + role : "" }, dataType: 'json', success: function (data) { if(data.code === 200){ Swal.fire({ icon: 'success', - title: "lang->line('validating_doctor_created')?>", + title: "lang->line($role == 'DOCTOR' ? 'validating_doctor_created' : 'validating_agent_created')?>", text:"lang->line('informations_updated')?>", timer: 3000 }).then(()=>{ @@ -287,7 +263,7 @@ $("#delete-btn").click(function () { $.ajax({ - url: '', + url: '', type: 'post', data: {id: selectedId}, dataType: 'json', @@ -295,7 +271,7 @@ if(data.code === 200){ Swal.fire({ icon: 'success', - title: "lang->line('validating_doctor_deleted')?>", + title: "lang->line($role == 'DOCTOR' ? 'validating_doctor_deleted' : 'validating_agent_deleted')?>", text:"lang->line('informations_updated')?>", timer: 3000 }).then(()=>{ diff --git a/application/views/nano_health/validating_agent/dashboard.php b/application/views/nano_health/validating_agent/dashboard.php new file mode 100755 index 00000000..4f14a37a --- /dev/null +++ b/application/views/nano_health/validating_agent/dashboard.php @@ -0,0 +1,272 @@ + + + + + + + + db->query("SELECT id FROM nh_insurances_subscriptions + WHERE MONTH(created_at) = '".$months[$i-1]."' AND YEAR(created_at) = '".$years[$i-1]."' + AND network_id ='".$this->session->userdata('network_id')."'"); + array_push($insuranceSubcriptions, $monthQuery->num_rows()); + } + + $careRequests = []; + +// $date = date("Y"); +// +// $demandes_data[] = ''; +// $demandes_data =array(); +// for ($i = 1; $i <= 12; $i++) { +// $demandes_query_mounth = $this->db->query("SELECT demande_id FROM info_demandeCredits +// WHERE MONTH(dateAjout) = '".$months[$i-1]."' AND YEAR(dateAjout) = ".$years[$i-1]." +// AND codeParrain='".$this->session->userdata('member_code')."'" +// ); +// $demandes_data[] = $demandes_query_mounth->num_rows(); +// } +// +// $demandes_query = $listdem; +// +// if($demandes_query!=false){ +// $demandes=$demandes_query->num_rows(); +// // Count networks for simple users +// $array_simple = array(); +// $num = 0; +// if ($demandes > 0) { +// foreach($demandes_query->result() as $row) { +// $num++; +// $array_simple[] = $row->codeMembre; +// } +// +// $vals_simple = array_count_values($array_simple); +// //echo 'No. of NON Duplicate Items: '.count($vals_simple).'

    '; +// //print_r($vals_simple); +// $pieChart2 = array(); +// foreach(array_keys($vals_simple) as $paramName2) { +// $color2 = dechex(rand(0x000000, 0xFFFFFF)); +// $trash2 = array("value" => $vals_simple[$paramName2], +// "color" => "#".$color2, +// "highlight" => "#".$color2, +// "label" => $paramName2); +// +// $pieChart2[]= $trash2; +// +// } +// } +// }else{ + $pieChart2 = array(); +// } + + /** + ** Geolocated User Treatment + **/ +// $users_geolocated_query = $list_geolocated_users; +// // Geolocated Users by month replace 2016 by NOW() +// $users_geolocated_data[] = ''; +// $users_geolocated_data =array(); +// for ($i = 1; $i <= 12; $i++) { +// $users_geolocated_query_january = $this->db->query("SELECT agent_id FROM super_infos +// WHERE MONTH(date_created) = '".$months[$i-1]."' AND YEAR(date_created) = ".$years[$i-1]." +// AND category='geolocated' AND code_parrain='".$this->session->userdata('member_code')."'"); +// $users_geolocated_data[] = $users_geolocated_query_january->num_rows(); +// } +// +// if($users_geolocated_query!=false){ +// +// $users_geolocated=$users_geolocated_query->num_rows(); +// //$users_geolocated_query = json_encode($users_geolocated_query->result()); +// // Counts network for geolocated users +// $array_geolocated = array(); +// $num = 0; +// if ($users_geolocated > 0) { +// foreach($users_geolocated_query->result() as $row) { +// $num++; +// $array_geolocated[] = date("M", strtotime($row->date_created)); +// } +// $vals_geolocated = array_count_values($array_geolocated); +// //echo 'No. of NON Duplicate Items: '.count($vals_geolocated).'

    '; +// //print_r($vals_geolocated); +// $pieChart = array(); +// foreach(array_keys($vals_geolocated) as $paramName) { +// $color = dechex(rand(0x000000, 0xFFFFFF)); +// $trash = array("value" => $vals_geolocated[$paramName], +// "color" => "#".$color, +// "highlight" => "#".$color, +// "label" => $paramName); +// +// $pieChart[]= $trash; +// } +// } +// }else{ +// $pieChart = array(); +// } + ?> + +
    + + +
    +

    + lang->line('validating_agent'); ?> + lang->line('Tableau de bord'); ?> +

    +
    + +
    + +
    +
    + +
    +
    +

    + +

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

    +
    +
    + +
    + lang->line("Plus d'informations"); ?> +
    +
    +
    + +
    +
    +

    + +

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

    +
    +
    + +
    + lang->line("Plus d'informations"); ?> +
    +
    +
    + +
    +
    +

    + +

    lang->line("rejected_subscription_requests"); ?>

    +
    +
    + +
    + lang->line("Plus d'informations"); ?> +
    +
    + +
    + +
    +
    +

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

    +
    +
    +
    + +
    +
    + +
    + +
    + + + + + +lang->line('subscription_requests'); ?> + + + + + + + +
    + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/views/nano_health/validating_agent/header.php b/application/views/nano_health/validating_agent/header.php new file mode 100755 index 00000000..d20b1611 --- /dev/null +++ b/application/views/nano_health/validating_agent/header.php @@ -0,0 +1,130 @@ + + + + + + + iLink | <?= $this->lang->line('validating_agent');?> + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + + diff --git a/application/views/nano_health/validating_doctor/header.php b/application/views/nano_health/validating_doctor/header.php index f02b69bd..08ce63c8 100755 --- a/application/views/nano_health/validating_doctor/header.php +++ b/application/views/nano_health/validating_doctor/header.php @@ -4,7 +4,7 @@ - iLink | Hyperviseur + iLink | <?= $this->lang->line('validating_doctor');?>
    #