Setup Medecin controlleur panel and improve nano-sante wallet

This commit is contained in:
Djery-Tom 2022-03-29 00:50:56 +01:00
parent e3c17d1a3f
commit c8bcfcf9cb
21 changed files with 2809 additions and 337 deletions

View File

@ -0,0 +1,77 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class ControllerDoctor extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('nano_health_model');
}
public function index()
{
if ($this->isLogged()){
$data['active'] = "dashboard";
$data['network_id'] = $data['id_network'] = $this->session->userdata('network_id');
if ($this->input->get('history')) {
$history_type = $this->input->get('history');
$id = $this->input->get('id');
if($history_type == 'invoices' && !empty($id)){
$data['active'] = "invoices";
$data['invoice'] = $this->nano_health_model->getInfosInvoiceById($id);
$data['agent'] = $this->db->get_where('agent_plus',['code_membre'=> $data['invoice']->institution_code ?? null])->first_row();
$data['health_care_sheets'] = $this->db->get_where('nh_infos_health_care_sheets',['invoice_id'=> $id]);
$this->load->view('nano_health/controller_doctor/header', $data);
$this->load->view('nano_health/controller_doctor/infos_invoice', $data);
$this->load->view('footer');
}else{
$this->historique($this->input->get('d'), $this->input->get('f'), $this->input->get('history'), $data);
}
}else{
$data['count_accepted'] = $this->nano_health_model->getCountInvoices(null,$this->session->userdata('agent_id'), 'ACCEPTED');
$data['count_accepted_modified'] = $this->nano_health_model->getCountInvoices(null, $this->session->userdata('agent_id'), 'ACCEPTED_MODIFIED');
$data['count_rejected'] = $this->nano_health_model->getCountInvoices(null,$this->session->userdata('agent_id'), 'REJECTED');
$data['count_under_validation'] = $this->nano_health_model->getCountInvoices($data['network_id'],null, 'UNDER_VALIDATION');
$this->load->view('nano_health/controller_doctor/header', $data);
$this->load->view('nano_health/controller_doctor/dashboard', $data);
$this->load->view('footer');
}
}
}
private function historique($startDate, $endDate,$type , $data)
{
$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"));
if ($type == 'invoices')
$data['active'] = 'invoices';
$this->load->view('nano_health/controller_doctor/header', $data);
if ($type == 'invoices')
$this->load->view('nano_health/controller_doctor/invoices');
$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;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -508,6 +508,8 @@ class Hyperviseur_dash extends CI_Controller
$data['nh_config'] = $nh_config ? $nh_config->first_row() : null ;
$data['config_id'] = $data['nh_config'] ? $data['nh_config']->id : null ;
$data['provider_billing_periods'] = $this->user_model->getEnumValues('nh_networks_configs','provider_billing_period');
$data['password_validation_types'] = $this->user_model->getEnumValues('nh_networks_configs','password_validation');
$data['payment_periods'] = $this->user_model->getEnumValues('nh_months_prices_grid','payment_period');
$data['years_prices_grid'] = $this->nano_health_model->getConfigYearsPricesGrid($data['config_id']);
$data['months_prices_grid'] = $this->nano_health_model->getConfigMonthsPricesGrid($data['config_id']);
$data['acts'] = $this->nano_health_model->getConfigActs($data['config_id']);
@ -2019,9 +2021,12 @@ class Hyperviseur_dash extends CI_Controller
public function validating_agents($role = null){
if ($this->isLogged()) {
$data['alert'] = "";
if($role == 'doctors'){
if($role == 'doctors') {
$data['active'] = "wallet_validating_doctors";
$data['role'] = 'DOCTOR';
}else if($role == 'controllers'){
$data['active'] = "wallet_validating_controllers";
$data['role'] = 'CONTROLLER';
}else{
$data['active'] = "wallet_validating_agents";
$data['role'] = 'AGENT';

View File

@ -17,12 +17,19 @@ class NanoHealthController extends CI_Controller
$configId = $_POST['config_id'];
$grid = $_POST['grid'] ?? [];
$this->db->delete('nh_years_prices_grid',['nh_network_config_id' => $configId]);
if(sizeof($grid) > 0){
$this->db->insert_batch('nh_years_prices_grid',$grid);
try{
$this->db->trans_begin();
$this->db->delete('nh_years_prices_grid',['nh_network_config_id' => $configId]);
if(sizeof($grid) > 0){
$this->db->insert_batch('nh_years_prices_grid',$grid);
}
$this->db->trans_commit();
echo json_encode("200");
}catch (Throwable $exception){
$this->db->trans_rollback();
var_dump($exception->getMessage());
echo json_encode("500");
}
echo json_encode("200");
}
}
}
@ -32,12 +39,36 @@ class NanoHealthController extends CI_Controller
if (isset($_POST)) {
$configId = $_POST['config_id'];
$grid = $_POST['grid'] ?? [];
$this->db->delete('nh_months_prices_grid',['nh_network_config_id' => $configId]);
if(sizeof($grid) > 0){
$this->db->insert_batch('nh_months_prices_grid',$grid);
foreach ($grid as $i => $row){
foreach ($row as $k => $v){
if(empty($v)){
$grid[$i][$k] = null;
}
}
}
try{
$this->db->trans_begin();
foreach ($grid as $row){
$n = $row['payment_period'] == 'DAILY' ? 22 : 1 ;
if($row['payment_period'] == 'ONE_TIME'){
$row['payment_duration_months'] = null;
}
$row['number_of_fractions'] = $n * ($row['payment_duration_months'] ?? 1);
if(!empty($row['id'])){
$this->db->where('id',$row['id']);
$this->db->update('nh_months_prices_grid', $row);
}else{
$this->db->insert('nh_months_prices_grid',$row);
}
}
$this->db->trans_commit();
echo json_encode("200");
}catch (Throwable $exception){
$this->db->trans_rollback();
var_dump($exception->getMessage());
echo json_encode("500");
}
echo json_encode("200");
}
}
}
@ -166,76 +197,14 @@ class NanoHealthController extends CI_Controller
}
}
public function validateSubscription()
public function validateSubscription($subscription_id)
{
if($this->isLogged()) {
if (isset($_POST)) {
$subscription_id = $_POST['subscription_id'];
$url = NANO_SANTE_SERVICE_URL.'/insurances/subscriptions/'.$subscription_id.'/validate';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
/* set the content type json */
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type:application/json',
'Authorization:'.NANO_SANTE_SERVICE_TOKEN,
'X-localization:'. $this->session->userdata('site_lang') == 'french' ? 'fr' : 'en'
));
/* set return type json */
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 */
$result = curl_exec($ch);
/* close cURL resource */
curl_close($ch);
if ($result) {
echo $result;
} else {
echo json_encode(['status' => 500]);
}
}
}
echo $this->makeRequest('PUT','/insurances/subscriptions/'.$subscription_id.'/validate', $_POST);
}
public function rejectSubscription()
public function rejectSubscription($subscription_id)
{
if($this->isLogged()) {
if (isset($_POST)) {
$subscription_id = $_POST['subscription_id'];
$url = NANO_SANTE_SERVICE_URL.'/insurances/subscriptions/'.$subscription_id.'/reject';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
/* set the content type json */
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type:application/json',
'Authorization:'.NANO_SANTE_SERVICE_TOKEN,
'X-localization:'. $this->session->userdata('site_lang') == 'french' ? 'fr' : 'en'
));
/* set return type json */
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->type = $this->input->post('type');
$body->reason = $this->input->post('reason');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));
/* execute request */
$result = curl_exec($ch);
/* close cURL resource */
curl_close($ch);
if ($result) {
echo $result;
} else {
echo json_encode(['status' => 500]);
}
}
}
echo $this->makeRequest('PUT','/insurances/subscriptions/'.$subscription_id.'/reject', $_POST);
}
@ -392,6 +361,11 @@ class NanoHealthController extends CI_Controller
}
}
public function getSingleHealthCareSheet($id)
{
echo $this->makeRequest('GET','/health-care-sheets/'.$id);
}
public function generateInvoice()
{
if($this->isLogged()) {
@ -429,7 +403,12 @@ class NanoHealthController extends CI_Controller
echo $this->makeRequest('PUT','/authorizations-care-requests', $_POST);
}
private function makeRequest($method , $path , $request_body){
public function validateInvoice($id)
{
echo $this->makeRequest('PUT','/invoices/'.$id, $_POST);
}
private function makeRequest($method , $path , $request_body = []){
if($this->isLogged()) {
$url = NANO_SANTE_SERVICE_URL.$path;
$ch = curl_init($url);

View File

@ -97,6 +97,8 @@
$this->session->set_userdata('current_pays', $agent->country);
if($agent->role == 'DOCTOR'){
redirect('ValidatingDoctor');
}else if($agent->role == 'CONTROLLER'){
redirect('ControllerDoctor');
}else{
redirect('ValidatingAgent');
}

View File

@ -13,9 +13,10 @@ class ValidatingAgent extends CI_Controller
if ($this->isLogged()){
$data['active'] = "dashboard";
$data['agent_id'] = $this->session->userdata('agent_id');
$data['id_network'] = $this->session->userdata('network_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');
$data['untreatedRequests'] = $this->nano_health_model->getNhInsurancesSubscriptionCount($data['id_network'],'UNDER_VALIDATION');
$this->load->view('nano_health/validating_agent/header', $data);
$this->load->view('nano_health/validating_agent/dashboard', $data);

View File

@ -0,0 +1,75 @@
<?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 ControllerDoctorInvoices extends CI_Controller
{
private $context = null;
function __construct()
{
parent::__construct();
// Load member model
$this->load->model('pagination/Invoices_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->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) {
$amount = Money::of(round($row->amount, 2), $row->currency_code, $this->context)->formatTo('fr_FR');
$insured_amount = Money::of(round($row->insured_amount, 2), $row->currency_code, $this->context)->formatTo('fr_FR');
$insurer_amount = Money::of(round($row->insurer_amount, 2), $row->currency_code, $this->context)->formatTo('fr_FR');
$data[] = array($row->invoice_id , $row->institution_name , $amount , $insured_amount, $insurer_amount,
$row->period_start_at, $row->period_end_at, mb_strtoupper($this->lang->line($row->state) ,'UTF-8'), '<a href="'.$current_url.'?history=invoices&id='.$row->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 Invoices extends CI_Controller
$insurer_amount = Money::of(round($row->insurer_amount, 2), $row->currency_code, $this->context)->formatTo('fr_FR');
$data[] = array($row->invoice_id , $row->institution_name , $amount , $insured_amount, $insurer_amount,
$row->period_start_at, $row->period_end_at, '<a href="'.$row->file_url.'" class="btn btn-primary" target="blank"> '.$this->lang->line('Voir plus...').'</a>');
$row->period_start_at, $row->period_end_at, mb_strtoupper($this->lang->line($row->state),'UTF-8'), '<a href="'.$row->file_url.'" class="btn btn-primary" target="_blank"> '.$this->lang->line('Voir plus...').'</a>');
}
$output = array(

View File

@ -870,4 +870,35 @@ $lang['expired_insurance'] = "Insurance expired";
$lang['family_coverage_sharing'] = "Family coverage pooling";
$lang['max_insurance_coverage_amount'] = "Insurance coverage limit amount";
$lang['service_providers_per_town'] = "Prestataires par ville";
$lang['controllers_doctors'] = "Controllers doctors";
$lang['manage_controllers_doctors'] = "Manage controller doctors";
$lang['controller_doctor'] = "Controller doctor";
$lang['add_controller_doctor'] = "Add a controller doctor";
$lang['controller_doctor_updated'] = "Controller doctor updated";
$lang['controller_doctor_deleted'] = "Controller doctor deleted";
$lang['controller_doctor_deleted'] = "Controller doctor deleted";
$lang['accepted_invoices'] = "Accepted invoices";
$lang['rejected_invoices'] = "Rejected invoices";
$lang['rejected_invoices'] = "Rejected invoices";
$lang['accepted_modified_invoices'] = "Accepted invoices modified";
$lang['under_validation_invoices'] = "Invoices under validation";
$lang['invoice_detail'] = "Invoice detail";
$lang['issuer_information'] = "Issuer information";
$lang['download'] = "Download";
$lang['reject_invoice'] = "Reject the invoice";
$lang['institution'] = "Institution";
$lang['accept_and_update'] = "Accept and Modify";
$lang['accept_and_update_invoice'] = "Accept and Modify the invoice";
$lang['ACCEPTED_MODIFIED'] = "Accepted Modified";
$lang['waiting_period_days'] = "Waiting period (in days)";
$lang['password_validation'] = "Password validation";
$lang['MIN'] = "Minimum";
$lang['MAX'] = "Maximum";
$lang['payment_period'] = "Payment period";
$lang['payment_period'] = "Payment period";
$lang['payment_duration_months'] = "Payment duration (in months)";
$lang['ONE_TIME'] = "One time only";
$lang['DAILY'] = "Daily";
$lang['undefined'] = "Not defined";
$lang['number_of_fractions'] = "Number of fractions"
?>

View File

@ -881,4 +881,34 @@ $lang['expired_insurance'] = "Assurances arrivées à échéance";
$lang['family_coverage_sharing'] = "Mutualisation de la couverture familiale";
$lang['max_insurance_coverage_amount'] = "Montant limite de couverture d'assurance";
$lang['service_providers_per_town'] = "Prestataires par ville";
$lang['controllers_doctors'] = "Médécins controlleurs";
$lang['manage_controllers_doctors'] = "Gestion des médécins controleurs";
$lang['controller_doctor'] = "Médécin controleur";
$lang['add_controller_doctor'] = "Ajouter un médécin controleur";
$lang['controller_doctor_updated'] = "Médécin controleur modifié";
$lang['controller_doctor_deleted'] = "Médécin controleur supprimé";
$lang['controller_doctor_deleted'] = "Médécin controleur supprimé";
$lang['accepted_invoices'] = "Factures acceptées";
$lang['rejected_invoices'] = "Factures rejetées";
$lang['accepted_modified_invoices'] = "Factures acceptées modifiées";
$lang['under_validation_invoices'] = "Factures en cours de validation";
$lang['invoice_detail'] = "Detail de la facture";
$lang['issuer_information'] = "Informations sur l'émetteur";
$lang['download'] = "Télécharger";
$lang['reject_invoice'] = "Rejecter la facture";
$lang['institution'] = "Etablissement";
$lang['accept_and_update'] = "Accepter et Modifier";
$lang['accept_and_update_invoice'] = "Accepter et Modifier la facture";
$lang['ACCEPTED_MODIFIED'] = "Acceptée Modifiée";
$lang['waiting_period_days'] = "Delai de carence (en jours)";
$lang['password_validation'] = "Validation par mot de passe";
$lang['MIN'] = "Minimale";
$lang['MAX'] = "Maximale";
$lang['payment_period'] = "Periode de paiement";
$lang['payment_period'] = "Periode de paiement";
$lang['payment_duration_months'] = "Durée du paiment (en mois)";
$lang['ONE_TIME'] = "Une seule fois";
$lang['DAILY'] = "Journalier";
$lang['undefined'] = "Non défini";
$lang['number_of_fractions'] = "Nombre de fractions"
?>

View File

@ -22,6 +22,7 @@ class Nano_health_model extends CI_Model
public function updateConfig($configId, $data){
$this->db->where('id', $configId);
// $data = formatDBData($data);
return $this->db->update('nh_networks_configs', $data);
}
@ -30,7 +31,7 @@ class Nano_health_model extends CI_Model
}
public function getConfigMonthsPricesGrid($configId){
return $this->db->get_where('nh_months_prices_grid',['nh_network_config_id'=> $configId]);
return $this->db->order_by('id','ASC')->get_where('nh_months_prices_grid',['nh_network_config_id'=> $configId]);
}
public function getConfigActs($configId){
@ -52,8 +53,8 @@ class Nano_health_model extends CI_Model
->where('insurance_subscription_state', $state)->count_all_results();
}
public function getNhInsurancesSubscriptionCount($state){
return $this->db->from('nh_insurances_subscriptions')
public function getNhInsurancesSubscriptionCount($networkId, $state){
return $this->db->from('nh_insurances_subscriptions')->where('network_id', $networkId)
->where('state', $state)->count_all_results();
}
@ -157,4 +158,20 @@ class Nano_health_model extends CI_Model
->where('i.deleted_at IS NOT NULL')
->where('i.insurance_id',$insuranceId)->order_by('i.deleted_at','desc')->get();
}
public function getInfosInvoiceById($id){
return $this->db->get_where('nh_infos_invoices',['id'=> $id])->first_row();
}
public function getCountInvoices($network_id , $validating_agent_id, $state){
$query = $this->db->from('nh_infos_invoices')->where('state',$state);
if(!empty($validating_agent_id)){
$query = $query->where('validating_agent_id', $validating_agent_id);
}
if(!empty($network_id)){
$query = $query->where('network_id', $network_id);
}
return $query->count_all_results();
}
}

View File

@ -205,6 +205,12 @@
<span><?php echo $this->lang->line('validating_doctors'); ?></span>
</a>
</li>
<li class="<?php if ($active == "wallet_validating_controllers") {echo "active";} ?>">
<a href="<?php echo base_url('Hyperviseur_dash/validating_agents/controllers') ?>">
<i class="fa fa-stethoscope"></i>
<span><?php echo $this->lang->line('controllers_doctors'); ?></span>
</a>
</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>

View File

@ -7,7 +7,6 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round|Open+Sans">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
<?php

View File

@ -0,0 +1,236 @@
<!-- 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);
}
/**
** Simple User Treatment
**/
$date = date("Y");
$demandes_data[] = '';
$demandes_data =array();
for ($i = 1; $i <= 12; $i++) {
$demandes_query_mounth = $this->db->query("SELECT id FROM nh_infos_invoices
WHERE MONTH(created_at) = '".$months[$i-1]."' AND YEAR(created_at) = ".$years[$i-1]."
AND network_id='".$network_id."'"
);
$demandes_data[] = $demandes_query_mounth->num_rows();
}
$pieChart = array();
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $this->lang->line('controller_doctor'); ?>
<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><?= $count_accepted ?? 0;?></h3>
<p><?= $this->lang->line('accepted_invoices'); ?></p>
</div>
<div class="icon">
<i class="ion ion-checkmark-circled"></i>
</div>
</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><?= $count_accepted_modified ?? 0;?></h3>
<p><?= $this->lang->line('accepted_modified_invoices'); ?></p>
</div>
<div class="icon">
<i class="ion ion-alert-circled"></i>
</div>
</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><?= $count_rejected ?? 0;?></h3>
<p><?= $this->lang->line("rejected_invoices"); ?></p>
</div>
<div class="icon">
<i class="ion ion-close-circled"></i>
</div>
</div>
</div>
<div class="col-lg-3 col-md-4 col-xs-6">
<!-- small box -->
<div class="small-box bg-blue">
<div class="inner">
<h3><?= $count_under_validation ?? 0;?></h3>
<p><?= $this->lang->line("under_validation_invoices"); ?></p>
</div>
<div class="icon">
<i class="ion ion-information-circled"></i>
</div>
</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('invoices'); ?></h3>
</div>
<div class="box-body">
<div class="chart">
<canvas id="barChart" style="height:230px"></canvas>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</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 Pie = '<?//= json_encode($pieChart) ?>//';
//if(Pie==='[]'){
// var select = document.getElementById('chartAd');
// $(select.children).hide();
// //$(select).append("<p><?////= $this->lang->line('Aucune adhesion'); ?>////</p>");
//}else{
// Pie = JSON.parse(Pie);
//}
//var Pie2 = '<?//= json_encode($pieChart2) ?>//';
//if(Pie2==='[]') {
// var select = document.getElementById('chartDem');
// $(select.children).hide();
// $(select).append("<p><?//= $this->lang->line('Aucune demande'); ?>//</p>");
//}else{
// Pie2 = JSON.parse(Pie2);
//}
var areaChartData = {
labels : <?= json_encode($label_months) ?>,
datasets: [
{
label : 'Electronics',
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($demandes_data) ?>
},
//{
// label : 'Digital Goods',
// fillColor : 'rgba(0, 187, 255, 1)',
// strokeColor : 'rgba(0, 187, 255, 1)',
// pointColor : '#00bbff',
// pointStrokeColor : 'rgba(0, 187, 255, 1)',
// pointHighlightFill : '#fff',
// pointHighlightStroke: 'rgba(0, 187, 255, 1)',
// data : <?//= json_encode($demandes_data) ?>
//}
]
};
var ctx = document.getElementById('barChart').getContext('2d');
var chart = new Chart(ctx, {
// The type of chart we want to create
type: 'line',
// The data for our dataset
data: {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July','August','September','October','November','December'],
datasets: [{
label: "My First dataset",
backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: [0, 10, 5, 2, 20, 30, 45]
}]
},
// Configuration options go here
options: {}
});
</script>
<!-- Page script -->
<script src="<?= base_url('dist/js/custom.js') ?>"></script>

View File

@ -0,0 +1,131 @@
<?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('controller_doctor');?></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('ControllerDoctor') ?>">
<i class="fa fa-dashboard"></i> <span><?= $this->lang->line('Tableau de bord'); ?></span>
</a>
</li>
<li class="<?php if($active=="invoices"){echo "active ";} ?>">
<a href="<?= base_url('ControllerDoctor?history=invoices') ?>">
<i class="fa fa-file-text"></i>
<span><?= $this->lang->line('invoices'); ?></span>
</a>
</li>
</ul>
</section>
<!-- /.sidebar -->
</aside>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,244 @@
<!-- 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('invoices_history') ?>
<!-- <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_invoices_list') ?></h3>
<div class="box-tools">
</div>
</div>
<div class="box-body" style="overflow-x:auto;">
<table id="invoices" class="table table-bordered table-striped">
<thead>
<tr>
<th align='center'><?= $this->lang->line('invoice_id') ?></th>
<th>Emetteur</th>
<th><?= $this->lang->line('total_amount') ?></th>
<th><?= $this->lang->line('total_insured_part') ?></th>
<th><?= $this->lang->line('total_insurance_part') ?></th>
<th>Date debut</th>
<th>Date fin</th>
<th><?= $this->lang->line('state') ?></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 = $('#invoices').DataTable({
// Processing indicator
"processing": true,
"language": {
"processing": "<?= $this->lang->line('loading') ?>",
"emptyTable" : "<?= $this->lang->line('no_insured') ?>"
},
// DataTables server-side processing mode
"serverSide": true,
// Initial no order.
"order": [],
// Load data from an Ajax source
"ajax": {
"url": "<?= base_url('pagination/ControllerDoctorInvoices/getLists'); ?>",
"data":{
"startDate" : "<?= $startDate?>",
"endDate" : "<?= $endDate?>",
"id_network" : "<?= $id_network ?? null ?>",
"network_agent_id" : "<?= $network_agent_id ?? null ?>",
"currentURL" : "<?= current_url()?>"
},
"type": "POST"
},
"aaSorting": [[6, "desc"]],
"columnDefs": [{
"targets": [5,6],
// "orderable": false,
render: $.fn.dataTable.render.moment('YYYY-MM-DD', 'D MMMM YYYY', format)
}],
dom: 'Bfrtip',
"buttons": [
'pageLength',
{
"extend": 'excelHtml5',
title: "<?= $this->lang->line('invoices_history') ?>",
},
{
extend: 'csvHtml5',
title: "<?= $this->lang->line('invoices_history') ?>",
},
{
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'LEGAL',
title: "<?= $this->lang->line('invoices_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 ?? null ?>";
const ne = "<?=$network_agent_id ?? null ?>"
$('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=care-requests" + "&d=" + debut + "&f=" + fin;
else
window.location = "<?= current_url()?>" + "?id="+id_network+"&history=care-requests" + "&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=care-requests";
else
window.location = "<?= current_url()?>" + "?id="+id_network+"&history=care-requests";
});
});
$("#requests").on('click', ".treat-demand", function () {
let action = $(this).data('action');
let id = $(this).data('id');
$.ajax({
url: '<?= base_url('NanoHealthController/treatCareRequest')?>',
type: 'POST',
dataType: 'json',
data: {
"action": action,
"validating_agent_id": "<?= $this->session->userdata('agent_id') ?>",
"request_id": id,
},
success: function (data) {
// console.log('data',data);
if(data.status === 200){
Swal.fire({
icon: 'success',
title: data.response,
text:"<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" :
}else{
toastr.error(data.error , "<?= $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
});
});
</script>

View File

@ -104,7 +104,7 @@ $careRequests = [];
</div>
</div>
<div class="row centered">
<div class="col-lg-3 col-xs-3">
<div class="col-lg-4 col-xs-3">
<div class="small-box bg-red-active">
<div class="inner">
<h3><?= $this->lang->line($nh_config->provider_billing_period ?? ''); ?></h3>
@ -115,7 +115,7 @@ $careRequests = [];
</div>
</div>
</div>
<div class="col-lg-3 col-xs-3">
<div class="col-lg-4 col-xs-3">
<div class="small-box bg-orange">
<div class="inner">
<h3><?= $this->lang->line($nh_config->family_coverage_sharing ? 'Oui' : 'Non'); ?></h3>
@ -126,7 +126,20 @@ $careRequests = [];
</div>
</div>
</div>
<div class="col-lg-2 col-xs-6">
<div class="col-lg-4 col-xs-6">
<div class="small-box bg-aqua-active">
<div class="inner">
<h3><?= $this->lang->line($nh_config->password_validation) ?></h3>
<p><?= $this->lang->line('password_validation') ?> </p>
</div>
<div class="icon">
<i class="fa fa-sort-numeric-desc"></i>
</div>
</div>
</div>
</div>
<div class="row centered">
<div class="col-lg-4 col-xs-6">
<div class="small-box bg-aqua-active">
<div class="inner">
<h3><?= $nh_config->max_number_of_beneficiaries ?? ''; ?></h3>
@ -137,7 +150,7 @@ $careRequests = [];
</div>
</div>
</div>
<div class="col-lg-2 col-xs-6">
<div class="col-lg-4 col-xs-6">
<div class="small-box bg-aqua-active">
<div class="inner">
<h3><?= $nh_config->age_limit_of_insured_and_spouse ?? ''; ?></h3>
@ -148,7 +161,7 @@ $careRequests = [];
</div>
</div>
</div>
<div class="col-lg-2 col-xs-6">
<div class="col-lg-4 col-xs-6">
<div class="small-box bg-aqua-active">
<div class="inner">
<h3><?= $nh_config->age_limit_of_child_beneficiary ?? ''; ?></h3>
@ -232,7 +245,7 @@ $careRequests = [];
</div>
</div>
<div class="row centered">
<div class="col-lg-6 col-xs-12">
<div class="col-lg-4 col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('years_price_grid') ?></h3>
@ -253,7 +266,7 @@ $careRequests = [];
<tr>
<td><?= $row->min_age ?></td>
<td><?= $row->max_age ?></td>
<td><?= $row->markup_percentage.'%' ?></td>
<td><?= floatval($row->markup_percentage).'%' ?></td>
</tr>
<?php
}
@ -267,7 +280,7 @@ $careRequests = [];
</div>
</div>
</div>
<div class="col-lg-6 col-xs-12">
<div class="col-lg-8 col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('months_price_grid') ?></h3>
@ -276,9 +289,13 @@ $careRequests = [];
<table class="table table-bordered" >
<thead>
<tr>
<th width="80"><?= $this->lang->line('number_of_months') ?> </th>
<th><?= $this->lang->line('number_of_months') ?> </th>
<th><?= $this->lang->line('min_amount') ?> </th>
<th width="180"><?= $this->lang->line('max_insurance_coverage_amount') ?> </th>
<th><?= $this->lang->line('max_insurance_coverage_amount') ?> </th>
<th><?= $this->lang->line('waiting_period_days') ?> </th>
<th><?= $this->lang->line('payment_period') ?> </th>
<th><?= $this->lang->line('payment_duration_months') ?> </th>
<th><?= $this->lang->line('number_of_fractions') ?></th>
</tr>
</thead>
<tbody>
@ -289,7 +306,10 @@ $careRequests = [];
<td><?= $row->number_of_months ?></td>
<td><?= Money::of(round($row->min_amount, 2), $currency_code, $context)->formatTo('fr_FR'); ?></td>
<td><?= Money::of(round($row->max_insurance_coverage_amount, 2), $currency_code, $context)->formatTo('fr_FR'); ?></td>
<td><?= $row->waiting_period_days ?? '' ?> </td>
<td><?= $this->lang->line($row->payment_period) ?> </td>
<td><?= $row->payment_duration_months ?> </td>
<td><?= $row->number_of_fractions ?></td>
</tr>
<?php
}
@ -457,7 +477,7 @@ $careRequests = [];
<div class="form-group" style="margin-top: 40px">
<label class="col-form-label"><?= $this->lang->line('max_number_of_beneficiaries'); ?></label>
<input type="number" min="0" max="9" step="1" required class="form-control"
<input type="number" min="0" max="1000" step="1" required class="form-control"
name="max_number_of_beneficiaries" value="<?= $nh_config->max_number_of_beneficiaries ?? 0 ?>">
</div>
<div class="form-group">
@ -470,6 +490,17 @@ $careRequests = [];
<input type="number" min="0" max="99" step="1" required class="form-control"
name="age_limit_of_child_beneficiary" value="<?= $nh_config->age_limit_of_child_beneficiary ?? 0 ?>">
</div>
<div class="form-group">
<label class="col-form-label"><?= $this->lang->line('password_validation'); ?></label>
<select class="form-control" name="password_validation" required>
<?php $array = array_values($password_validation_types);
foreach ($array as $value) { ?>
<option value="<?=$value?>" <?= $value === ($nh_config->password_validation ?? '') ? 'selected' : '' ?> >
<?=$this->lang->line($value)?>
</option>
<?php } ?>
</select>
</div>
</div>
<div class="col-lg-6">
@ -558,7 +589,7 @@ $careRequests = [];
<tr>
<td><?= $row->min_age ?></td>
<td><?= $row->max_age ?></td>
<td><?= $row->markup_percentage?></td>
<td><?= floatval($row->markup_percentage)?></td>
<td>
<a class="add add1" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit1" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
@ -584,7 +615,7 @@ $careRequests = [];
</div>
</div>
<div class="modal fade" id="modal-months-grid">
<div class="modal-dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
@ -610,9 +641,13 @@ $careRequests = [];
<table id="months_prices_grid" class="table table-bordered">
<thead>
<tr>
<th style="display: none;">ID</th>
<th><?= $this->lang->line('number_of_months') ?> </th>
<th><?= $this->lang->line('min_amount') ?> </th>
<th><?= $this->lang->line('max_insurance_coverage_amount') ?> </th>
<th><?= $this->lang->line('waiting_period_days') ?> </th>
<th><?= $this->lang->line('payment_period') ?> </th>
<th><?= $this->lang->line('payment_duration_months') ?></th>
<th>Actions</th>
</tr>
</thead>
@ -621,9 +656,13 @@ $careRequests = [];
if (isset($months_prices_grid)) {
foreach ($months_prices_grid->result() as $row) { ?>
<tr>
<td><?= $row->number_of_months ?></td>
<td><?= $row->min_amount ?></td>
<td><?= $row->max_insurance_coverage_amount ?></td>
<td name='id' style="display: none;"><?=$row->id?></td>
<td name='number_of_months'><?= $row->number_of_months ?></td>
<td name='min_amount'><?= floatval($row->min_amount) ?></td>
<td name='max_insurance_coverage_amount'><?= floatval($row->max_insurance_coverage_amount) ?></td>
<td name='waiting_period_days'><?= $row->waiting_period_days ?? '' ?></td>
<td name='payment_period' value="<?=$row->payment_period?>"><?= $this->lang->line($row->payment_period) ?></td>
<td name='payment_duration_months' ><?= $row->payment_duration_months ?></td>
<td>
<a class="add add2" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit2" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
@ -841,6 +880,7 @@ $careRequests = [];
"age_limit_of_insured_and_spouse": $("input[name=age_limit_of_insured_and_spouse]").val(),
"age_limit_of_child_beneficiary": $("input[name=age_limit_of_child_beneficiary]").val(),
"family_coverage_sharing" : family_coverage_sharing,
"password_validation" : $("select[name=password_validation]").val(),
"current_affection_percentage_insurer": current_affection_percentage_insurer,
"current_affection_percentage_insured": current_affection_percentage_insured,
"long_term_affection_percentage_insurer": long_term_affection_percentage_insurer,
@ -940,13 +980,16 @@ $careRequests = [];
$('#months_prices_grid tr').has('td').each(function (i, el) {
var arrayItem = {};
var row = [];
$('td', $(this)).each(function (index, item) {
row.push(parseFloat($(item).html()));
});
arrayItem.nh_network_config_id = config_id
arrayItem.number_of_months = row[0];
arrayItem.min_amount = row[1];
arrayItem.max_insurance_coverage_amount = row[2];
$('td', $(this)).each(function (index, item) {
if($(item).attr('name')){
if($(item).attr("name") === 'payment_period'){
arrayItem[$(item).attr("name")] = $(item).attr("value")
}else{
arrayItem[$(item).attr("name")] = parseFloat($(item).html()) || null
}
}
});
grid.push(arrayItem);
});
@ -978,7 +1021,6 @@ $careRequests = [];
}
});
} else {
$('#monthsGridForm')[0].reportValidity();
}
@ -1185,7 +1227,7 @@ $careRequests = [];
var row = '<tr>' +
`<td><input type="number" required min="0" max="99" class="form-control" name="min_age" value="${initValue}" disabled></td>` +
`<td><input type="number" required min="0" max="99" class="form-control" name="max_age" value="${maxAge}" ></td>` +
'<td><input type="number" required class="form-control" min="-100" max="100" name="markup_percentage"></td>' +
'<td><input type="number" required class="form-control" min="-100" max="100" step="any" name="markup_percentage"></td>' +
'<td> ' + actions1 + '</td>' +
'</tr>';
$("#years_prices_grid").append(row);
@ -1250,7 +1292,7 @@ $careRequests = [];
if (index == 1)
$(this).html('<input type="number" required class="form-control" name="max_age" value="' + $(this).text() + '" disabled>');
if (index == 2)
$(this).html('<input type="number" required class="form-control" min="-100" max="100" name="markup_percentage" value="' + $(this).text() + '">');
$(this).html('<input type="number" required class="form-control" min="-100" max="100" step="any" name="markup_percentage" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add, .edit").toggle();
$(".new1").attr("disabled", "disabled");
@ -1264,7 +1306,18 @@ $careRequests = [];
//Months Grid
var actions2 = $("#months_prices_grid td:last-child").html();
// Append table with add row form on add new button click
function getPaymentPeriods(selectedValue) {
var periods = '';
<?php foreach ($payment_periods as $p ) {?>
var val = "<?=$p?>";
var selected = val === selectedValue ? 'selected' : '';
periods += (`<option value='<?= $p ?>' ${selected} > <?= $this->lang->line($p) ?> </option>`);
<?php } ?>
return periods;
}
// Append table with add row form on add new button click
$(".new2").click(function () {
if (!actions2) {
actions2 = '<a class="add add2" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>\n' +
@ -1277,6 +1330,13 @@ $careRequests = [];
'<td><input type="number" required min="1" class="form-control" name="number_of_months"></td>' +
'<td><input type="number" required min="0" step="0.01" class="form-control" name="min_amount" ></td>' +
'<td><input type="number" required min="0" step="0.01" class="form-control" name="max_insurance_coverage_amount" ></td>' +
'<td><input type="number" min="1" step="1" class="form-control" name="waiting_period_days" ></td>' +
'<td>' +
'<select required class="form-control" name="payment_period" >' +
getPaymentPeriods(null)+
'</select>' +
'</td>' +
'<td><input type="number" min="1" step="1" class="form-control" name="payment_duration_months" ></td>' +
'<td> ' + actions2 + '</td>' +
'</tr>';
$("#months_prices_grid").append(row);
@ -1289,6 +1349,7 @@ $careRequests = [];
var input = $(this).parents("tr").find('input[type="number"]');
var minAmount = parseFloat($(this).parents("tr").find('input[name="min_amount"]').first().val());
var maxAmount = parseFloat($(this).parents("tr").find('input[name="max_insurance_coverage_amount"]').first().val());
var select = $(this).parents("tr").find('select');
input.each(function () {
if ($(this).attr('name') == 'min_amount') {
@ -1313,21 +1374,39 @@ $careRequests = [];
$(this).parents("tr").find(".error").first().focus();
if (!empty) {
input.each(function () {
$(this).parent("td").html($(this).val());
$(this).parent("td").attr('name', $(this).attr('name')).html($(this).val());
});
$(this).parents("tr").find(".add, .edit").toggle();
$(".new2").removeAttr("disabled");
}
select.each(function () {
$(this).parent("td").html($(this).find('option:selected').text()).attr("value",$(this).val());
});
});
// Edit row on edit button click
$(document).on("click", ".edit2", function () {
var length = $(this).parents("tr").find("td:not(:last-child)").length;
// If startAt =7 , alors il exite deja en BD, car on a hidden la 1ere colonne qui contient l'id
var startAt = length === 7 ? 1 : 0;
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
if (index == 0)
if (index === startAt)
$(this).html('<input type="number" required class="form-control" min="1" name="number_of_months" value="' + $(this).text() + '">');
if (index == 1)
if (index === (startAt + 1))
$(this).html('<input type="number" required class="form-control" min="0" step="0.01" name="min_amount" value="' + $(this).text() + '">');
if (index == 2)
if (index === (startAt + 2))
$(this).html('<input type="number" required class="form-control" min="0" step="0.01" name="max_insurance_coverage_amount" value="' + $(this).text() + '">');
if (index === (startAt + 3))
$(this).html('<input type="number" class="form-control" min="1" step="1" name="waiting_period_days" value="' + $(this).text() + '">');
if (index === (startAt + 4)){
let val = $(this).attr("value");
if(!val){
val = $(this).attr("payment_period");
}
$(this).html('<select class="form-control" name="payment_period" required >'+ getPaymentPeriods(val)+ '</select>');
}
if (index === (startAt + 5))
$(this).html('<input type="number" class="form-control" min="1" step="1" name="payment_duration_months" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add, .edit").toggle();
$(".new2").attr("disabled", "disabled");

View File

@ -465,11 +465,10 @@
$('#accept-subscription').click(function() {
$.ajax({
url: '<?= base_url('NanoHealthController/validateSubscription')?>',
url: '<?= base_url('NanoHealthController/validateSubscription/'.$subscription->id )?>',
type: 'POST',
dataType: 'json',
data: {
"subscription_id": "<?=$subscription->id ?>",
<?php if(isset($category) && $category == 'AGENT') { ?>
"nh_validating_agent_id": "<?= $this->session->userdata('agent_id') ?>",
<?php } else { ?>
@ -507,11 +506,10 @@
toastr.warning( "<?= $this->lang->line('reason_rule')?>", "<?= $this->lang->line('management_rule')?>");
}else{
$.ajax({
url: '<?php echo base_url('NanoHealthController/rejectSubscription')?>',
url: '<?php echo base_url('NanoHealthController/rejectSubscription/'.$subscription->id)?>',
type: 'POST',
dataType: 'json',
data: {
"subscription_id": "<?=$subscription->id ?>",
<?php if(isset($category) && $category == 'AGENT') { ?>
"nh_validating_agent_id": "<?= $this->session->userdata('agent_id') ?>",
<?php } else { ?>
@ -552,11 +550,10 @@
toastr.warning( "<?= $this->lang->line('message_rule')?>", "<?= $this->lang->line('management_rule')?>");
}else{
$.ajax({
url: '<?php echo base_url('NanoHealthController/rejectSubscription')?>',
url: '<?php echo base_url('NanoHealthController/rejectSubscription/'.$subscription->id)?>',
type: 'POST',
dataType: 'json',
data: {
"subscription_id": "<?=$subscription->id ?>",
<?php if(isset($category) && $category == 'AGENT') { ?>
"nh_validating_agent_id": "<?= $this->session->userdata('agent_id') ?>",
<?php } else { ?>

View File

@ -58,6 +58,7 @@
<th><?= $this->lang->line('total_insurance_part') ?></th>
<th>Date debut</th>
<th>Date fin</th>
<th><?= $this->lang->line('state') ?></th>
<th align='center'>Action</th>
</tr>
</thead>

View File

@ -3,9 +3,21 @@
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<?php
switch ($role){
case 'DOCTOR':
$title1 ='manage_validating_doctors';
break;
case 'CONTROLLER':
$title1 ='manage_controllers_doctors';
break;
default:
$title1 = 'manage_validating_agents';
}
?>
<section class="content-header">
<h1>
<?= $this->lang->line( $role == 'DOCTOR' ? 'manage_validating_doctors' : 'manage_validating_agents') ; ?>
<?= $this->lang->line($title1) ; ?>
</h1>
</section>
@ -14,7 +26,19 @@
<div class="col-xs-8">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line($role == 'DOCTOR' ? 'validating_doctors' : 'validating_agents'); ?></h3>
<?php
switch ($role){
case 'DOCTOR':
$title2 ='validating_doctors';
break;
case 'CONTROLLER':
$title2 ='controllers_doctors';
break;
default:
$title2 = 'validating_agents';
}
?>
<h3 class="box-title"><?php echo $this->lang->line($title2); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<table id="agents" class="table table-bordered table-striped">
@ -67,7 +91,19 @@
<div class="col-xs-4">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line($role == 'DOCTOR' ? 'add_validating_doctor': 'add_validating_agent'); ?></h3>
<?php
switch ($role){
case 'DOCTOR':
$title3 ='add_validating_doctor';
break;
case 'CONTROLLER':
$title3 ='add_controller_doctor';
break;
default:
$title3 = 'add_validating_agent';
}
?>
<h3 class="box-title"><?php echo $this->lang->line($title3); ?></h3>
</div>
<div class="box-body">
<form id="create-agent-form" class="bottom-75 center-block">
@ -187,6 +223,19 @@
$('#delete-modal').modal('show');
});
<?php
switch ($role){
case 'DOCTOR':
$title4 ='validating_doctor_updated';
break;
case 'CONTROLLER':
$title4 ='controller_doctor_updated';
break;
default:
$title4 = 'validating_agent_updated';
}
?>
$("#update-form").submit(function () {
$.ajax({
url: '<?php echo base_url('NanoHealthController/updateValidatingAgent')?>',
@ -203,7 +252,7 @@
if(data.code === 200){
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line($role == 'DOCTOR' ? 'validating_doctor_updated' : 'validating_agent_updated')?>",
title: "<?= $this->lang->line($title4)?>",
text:"<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
@ -222,6 +271,18 @@
event.preventDefault();
});
<?php
switch ($role){
case 'DOCTOR':
$title5 ='validating_doctor_created';
break;
case 'CONTROLLER':
$title5 ='controller_doctor_created';
break;
default:
$title5 = 'validating_agent_created';
}
?>
$("#create-agent-form").submit(function (event) {
$.ajax({
@ -240,7 +301,7 @@
if(data.code === 200){
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line($role == 'DOCTOR' ? 'validating_doctor_created' : 'validating_agent_created')?>",
title: "<?= $this->lang->line($title5)?>",
text:"<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
@ -259,7 +320,18 @@
event.preventDefault();
});
<?php
switch ($role){
case 'DOCTOR':
$title6 ='validating_doctor_deleted';
break;
case 'CONTROLLER':
$title6 ='controller_doctor_deleted';
break;
default:
$title6 = 'validating_agent_deleted';
}
?>
$("#delete-btn").click(function () {
$.ajax({
url: '<?php echo base_url('NanoHealthController/deleteValidatingAgent')?>',
@ -270,7 +342,7 @@
if(data.code === 200){
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line($role == 'DOCTOR' ? 'validating_doctor_deleted' : 'validating_agent_deleted')?>",
title: "<?= $this->lang->line($title6)?>",
text:"<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{