|
|
|
@ -39,12 +39,39 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|
|
|
|
</div>
|
|
|
|
|
<!-- /.box-header -->
|
|
|
|
|
<!-- form start -->
|
|
|
|
|
<form role="form" id="walletForm">
|
|
|
|
|
<form id="sheet-form">
|
|
|
|
|
<div class="box-body">
|
|
|
|
|
<div class="row" style="margin-bottom: 30px">
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label><?= $this->lang->line('one_insured')?></label>
|
|
|
|
|
<select class="form-control" name="insured_id" required>
|
|
|
|
|
<option value="" selected disabled> Choisissez l'assuré</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group" id="patient">
|
|
|
|
|
<label>Patient</label>
|
|
|
|
|
<select class="form-control" name="beneficiary_id" required>
|
|
|
|
|
<option value="" selected disabled> Choisissez le patient</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="patient-details">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label><?= $this->lang->line('patient_lastname')?></label>
|
|
|
|
|
<input class="form-control" name="patient_lastname" required>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label><?= $this->lang->line('patient_firstname')?></label>
|
|
|
|
|
<input class="form-control" name="patient_firstname">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label><?= $this->lang->line('practitioner_lastname')?></label>
|
|
|
|
|
<input class="form-control" name="practitioner_lastname">
|
|
|
|
|
<input class="form-control" name="practitioner_lastname" required>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label><?= $this->lang->line('practitioner_firstname')?></label>
|
|
|
|
@ -52,19 +79,25 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label>Classification</label>
|
|
|
|
|
<input class="form-control" name="practitioner_firstname">
|
|
|
|
|
<select required class="form-control" name="practitioner_provider_class_id">
|
|
|
|
|
<?php foreach ($provider_classes->result() as $row) { ?>
|
|
|
|
|
<option value="<?=$row->id ?>"> <?= $row->name ?></option>
|
|
|
|
|
<?php } ?>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label><?= $this->lang->line('care_condition')?></label>
|
|
|
|
|
<label>
|
|
|
|
|
<select class="form-control" name="care_condition">
|
|
|
|
|
<select class="form-control" name="care_condition" required>
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group mt-2" style="overflow-x:auto;">
|
|
|
|
|
<div class="table-title">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-sm-8">
|
|
|
|
@ -73,24 +106,26 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|
|
|
|
</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'); ?>
|
|
|
|
|
class="fa fa-plus"></i> <?php echo $this->lang->line('new_prestation'); ?>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<table id="user_wallet_wallet" class="table table-bordered">
|
|
|
|
|
<table id="prestations" class="table table-bordered">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>Min</th>
|
|
|
|
|
<th>Max</th>
|
|
|
|
|
<th><?php echo $this->lang->line('rate'); ?> (%)</th>
|
|
|
|
|
<th><?php echo $this->lang->line('act_code'); ?> </th>
|
|
|
|
|
<th><?php echo $this->lang->line('Montant'); ?></th>
|
|
|
|
|
<th><?= $this->lang->line('moderator_ticket'); ?></th>
|
|
|
|
|
<th><?= $this->lang->line('insurance_amount'); ?></th>
|
|
|
|
|
<th><?= $this->lang->line('home_visit_fees'); ?></th>
|
|
|
|
|
<th>Actions</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<?php
|
|
|
|
|
if (isset($plr_user_wallet_wallet)) {
|
|
|
|
|
foreach ($plr_user_wallet_wallet->result() as $row) {
|
|
|
|
|
if (isset($plr_prestations)) {
|
|
|
|
|
foreach ($plr_prestations->result() as $row) {
|
|
|
|
|
echo "<tr>
|
|
|
|
|
<td>" . $row->min . "</td>
|
|
|
|
|
<td>" . $row->max . "</td>
|
|
|
|
@ -107,50 +142,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|
|
|
|
</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"></i></a>
|
|
|
|
|
<a class="edit edit7" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>
|
|
|
|
|
<a class="delete delete7" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group" style="overflow-x:auto;">
|
|
|
|
|
<div class="form-group mt-4" style="overflow-x:auto;">
|
|
|
|
|
<div class="table-title">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-sm-8">
|
|
|
|
@ -158,33 +150,33 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|
|
|
|
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 type="button" class="btn btn-info add-new new2"><i
|
|
|
|
|
class="fa fa-plus"></i> <?php echo $this->lang->line('new_exam'); ?>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<table id="user_wallet_wallet_national" class="table table-bordered">
|
|
|
|
|
<table id="exams" class="table table-bordered">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>Min</th>
|
|
|
|
|
<th>Max</th>
|
|
|
|
|
<th><?php echo $this->lang->line('rate'); ?> (%)</th>
|
|
|
|
|
<th><?= $this->lang->line('exam_class'); ?></th>
|
|
|
|
|
<th><?= $this->lang->line('exam_description'); ?></th>
|
|
|
|
|
<th><?= $this->lang->line('quantity'); ?></th>
|
|
|
|
|
<th>Actions</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<?php
|
|
|
|
|
if (isset($plr_user_wallet_wallet_national)) {
|
|
|
|
|
foreach ($plr_user_wallet_wallet_national->result() as $row) {
|
|
|
|
|
if (isset($plr_prescriptions)) {
|
|
|
|
|
foreach ($plr_prescriptions->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"></i></a>
|
|
|
|
|
<a class="edit edit7" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>
|
|
|
|
|
<a class="delete delete7" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>
|
|
|
|
|
<a class="add add2" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>
|
|
|
|
|
<a class="edit edit2" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>
|
|
|
|
|
<a class="delete delete2" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>';
|
|
|
|
|
}
|
|
|
|
@ -193,6 +185,55 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group mt-4" 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 new3"><i
|
|
|
|
|
class="fa fa-plus"></i> <?php echo $this->lang->line('new_prescription'); ?>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<table id="prescriptions" class="table table-bordered">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th><?= $this->lang->line('drugs_or_device'); ?></th>
|
|
|
|
|
<th><?= $this->lang->line('dosage'); ?></th>
|
|
|
|
|
<th><?= $this->lang->line('quantity'); ?></th>
|
|
|
|
|
<th>Actions</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<?php
|
|
|
|
|
if (isset($plr_prescriptions)) {
|
|
|
|
|
foreach ($plr_prescriptions->result() as $row) {
|
|
|
|
|
echo "<tr>
|
|
|
|
|
<td>" . $row->min . "</td>
|
|
|
|
|
<td>" . $row->max . "</td>
|
|
|
|
|
<td>" . $row->taux . "</td>" . '
|
|
|
|
|
<td>
|
|
|
|
|
<a class="add add3" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>
|
|
|
|
|
<a class="edit edit3" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>
|
|
|
|
|
<a class="delete delete3" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label><?= $this->lang->line('mot de passe')?></label>
|
|
|
|
|
<input type="password" class="form-control" name="password" required>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- /.box-body -->
|
|
|
|
|
|
|
|
|
@ -240,80 +281,170 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|
|
|
|
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()) {
|
|
|
|
|
$(document).ready(function (){
|
|
|
|
|
$('#patient').hide();
|
|
|
|
|
$('#patient-details').hide();
|
|
|
|
|
// Get The Data
|
|
|
|
|
const insured = JSON.parse(sessionStorage.getItem('insured'));
|
|
|
|
|
if(insured && Array.isArray(insured)){
|
|
|
|
|
var currentInsurance = null
|
|
|
|
|
// console.log('insured', insured)
|
|
|
|
|
// insured.each()
|
|
|
|
|
$.each(insured, function (i, item) {
|
|
|
|
|
$('#sheet-form').find('select[name="insured_id"]').append($('<option>', {
|
|
|
|
|
value: item.insured_id,
|
|
|
|
|
text : item.insured_id+' - '+item.user.lastname +' '+(item.user.firstname || '')
|
|
|
|
|
}));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('#sheet-form').find('select[name="insured_id"]').change(function () {
|
|
|
|
|
const insurance = insured.filter(i => i.insured_id === $(this).val());
|
|
|
|
|
$.each(insurance, function (i, item) {
|
|
|
|
|
currentInsurance = item;
|
|
|
|
|
$('#sheet-form').find('select[name="beneficiary_id"]').append($('<optgroup>', {
|
|
|
|
|
label: 'Assuré principal',
|
|
|
|
|
}));
|
|
|
|
|
$('#sheet-form').find('select[name="beneficiary_id"]').append($('<option>', {
|
|
|
|
|
value: 0,
|
|
|
|
|
text : item.user.lastname +' '+(item.user.firstname || '')
|
|
|
|
|
}));
|
|
|
|
|
$('#sheet-form').find('select[name="beneficiary_id"]').append($('<optgroup>', {
|
|
|
|
|
label: 'Ayants droits',
|
|
|
|
|
}));
|
|
|
|
|
$.each(item.beneficiaries, function (j, it) {
|
|
|
|
|
$('#sheet-form').find('select[name="beneficiary_id"]').append($('<option>', {
|
|
|
|
|
value: it.id,
|
|
|
|
|
text : it.lastname +' '+it.firstname
|
|
|
|
|
}));
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
$('#patient').show();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('#sheet-form').find('select[name="beneficiary_id"]').change(function () {
|
|
|
|
|
var val = parseInt($(this).val());
|
|
|
|
|
|
|
|
|
|
if(val === 0){
|
|
|
|
|
$('#sheet-form').find('input[name="patient_lastname"]').val(currentInsurance.user.lastname)
|
|
|
|
|
$('#sheet-form').find('input[name="patient_firstname"]').val(currentInsurance.user.firstname)
|
|
|
|
|
}else{
|
|
|
|
|
const b = currentInsurance.beneficiaries.filter(i => i.id === val);
|
|
|
|
|
$('#sheet-form').find('input[name="patient_lastname"]').val(b[0].lastname)
|
|
|
|
|
$('#sheet-form').find('input[name="patient_firstname"]').val(b[0].firstname)
|
|
|
|
|
}
|
|
|
|
|
$('#patient-details').show();
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
history.back()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#sheet-form").submit(function(e){
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
|
|
// Paliers
|
|
|
|
|
var plr_user_wallet_wallet = [];
|
|
|
|
|
var prestations = [];
|
|
|
|
|
var exams = [];
|
|
|
|
|
var prescriptions = [];
|
|
|
|
|
|
|
|
|
|
var plr_user_wallet_wallet_national = [];
|
|
|
|
|
|
|
|
|
|
$('#user_wallet_wallet tr').has('td').each(function () {
|
|
|
|
|
$('#prestations tr').has('td').each(function () {
|
|
|
|
|
var arrayItem = {};
|
|
|
|
|
$('td', $(this)).each(function (index, item) {
|
|
|
|
|
if (index < 3)
|
|
|
|
|
arrayItem[index] = parseFloat($(item).html());
|
|
|
|
|
if (index === 0)
|
|
|
|
|
arrayItem['act_id'] = $(item).attr('value');
|
|
|
|
|
if (index === 1)
|
|
|
|
|
arrayItem['amount'] = parseFloat($(item).html());
|
|
|
|
|
if (index === 4)
|
|
|
|
|
arrayItem['home_visit_fees'] = parseFloat($(item).html()) || null;
|
|
|
|
|
});
|
|
|
|
|
plr_user_wallet_wallet.push(arrayItem);
|
|
|
|
|
prestations.push(arrayItem);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#user_wallet_wallet_national tr').has('td').each(function () {
|
|
|
|
|
$('#exams tr').has('td').each(function () {
|
|
|
|
|
var arrayItem = {};
|
|
|
|
|
$('td', $(this)).each(function (index, item) {
|
|
|
|
|
if (index < 3)
|
|
|
|
|
arrayItem[index] = parseFloat($(item).html());
|
|
|
|
|
if (index === 0)
|
|
|
|
|
arrayItem['act_id'] = $(item).attr('value');
|
|
|
|
|
if (index === 1)
|
|
|
|
|
arrayItem['description'] = $(item).html();
|
|
|
|
|
if (index === 2)
|
|
|
|
|
arrayItem['quantity'] = parseFloat($(item).html());
|
|
|
|
|
});
|
|
|
|
|
plr_user_wallet_wallet_national.push(arrayItem);
|
|
|
|
|
exams.push(arrayItem);
|
|
|
|
|
});
|
|
|
|
|
$('#prescriptions tr').has('td').each(function () {
|
|
|
|
|
var arrayItem = {};
|
|
|
|
|
$('td', $(this)).each(function (index, item) {
|
|
|
|
|
if (index === 0)
|
|
|
|
|
arrayItem['drug_or_device_id'] = $(item).attr('value');
|
|
|
|
|
if (index === 1)
|
|
|
|
|
arrayItem['dosage'] = $(item).html();
|
|
|
|
|
if (index === 2)
|
|
|
|
|
arrayItem['quantity'] = parseFloat($(item).html());
|
|
|
|
|
});
|
|
|
|
|
prescriptions.push(arrayItem);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if(prestations.length === 0){
|
|
|
|
|
return toastr.error("Vous devez saisir au moins une prestation", "<?php echo $this->lang->line('request_error')?>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var unindexed_array = $(this).serializeArray();
|
|
|
|
|
var indexed_array = {};
|
|
|
|
|
|
|
|
|
|
$.map(unindexed_array, function(n, i){
|
|
|
|
|
indexed_array[n['name']] = n['value'];
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
indexed_array.beneficiary_id = parseInt(indexed_array.beneficiary_id) === 0 ? null : indexed_array.beneficiary_id;
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '<?php echo base_url('Gestion/config_wallet/update')?>',
|
|
|
|
|
url: '<?php echo base_url('NanoHealthController/saveHealthCareSheetConsultation')?>',
|
|
|
|
|
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,
|
|
|
|
|
...indexed_array, "network_agent_id" : "<?= $network_agent_id ?>",
|
|
|
|
|
"performances": prestations, "exams": exams, "prescriptions": prescriptions,
|
|
|
|
|
},
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data == '200') {
|
|
|
|
|
if(data.status === 200){
|
|
|
|
|
Swal.fire({
|
|
|
|
|
icon: 'success',
|
|
|
|
|
title: "<?php echo $this->lang->line('wallet_update')?>",
|
|
|
|
|
text: "<?php echo $this->lang->line('informations_updated')?>",
|
|
|
|
|
title: "<?= $this->lang->line('drug_and_device_updated')?>",
|
|
|
|
|
text:"<?= $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')?>");
|
|
|
|
|
toastr.error(data.error , "<?= $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 () {
|
|
|
|
|
|
|
|
|
|
function getActsOptions(selectedValue) {
|
|
|
|
|
var actsOptions = '';
|
|
|
|
|
<?php foreach ($acts->result() as $a ) {?>
|
|
|
|
|
var id = <?= $a->id ?>;
|
|
|
|
|
var selected = id === parseInt(selectedValue) ? 'selected' : '';
|
|
|
|
|
actsOptions += (`<option value=<?= $a->id ?> ${selected} > <?= $a->name ?> </option>`);
|
|
|
|
|
<?php } ?>
|
|
|
|
|
return actsOptions;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$('[data-toggle="tooltip"]').tooltip();
|
|
|
|
|
var actions1 = $("#user_wallet_wallet td:last-child").html();
|
|
|
|
|
|
|
|
|
|
var actions1 = $("#prestations td:last-child").html();
|
|
|
|
|
// Append table with add row form on add new button click
|
|
|
|
|
$(".new1").click(function () {
|
|
|
|
|
if (!actions1) {
|
|
|
|
@ -322,42 +453,30 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|
|
|
|
' <a class="delete delete1" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>';
|
|
|
|
|
}
|
|
|
|
|
$(this).attr("disabled", "disabled");
|
|
|
|
|
var index = $("#user_wallet_wallet tbody tr:last-child").index();
|
|
|
|
|
var index = $("#prestations 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>' +
|
|
|
|
|
'<select required class="form-control" name="act_id" >' +
|
|
|
|
|
getActsOptions(null)+
|
|
|
|
|
'</select>' +
|
|
|
|
|
'</td>' +
|
|
|
|
|
'<td><input type="number" required class="form-control" name="amount" min="0"></td>' +
|
|
|
|
|
'<td><input class="form-control" name="moderator_ticket" disabled></td>' +
|
|
|
|
|
'<td><input class="form-control" name="insurance_amount" disabled ></td>' +
|
|
|
|
|
'<td><input type="number" class="form-control" name="home_visit_fees" min="0"></td>' +
|
|
|
|
|
'<td> ' + actions1 + '</td>' +
|
|
|
|
|
'</tr>';
|
|
|
|
|
$("#user_wallet_wallet").append(row);
|
|
|
|
|
$("#user_wallet_wallet tbody tr").eq(index + 1).find(".add, .edit").toggle();
|
|
|
|
|
$("#prestations").append(row);
|
|
|
|
|
$("#prestations 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());
|
|
|
|
|
var input = $(this).parents("tr").find('input');
|
|
|
|
|
var select = $(this).parents("tr").find('select');
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
@ -365,7 +484,6 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|
|
|
|
} else {
|
|
|
|
|
$(this).removeClass("error");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$(this).parents("tr").find(".error").first().focus();
|
|
|
|
|
if (!empty) {
|
|
|
|
@ -375,16 +493,24 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|
|
|
|
$(this).parents("tr").find(".add, .edit").toggle();
|
|
|
|
|
$(".new1").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", ".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() + '">');
|
|
|
|
|
$(this).html('<select class="form-control" name="act_id" required >'+ getActsOptions($(this).attr("value"))+ '</select>');
|
|
|
|
|
if (index == 1)
|
|
|
|
|
$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">');
|
|
|
|
|
$(this).html('<input type="number" required class="form-control" name="amount" min="0" value="' + $(this).text() + '">');
|
|
|
|
|
if (index == 2)
|
|
|
|
|
$(this).html('<input type="number" required class="form-control" min="0" value="' + $(this).text() + '">');
|
|
|
|
|
$(this).html('<input class="form-control" name="moderator_ticket" disabled value="' + $(this).text() + '">');
|
|
|
|
|
if (index == 3)
|
|
|
|
|
$(this).html('<input class="form-control" name="insurance_amount" disabled value="' + $(this).text() + '">');
|
|
|
|
|
if (index == 4)
|
|
|
|
|
$(this).html('<input type="number" class="form-control" name="home_visit_fees" min="0" value="' + $(this).text() + '">');
|
|
|
|
|
});
|
|
|
|
|
$(this).parents("tr").find(".add, .edit").toggle();
|
|
|
|
|
$(".new1").attr("disabled", "disabled");
|
|
|
|
@ -395,55 +521,39 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|
|
|
|
$(".new1").removeAttr("disabled");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Table Examens
|
|
|
|
|
|
|
|
|
|
// Paliers nationaux
|
|
|
|
|
|
|
|
|
|
// Table 7
|
|
|
|
|
var actions7 = $("#user_wallet_wallet_national td:last-child").html();
|
|
|
|
|
var actions2 = $("#exams 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"></i></a>\n' +
|
|
|
|
|
' <a class="edit edit7" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>\n' +
|
|
|
|
|
' <a class="delete delete7" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>';
|
|
|
|
|
$(".new2").click(function () {
|
|
|
|
|
if (!actions2) {
|
|
|
|
|
actions2 = '<a class="add add2" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>\n' +
|
|
|
|
|
' <a class="edit edit2" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>\n' +
|
|
|
|
|
' <a class="delete delete2" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>';
|
|
|
|
|
}
|
|
|
|
|
$(this).attr("disabled", "disabled");
|
|
|
|
|
var index = $("#user_wallet_wallet_national tbody tr:last-child").index();
|
|
|
|
|
var index = $("#exams 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>' +
|
|
|
|
|
'<td>' +
|
|
|
|
|
'<select required class="form-control" name="act_id" >' +
|
|
|
|
|
getActsOptions(null)+
|
|
|
|
|
'</select>' +
|
|
|
|
|
'</td>' +
|
|
|
|
|
'<td><input class="form-control" name="description"></td>' +
|
|
|
|
|
'<td><input class="form-control" name="quantity" min="1" step="1" type="number"></td>' +
|
|
|
|
|
'<td> ' + actions2 + '</td>' +
|
|
|
|
|
'</tr>';
|
|
|
|
|
$("#user_wallet_wallet_national").append(row);
|
|
|
|
|
$("#user_wallet_wallet_national tbody tr").eq(index + 1).find(".add, .edit").toggle();
|
|
|
|
|
$("#exams").append(row);
|
|
|
|
|
$("#exams tbody tr").eq(index + 1).find(".add, .edit").toggle();
|
|
|
|
|
$('[data-toggle="tooltip"]').tooltip();
|
|
|
|
|
});
|
|
|
|
|
// Add row on add button click
|
|
|
|
|
$(document).on("click", ".add7", function () {
|
|
|
|
|
$(document).on("click", ".add2", 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());
|
|
|
|
|
var input = $(this).parents("tr").find('input');
|
|
|
|
|
var select = $(this).parents("tr").find('select');
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
@ -451,7 +561,6 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|
|
|
|
} else {
|
|
|
|
|
$(this).removeClass("error");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$(this).parents("tr").find(".error").first().focus();
|
|
|
|
|
if (!empty) {
|
|
|
|
@ -459,26 +568,114 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|
|
|
|
$(this).parent("td").html($(this).val());
|
|
|
|
|
});
|
|
|
|
|
$(this).parents("tr").find(".add, .edit").toggle();
|
|
|
|
|
$(".new7").removeAttr("disabled");
|
|
|
|
|
$(".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", ".edit7", function () {
|
|
|
|
|
$(document).on("click", ".edit2", 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() + '">');
|
|
|
|
|
$(this).html('<select class="form-control" name="act_id" required >'+ getActsOptions($(this).attr("value"))+ '</select>');
|
|
|
|
|
if (index == 1)
|
|
|
|
|
$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">');
|
|
|
|
|
$(this).html('<input class="form-control" name="description" value="' + $(this).text() + '">');
|
|
|
|
|
if (index == 2)
|
|
|
|
|
$(this).html('<input type="number" required class="form-control" min="0" value="' + $(this).text() + '">');
|
|
|
|
|
$(this).html('<input class="form-control" name="quantity" min="1" step="1" value="' + $(this).text() + '">');
|
|
|
|
|
});
|
|
|
|
|
$(this).parents("tr").find(".add, .edit").toggle();
|
|
|
|
|
$(".new7").attr("disabled", "disabled");
|
|
|
|
|
$(".new2").attr("disabled", "disabled");
|
|
|
|
|
});
|
|
|
|
|
// Delete row on delete button click
|
|
|
|
|
$(document).on("click", ".delete7", function () {
|
|
|
|
|
$(document).on("click", ".delete2", function () {
|
|
|
|
|
$(this).parents("tr").remove();
|
|
|
|
|
$(".new7").removeAttr("disabled");
|
|
|
|
|
$(".new2").removeAttr("disabled");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Table prescription
|
|
|
|
|
|
|
|
|
|
function getDrugAndDevicesOptions(selectedValue) {
|
|
|
|
|
var actsOptions = '';
|
|
|
|
|
<?php foreach ($drugs_and_devices->result() as $a ) {?>
|
|
|
|
|
var id = <?= $a->id ?>;
|
|
|
|
|
var selected = id === parseInt(selectedValue) ? 'selected' : '';
|
|
|
|
|
actsOptions += (`<option value=<?= $a->id ?> ${selected} > <?= $a->name ?> </option>`);
|
|
|
|
|
<?php } ?>
|
|
|
|
|
return actsOptions;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Table prescriptions
|
|
|
|
|
var actions3 = $("#prescriptions td:last-child").html();
|
|
|
|
|
// Append table with add row form on add new button click
|
|
|
|
|
$(".new3").click(function () {
|
|
|
|
|
if (!actions3) {
|
|
|
|
|
actions3 = '<a class="add add3" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>\n' +
|
|
|
|
|
' <a class="edit edit3" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>\n' +
|
|
|
|
|
' <a class="delete delete3" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>';
|
|
|
|
|
}
|
|
|
|
|
$(this).attr("disabled", "disabled");
|
|
|
|
|
var index = $("#prescriptions tbody tr:last-child").index();
|
|
|
|
|
var row = '<tr>' +
|
|
|
|
|
'<td>' +
|
|
|
|
|
'<select required class="form-control" name="drug_or_device_id" >' +
|
|
|
|
|
getDrugAndDevicesOptions(null)+
|
|
|
|
|
'</select>' +
|
|
|
|
|
'</td>' +
|
|
|
|
|
'<td><input required class="form-control" name="dosage" ></td>' +
|
|
|
|
|
'<td><input type="number" required class="form-control" min="1" step="1" name="quantity"></td>' +
|
|
|
|
|
'<td> ' + actions3 + '</td>' +
|
|
|
|
|
'</tr>';
|
|
|
|
|
$("#prescriptions").append(row);
|
|
|
|
|
$("#prescriptions tbody tr").eq(index + 1).find(".add, .edit").toggle();
|
|
|
|
|
$('[data-toggle="tooltip"]').tooltip();
|
|
|
|
|
});
|
|
|
|
|
// Add row on add button click
|
|
|
|
|
$(document).on("click", ".add3", function () {
|
|
|
|
|
var empty = false;
|
|
|
|
|
var input = $(this).parents("tr").find('input');
|
|
|
|
|
var select = $(this).parents("tr").find('select');
|
|
|
|
|
|
|
|
|
|
input.each(function () {
|
|
|
|
|
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();
|
|
|
|
|
$(".new3").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", ".edit3", function () {
|
|
|
|
|
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
|
|
|
|
|
if (index == 0)
|
|
|
|
|
$(this).html('<select class="form-control" name="drug_or_device_id" required >'+ getDrugAndDevicesOptions($(this).attr("value"))+ '</select>');
|
|
|
|
|
if (index == 1)
|
|
|
|
|
$(this).html('<input required class="form-control" name="dosage" value="' + $(this).text() + '">');
|
|
|
|
|
if (index == 2)
|
|
|
|
|
$(this).html('<input type="number" required class="form-control" name="quantity" min="1" step="1" value="' + $(this).text() + '">');
|
|
|
|
|
});
|
|
|
|
|
$(this).parents("tr").find(".add, .edit").toggle();
|
|
|
|
|
$(".new3").attr("disabled", "disabled");
|
|
|
|
|
});
|
|
|
|
|
// Delete row on delete button click
|
|
|
|
|
$(document).on("click", ".delete3", function () {
|
|
|
|
|
$(this).parents("tr").remove();
|
|
|
|
|
$(".new3").removeAttr("disabled");
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|