Add Agent login

This commit is contained in:
Djery-Tom 2021-12-20 18:47:02 +01:00
parent 7f40059f0e
commit 2bc06cf940
18 changed files with 612 additions and 64 deletions

190
application/controllers/Agent.php Executable file
View File

@ -0,0 +1,190 @@
<?php
use Brick\Money\Context\AutoContext;
use Brick\Money\Money;
defined('BASEPATH') or exit('No direct script access allowed');
class Agent extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('wallet_model');
$this->load->model('nano_credit_model');
$this->load->model('Users_simple');
$this->load->model('User_model');
}
public function index()
{
if ($this->isLogged()) {
$data['active'] = "health_care_sheets";
$data['member_code'] = $this->session->userdata('member_code');
$data['category'] = $this->session->userdata('category');
$data['network'] = $this->session->userdata('network');
$data['code_parrain'] = $this->session->userdata('parrain');
$data['network_agent_id'] = $this->session->userdata('network_agent_id');
$startDate = $this->input->get('d');
$endDate = $this->input->get('f');
$format = $this->session->userdata('site_lang') === 'french' ? 'd-m-Y' : 'Y-m-d';
$data['startDate'] = $startDate ? date($format, strtotime($startDate)) : null;
$data['endDate'] = $endDate ? date($format, strtotime($endDate)) : null;
$endDate = Date('Y-m-d', strtotime($endDate . "+1 day"));
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
$this->load->view('header_agent', $data);
$this->load->view('nano_health/hyper/insurances_health_care_sheets');
$this->load->view('footer');
}
}
// Wallet
public function wallet()
{
if (!$this->session->userdata('email')) {
$this->session->set_flashdata('error', 'log in first');
$data['alert'] = "ok";
$data['message'] = "Login first!";
$this->load->view('login', $data);
} else {
$id_network = $this->session->userdata('network_id');
$data["commission"] = "";
$data["principal"] = "";
$data["transactions"] = "";
$agent_id = $this->session->userdata('agent_id');
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
if ($this->input->get('history')) {
$this->historique($id_network, $this->input->get('d'), $this->input->get('f'), $this->session->userdata('member_code'),
$this->input->get('history'));
} else {
$context = new AutoContext();
//Create wallet if it not exist
$res = $this->wallet_model->getWallet($agent_id);
if ($res == false) {
if ($data['hasWallet']) {
$this->user_model->addWallet($agent_id);
}
}
$res = $this->wallet_model->getWallet($agent_id);
if ($res != null) {
$row = $res->first_row();
$data["commission"] = Money::of(round($row->balance_com, 2), $this->session->userdata('currency_code'), $context)->formatTo('fr_FR');
$data["principal"] = Money::of(round($row->balance_princ, 2), $this->session->userdata('currency_code'), $context)->formatTo('fr_FR');
$agents_g = $this->user_model->getUsersGeolocatedForSup($this->session->userdata('member_code'));
$data['agents_g'] = $agents_g;
//Fetch all transactions of any geolocated agent of the network
$data["transactions"] = array();
if ($agents_g) {
foreach ($agents_g->result() as $row) {
$wallet = $this->wallet_model->getWallet($row->agent_id);
if ($wallet) {
if ($data['hasWallet']->first_row()->type == 'visa') {
$transactions = $this->user_model->getAgentTransactions($wallet->first_row()->wallet_id);
} else if ($data['hasWallet']->first_row()->type == 'ilink') {
$transactions = $this->user_model->getAgentiLinkTransactions($wallet->first_row()->wallet_id);
}
if ($transactions) {
foreach ($transactions->result() as $trans) {
$trans->agent_id = $row->agent_id; // Add agent id to transaction
array_push($data['transactions'], $trans);
}
}
}
}
}
} else {
$data["commission"] = "N/A";
$data["principal"] = "N/A";
$data["totalCommissionBanque"] = "N/A";
$data["transactions"] = false;
}
$data['currency_code'] = $this->session->userdata('currency_code');
$data['alert'] = "";
$data['active'] = "wallet";
$data['code_parrain'] = $this->session->userdata('code_parrain');
$data['category'] = $this->session->userdata('category');
$data['network'] = $this->session->userdata('network');
$data['network_id'] = $id_network;
$data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays'));
$data['pays'] = $this->user_model->getAllGameCountries();
$data['networks'] = $this->user_model->getActiveNetwork();
$data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network);
// $data['geolocated_user'] = $this->user_model->getSuperNameAndCodeForSup($this->session->userdata('member_code'));
$this->load->view('header_sup', $data);
if ($data['hasWallet']->first_row()->type == 'visa')
$this->load->view('gestion_wallet_sup');
elseif ($data['hasWallet']->first_row()->type == 'ilink')
$this->load->view('gestion_wallet_sup_ilink');
$this->load->view('footer');
}
}
}
private function historique($network_id, $startDate, $endDate, $codeMembre, $type)
{
$data['configWallet'] = $this->wallet_model->getConfigWallet($network_id);
$format = $this->session->userdata('site_lang') === 'french' ? 'd-m-Y' : 'Y-m-d';
$data['startDate'] = $startDate ? date($format, strtotime($startDate)) : null;
$data['endDate'] = $endDate ? date($format, strtotime($endDate)) : null;
$endDate = Date('Y-m-d', strtotime($endDate . "+1 day"));
if ($type == 'transaction')
$data['transactions'] = $this->user_model->getTransactionsSup($startDate, $endDate, $codeMembre);
else if ($type == 'transaction_ilink')
$data['transactions'] = $this->wallet_model->getIlinkTransactionsSup($startDate, $endDate, $codeMembre);
else if ($type == 'commission_transfer')
$data['transactions'] = $this->wallet_model->getCommissionTransfers($startDate, $endDate, $this->session->userdata('member_code'));
else if ($type == 'balance_statement')
$data['wallets'] = $this->user_model->getInfosWalletAgentForSuper($codeMembre);
$data['active'] = "wallet";
$data['alert'] = "";
$data['network'] = $this->session->userdata('network');
$data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays'));
$data['networks'] = $this->user_model->getActiveNetwork();
// $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code'));
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
$data['country'] = $this->session->userdata('current_pays');
$data['category'] = $this->session->userdata('category');
$data['geolocated_user'] = $this->user_model->getSuperNameAndCodeForSup($this->session->userdata('member_code'));
$data['id_network'] = $this->session->userdata('network_id');
$this->load->view('header_sup', $data);
if ($type == 'transaction')
$this->load->view('historique_transactions');
else if ($type == 'transaction_ilink')
$this->load->view('historique_transactions_ilink');
else if ($type == 'commission_transfer')
$this->load->view('historique_transferts_commission');
else if ($type == 'balance_statement')
$this->load->view('config_wallet_ilink_hyp/etat_soldes');
$this->load->view('footer');
}
private function isLogged()
{
if (!$this->session->userdata('email')) {
$this->session->set_flashdata('error', 'log in first');
$data['alert'] = "ok";
$data['message'] = "Login first!";
$this->load->view('login', $data);
return false;
}
return true;
}
}

View File

@ -149,6 +149,10 @@
} else if ($data->category == $super) {
$this->session->set_userdata('code_parrain', $data->code_parrain);
redirect('Superviseur_dash');
}else if($data->category == 'geolocated') {
$this->session->set_userdata('code_parrain', $data->code_parrain);
$this->session->set_userdata('network_agent_id', $data->network_agent_id);
redirect('Agent');
}
}

View File

@ -820,4 +820,5 @@ $lang['resubmit'] = "Resubmit";
$lang['subscription_resubmitted'] = "The subscription has been resubmitted";
$lang['insurance_part'] = "Insurance share";
$lang['insurance_part'] = "Insurance share";
$lang['consultation_id'] = "Consulation ID";
?>

View File

@ -831,4 +831,5 @@ $lang['resubmit'] = "Resoumettre";
$lang['subscription_resubmitted'] = "La souscription a été re-soumise";
$lang['insurance_part'] = "Part de l'assurance";
$lang['insurance_part'] = "Part de l'assurance";
$lang['consultation_id'] = "ID de la consultation";
?>

View File

@ -30,11 +30,14 @@ class User_model extends CI_Model
$this->db->where("email",$id);
$query=$this->db->get();
break;
case 2: //hyperviseur ou superviseur
case 2: //hyperviseur ou superviseur ou agent
$query = $this->db->query("SELECT * FROM hyper_infos WHERE code_membre='".$id."'");
if($query->num_rows()==0){
$query = $this->db->query("SELECT * FROM super_infos WHERE category='super' AND code_membre='".$id."'");
}
if($query->num_rows()==0){
$query = $this->db->query("SELECT * FROM agent_plus WHERE category='geolocated' AND code_membre='".$id."'");
}
break;
}

View File

@ -37,7 +37,13 @@ class HealthCareSheets_model extends CI_Model
public function countAll($postData)
{
$this->db->from($this->table);
if(!empty($postData['id_network'])){
$this->db->where('network_id', $postData['id_network']);
}
if(!empty($postData['network_agent_id'])){
$this->db->where('network_agent_id', $postData['network_agent_id']);
}
return $this->db->count_all_results();
}
@ -60,7 +66,13 @@ class HealthCareSheets_model extends CI_Model
{
$this->db->from($this->table);
if(!empty($postData['id_network'])){
$this->db->where('network_id', $postData['id_network']);
}
if(!empty($postData['network_agent_id'])){
$this->db->where('network_agent_id', $postData['network_agent_id']);
}
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")));

View File

@ -46,7 +46,7 @@
<input name="email" id="email" type="text" class="form-control" placeholder="Email" required>
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
</div>
<div class="form-group" align="center">
<div class="form-group" style="text-align: center">
<button type="submit" name="Submit" class="btn btn-primary btn-block btn-flat">Confirmer</button>
<button type="button" id="back" class="btn btn-danger btn-block btn-flat">Retour</button>
</div>

View File

@ -49,7 +49,7 @@
<input type="password" name="password_confirm" id="password_confirm" class="form-control" placeholder="Entrez à nouveau le mot de passe" required>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="form-group" align="center">
<div class="form-group" style="text-align: center">
<button type="submit" name="Submit" class="btn btn-primary btn-block btn-flat">Terminer</button>
</div>
</form>

View File

@ -53,7 +53,7 @@
<input type="text" name="transaction" id="transaction" class="form-control" placeholder="N° transaction" required>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="form-group" align="center">
<div class="form-group" style="text-align: center">
<button type="submit" name="Submit" class="btn btn-primary btn-block btn-flat">Créer</button>
</div>
</form>

View File

@ -141,7 +141,7 @@
<div class="col-xs-4">
<div class="box">
<div class="box-header">
<h3 class="" align="center"><?php echo $this->lang->line('Créer un compte administrateur'); ?></h3>
<h3 class="" style="text-align: center"><?php echo $this->lang->line('Créer un compte administrateur'); ?></h3>
</div>
<div class="box-body">
<form method='POST' id="create-admin-form" class="bottom-75 center-block">
@ -183,7 +183,7 @@
<input type="text" class="form-control input-lg" name="adresse" required
id="adresse">
</div>
<div align="center" class="form-group">
<div style="text-align: center" class="form-group">
<input id="btn-add" type="submit" value="<?php echo $this->lang->line('Créer le compte'); ?>" class="btn btn-primary">
</div>
</form>

View File

@ -62,7 +62,7 @@
<th align='center'><?php echo $this->lang->line('Statut'); ?></th>
<th align='center'><?php echo $this->lang->line('Activer/Désactiver'); ?></th>
<th align='center'><?php echo $this->lang->line('Modifier'); ?></th>
<th align="center"><?php echo $this->lang->line('Supprimer'); ?></th>
<th style="text-align: center"><?php echo $this->lang->line('Supprimer'); ?></th>
</tr>
</thead>
<tbody>

View File

@ -184,7 +184,7 @@
<th align='center'><?php echo $this->lang->line('Statut'); ?></th>
<th align='center'> <?php echo $this->lang->line('share_rate') ?></th>
<th align='center'> URL</th>
<th align="center"> Action</th>
<th style="text-align: center"> Action</th>
</tr>
</thead>
<tbody>

View File

@ -0,0 +1,120 @@
<?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 | Superviseur</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').' - '.$this->session->userdata('member_code');?>
<small><?= $this->session->userdata('email');?></small>
</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('phone');?>
</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">
<?php if ($hasWallet) {
?>
<?php if ($hasWallet->first_row()->type == 'ilink_sante') { ?>
<li class="<?php if ($active == "health_care_sheets") {
echo "active";
} ?>">
<a href="<?= base_url('Agent') ?>">
<i class="fa fa-money"></i> <span>Feuille de soins</span>
</a>
</li>
<?php }?>
<?php } ?>
</ul>
</section>
<!-- /.sidebar -->
</aside>

View File

@ -0,0 +1,206 @@
<!-- 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_health_care_sheets') ?>
<!-- <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_health_care_sheets_list') ?></h3>
<div class="box-tools">
</div>
</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('health_care_sheet_id') ?></th>
<th>Type</th>
<th><?= $this->lang->line('insured_id') ?></th>
<th><?= $this->lang->line('patient_lastname') ?></th>
<th><?= $this->lang->line('patient_situation') ?></th>
<th><?= $this->lang->line('institution_name') ?></th>
<th><?= $this->lang->line('practitioner_lastname') ?></th>
<th><?= $this->lang->line('care_condition') ?></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('no_insured') ?>"
},
// DataTables server-side processing mode
"serverSide": true,
// Initial no order.
"order": [],
// Load data from an Ajax source
"ajax": {
"url": "<?= base_url('pagination/HealthCareSheets/getLists'); ?>",
"data":{
"startDate" : "<?= $startDate?>",
"endDate" : "<?= $endDate?>",
"id_network" : "<?= $id_network ?? '' ?>",
"currentURL" : "<?= current_url()?>"
},
"type": "POST"
},
"aaSorting": [[9, "desc"]],
"columnDefs": [{
"targets": [9],
// "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') ?>",
},
{
extend: 'csvHtml5',
title: "<?= $this->lang->line('subscriptions_history') ?>",
},
{
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'LEGAL',
title: "<?= $this->lang->line('subscriptions_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-health_care_sheets" + "&d=" + debut + "&f=" + fin;
else
window.location = "<?= current_url()?>" + "?id="+id_network+"&history=insurance-health_care_sheets" + "&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-health_care_sheets";
else
window.location = "<?= current_url()?>" + "?id="+id_network+"&history=insurance-health_care_sheets";
});
});
</script>

View File

@ -74,28 +74,34 @@
</colgroup>
<thead>
<tr>
<th align="center"><strong>Patient</strong></th>
<th style="text-align: center"><strong>Patient</strong></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td><?= $this->lang->line('insured_id'); ?></td>
<td align="center"><strong><?= $health_care_sheet->insured_id ?></strong></td>
<td style="text-align: center"><strong><?= $health_care_sheet->insured_id ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('patient_lastname'); ?></td>
<td align="center"><strong><?= $health_care_sheet->patient_lastname ; ?></strong></td>
<td style="text-align: center"><strong><?= $health_care_sheet->patient_lastname ; ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('patient_firstname')?></td>
<td align="center"><strong><?= $health_care_sheet->patient_firstname ?></strong></td>
<td style="text-align: center"><strong><?= $health_care_sheet->patient_firstname ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('patient_situation')?></td>
<td align="center"><strong><?= $this->lang->line($health_care_sheet->patient_situation) ?></strong></td>
<td style="text-align: center"><strong><?= $this->lang->line($health_care_sheet->patient_situation) ?></strong></td>
</tr>
<?php if($health_care_sheet->type == 'EXECUTION') { ?>
<tr>
<td><?= $this->lang->line('consultation_id')?></td>
<td style="text-align: center"><strong><?= $health_care_sheet->prescription_health_care_sheet_id ?></strong></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
@ -114,28 +120,28 @@
<tbody>
<tr>
<td><?= $this->lang->line('institution_name'); ?></td>
<td align="center"><strong><?= $health_care_sheet->institution_name ?></strong></td>
<td style="text-align: center"><strong><?= $health_care_sheet->institution_name ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('institution_code'); ?></td>
<td align="center"><strong><?= $health_care_sheet->institution_code ?></strong></td>
<td style="text-align: center"><strong><?= $health_care_sheet->institution_code ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('practitioner_lastname'); ?></td>
<td align="center"><strong><?= $health_care_sheet->practitioner_lastname ; ?></strong></td>
<td style="text-align: center"><strong><?= $health_care_sheet->practitioner_lastname ; ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('practitioner_firstname')?></td>
<td align="center"><strong><?= $health_care_sheet->practitioner_firstname ?></strong></td>
<td style="text-align: center"><strong><?= $health_care_sheet->practitioner_firstname ?></strong></td>
</tr>
<tr>
<td>Classification</td>
<td align="center"><strong><?= $health_care_sheet->practitioner_provider_class ?></strong></td>
<td style="text-align: center"><strong><?= $health_care_sheet->practitioner_provider_class ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('care_condition')?></td>
<td align="center"><strong><?= $this->lang->line($health_care_sheet->care_condition) ?></strong></td>
<td style="text-align: center"><strong><?= $this->lang->line($health_care_sheet->care_condition) ?></strong></td>
</tr>
<?php if(isset($health_care_sheet->accident_date)){ ?>
<tr>
@ -187,6 +193,7 @@
</div>
<?php if($health_care_sheet->type != 'EXECUTION') { ?>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"><?= $this->lang->line('performances') ?></h3>
@ -231,6 +238,8 @@
</table>
</div>
</div>
<?php } ?>
<?php if (isset($exams) && $exams->num_rows() > 0 ) { ?>
<div class="box box-primary">

View File

@ -73,21 +73,21 @@
<tbody>
<tr>
<td><?= $this->lang->line('insured_id'); ?></td>
<td align="center"><strong><?= $insured_id ?></strong></td>
<td style="text-align: center"><strong><?= $insured_id ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('Nom'); ?></td>
<td align="center"><strong><?= $user->lastname ?? '' . $user->firstname ?? ''; ?></strong></td>
<td style="text-align: center"><strong><?= $user->lastname ?? '' . $user->firstname ?? ''; ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('Adresse')?></td>
<td align="center"><strong><?= $user->adresse ?></strong></td>
<td style="text-align: center"><strong><?= $user->adresse ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('Contact')?></td>
<td align="center"><strong><?= $user->phone." | ".$user->email ?></strong></td>
<td style="text-align: center"><strong><?= $user->phone." | ".$user->email ?></strong></td>
</tr>
</tbody>
</table>

View File

@ -91,16 +91,16 @@
<tbody>
<tr>
<td><?= $this->lang->line('Nom'); ?></td>
<td align="center"><strong><?= $user->lastname ?? '' . $user->firstname ?? ''; ?></strong></td>
<td style="text-align: center"><strong><?= $user->lastname ?? '' . $user->firstname ?? ''; ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('Adresse')?></td>
<td align="center"><strong><?= $user->adresse ?></strong></td>
<td style="text-align: center"><strong><?= $user->adresse ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('Contact')?></td>
<td align="center"><strong><?= $user->phone." | ".$user->email ?></strong></td>
<td style="text-align: center"><strong><?= $user->phone." | ".$user->email ?></strong></td>
</tr>
</tbody>
</table>

View File

@ -128,7 +128,8 @@
"data":{
"startDate" : "<?= $startDate?>",
"endDate" : "<?= $endDate?>",
"id_network" : "<?= $id_network ?>",
"id_network" : "<?= $id_network ?? null ?>",
"network_agent_id" : "<?= $network_agent_id ?? null ?>",
"currentURL" : "<?= current_url()?>"
},
"type": "POST"
@ -175,7 +176,8 @@
$(function () {
const lang = $('#picker').data('lang');
const category = $('#picker').data('category');
const id_network = "<?= $id_network?>";
const id_network = "<?= $id_network ?? null ?>";
const ne = "<?=$network_agent_id ?? null ?>"
$('input[name="daterange"]').daterangepicker({
opens: 'left',
autoUpdateInput: false,