Add Agent panel

This commit is contained in:
Djery-Tom 2021-12-22 10:08:33 +01:00
parent 783dd3dea1
commit a136faf988
6 changed files with 527 additions and 219 deletions

View File

@ -28,7 +28,33 @@ class Agent extends CI_Controller
$data['network'] = $this->session->userdata('network'); $data['network'] = $this->session->userdata('network');
$data['code_parrain'] = $this->session->userdata('parrain'); $data['code_parrain'] = $this->session->userdata('parrain');
$data['network_agent_id'] = $this->session->userdata('network_agent_id'); $data['network_agent_id'] = $this->session->userdata('network_agent_id');
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
if ($this->input->get('history')) {
if($this->input->get('id') !== null){
$history = $this->input->get('history');
if($history == 'insurance-health_care_sheets'){
$data['active'] = "health_care_sheets";
$data['health_care_sheet_id'] = $this->input->get('id');
$data['health_care_sheet'] = $this->nano_health_model->getInfosHealthCareSheetById($this->input->get('id'));
$data['performances'] = $this->nano_health_model->getHealthCareSheetPerformances($data['health_care_sheet']->id ?? null);
$data['exams'] = $this->nano_health_model->getHealthCareSheetExams($data['health_care_sheet']->id ?? null);
$data['prescriptions'] = $this->nano_health_model->getHealthCareSheetPrescriptions($data['health_care_sheet']->id ?? null);
$this->load->view('header_agent', $data);
$this->load->view('nano_health/hyper/infos_health_care_sheet');
}
$this->load->view('footer');
return;
}else{
// $this->historique($id_network, $this->input->get('d'), $this->input->get('f'), $this->input->get('history'), $this->input->get('parrainId'));
}
}else if($this->input->get('action')) {
$this->load->view('header_agent', $data);
$this->load->view('nano_health/agent/health_care_sheet_form');
$this->load->view('footer');
}else{
$startDate = $this->input->get('d'); $startDate = $this->input->get('d');
$endDate = $this->input->get('f'); $endDate = $this->input->get('f');
@ -37,12 +63,12 @@ class Agent extends CI_Controller
$data['endDate'] = $endDate ? date($format, strtotime($endDate)) : null; $data['endDate'] = $endDate ? date($format, strtotime($endDate)) : null;
$endDate = Date('Y-m-d', strtotime($endDate . "+1 day")); $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('header_agent', $data);
$this->load->view('nano_health/hyper/insurances_health_care_sheets'); $this->load->view('nano_health/hyper/insurances_health_care_sheets');
$this->load->view('footer'); $this->load->view('footer');
} }
} }
}
// Wallet // Wallet

View File

@ -821,4 +821,5 @@ $lang['subscription_resubmitted'] = "The subscription has been resubmitted";
$lang['insurance_part'] = "Insurance share"; $lang['insurance_part'] = "Insurance share";
$lang['insurance_part'] = "Insurance share"; $lang['insurance_part'] = "Insurance share";
$lang['consultation_id'] = "Consulation ID"; $lang['consultation_id'] = "Consulation ID";
$lang['new_care_sheet'] = "Enter a care sheet";
?> ?>

View File

@ -832,4 +832,5 @@ $lang['subscription_resubmitted'] = "La souscription a été re-soumise";
$lang['insurance_part'] = "Part de l'assurance"; $lang['insurance_part'] = "Part de l'assurance";
$lang['insurance_part'] = "Part de l'assurance"; $lang['insurance_part'] = "Part de l'assurance";
$lang['consultation_id'] = "ID de la consultation"; $lang['consultation_id'] = "ID de la consultation";
$lang['new_care_sheet'] = "Saisir une feuille de soins";
?> ?>

View File

@ -0,0 +1,484 @@
<link rel="stylesheet"
href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>">
<link rel="stylesheet"
href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
<link rel="stylesheet" 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
use Brick\Money\Context\CustomContext;
use Brick\Money\Money;
$context = new \Brick\Money\Context\AutoContext();
$fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?php echo $this->lang->line('new_care_sheet') ?>
</h1>
</section>
<section class="content">
<div class="row">
<!-- left column -->
<div class="col-md-12">
<!-- general form elements -->
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">Formulaire</h3>
</div>
<!-- /.box-header -->
<!-- form start -->
<form role="form" id="walletForm">
<div class="box-body">
<div class="form-group">
<label><?= $this->lang->line('practitioner_lastname')?></label>
<input class="form-control" name="practitioner_lastname">
</div>
<div class="form-group">
<label><?= $this->lang->line('practitioner_firstname')?></label>
<input class="form-control" name="practitioner_firstname">
</div>
<div class="form-group">
<label>Classification</label>
<input class="form-control" name="practitioner_firstname">
</div>
<div class="form-group">
<label><?= $this->lang->line('care_condition')?></label>
<label>
<select class="form-control" name="care_condition">
<option value="CURRENT_AFFECTION"> <?= $this->lang->line('CURRENT_AFFECTION')?></option>
<option value="LONG_TERM_AFFECTION"> <?= $this->lang->line('LONG_TERM_AFFECTION')?></option>
<option value="EXONERATION"> <?= $this->lang->line('EXONERATION')?></option>
</select>
</label>
</div>
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?php echo $this->lang->line('performances'); ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new1"><i
class="fa fa-plus"></i> <?php echo $this->lang->line('new_level'); ?>
</button>
</div>
</div>
</div>
<table id="user_wallet_wallet" class="table table-bordered">
<thead>
<tr>
<th>Min</th>
<th>Max</th>
<th><?php echo $this->lang->line('rate'); ?> (%)</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if (isset($plr_user_wallet_wallet)) {
foreach ($plr_user_wallet_wallet->result() as $row) {
echo "<tr>
<td>" . $row->min . "</td>
<td>" . $row->max . "</td>
<td>" . $row->taux . "</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>
<a class="delete delete1" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?php echo $this->lang->line('medical_prescriptions'); ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new7"><i
class="fa fa-plus"></i> <?php echo $this->lang->line('new_level'); ?>
</button>
</div>
</div>
</div>
<table id="user_wallet_wallet_national" class="table table-bordered">
<thead>
<tr>
<th>Min</th>
<th>Max</th>
<th><?php echo $this->lang->line('rate'); ?> (%)</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if (isset($plr_user_wallet_wallet_national)) {
foreach ($plr_user_wallet_wallet_national->result() as $row) {
echo "<tr>
<td>" . $row->min . "</td>
<td>" . $row->max . "</td>
<td>" . $row->taux . "</td>" . '
<td>
<a class="add add7" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit7" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
<a class="delete delete7" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?php echo $this->lang->line('exams'); ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new7"><i
class="fa fa-plus"></i> <?php echo $this->lang->line('new_level'); ?>
</button>
</div>
</div>
</div>
<table id="user_wallet_wallet_national" class="table table-bordered">
<thead>
<tr>
<th>Min</th>
<th>Max</th>
<th><?php echo $this->lang->line('rate'); ?> (%)</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if (isset($plr_user_wallet_wallet_national)) {
foreach ($plr_user_wallet_wallet_national->result() as $row) {
echo "<tr>
<td>" . $row->min . "</td>
<td>" . $row->max . "</td>
<td>" . $row->taux . "</td>" . '
<td>
<a class="add add7" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit7" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
<a class="delete delete7" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<button type="submit" class="btn btn-primary"><?php echo $this->lang->line('save'); ?></button>
<!-- <button type="button" class="btn btn-default pull-left"-->
<!-- data-dismiss="modal">--><?php //echo $this->lang->line('Fermer'); ?><!--</button>-->
</div>
</form>
</div>
<!-- /.box -->
</div>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
<script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
<!-- ChartJS -->
<script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script>
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
<script>
toastr.options.closeButton = true;
toastr.options.closeMethod = 'fadeOut';
toastr.options.closeDuration = 5000;
toastr.options.closeEasing = 'swing';
$('#updateWallet').click(function () {
const network_id = $(this).data('network-id');
const id_config = $(this).data('id-config');
if ($('#walletForm')[0].checkValidity()) {
// Paliers
var plr_user_wallet_wallet = [];
var plr_user_wallet_wallet_national = [];
$('#user_wallet_wallet tr').has('td').each(function () {
var arrayItem = {};
$('td', $(this)).each(function (index, item) {
if (index < 3)
arrayItem[index] = parseFloat($(item).html());
});
plr_user_wallet_wallet.push(arrayItem);
});
$('#user_wallet_wallet_national tr').has('td').each(function () {
var arrayItem = {};
$('td', $(this)).each(function (index, item) {
if (index < 3)
arrayItem[index] = parseFloat($(item).html());
});
plr_user_wallet_wallet_national.push(arrayItem);
});
$.ajax({
url: '<?php echo base_url('Gestion/config_wallet/update')?>',
type: 'POST',
dataType: 'json',
data: {
"type": "ilink",
"config":"user_wallet_wallet",
"network_id": network_id, "id_config": id_config,
"plr_user_wallet_wallet": plr_user_wallet_wallet,
"plr_user_wallet_wallet_national": plr_user_wallet_wallet_national,
},
success: function (data) {
if (data == '200') {
Swal.fire({
icon: 'success',
title: "<?php echo $this->lang->line('wallet_update')?>",
text: "<?php echo $this->lang->line('informations_updated')?>",
timer: 3000
}).then(() => {
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" :
} else {
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
}
});
} else {
$('#walletForm')[0].reportValidity();
}
});
</script>
<script type="text/javascript">
// Paliers scripts
$(document).ready(function () {
$('[data-toggle="tooltip"]').tooltip();
var actions1 = $("#user_wallet_wallet td:last-child").html();
// Append table with add row form on add new button click
$(".new1").click(function () {
if (!actions1) {
actions1 = '<a class="add add1" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>\n' +
' <a class="edit edit1" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>\n' +
' <a class="delete delete1" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>';
}
$(this).attr("disabled", "disabled");
var index = $("#user_wallet_wallet tbody tr:last-child").index();
var row = '<tr>' +
'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' +
'<td><input type="number" required class="form-control" name="max" id="max"></td>' +
'<td><input type="number" required class="form-control" min="0" name="taux" id="taux"></td>' +
'<td> ' + actions1 + '</td>' +
'</tr>';
$("#user_wallet_wallet").append(row);
$("#user_wallet_wallet tbody tr").eq(index + 1).find(".add, .edit").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
$(document).on("click", ".add1", function () {
var empty = false;
var input = $(this).parents("tr").find('input[type="number"]');
var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val());
var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val());
input.each(function () {
if ($(this).attr('id') == 'min') {
if (min >= max) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else if ($(this).attr('id') == 'max') {
if (max <= min) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else {
if (!$(this)[0].checkValidity()) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
}
});
$(this).parents("tr").find(".error").first().focus();
if (!empty) {
input.each(function () {
$(this).parent("td").html($(this).val());
});
$(this).parents("tr").find(".add, .edit").toggle();
$(".new1").removeAttr("disabled");
}
});
// Edit row on edit button click
$(document).on("click", ".edit1", function () {
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
if (index == 0)
$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">');
if (index == 1)
$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">');
if (index == 2)
$(this).html('<input type="number" required class="form-control" min="0" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add, .edit").toggle();
$(".new1").attr("disabled", "disabled");
});
// Delete row on delete button click
$(document).on("click", ".delete1", function () {
$(this).parents("tr").remove();
$(".new1").removeAttr("disabled");
});
// Paliers nationaux
// Table 7
var actions7 = $("#user_wallet_wallet_national td:last-child").html();
// Append table with add row form on add new button click
$(".new7").click(function () {
if (!actions7) {
actions7 = '<a class="add add7" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE07B;</i></a>\n' +
' <a class="edit edit7" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>\n' +
' <a class="delete delete7" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>';
}
$(this).attr("disabled", "disabled");
var index = $("#user_wallet_wallet_national tbody tr:last-child").index();
var row = '<tr>' +
'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' +
'<td><input type="number" required class="form-control" name="max" id="max"></td>' +
'<td><input type="number" required class="form-control" name="taux" id="taux"></td>' +
'<td> ' + actions7 + '</td>' +
'</tr>';
$("#user_wallet_wallet_national").append(row);
$("#user_wallet_wallet_national tbody tr").eq(index + 1).find(".add, .edit").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
$(document).on("click", ".add7", function () {
var empty = false;
var input = $(this).parents("tr").find('input[type="number"]');
var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val());
var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val());
input.each(function () {
if ($(this).attr('id') == 'min') {
if (min >= max) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else if ($(this).attr('id') == 'max') {
if (max <= min) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else {
if (!$(this)[0].checkValidity()) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
}
});
$(this).parents("tr").find(".error").first().focus();
if (!empty) {
input.each(function () {
$(this).parent("td").html($(this).val());
});
$(this).parents("tr").find(".add, .edit").toggle();
$(".new7").removeAttr("disabled");
}
});
// Edit row on edit button click
$(document).on("click", ".edit7", function () {
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
if (index == 0)
$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">');
if (index == 1)
$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">');
if (index == 2)
$(this).html('<input type="number" required class="form-control" min="0" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add, .edit").toggle();
$(".new7").attr("disabled", "disabled");
});
// Delete row on delete button click
$(document).on("click", ".delete7", function () {
$(this).parents("tr").remove();
$(".new7").removeAttr("disabled");
});
});
</script>

View File

@ -1,206 +0,0 @@
<!-- 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

@ -44,7 +44,9 @@
<div class="box-header"> <div class="box-header">
<h3 class="box-title"><?= $this->lang->line('export_health_care_sheets_list') ?></h3> <h3 class="box-title"><?= $this->lang->line('export_health_care_sheets_list') ?></h3>
<div class="box-tools"> <div class="box-tools">
<a class="btn btn-primary" href="<?= current_url().('?action=new')?>">
<?= $this->lang->line('new_care_sheet'); ?>
</a>
</div> </div>
</div> </div>
<div class="box-body" style="overflow-x:auto;"> <div class="box-body" style="overflow-x:auto;">