Add validating agents and insurances insured

This commit is contained in:
Djery-Tom 2021-11-04 18:01:59 +01:00
parent 81da1b44dc
commit 1120965566
32 changed files with 1068 additions and 230 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed'); defined('BASEPATH') OR exit('No direct script access allowed');
class Doctor_password extends CI_Controller class Agent_password extends CI_Controller
{ {
public function __construct() public function __construct()
@ -16,10 +16,10 @@ class Doctor_password extends CI_Controller
echo "Lien incorrect"; echo "Lien incorrect";
} }
else { else {
$db_token = $this->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 ){ if($db_token->num_rows() > 0 ){
$this->session->set_userdata('token', $this->input->get('token')); $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{ }else{
echo "Ce lien a déjà expiré"; echo "Ce lien a déjà expiré";
} }
@ -40,18 +40,18 @@ class Doctor_password extends CI_Controller
$salt = $hash["salt"]; // salt $salt = $hash["salt"]; // salt
$this->db->where('token' , $this->session->userdata('token')); $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){ if($res==true){
$new_token = null; $new_token = null;
do { do {
$new_token = bin2hex(openssl_random_pseudo_bytes(16)); $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); } while ($tokenExist->num_rows() > 0);
$this->db->where('token' , $this->session->userdata('token')); $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){ if($res_token==true){
$data['alert'] = 'password'; $data['alert'] = 'password';

View File

@ -531,7 +531,7 @@ class Hyperviseur_dash extends CI_Controller
$data['refunds'] = $this->wallet_model->getRefunds($startDate, $endDate, $network_id); $data['refunds'] = $this->wallet_model->getRefunds($startDate, $endDate, $network_id);
else if ($type == 'commission_payments') else if ($type == 'commission_payments')
$data['payments'] = $this->wallet_model->getCommissionPayments($startDate, $endDate, $network_id); $data['payments'] = $this->wallet_model->getCommissionPayments($startDate, $endDate, $network_id);
else if ($type == 'insurance-subscriptions'){ else if ($type == 'insurance-subscriptions' || $type == 'insurance-insured'){
} }
else{ else{
@ -552,6 +552,10 @@ class Hyperviseur_dash extends CI_Controller
$data['id_network'] = $network_id; $data['id_network'] = $network_id;
$data['parrain_id'] = $parrainId; $data['parrain_id'] = $parrainId;
if($type == 'insurance-insured'){
$data['active'] = "wallet_insured";
}
$this->load->view('header_hyp', $data); $this->load->view('header_hyp', $data);
if ($type == 'transaction') if ($type == 'transaction')
$this->load->view('historique_transactions'); $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'); $this->load->view('config_wallet_ilink_hyp/historique_commission_payements');
else if ($type == 'insurance-subscriptions') else if ($type == 'insurance-subscriptions')
$this->load->view('nano_health/hyper/insurances_subscriptions.php'); $this->load->view('nano_health/hyper/insurances_subscriptions.php');
else if ($type == 'insurance-insured')
$this->load->view('nano_health/hyper/insurances_insured.php');
else else
$this->load->view('historique_recharges'); $this->load->view('historique_recharges');
$this->load->view('footer'); $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()) { if ($this->isLogged()) {
$data['active'] = "wallet_validating_doctors";
$data['alert'] = ""; $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['network'] = $this->session->userdata('network');
$data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays'));
@ -1944,10 +1957,10 @@ class Hyperviseur_dash extends CI_Controller
$nh_config = $this->nano_health_model->getConfig($data['network_id']); $nh_config = $this->nano_health_model->getConfig($data['network_id']);
$data['nh_config'] = $nh_config ? $nh_config->first_row() : null ; $data['nh_config'] = $nh_config ? $nh_config->first_row() : null ;
$data['config_id'] = $data['nh_config'] ? $data['nh_config']->id : 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('header_hyp', $data);
$this->load->view('nano_health/hyper/validating_doctors'); $this->load->view('nano_health/hyper/validating_agents');
$this->load->view('footer'); $this->load->view('footer');
} }
} }

View File

@ -70,30 +70,30 @@ class NanoHealthController extends CI_Controller
} }
} }
public function createValidatingDoctor() public function createValidatingAgent()
{ {
if($this->isLogged()) { if($this->isLogged()) {
if (isset($_POST)) { 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) { if ($emailExist->num_rows() == 0) {
do { do {
$token = bin2hex(openssl_random_pseudo_bytes(16)); $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); } while ($tokenExist->num_rows() > 0);
$_POST['token'] = $token; $_POST['token'] = $token;
$query = $this->db->insert('nh_validating_doctors', $_POST); $query = $this->db->insert('nh_validating_agents', $_POST);
if ($query) { if ($query) {
$link = base_url("Doctor_password/?token=" . $token); $link = base_url("Agent_password/?token=" . $token);
$this->load->library('email'); $this->load->library('email');
$this->email->from('noreply@ilink-app.com', 'iLink World'); $this->email->from('noreply@ilink-app.com', 'iLink World');
$this->email->to($_POST['email']); $this->email->to($_POST['email']);
$this->email->subject($this->lang->line("mail_title_validating_doctor")); $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("mail_body_validating_doctor") . ' ' . $link); $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(); $this->email->send();
@ -108,14 +108,14 @@ class NanoHealthController extends CI_Controller
} }
} }
public function updateValidatingDoctor() public function updateValidatingAgent()
{ {
if($this->isLogged()) { if($this->isLogged()) {
if (isset($_POST)) { 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) { if ($emailExist->num_rows() == 0) {
$this->db->where('id',$_POST['id']); $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]); echo json_encode(['code' => 200]);
}else{ }else{
echo json_encode(['code'=> 419 , 'message' => $this->lang->line("L'email entré est déjà utilisé")]); 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($this->isLogged()) {
if (isset($_POST)) { 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]); echo json_encode(['code' => 200]);
} }
} }
@ -179,6 +179,7 @@ class NanoHealthController extends CI_Controller
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$body = new \stdClass(); $body = new \stdClass();
$body->agent_id = $this->input->post('agent_id'); $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)); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));
/* execute request */ /* execute request */
@ -213,6 +214,7 @@ class NanoHealthController extends CI_Controller
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$body = new \stdClass(); $body = new \stdClass();
$body->agent_id = $this->input->post('agent_id'); $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'); $body->reason = $this->input->post('reason');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));

View File

@ -74,26 +74,32 @@
'user_role' => $this->input->post('user_role') '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)){ 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 $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 = ?"; 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']]); $agent = $this->db->query($sql,[$user_login['user_email']]);
if($doctor->num_rows()>0) { if($agent->num_rows()>0) {
$doctor = $doctor->first_row(); $agent = $agent->first_row();
$encrypted_password = $doctor->password; $encrypted_password = $agent->password;
$hash = checkhashSSHA($doctor->salt,$user_login['user_password']); $hash = checkhashSSHA($agent->salt,$user_login['user_password']);
if ($encrypted_password == $hash) { if ($encrypted_password == $hash) {
$this->session->set_userdata('email', $doctor->email); $this->session->set_userdata('agent_id', $agent->id);
$this->session->set_userdata('firstname', $doctor->firstname); $this->session->set_userdata('email', $agent->email);
$this->session->set_userdata('lastname', $doctor->lastname); $this->session->set_userdata('firstname', $agent->firstname);
$this->session->set_userdata('phone', $doctor->email); $this->session->set_userdata('lastname', $agent->lastname);
$this->session->set_userdata('currency_code', $doctor->currency_code); $this->session->set_userdata('phone', $agent->email);
$this->session->set_userdata('network', $doctor->network); $this->session->set_userdata('role', $agent->role);
$this->session->set_userdata('network_id', $doctor->network_id); $this->session->set_userdata('currency_code', $agent->currency_code);
$this->session->set_userdata('current_pays', $doctor->country); $this->session->set_userdata('network', $agent->network);
redirect('ValidatingDoctor'); $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{ }else{

View File

@ -0,0 +1,80 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class ValidatingAgent extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->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;
}
}

View File

@ -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'); $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, $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,
'<a href="'.$current_url.'?history=insurance-subscriptions&id='.$row->insurance_subscription_id.'" class="btn btn-primary" > '.$this->lang->line('Voir plus...').'</a>'); '<a href="'.$current_url.'?history=insurance-subscriptions&id='.$row->insurance_subscription_id.'" class="btn btn-primary" > '.$this->lang->line('Voir plus...').'</a>');
} }

View File

@ -0,0 +1,79 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
use Brick\Money\Context\AutoContext;
use Brick\Money\CurrencyConverter;
use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider;
use Brick\Money\ExchangeRateProvider\PDOProvider;
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
use Brick\Money\Money;
class Insurances extends CI_Controller
{
private $converter = null;
private $context = null;
function __construct()
{
parent::__construct();
// Load member model
$this->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,
'<a href="'.$current_url.'?history=insurances&id='.$row->insurance_subscription_id.'" class="btn btn-primary" > '.$this->lang->line('Voir plus...').'</a>');
}
$output = array(
"draw" => $_POST['draw'],
"recordsTotal" => $this->model->countAll($_POST),
"recordsFiltered" => $this->model->countFiltered($_POST),
"data" => $data,
);
// Output to JSON format
echo json_encode($output);
}
}

View File

@ -58,7 +58,7 @@ class WalletIlinkTransaction extends CI_Controller
$i++; $i++;
$created = $row->date ; //date('jS M Y', strtotime($row->date)); $created = $row->date ; //date('jS M Y', strtotime($row->date));
// $status = ($row->status == 1)?'Active':'Inactive'; // $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)); $numero_carte = join(" ", str_split($row->numero_carte, 4));

View File

@ -54,7 +54,7 @@ class WalletTransaction extends CI_Controller
$disabled = $row->canceled ? "disabled" : ""; $disabled = $row->canceled ? "disabled" : "";
$disabled1 = $row->deleted ? "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, $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,
'<button data-id-transaction="'.$row->id.'" id="cancel" class="btn btn-danger btn-block" '.$disabled.' > '<button data-id-transaction="'.$row->id.'" id="cancel" class="btn btn-danger btn-block" '.$disabled.' >
'.$this->lang->line('cancel').' '.$this->lang->line('cancel').'

View File

@ -711,7 +711,6 @@ $lang['reject'] = "Reject";
$lang['UNDER_VALIDATION'] = "Under validation"; $lang['UNDER_VALIDATION'] = "Under validation";
$lang['CHILD'] = "CHILD"; $lang['CHILD'] = "CHILD";
$lang['SPOUSE'] = "SPOUSE"; $lang['SPOUSE'] = "SPOUSE";
$lang['care_requests'] = "Care requests";
$lang['birthdate_proof_doc'] = "Birth certificate"; $lang['birthdate_proof_doc'] = "Birth certificate";
$lang['justice_doc'] = "Justice document"; $lang['justice_doc'] = "Justice document";
$lang['marriage_certificate_doc'] = "Marriage certificate"; $lang['marriage_certificate_doc'] = "Marriage certificate";
@ -724,4 +723,23 @@ $lang['reject_subscription'] = "Reject the subscription";
$lang['reject_reason'] = "Reason for rejection"; $lang['reject_reason'] = "Reason for rejection";
$lang['subscription_rejected'] = "Rejected subscription"; $lang['subscription_rejected'] = "Rejected subscription";
$lang['reason_rule'] = "Reason must not exceed 500 characters"; $lang['reason_rule'] = "Reason must not exceed 500 characters";
$lang['validating_agents'] = "Validating agents";
$lang['validating_agent'] = "Validating agent";
$lang['manage_validating_agents'] = "Managing validating agents";
$lang['add_validating_agent'] = "Add a validating agent";
$lang['validating_agent_created'] = "Validating agent created";
$lang['mail_title_validating_agent'] = "Create your validating agent account";
$lang['mail_body_validating_agent'] = "Your validating agent account has been created. Please follow this link to set up your password";
$lang['validating_agent_updated'] = "Validating agent modified";
$lang['validating_agent_deleted'] = "Deleted validating agent";
$lang['subscription_requests'] = "Subscription requests";
$lang['subscription_requests'] = "Subscription requests";
$lang['accepted_subscription_requests'] = "Subscription requests accepted";
$lang['rejected_subscription_requests'] = "rejected subscription requests";
$lang['not_treated_subscription_requests'] = "Subscription requests not processed";
$lang['insured'] = "Insured";
$lang['manage_insured'] = "Insured management";
$lang['PAID'] = "Paid";
$lang['insured_id'] = "Insured ID";
$lang['subscription_id'] = "Subscription ID";
?> ?>

View File

@ -723,7 +723,6 @@ $lang['reject'] = "Rejeter";
$lang['UNDER_VALIDATION'] = "En cours de validation"; $lang['UNDER_VALIDATION'] = "En cours de validation";
$lang['CHILD'] = "ENFANT"; $lang['CHILD'] = "ENFANT";
$lang['SPOUSE'] = "CONJOINT"; $lang['SPOUSE'] = "CONJOINT";
$lang['care_requests'] = "Demandes de soins";
$lang['birthdate_proof_doc'] = "Acte de naissance"; $lang['birthdate_proof_doc'] = "Acte de naissance";
$lang['justice_doc'] = "Document de justice"; $lang['justice_doc'] = "Document de justice";
$lang['marriage_certificate_doc'] = "Acte de mariage"; $lang['marriage_certificate_doc'] = "Acte de mariage";
@ -736,4 +735,23 @@ $lang['reject_subscription'] = "Rejecter la subscription";
$lang['reject_reason'] = "Motif du rejet"; $lang['reject_reason'] = "Motif du rejet";
$lang['subscription_rejected'] = "Souscription rejetée"; $lang['subscription_rejected'] = "Souscription rejetée";
$lang['reason_rule'] = "Le motif ne doit pas dépasser 500 caractères"; $lang['reason_rule'] = "Le motif ne doit pas dépasser 500 caractères";
$lang['validating_agents'] = "Agents valideurs";
$lang['validating_agent'] = "Agent valideur";
$lang['manage_validating_agents'] = "Gestion des agents valideurs";
$lang['add_validating_agent'] = "Ajouter un agent valideur";
$lang['validating_agent_created'] = "Agent valideur crée";
$lang['mail_title_validating_agent'] = "Création de votre compte agent valideur";
$lang['mail_body_validating_agent'] = "votre compte agent valideur a bien été créé.\n\nVeuillez suivre ce lien pour configurer votre mot de passe.";
$lang['validating_agent_updated'] = "Agent valideur modifié";
$lang['validating_agent_deleted'] = "Agent valideur supprimé";
$lang['subscription_requests'] = "Demandes de souscriptions";
$lang['subscription_requests'] = "Demandes de souscriptions";
$lang['accepted_subscription_requests'] = "Demandes de souscriptions acceptées";
$lang['rejected_subscription_requests'] = "Demandes de souscriptions rejetées";
$lang['not_treated_subscription_requests'] = "Demandes de souscriptions non traitées";
$lang['insured'] = "Assurés";
$lang['manage_insured'] = "Gestion des assurés";
$lang['PAID'] = "Payée";
$lang['insured_id'] = "ID de l'assuré";
$lang['souscription_id'] = "ID de la souscription";
?> ?>

View File

@ -46,4 +46,14 @@ class Nano_health_model extends CI_Model
public function getInfosInsuranceSubscriptionById($insuranceSubscriptionId){ public function getInfosInsuranceSubscriptionById($insuranceSubscriptionId){
return $this->db->get_where('nh_infos_insurances_subscriptions',['insurance_subscription_id'=> $insuranceSubscriptionId])->first_row(); return $this->db->get_where('nh_infos_insurances_subscriptions',['insurance_subscription_id'=> $insuranceSubscriptionId])->first_row();
} }
public function getNhValidatingAgentSubscriptionHistory($agentId , $state){
return $this->db->from('nh_insurances_subscriptions_history')->where('nh_validating_agent_id', $agentId)
->where('insurance_subscription_state', $state)->count_all_results();
}
public function getNhInsurancesSubscriptionCount($state){
return $this->db->from('nh_insurances_subscriptions')
->where('state', $state)->count_all_results();
}
} }

View File

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

View File

@ -40,7 +40,7 @@
</div> </div>
<!-- /.login-logo --> <!-- /.login-logo -->
<div class="login-box-body"> <div class="login-box-body">
<form action="<?= base_url(isset($isValidatingDoctor) ? 'Doctor_password/create_password' : 'Admin_password/create_password' )?>" method="post" id="password-form"> <form action="<?= base_url(isset($isValidatingAgent) ? 'Agent_password/create_password' : 'Admin_password/create_password' )?>" method="post" id="password-form">
<div class="form-group has-feedback"> <div class="form-group has-feedback">
<input name="password" id="password" type="password" class="form-control" placeholder="Nouveau mot de passe" required> <input name="password" id="password" type="password" class="form-control" placeholder="Nouveau mot de passe" required>
<span class="glyphicon glyphicon-lock form-control-feedback"></span> <span class="glyphicon glyphicon-lock form-control-feedback"></span>

View File

@ -98,7 +98,7 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<h1> <h1>
<?php echo $this->lang->line('Gestion des wallets'). ' '. $network .' - '.$country; ?> <?php echo $this->lang->line('Gestion des wallets'). ' '. $network .' - '.$country; ?>
<span class="label label-success pull-right"><?= strtoupper(str_replace('_',' ',$type)) ?></span> <span class="label label-success pull-right"><?= mb_strtoupper(str_replace('_',' ',$type),'UTF-8') ?></span>
</h1> </h1>
<?php <?php
$site_url = base_url(); $site_url = base_url();

View File

@ -96,7 +96,7 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
<h1> <h1>
<?php echo $this->lang->line('Gestion des wallets'). ' '. $network .' - '.$country; ?> <?php echo $this->lang->line('Gestion des wallets'). ' '. $network .' - '.$country; ?>
<span class="label label-success pull-right"><?= strtoupper(str_replace('_',' ',$type)) ?></span> <span class="label label-success pull-right"><?= mb_strtoupper(str_replace('_',' ',$type),'UTF-8') ?></span>
</h1> </h1>
<?php <?php
$site_url = base_url(); $site_url = base_url();

View File

@ -74,7 +74,7 @@
echo "<tr> echo "<tr>
<td align='center'>$num</td> <td align='center'>$num</td>
<td>$row->name</td> <td>$row->name</td>
<td><span class='label label-success'>" . strtoupper($row->type) . "</span></td>"; <td><span class='label label-success'>" . mb_strtoupper($row->type,'UTF-8') . "</span></td>";
?> ?>
<?php <?php
if ($row->rate != null) { if ($row->rate != null) {
@ -196,7 +196,7 @@
echo "<tr> echo "<tr>
<td align='center'>$num</td> <td align='center'>$num</td>
<td>$row->name</td> <td>$row->name</td>
<td><span class='label label-success'>" . strtoupper($row->type) . "</span></td>"; <td><span class='label label-success'>" . mb_strtoupper($row->type,'UTF-8') . "</span></td>";
?> ?>
<?php <?php
if ($row->is_transmitting_network) { if ($row->is_transmitting_network) {

View File

@ -87,7 +87,7 @@
<td align='center'>$num</td> <td align='center'>$num</td>
<td>$row->name</td> <td>$row->name</td>
<td>$row->country</td> <td>$row->country</td>
<td><span class='label label-success'>".strtoupper($row->type)."</span></td>"; <td><span class='label label-success'>".mb_strtoupper($row->type,'UTF-8')."</span></td>";
?> ?>
<?php <?php
if ($row->rate != null ) { if ($row->rate != null ) {
@ -181,7 +181,7 @@
<td align='center'>$num</td> <td align='center'>$num</td>
<td>$row->name</td> <td>$row->name</td>
<td>$row->country</td> <td>$row->country</td>
<td><span class='label label-success'>".strtoupper($row->type)."</span></td>"; <td><span class='label label-success'>".mb_strtoupper($row->type,'UTF-8')."</span></td>";
?> ?>
<?php <?php
if ($row->rate != null ) { if ($row->rate != null ) {

View File

@ -77,7 +77,7 @@
<?php <?php
if($row->enabled){ if($row->enabled){
?> ?>
<td><span class="label label-success"><?= strtoupper(str_replace('_',' ',$row->type)) ?></span></td> <td><span class="label label-success"><?= mb_strtoupper(str_replace('_',' ',$row->type),'UTF-8') ?></span></td>
<td><button type="button" data-toggle="modal" data-target="#disableWallet" data-network-id="<?= $row->id ?>" data-country-id="<?= $row->country_id ?>" <td><button type="button" data-toggle="modal" data-target="#disableWallet" data-network-id="<?= $row->id ?>" data-country-id="<?= $row->country_id ?>"
class="btn btn-danger openModal"><?= $this->lang->line('Désactiver'); ?></button></td> class="btn btn-danger openModal"><?= $this->lang->line('Désactiver'); ?></button></td>
<?php <?php

View File

@ -191,14 +191,24 @@
</a> </a>
</li> </li>
<?php if ($hasWallet->first_row()->type == 'ilink_sante') { ?> <?php if ($hasWallet->first_row()->type == 'ilink_sante') { ?>
<li class="<?php if ($active == "wallet_validating_doctors") { <li class="<?php if ($active == "wallet_validating_doctors") {echo "active";} ?>">
echo "active"; <a href="<?php echo base_url('Hyperviseur_dash/validating_agents/doctors') ?>">
} ?>">
<a href="<?php echo base_url('Hyperviseur_dash/validating_doctors') ?>">
<i class="fa fa-stethoscope"></i> <i class="fa fa-stethoscope"></i>
<span><?php echo $this->lang->line('validating_doctors'); ?></span> <span><?php echo $this->lang->line('validating_doctors'); ?></span>
</a> </a>
</li> </li>
<li class="<?php if ($active == "wallet_validating_agents") {echo "active";} ?>">
<a href="<?php echo base_url('Hyperviseur_dash/validating_agents') ?>">
<i class="fa fa-user"></i>
<span><?php echo $this->lang->line('validating_agents'); ?></span>
</a>
</li>
<li class="<?php if ($active == "wallet_insured") {echo "active";} ?>">
<a href="<?php echo base_url('Hyperviseur_dash/wallet?history=insurance-insured') ?>">
<i class="fa fa-medkit"></i>
<span><?php echo $this->lang->line('insured'); ?></span>
</a>
</li>
<?php } ?> <?php } ?>
<li class="<?php if ($active == "wallet_password") { <li class="<?php if ($active == "wallet_password") {
echo "active"; echo "active";

View File

@ -111,7 +111,7 @@
} }
echo "<tr> echo "<tr>
<td align='center' >$row->id</td> <td align='center' >$row->id</td>
<td>".strtoupper($type)."</td> <td>".mb_strtoupper($type,'UTF-8')."</td>
<td>".join(" ", str_split($row->numCarte, 4))."</td> <td>".join(" ", str_split($row->numCarte, 4))."</td>
<td>".$fmt->format($net)."</td> <td>".$fmt->format($net)."</td>
<td>".($row->type_transac == 'credit' ? $fmt->format($banque) : "")."</td> <td>".($row->type_transac == 'credit' ? $fmt->format($banque) : "")."</td>

View File

@ -150,7 +150,7 @@
<td align='center' >$row->id_demande</td> <td align='center' >$row->id_demande</td>
<td>" . $this->lang->line($row->etat) . "</td> <td>" . $this->lang->line($row->etat) . "</td>
<td>" . $this->lang->line($row->type_caution) . "</td> <td>" . $this->lang->line($row->type_caution) . "</td>
<td>" . strtoupper($row->duree_mois) . "</td> <td>" . mb_strtoupper($row->duree_mois,'UTF-8') . "</td>
<td>" . Money::of(round($row->montant_rembourse, 2), $currency_code, $context)->formatTo('fr_FR') . "</td> <td>" . Money::of(round($row->montant_rembourse, 2), $currency_code, $context)->formatTo('fr_FR') . "</td>
<td>" . $moneyNet->formatTo('fr_FR') . "</td> <td>" . $moneyNet->formatTo('fr_FR') . "</td>
<td>" . Money::of(round($row->interet, 2), $currency_code, $context)->formatTo('fr_FR') . "</td> <td>" . Money::of(round($row->interet, 2), $currency_code, $context)->formatTo('fr_FR') . "</td>

View File

@ -141,7 +141,7 @@
echo "<tr> echo "<tr>
<td align='center' >$row->id_epargne</td> <td align='center' >$row->id_epargne</td>
<td>" . $this->lang->line($row->etat) . "</td> <td>" . $this->lang->line($row->etat) . "</td>
<td>" . strtoupper($row->duree_mois) . "</td> <td>" . mb_strtoupper($row->duree_mois,'UTF-8') . "</td>
<td>" . $moneyNet->formatTo('fr_FR') . "</td> <td>" . $moneyNet->formatTo('fr_FR') . "</td>
<td>" . Money::of(round($row->interet, 2), $currency_code, $context)->formatTo('fr_FR') . "</td> <td>" . Money::of(round($row->interet, 2), $currency_code, $context)->formatTo('fr_FR') . "</td>
<td>" . Money::of(round($row->taxe, 2), $currency_code, $context)->formatTo('fr_FR') . "</td> <td>" . Money::of(round($row->taxe, 2), $currency_code, $context)->formatTo('fr_FR') . "</td>

View File

@ -55,7 +55,7 @@ $context = new \Brick\Money\Context\AutoContext();
<h1> <h1>
<?= $this->lang->line('Gestion des wallets'). ' '. $network .' - '.$country; ?> <?= $this->lang->line('Gestion des wallets'). ' '. $network .' - '.$country; ?>
<span class="label label-success pull-right"><?= strtoupper(str_replace('_',' ',$type)) ?></span> <span class="label label-success pull-right"><?= mb_strtoupper(str_replace('_',' ',$type),'UTF-8') ?></span>
</h1> </h1>
<?php <?php

View File

@ -65,36 +65,9 @@ $careRequests = [];
<div class="content-wrapper"> <div class="content-wrapper">
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <section class="content-header">
<h1> <h1>
<?= $this->lang->line('Gestion des wallets'). ' '. $network .' - '.$country; ?> <?= $this->lang->line('Gestion des wallets'). ' '. $network .' - '.$country; ?>
</h1> </h1>
<?php
if ($alert == "ok") {
if (!$success == "ok") {
?>
<div class='alert alert-danger alert-dismissible col-xs-6'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
<?= $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible col-xs-6">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?= $message; ?>
</div>
<?php
}
}
?>
</section> </section>

View File

@ -62,30 +62,6 @@
$this->converter = new CurrencyConverter($provider); $this->converter = new CurrencyConverter($provider);
$this->context = new AutoContext(); $this->context = new AutoContext();
$fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
$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>
<?= $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible col-xs-6">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?= $message; ?>
</div>
<?php
}
}
?> ?>
</section> </section>
@ -409,7 +385,7 @@
'pageLength', 'pageLength',
{ {
"extend": 'excelHtml5', "extend": 'excelHtml5',
title: "<?= $this->lang->line('taxes_list') . ' :: ' . $this->lang->line('subscription_detail') . ' - ' . $insurance_subscription_id?>", title: "<?= $this->lang->line('beneficiaries') . ' :: ' . $this->lang->line('subscription_detail') . ' - ' . $insurance_subscription_id?>",
// exportOptions: { // exportOptions: {
// columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] // 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 i = 0; i < data.body.length; i++) {
for (var j = 0; j < data.body[i].length; j++) { for (var j = 0; j < data.body[i].length; j++) {
// data.body[i][j] = '\u200C' + data.body[i][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 // Get the value and strip the non numeric characters
// var value = $(this).text(); // var value = $(this).text();
value = data.body[i][j].replace(',', ".") value = data.body[i][j].replace(',', ".")
@ -429,13 +405,13 @@
}, },
{ {
extend: 'csvHtml5', extend: 'csvHtml5',
title: "<?= $this->lang->line('taxes_list') . ' :: ' . $this->lang->line('subscription_detail') . ' - ' . $insurance_subscription_id?>", title: "<?= $this->lang->line('beneficiaries') . ' :: ' . $this->lang->line('subscription_detail') . ' - ' . $insurance_subscription_id?>",
}, },
{ {
extend: 'pdfHtml5', extend: 'pdfHtml5',
orientation: 'landscape', orientation: 'landscape',
pageSize: 'LEGAL', pageSize: 'LEGAL',
title: "<?= $this->lang->line('taxes_list') . ' :: ' . $this->lang->line('subscription_detail') . ' - ' . $insurance_subscription_id?>", title: "<?= $this->lang->line('beneficiaries') . ' :: ' . $this->lang->line('subscription_detail') . ' - ' . $insurance_subscription_id?>",
}, },
// 'colvis' // 'colvis'
] ]
@ -449,7 +425,11 @@
dataType: 'json', dataType: 'json',
data: { data: {
"subscription_id": "<?=$subscription->id ?>", "subscription_id": "<?=$subscription->id ?>",
"agent_id": "<?= $this->session->userdata('agent_id') ?>", <?php if(isset($category) && $category == 'AGENT') { ?>
"nh_validating_agent_id": "<?= $this->session->userdata('agent_id') ?>",
<?php } else { ?>
"agent_id": "<?= $this->session->userdata('agent_id') ?>",
<?php } ?>
}, },
success: function (data) { success: function (data) {
// console.log('data',data); // console.log('data',data);
@ -487,7 +467,11 @@
dataType: 'json', dataType: 'json',
data: { data: {
"subscription_id": "<?=$subscription->id ?>", "subscription_id": "<?=$subscription->id ?>",
"agent_id": "<?= $this->session->userdata('agent_id') ?>", <?php if(isset($category) && $category == 'AGENT') { ?>
"nh_validating_agent_id": "<?= $this->session->userdata('agent_id') ?>",
<?php } else { ?>
"agent_id": "<?= $this->session->userdata('agent_id') ?>",
<?php } ?>
"reason": reason "reason": reason
}, },
success: function (data) { success: function (data) {

View File

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

View File

@ -9,39 +9,12 @@
?> ?>
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <section class="content-header">
<h1> <h1>
<?php echo isset($category) ? 'Wallet' : $this->lang->line('Gestion des wallets') ; echo ' '.$network.' - '.$country <?php echo isset($category) ? ($category != 'AGENT' ? 'Wallet' : '') : $this->lang->line('Gestion des wallets') ; echo ' '.$network.' - '.$country
.' :: '.$this->lang->line('subscriptions_history'); ?> .' :: '.$this->lang->line('subscriptions_history'); ?>
<!-- <input type="button" class="btn btn-primary pull-right" id="Bactiver"--> <!-- <input type="button" class="btn btn-primary pull-right" id="Bactiver"-->
<!-- value="Activer/Désactiver le(s) réseau(x)" />--> <!-- value="Activer/Désactiver le(s) réseau(x)" />-->
</h1> </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">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
</div>
<?php
}
}
?>
</section> </section>
<section class="content"> <section class="content">
<div class="row"> <div class="row">
@ -168,7 +141,7 @@
'pageLength', 'pageLength',
{ {
"extend": 'excelHtml5', "extend": 'excelHtml5',
title: "<?= $this->lang->line('Historique des subscriptions') ?>", title: "<?= $this->lang->line('subscriptions_history') ?>",
// exportOptions: { // exportOptions: {
// columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] // 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 i = 0; i < data.body.length; i++) {
for (var j = 0; j < data.body[i].length; j++) { for (var j = 0; j < data.body[i].length; j++) {
// data.body[i][j] = '\u200C' + data.body[i][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 // Get the value and strip the non numeric characters
// var value = $(this).text(); // var value = $(this).text();
value = data.body[i][j].replace(',', ".") value = data.body[i][j].replace(',', ".")
@ -190,15 +163,12 @@
}, },
{ {
extend: 'csvHtml5', extend: 'csvHtml5',
title: "<?= $this->lang->line('Historique des subscriptions') ?>", title: "<?= $this->lang->line('subscriptions_history') ?>",
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8]
},
customizeData: function (data) { customizeData: function (data) {
for (var i = 0; i < data.body.length; i++) { for (var i = 0; i < data.body.length; i++) {
for (var j = 0; j < data.body[i].length; j++) { for (var j = 0; j < data.body[i].length; j++) {
// data.body[i][j] = '\u200C' + data.body[i][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 // Get the value and strip the non numeric characters
// var value = $(this).text(); // var value = $(this).text();
value = data.body[i][j].replace(',', ".") value = data.body[i][j].replace(',', ".")
@ -214,10 +184,7 @@
extend: 'pdfHtml5', extend: 'pdfHtml5',
orientation: 'landscape', orientation: 'landscape',
pageSize: 'LEGAL', pageSize: 'LEGAL',
title: "<?= $this->lang->line('Historique des subscriptions') ?>", title: "<?= $this->lang->line('Hsubscriptions_history') ?>",
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
},
trim: false, trim: false,
"action": newexportaction "action": newexportaction
}, },
@ -267,35 +234,3 @@
}); });
</script> </script>
<script>
$(document).on("click", "#cancel", function () {
const id_transaction = $(this).data('id-transaction');
$.ajax({
url : '<?php echo base_url('Gestion/cancelIlinkTransation')?>',
type : 'POST',
dataType : 'json',
data: {"id_transaction": id_transaction},
async:true,
success : function(data){
if(data){
Swal.fire({
icon: 'success',
title: "<?php echo $this->lang->line('canceled_transaction')?>",
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>

View File

@ -5,33 +5,8 @@
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <section class="content-header">
<h1> <h1>
<?php echo $this->lang->line('manage_validating_doctors'); ?> <?= $this->lang->line( $role == 'DOCTOR' ? 'manage_validating_doctors' : 'manage_validating_agents') ; ?>
</h1> </h1>
<?php
if ($alert == "ok") {
if (!$success == "ok") {
?>
<div class='alert alert-danger alert-dismissible col-xs-6'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
<?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">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
</div>
<?php
}
}
?>
</section> </section>
<section class="content"> <section class="content">
@ -39,10 +14,10 @@
<div class="col-xs-8"> <div class="col-xs-8">
<div class="box"> <div class="box">
<div class="box-header"> <div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('validating_doctors'); ?></h3> <h3 class="box-title"><?php echo $this->lang->line($role == 'DOCTOR' ? 'validating_doctors' : 'validating_agents'); ?></h3>
</div> </div>
<div class="box-body" style="overflow-x:auto;"> <div class="box-body" style="overflow-x:auto;">
<table id="doctors" class="table table-bordered table-striped"> <table id="agents" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th align='center'>#</th> <th align='center'>#</th>
@ -56,8 +31,8 @@
</thead> </thead>
<tbody> <tbody>
<?php <?php
if(isset($doctors)){ if(isset($agents)){
foreach ($doctors->result() as $i => $row) { foreach ($agents->result() as $i => $row) {
$statut = $this->lang->line('Non confirmé'); $statut = $this->lang->line('Non confirmé');
if (isset($row->salt)) { if (isset($row->salt)) {
$statut = $this->lang->line("Confirmé"); $statut = $this->lang->line("Confirmé");
@ -93,10 +68,10 @@
<div class="col-xs-4"> <div class="col-xs-4">
<div class="box"> <div class="box">
<div class="box-header"> <div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('add_validating_doctor'); ?></h3> <h3 class="box-title"><?php echo $this->lang->line($role == 'DOCTOR' ? 'add_validating_doctor': 'add_validating_agent'); ?></h3>
</div> </div>
<div class="box-body"> <div class="box-body">
<form id="create-doctor-form" class="bottom-75 center-block"> <form id="create-agent-form" class="bottom-75 center-block">
<div class="form-group"> <div class="form-group">
<label for="lastname"><?php echo $this->lang->line('Nom'); ?></label> <label for="lastname"><?php echo $this->lang->line('Nom'); ?></label>
<input type="text" class="form-control input-lg" name="lastname" required> <input type="text" class="form-control input-lg" name="lastname" required>
@ -192,7 +167,7 @@
toastr.options.closeEasing = 'swing'; toastr.options.closeEasing = 'swing';
$(function () { $(function () {
$('#doctors').DataTable(); $('#agents').DataTable();
}) })
var idConfig = <?= $config_id ?>; var idConfig = <?= $config_id ?>;
@ -215,7 +190,7 @@
$("#update-form").submit(function () { $("#update-form").submit(function () {
$.ajax({ $.ajax({
url: '<?php echo base_url('NanoHealthController/updateValidatingDoctor')?>', url: '<?php echo base_url('NanoHealthController/updateValidatingAgent')?>',
type: 'post', type: 'post',
data: { data: {
id: selectedId, id: selectedId,
@ -229,7 +204,7 @@
if(data.code === 200){ if(data.code === 200){
Swal.fire({ Swal.fire({
icon: 'success', icon: 'success',
title: "<?= $this->lang->line('validating_doctor_updated')?>", title: "<?= $this->lang->line($role == 'DOCTOR' ? 'validating_doctor_updated' : 'validating_agent_updated')?>",
text:"<?= $this->lang->line('informations_updated')?>", text:"<?= $this->lang->line('informations_updated')?>",
timer: 3000 timer: 3000
}).then(()=>{ }).then(()=>{
@ -248,24 +223,25 @@
event.preventDefault(); event.preventDefault();
}); });
$("#create-doctor-form").submit(function (event) { $("#create-agent-form").submit(function (event) {
$.ajax({ $.ajax({
url: '<?php echo base_url('NanoHealthController/createValidatingDoctor')?>', url: '<?php echo base_url('NanoHealthController/createValidatingAgent')?>',
type: 'post', type: 'post',
data: { data: {
nh_network_config_id : idConfig, nh_network_config_id : idConfig,
lastname: $("input[name=lastname]",this).val(), lastname: $("input[name=lastname]",this).val(),
firstname: $("input[name=firstname]",this).val(), firstname: $("input[name=firstname]",this).val(),
email: $("input[name=email]",this).val(), email: $("input[name=email]",this).val(),
phone: $("input[name=phone]",this).val() phone: $("input[name=phone]",this).val(),
role : "<?=$role?>"
}, },
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
if(data.code === 200){ if(data.code === 200){
Swal.fire({ Swal.fire({
icon: 'success', icon: 'success',
title: "<?= $this->lang->line('validating_doctor_created')?>", title: "<?= $this->lang->line($role == 'DOCTOR' ? 'validating_doctor_created' : 'validating_agent_created')?>",
text:"<?= $this->lang->line('informations_updated')?>", text:"<?= $this->lang->line('informations_updated')?>",
timer: 3000 timer: 3000
}).then(()=>{ }).then(()=>{
@ -287,7 +263,7 @@
$("#delete-btn").click(function () { $("#delete-btn").click(function () {
$.ajax({ $.ajax({
url: '<?php echo base_url('NanoHealthController/deleteValidatingDoctor')?>', url: '<?php echo base_url('NanoHealthController/deleteValidatingAgent')?>',
type: 'post', type: 'post',
data: {id: selectedId}, data: {id: selectedId},
dataType: 'json', dataType: 'json',
@ -295,7 +271,7 @@
if(data.code === 200){ if(data.code === 200){
Swal.fire({ Swal.fire({
icon: 'success', icon: 'success',
title: "<?= $this->lang->line('validating_doctor_deleted')?>", title: "<?= $this->lang->line($role == 'DOCTOR' ? 'validating_doctor_deleted' : 'validating_agent_deleted')?>",
text:"<?= $this->lang->line('informations_updated')?>", text:"<?= $this->lang->line('informations_updated')?>",
timer: 3000 timer: 3000
}).then(()=>{ }).then(()=>{

View File

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

View File

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

View File

@ -4,7 +4,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>iLink | Hyperviseur</title> <title>iLink | <?= $this->lang->line('validating_doctor');?></title>
<!-- Tell the browser to be responsive to screen width --> <!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.7 --> <!-- Bootstrap 3.3.7 -->