Merge branch 'staging' into features/feature-facture-generated-state-and-sent-state

This commit is contained in:
Tiavina 2025-03-07 17:23:37 +03:00
commit b400430cbb
30 changed files with 464 additions and 201 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,75 @@
/*!
* Bootstrap backdrop.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap base-component.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap component-functions.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap config.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap data.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap event-handler.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap focustrap.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap index.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap manipulator.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap modal.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap scrollbar.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Bootstrap selector-engine.js v5.2.3 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
/*!
* Sizzle CSS Selector Engine v2.3.9
* https://sizzlejs.com/

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -36,7 +36,7 @@ date_default_timezone_set('Europe/Paris');
class PageController extends Controller {
private $idNextcloud;
private $myDb;
private Bdd $myDb;
// private $src_path = "/var/www/html/apps/gestion/img/";
private $src_path = "/var/www/html/custom_apps/gestion/img/";
@ -1129,7 +1129,7 @@ class PageController extends Controller {
* @NoCSRFRequired
*/
public function getFacturesWithProduits() {
$result = $this->myDb->getFacturesWithProduits($this->idNextcloud);
$result = $this->myDb->getFacturesWithProduits();
$this->refreshFEC();
return $result;
}
@ -1580,6 +1580,28 @@ class PageController extends Controller {
}
public function sendAttachmentToClientByDefunt($defuntId, $ff_pdf, $subject, $body, $addName = false){
$devis = $this->myDb->getDevisOfDefunt($defuntId);
if($devis != null){
try {
$client_email = $devis['client_mail'];
$client_nom = $devis['client_nom'];
$data = file_get_contents($ff_pdf);
$message = $this->mailer->createMessage();
$message->setTo(recipients: [$client_email => $client_nom]);
// $message->setFrom([$client_email => $client_nom]);
$content = $this->mailer->createAttachment($data,$ff_pdf,"x-pdf");
$message->attach($content);
$message->setSubject($subject);
$message->setPlainBody($addName ? $body." de ".$devis['defunt_nom']: $body);
$this->mailer->send($message);
return new DataResponse("", 200, ['Content-Type' => 'application/json']);
} catch (Exception $e) {
return new DataResponse("Is your global mail server configured in Nextcloud ?", 500, ['Content-Type' => 'application/json']);
}
}
}
/**
* @NoAdminRequired
* @NoCSRFRequired
@ -2005,7 +2027,7 @@ class PageController extends Controller {
* @NoCSRFRequired
* @param string $numdefunt
*/
public function saveRapportSoin($numdefunt){
public function saveRapportSoin($numdefunt, $isSendEmail = false){
$defaultConfig = json_decode($this->myDb->getConfiguration(BddConstant::DEFAULT_ADMIN_ID_NEXTCLOUD));
$defunt = json_decode($this->myDb->getOneDefunt($numdefunt, $this->idNextcloud))[0];
$observations = json_decode($this->myDb->getListObservations($numdefunt, $this->idNextcloud));
@ -2251,6 +2273,11 @@ class PageController extends Controller {
$file_pdf = $this->storage->get($ff_pdf);
$file_pdf->putContent($pdfContent);
if($ff_pdf != null && $isSendEmail){
//send email
$this->sendAttachmentToClientByDefunt($defunt->id, $ff_pdf, "Rapport soins", " Veuiller trouver ci-joint le rapport de soins de ".$nomDefunt.".");
}
$res = array();
$res['path'] = $folderDestination;
@ -2291,7 +2318,7 @@ class PageController extends Controller {
* @NoCSRFRequired
* @param string $numdefunt
*/
public function saveRapportBijoux($numdefunt,$withPhotos = false){
public function saveRapportBijoux($numdefunt,$withPhotos = false, $isSendEmail = false){
if($withPhotos != null && $withPhotos == 1){
$withPhotos = true;
}
@ -2428,6 +2455,11 @@ class PageController extends Controller {
$file_pdf = $this->storage->get($ff_pdf);
$file_pdf->putContent($pdfContent);
if($ff_pdf != null && $isSendEmail){
//send email
$this->sendAttachmentToClientByDefunt($defunt->id, $ff_pdf, "Rapport des bijoux", " Veuiller trouver ci-joint le rapport des bijoux de ".$nomDefunt.".");
}
$res = array();
$res['path'] = $folderDestination;
return json_encode($res);
@ -2636,9 +2668,13 @@ class PageController extends Controller {
* @param int $defuntId
*/
public function exportCareCertificate($defuntId){
public function exportCareCertificate($defuntId, $isSendEmail = false){
try{
$careCertificateFilename = $this->certificateService->generateCareCertificate($defuntId,$this->idNextcloud);
if($careCertificateFilename != null && $isSendEmail){
//send email
$this->sendAttachmentToClientByDefunt($defuntId, $careCertificateFilename, "Attestation de soins", " Veuiller trouver ci-joint l'attestation de soins ", true);
}
return $careCertificateFilename;
}
catch(\OCP\Files\NotFoundException $e) { }
@ -2781,9 +2817,14 @@ class PageController extends Controller {
* @param int $defuntId
*/
public function saveAttestationPacemaker($defuntId){
public function saveAttestationPacemaker($defuntId, $isSendEmail = false){
try{
$careCertificateFilename = $this->certificateService->generatePacemakerCertificate($defuntId,$this->idNextcloud);
if($careCertificateFilename != null && $isSendEmail){
//send email
$this->sendAttachmentToClientByDefunt($defuntId, $careCertificateFilename, "Attestation pacemaker", " Veuiller trouver ci-joint l'attestation de pacemaker ", true);
}
return $careCertificateFilename;
}
catch(\OCP\Files\NotFoundException $e) { }

View File

@ -263,7 +263,8 @@ class Bdd {
.$this->tableprefix."client.adresse as adresse_cli,".$this->tableprefix."client.mail as mail_cli,".$this->tableprefix."client.telephone as telephone_cli,".$this->tableprefix."client.legal_one as legalone_cli,"
.$this->tableprefix."client.fk_client_group_facturation_id as fk_client_group_facturation_id,"
.$this->tableprefix."thanato.nom as nom_thanato, ".$this->tableprefix."thanato.prenom as prenom_thanato, ".$this->tableprefix."thanato.id as tid, "
.$this->tableprefix."devis.num, ".$this->tableprefix."devis.date, ".$this->tableprefix."devis.version, ".$this->tableprefix."devis.mentions, "
.$this->tableprefix."devis.num, ".$this->tableprefix."devis.date, ".$this->tableprefix."devis.version, ".$this->tableprefix."devis.mentions, "
.$this->tableprefix."devis.order_number, ".$this->tableprefix."devis.case_number, "
.$this->tableprefix."lieu.id as lid, ".$this->tableprefix."lieu.nom as lieu,".$this->tableprefix."lieu.adresse as adresse_soin,".$this->tableprefix."devis.id_lieu, "
.$this->tableprefix."defunt.id as id_defunt, ".$this->tableprefix."defunt.nom as nom_defunt, "
.$this->tableprefix."devis.devis_full_number as devis_full_number
@ -348,6 +349,57 @@ class Bdd {
return json_encode($result);
}
public function getFacturesListWithDependencies(){
$sql = "SELECT
facture.id,
facture.user_id,
facture.num,
facture.date,
facture.fk_facture_status_key,
facture.fk_facture_payment_type_id,
facture.payment_date,
facture_payment_type.facture_payment_type_label,
facture_status.facture_status_label,
facture.facture_type,
facture.fk_client_id as facture_client_id,
facture.fk_client_group_facturation_id as facture_client_group_facturation_id,
facture.date_paiement,
facture.type_paiement,
facture.id_devis,
facture.version,
facture.status_paiement,
facture_client.nom as facture_client_name,
facture_client_group_facturation.group_facturation_name as facture_group_name,
devis.num as dnum,
devis.comment as dcomment,
client.entreprise,
client.nom,
client.prenom,
client.id as id_cli,
client.entreprise as client_entreprise,
client.fk_client_group_facturation_id as fk_client_group_facturation_id,
client.adresse as adresse_cli,client.mail as mail_cli,
client.telephone as telephone_cli,client.legal_one as legalone_cli,
client.fk_client_group_id as fk_client_group_id,
defunt.id as id_defunt,
defunt.nom as nom_defunt,
lieu.id as lid,
lieu.nom as lieu,
lieu.adresse as adresse_soin,devis.id_lieu
FROM ".$this->tableprefix."facture as facture
LEFT JOIN ".$this->tableprefix."devis as devis on facture.id_devis = devis.id
LEFT JOIN ".$this->tableprefix."lieu as lieu on devis.id_lieu = lieu.id
LEFT JOIN ".$this->tableprefix."client as client on devis.id_client = client.id
LEFT JOIN ".$this->tableprefix."defunt as defunt on devis.id_defunt = defunt.id
LEFT JOIN ".$this->tableprefix."facture_payment_type as facture_payment_type on facture.fk_facture_payment_type_id = facture_payment_type.id
LEFT JOIN ".$this->tableprefix."facture_status as facture_status on facture.fk_facture_status_key = facture_status.facture_status_key
LEFT JOIN ".$this->tableprefix."client as facture_client on facture.fk_client_id = facture_client.id
LEFT JOIN ".$this->tableprefix."client_group_facturation as facture_client_group_facturation on facture.fk_client_group_facturation_id = facture_client_group_facturation.id
ORDER BY facture.id DESC, facture.date_paiement DESC";
$result = $this->execSQL($sql, array());
return $result;
}
public function getFactures($idNextcloud){
$sql = "SELECT ".$this->tableprefix."facture.id, ".$this->tableprefix."facture.user_id, ".$this->tableprefix."facture.num, ".$this->tableprefix."facture.date, "
.$this->tableprefix."facture.fk_facture_status_key, ".$this->tableprefix."facture.fk_facture_payment_type_id, ".$this->tableprefix."facture.payment_date, "
@ -379,8 +431,8 @@ class Bdd {
return $result;
}
public function getFacturesWithProduits($idNextCloud){
$factures = $this->getFactures($idNextCloud);
public function getFacturesWithProduits(){
$factures = $this->getFacturesListWithDependencies();
$facturesList = json_decode($factures);
foreach($facturesList as $currentFacture){
$produits = $this->getProduitsDevisByDevisId($currentFacture->id_devis);
@ -3450,6 +3502,7 @@ class Bdd {
defunt.product_reference as defunt_product_reference,
client.nom as client_nom,
client.prenom as client_prenom,
client.mail as client_mail,
client.entreprise as client_entreprise,
client.adresse as client_adresse,
thanato.nom as thanato_nom,
@ -4424,7 +4477,9 @@ class Bdd {
facture.fk_client_id,
facture.fk_client_group_facturation_id,
facture.month,
facture.year
facture.year,
facture.facture_case_number,
facture.facture_order_number
FROM ".$this->tableprefix."facture as facture
WHERE facture.id = ? AND
facture.facture_type = ?

View File

@ -1,10 +1,11 @@
import "@nextcloud/dialogs/dist/index.css";
import Modal from 'bootstrap/js/dist/modal';
import "datatables.net-dt/css/jquery.dataTables.css";
import "../css/mycss.css";
import { globalConfiguration } from "./modules/mainFunction.mjs";
import "./listener/main_listener";
import { setDefuntCover, setDefuntPacemakerPhoto,setBijouxPhoto,getBibliotheques, getBijouxById, getHypodermiquesyId, getObservationsById, getproduits, saveAttestationPacemaker,exportCareCertificate, saveRapportBijoux, saveRapportSoin, updateDB } from "./modules/ajaxRequest.mjs";
import { getBibliotheques, exportCareCertificate,getBijouxById, getHypodermiquesyId, getObservationsById, getproduits, saveAttestationPacemaker, saveRapportBijoux, saveRapportSoin, setBijouxPhoto, setDefuntCover, setDefuntPacemakerPhoto, updateDB } from "./modules/ajaxRequest.mjs";
import { globalConfiguration } from "./modules/mainFunction.mjs";
let bibliotheques = [];
let sortedBibliotheques = [];
@ -99,14 +100,16 @@ window.addEventListener("DOMContentLoaded", function () {
break;
}
}
saveRapportBijoux({
numdefunt: defuntid,
withPhotos: selectedValue
});
$('#saveRapportBijouxModal').hide();
modalElement.data('export-type', 'rapport-bijoux')
modalElement.data('export-with-photos', selectedValue)
modalElement.modal('show')
// saveRapportBijoux({
// numdefunt: defuntid,
// withPhotos: selectedValue
// });
});
setDefuntCoverButton.addEventListener("click",function(){
const productCoverRadios = document.getElementsByName('coverProductsRadioButton');
@ -123,15 +126,57 @@ window.addEventListener("DOMContentLoaded", function () {
});
})
const modalElement = $('#confirmSendEmailModal')
const _ = new Modal(modalElement[0],{
backdrop: false
})
$('#valdateSendEmailModal').on('click', function(){
const type = modalElement.data('export-type')
const isSendEmail = $('#valueSendEmailModal').is(':checked')
switch(type){
case 'care-certificate':
exportCareCertificate({defuntId : defuntid, isSendEmail})
break;
case 'pacemaker':
saveAttestationPacemaker({ defuntId: defuntid ,isSendEmail});
break;
case 'rapport-soin':
saveRapportSoin({ numdefunt: defuntid ,isSendEmail});
break;
case 'rapport-bijoux':
const selectedValue = modalElement.data('export-with-photos')
saveRapportBijoux({
numdefunt: defuntid,
withPhotos: selectedValue ,
isSendEmail
});
default:
break;
}
modalElement.modal('hide')
$('#valueSendEmailModal').prop('checked', false);
})
$('#closeSendEmailModal').on('click', function(){
modalElement.data('export-type', null)
modalElement.modal('hide')
$('#valueSendEmailModal').prop('checked', false);
})
exportCareCertificateButton.addEventListener("click",function(){
exportCareCertificate({defuntId : defuntid});
modalElement.data('export-type', 'care-certificate')
modalElement.modal('show')
// exportCareCertificate({defuntId : defuntid});
})
pacemakerBtn.addEventListener("click", function(){
saveAttestationPacemaker({ defuntId: defuntid });
modalElement.data('export-type', 'pacemaker')
modalElement.modal('show')
// saveAttestationPacemaker({ defuntId: defuntid });
});
rapportSoinBtn.addEventListener("click", function(){
saveRapportSoin({ numdefunt: defuntid });
modalElement.data('export-type', 'rapport-soin')
modalElement.modal('show')
// saveRapportSoin({ numdefunt: defuntid });
});
$(document).on("change", ".photoBijouUpload", function () {

View File

@ -34,7 +34,8 @@ export class Facture {
}
this.payment_date = paymentDate;
this.factureType = myresp.facture_type;
if(this.factureType == FactureTypeSingle){
const isFactureSingle = this.factureType == FactureTypeSingle;
if(isFactureSingle){
this.baseUrl = generateUrl(`/apps/gestion/facture/${this.id}/show`);
}
else{
@ -46,6 +47,17 @@ export class Facture {
this.isDocumentAlreadySentLabel = this.getDocumentStateLabel(isDocumentAlreadySent);
this.isDocumentAlreadyGeneratedClass = this.getDocumentStateClass(isDocumentAlreadyGenerated);
this.isDocumentAlreadySentClass = this.getDocumentStateClass(isDocumentAlreadySent);
this.clientName = this.nom;
if(isFactureSingle == false){
const isFactureClientWithoutGroup = myresp.facture_client_id != null && myresp.facture_client_id != 0;
if(isFactureClientWithoutGroup){
this.clientName = ((myresp.facture_client_name == null || myresp.facture_client_name.length == 0) ? '-' : myresp.facture_client_name);
}
else{
this.clientName = ((myresp.facture_group_name == null || myresp.facture_group_name.length == 0) ? '-' : myresp.facture_group_name);
}
}
}
getDocumentStateLabel(documentState){
@ -68,7 +80,7 @@ export class Facture {
'<input style="margin:0;padding:0;" class="inputDate devisOrFactureInputDate" type="date" value=' + this.date_paiement + ' data-table="facture" data-column="date_paiement" data-id="' + this.id + '"/>',
'<div>' + this.type_paiement + '</div>',
'<div class="selectAvailableDevis" data-table="facture" data-column="id_devis" data-id="' + this.id + '" data-current="' + this.id_devis + '">' + this.nom_defunt + ' | <span style="font-size: 0.7rem">' + this.prenom + ' ' + this.nom + '</span></div>',
'<div>' + this.nom + '</div>',
'<div>' + this.clientName + '</div>',
'<div>' + this.factureProduits + '</div>',
'<div>' + this.status_paiement + '</div>',
'<div>' + this.payment_date + '</div>',

View File

@ -115,16 +115,16 @@
}
;
foreach ($devis as $key => $d) {
foreach ($devis as $key => $currentDevis) {
?>
<div class="bootstrap-iso d-flex flex-column justify-content-between">
<div class="d-flex flex-column w-100">
<h2 class="mt-3 mb-3 text-center"> <?php p($l->t('Quote')); ?>
<div id="devisid" style="display:inline" data-table="devis" data-column="num"
data-id="<?php echo $d->id; ?>">sur le defunt <?php echo $d->nom_defunt; ?></div>
data-id="<?php echo $currentDevis->id; ?>">sur le defunt <?php echo $currentDevis->nom_defunt; ?></div>
<span data-html2canvas-ignore>(</span>
<div data-html2canvas-ignore id="devisversion" style="display:inline" data-table="devis"
data-column="version" data-id="<?php echo $d->id; ?>"><?php echo $d->lieu; ?>)</div>
data-column="version" data-id="<?php echo $currentDevis->id; ?>"><?php echo $currentDevis->lieu; ?>)</div>
</h2>
<hr />
<div class="row">
@ -152,21 +152,21 @@
</div>
<div class="col-5 h-100 m-0" style="min-height:250px;">
<h5 class="p-3 m-0 text-dark text-center border border-2 border-dark"><?php p($l->t('TO')); ?>
<span id="entreprise"><?php echo $d->entreprise ?></span></h6>
<span id="entreprise"><?php echo $currentDevis->entreprise ?></span></h6>
<p
class="p-3 m-0 h-auto text-center text-dark text-center border border-top-0 border-2 border-dark">
<span id="nomprenom" data-id="0" data-table="devis"
data-column="id_client"><?php echo $d->prenom . ' ' . $d->nom ?></span><br />
<span id="adresse"><?php echo $d->adresse_cli ?></span><br />
<span id="mail"><?php echo $d->mail_cli ?></span><br />
<span id="telephone"><?php echo $d->telephone_cli ?></span><br />
<span id="legal_one"><?php echo $d->legalone_cli ?></span><br />
data-column="id_client"><?php echo $currentDevis->prenom . ' ' . $currentDevis->nom ?></span><br />
<span id="adresse"><?php echo $currentDevis->adresse_cli ?></span><br />
<span id="mail"><?php echo $currentDevis->mail_cli ?></span><br />
<span id="telephone"><?php echo $currentDevis->telephone_cli ?></span><br />
<span id="legal_one"><?php echo $currentDevis->legalone_cli ?></span><br />
<span id="dateContext" style="display: none"><?php echo $facture->date ?></span>
<span id="nomcli" style="display: none"><?php echo $d->prenom . ' ' . $d->nom ?></span>
<span id="idcli" style="display: none"><?php echo $d->id_cli ?></span>
<span id="etp" style="display: none"><?php echo $d->entreprise ?></span>
<span id="nomcli" style="display: none"><?php echo $currentDevis->prenom . ' ' . $currentDevis->nom ?></span>
<span id="idcli" style="display: none"><?php echo $currentDevis->id_cli ?></span>
<span id="etp" style="display: none"><?php echo $currentDevis->entreprise ?></span>
<span class="pdf"
style="display: none"><?php echo $d->entreprise . "_" . $d->id . "_v" . $d->version ?></span>
style="display: none"><?php echo $currentDevis->entreprise . "_" . $currentDevis->id . "_v" . $currentDevis->version ?></span>
</p>
</div>
</div>
@ -175,7 +175,7 @@
<hr />
<div class="col col-xl mb-3 text-center">
<b><span><?php p($l->t('Offer valid for 1 month from')); ?> :
</span><span><?php echo (new DateTime($d->date))->format('d-m-Y'); ?></span></b></div>
</span><span><?php echo (new DateTime($currentDevis->date))->format('d-m-Y'); ?></span></b></div>
<hr />
</div>
</div>
@ -183,21 +183,36 @@
<div class="col col-md">
<div class="col col-xl text-center">
<span>Date de soin :
<b><?php echo (new DateTime($d->date))->format('d-m-Y'); ?></b>,</span>&nbsp;<span
id="devisid" data-id=<?php echo $d->id; ?>>Defunt associé :
<b><?php echo $d->num; ?></b></span><br />
<span>Lieu : <b><?php echo $d->lieu; ?> (<?php echo $d->adresse_soin; ?>)</b>
<b><?php echo (new DateTime($currentDevis->date))->format('d-m-Y'); ?></b>,</span>&nbsp;<span
id="devisid" data-id=<?php echo $currentDevis->id; ?>>Defunt associé :
<b><?php echo $currentDevis->nom_defunt; ?></b></span><br />
<span>Lieu : <b><?php echo $currentDevis->lieu; ?> (<?php echo $currentDevis->adresse_soin; ?>)</b>
</div>
</div>
</div>
<div class="row">
<div class="col col-md">
<hr />
<div class="col col-xl mb-3 text-center editable" id="deviscomment" style="display:inline"
data-table="devis" data-column="comment" data-id="<?php echo $d->id; ?>">
<?php echo ($d->comment == "") ? "-" : $d->comment; ?></div>
<hr />
<label class="fw-bold">Commande :</label>
<div class="col col-xl mb-3 text-center editable"
style="display:inline"
data-table="devis" data-column="order_number"
data-id="<?php echo $currentDevis->id;?>">
<?php echo ($currentDevis->order_number == "" ) ? "-" : $currentDevis->order_number ; ?>
</div>
</div>
<hr />
</div>
<div class="row">
<div class="col col-md">
<label class="fw-bold">Numéro de dossier :</label>
<div class="col col-xl mb-3 text-center editable"
style="display:inline"
data-table="devis" data-column="case_number"
data-id="<?php echo $currentDevis->id;?>">
<?php echo ($currentDevis->case_number == "" ) ? "-" : $currentDevis->case_number ; ?>
</div>
</div>
<hr />
</div>
<div class="table-responsive">
<table id="produits" data-type="facture" class="table table-striped">
@ -212,7 +227,7 @@
</tr>
</thead>
<tbody>
<?php foreach ($d->dproduits as $key => $produit) { ?>
<?php foreach ($currentDevis->dproduits as $key => $produit) { ?>
<tr>
<td><?php echo $produit->reference ?></td>
<td><?php echo $produit->description ?></td>
@ -242,7 +257,7 @@
$tva = json_decode($_['configuration'])[0]->tva_default;
$totalttc = 0;
$totalprice = 0;
foreach ($d->dproduits as $key => $produit) {
foreach ($currentDevis->dproduits as $key => $produit) {
$totalhtc = $totalhtc + ($produit->quantite * $produit->prix_unitaire);
}
$totalttc = ($totalhtc * $tva) / 100;

View File

@ -1,23 +1,23 @@
<?php
$quantiteOptions = [0];
for ($i = 1; $i <= 10; $i++) {
$quantiteOptions[] = $i / 10;
}
for($i=1; $i<=15; $i++) {
if($i>1) $quantiteOptions[] = $i;
if($i<15) $quantiteOptions[] = $i + 0.5;
}
$coverProducts = $_['coverProducts'];
$quantiteOptions = [0];
for ($i = 1; $i <= 10; $i++) {
$quantiteOptions[] = $i / 10;
}
for ($i = 1; $i <= 15; $i++) {
if ($i > 1) $quantiteOptions[] = $i;
if ($i < 15) $quantiteOptions[] = $i + 0.5;
}
$coverProducts = $_['coverProducts'];
?>
<div id="contentTable">
<div id="defuntid" data-table="defunt" data-id="<?php echo $_['defunt'][0]->id; ?>"></div>
<div class="breadcrumb" data-html2canvas-ignore>
<div class="crumb svg crumbhome">
<a href="<?php echo($_['url']['index']); ?>" class="icon-home"></a>
<span style="display: none;"></span>
<a href="<?php echo ($_['url']['index']); ?>" class="icon-home"></a>
<span style="display: none;"></span>
</div>
<div class="crumb svg crumbhome">
<span>Défunt</span>
<span>Défunt</span>
</div>
</div>
<div class="container-fluid">
@ -39,7 +39,7 @@
<div class="d-flex flex-row align-items-center col-12" style="margin-bottom: 8px">
<div class="col-3">Date de décès</div>
<div class="col-9">
<input class="gestion-input inputDate w-100" type="date" value="<?php echo $_['defunt'][0]->date_defunt ?>" data-table="defunt" data-column="date" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input class="gestion-input inputDate w-100" type="date" value="<?php echo $_['defunt'][0]->date_defunt ?>" data-table="defunt" data-column="date" data-id="<?php echo $_['defunt'][0]->id ?>" />
</div>
</div>
<!-- Heure -->
@ -48,11 +48,11 @@
<div class="col-9">
<div class="d-flex flex-row col-12 align-items-center">
<div class="col-5">
<input class="gestion-input w-100" type="time" value="<?php echo $_['defunt'][0]->heure_debut ?>" data-table="defunt" data-column="heure_debut" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input class="gestion-input w-100" type="time" value="<?php echo $_['defunt'][0]->heure_debut ?>" data-table="defunt" data-column="heure_debut" data-id="<?php echo $_['defunt'][0]->id ?>" />
</div>
<div class="d-flex col-2 justify-content-center align-items-center">à</div>
<div class="col-5">
<input class="gestion-input w-100" type="time" value="<?php echo $_['defunt'][0]->heure_fin ?>" data-table="defunt" data-column="heure_fin" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input class="gestion-input w-100" type="time" value="<?php echo $_['defunt'][0]->heure_fin ?>" data-table="defunt" data-column="heure_fin" data-id="<?php echo $_['defunt'][0]->id ?>" />
</div>
</div>
</div>
@ -61,58 +61,58 @@
<div class="d-flex flex-row align-items-center col-12" style="margin-bottom: 8px">
<div class="col-3">Nom</div>
<div class="col-9">
<input class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->nom_defunt ?>" data-table="defunt" data-column="nom" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->nom_defunt ?>" data-table="defunt" data-column="nom" data-id="<?php echo $_['defunt'][0]->id ?>" />
</div>
</div>
<!-- Date de naissance -->
<div class="d-flex flex-row align-items-center col-12" style="margin-bottom: 8px">
<div class="col-3">Date de naissance</div>
<div class="col-9">
<input class="gestion-input w-100" type="date" value="<?php echo $_['defunt'][0]->date_naissance ?>" data-table="defunt" data-column="date_naissance" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input class="gestion-input w-100" type="date" value="<?php echo $_['defunt'][0]->date_naissance ?>" data-table="defunt" data-column="date_naissance" data-id="<?php echo $_['defunt'][0]->id ?>" />
</div>
</div>
<!-- Sexe -->
<div class="d-flex flex-row align-items-center col-12" style="margin-bottom: 8px">
<div class="col-3">Sexe</div>
<div class="col-9">
<select class="gestion-select w-100" data-table="defunt" data-column="sexe" data-id="<?php echo $_['defunt'][0]->id ?>">
<option value="m" <?php if(strcmp($_['defunt'][0]->sexe, 'm')==0) echo 'selected' ?>>Masculin</option>
<option value="f" <?php if(strcmp($_['defunt'][0]->sexe, 'f')==0) echo 'selected' ?>>Féminin</option>
</select>
<select class="gestion-select w-100" data-table="defunt" data-column="sexe" data-id="<?php echo $_['defunt'][0]->id ?>">
<option value="m" <?php if (strcmp($_['defunt'][0]->sexe, 'm') == 0) echo 'selected' ?>>Masculin</option>
<option value="f" <?php if (strcmp($_['defunt'][0]->sexe, 'f') == 0) echo 'selected' ?>>Féminin</option>
</select>
</div>
</div>
<!-- Référence pacemaker -->
<div class="d-flex flex-row align-items-center col-12" style="margin-bottom: 16px">
<div class="col-3">Référence pacemaker</div>
<div class="col-9">
<input class="gestion-input w-100" type="text" value="<?php echo ($_['defunt'][0]->ref_pacemaker ?? "") ?>" data-table="defunt" data-column="ref_pacemaker" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input class="gestion-input w-100" type="text" value="<?php echo ($_['defunt'][0]->ref_pacemaker ?? "") ?>" data-table="defunt" data-column="ref_pacemaker" data-id="<?php echo $_['defunt'][0]->id ?>" />
</div>
</div>
<!-- Product reference -->
<div class="d-flex flex-row align-items-center col-12" style="margin-bottom: 16px">
<div class="col-3">Référence du produit</div>
<div class="col-9">
<input class="gestion-input w-100" type="text" value="<?php echo ($_['defunt'][0]->product_reference ?? "") ?>" data-table="defunt" data-column="product_reference" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input class="gestion-input w-100" type="text" value="<?php echo ($_['defunt'][0]->product_reference ?? "") ?>" data-table="defunt" data-column="product_reference" data-id="<?php echo $_['defunt'][0]->id ?>" />
</div>
</div>
<!-- Product brand -->
<div class="d-flex flex-row align-items-center col-12" style="margin-bottom: 16px">
<div class="col-3">Marque du produit</div>
<div class="col-9">
<input class="gestion-input w-100" type="text" value="<?php echo ($_['defunt'][0]->product_brand ?? "") ?>" data-table="defunt" data-column="product_brand" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input class="gestion-input w-100" type="text" value="<?php echo ($_['defunt'][0]->product_brand ?? "") ?>" data-table="defunt" data-column="product_brand" data-id="<?php echo $_['defunt'][0]->id ?>" />
</div>
</div>
<!-- Product photo -->
<div class="d-flex flex-row align-items-center col-12" style="margin-bottom: 16px">
<div class="col-3">Photo du produit</div>
<div class="col-9">
<input class="w-100 uploadDefuntPacemakerPhoto" accept="image/*" type="file" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input class="w-100 uploadDefuntPacemakerPhoto" accept="image/*" type="file" data-id="<?php echo $_['defunt'][0]->id ?>" />
<?php
if($_['defunt'][0]->product_photo != null){
?>
<label id="pacemakerPhotoLabel" for=""><?php echo ($_['defunt'][0]->product_photo_name ?? "") ?></label>
<?php
}
if ($_['defunt'][0]->product_photo != null) {
?>
<label id="pacemakerPhotoLabel" for=""><?php echo ($_['defunt'][0]->product_photo_name ?? "") ?></label>
<?php
}
?>
</div>
</div>
@ -121,15 +121,15 @@
<h6>Housse</h6>
<hr>
<?php foreach ($coverProducts as $currentCoverProduct): ?>
<div class="row">
<div class="d-flex align-items-center mb-2">
<input type="radio"
name="coverProductsRadioButton"
value="<?= $currentCoverProduct->id; ?>"
<?= $currentCoverProduct->id == $_['defunt'][0]->product_cover_id ? 'checked' : ''; ?>>
<label class="form-check-label"><?= $currentCoverProduct->description; ?></label>
<div class="row">
<div class="d-flex align-items-center mb-2">
<input type="radio"
name="coverProductsRadioButton"
value="<?= $currentCoverProduct->id; ?>"
<?= $currentCoverProduct->id == $_['defunt'][0]->product_cover_id ? 'checked' : ''; ?>>
<label class="form-check-label"><?= $currentCoverProduct->description; ?></label>
</div>
</div>
</div>
<?php endforeach; ?>
<div class="row p-2">
<button class="btn btn-secondary" id="coverProductsRadioButton"> Valider le choix </button>
@ -138,7 +138,7 @@
</div>
<div>
<button id="buttonEditCareRapport" class="btn btn-secondary" type="button">
Editer rapport de soin
Editer rapport de soin
</button>
</div>
<div id="additionalDefuntData" class="hiddenContent pt-2">
@ -149,7 +149,7 @@
<div class="d-flex flex-row col-12" style="margin-bottom: 8px">
<div class="col-3">Corpulence</div>
<div class="col-9">
<input id="corpulence-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->corpulence ?>" data-table="defunt" data-column="corpulence" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input id="corpulence-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->corpulence ?>" data-table="defunt" data-column="corpulence" data-id="<?php echo $_['defunt'][0]->id ?>" />
<ul class="corpulence-list"></ul>
</div>
</div>
@ -157,7 +157,7 @@
<div class="d-flex flex-row col-12" style="margin-bottom: 8px">
<div class="col-3">Rigidité</div>
<div class="col-9">
<input id="rigidite-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->rigidite ?>" data-table="defunt" data-column="rigidite" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input id="rigidite-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->rigidite ?>" data-table="defunt" data-column="rigidite" data-id="<?php echo $_['defunt'][0]->id ?>" />
<ul class="rigidite-list"></ul>
</div>
</div>
@ -165,7 +165,7 @@
<div class="d-flex flex-row col-12" style="margin-bottom: 16px">
<div class="col-3">Lividités</div>
<div class="col-9">
<input id="lividite-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->lividite ?>" data-table="defunt" data-column="lividite" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input id="lividite-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->lividite ?>" data-table="defunt" data-column="lividite" data-id="<?php echo $_['defunt'][0]->id ?>" />
<ul class="lividite-list"></ul>
</div>
</div>
@ -184,7 +184,7 @@
<div class="d-flex flex-row align-items-center col-12" style="margin-bottom: 8px">
<div class="col-3">Désignation</div>
<div class="col-9">
<input id="acces-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->acces ?>" data-table="defunt" data-column="acces" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input id="acces-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->acces ?>" data-table="defunt" data-column="acces" data-id="<?php echo $_['defunt'][0]->id ?>" />
<ul class="acces-list"></ul>
</div>
</div>
@ -192,18 +192,18 @@
<div class="d-flex flex-row align-items-center col-12" style="margin-bottom: 8px">
<div class="col-3">Recherche</div>
<div class="col-9">
<input class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->acces_recherche ?>" data-table="defunt" data-column="acces_recherche" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->acces_recherche ?>" data-table="defunt" data-column="acces_recherche" data-id="<?php echo $_['defunt'][0]->id ?>" />
</div>
</div>
<!-- Etat -->
<div class="d-flex flex-row align-items-center col-12" style="margin-bottom: 16px">
<div class="col-3">État</div>
<div class="col-9">
<select class="gestion-select w-100" data-table="defunt" data-column="acces_etat" data-id="<?php echo $_['defunt'][0]->id ?>">
<option>Selectionner un état</option>
<option value="mauvais" <?php if(strcmp($_['defunt'][0]->acces_etat, 'mauvais')==0) echo 'selected' ?>>Mauvais</option>
<option value="bon" <?php if(strcmp($_['defunt'][0]->acces_etat, 'bon')==0) echo 'selected' ?>>Bon</option>
</select>
<select class="gestion-select w-100" data-table="defunt" data-column="acces_etat" data-id="<?php echo $_['defunt'][0]->id ?>">
<option>Selectionner un état</option>
<option value="mauvais" <?php if (strcmp($_['defunt'][0]->acces_etat, 'mauvais') == 0) echo 'selected' ?>>Mauvais</option>
<option value="bon" <?php if (strcmp($_['defunt'][0]->acces_etat, 'bon') == 0) echo 'selected' ?>>Bon</option>
</select>
</div>
</div>
</div>
@ -214,7 +214,7 @@
<div class="d-flex flex-row col-12" style="margin-bottom: 8px">
<div class="col-3">Désignation</div>
<div class="col-9">
<input id="preinjection-input" class="gestion-input w-100" autocomplete="off" type="text" value="<?php echo $_['defunt'][0]->preinjection ?>" data-table="defunt" data-column="preinjection" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input id="preinjection-input" class="gestion-input w-100" autocomplete="off" type="text" value="<?php echo $_['defunt'][0]->preinjection ?>" data-table="defunt" data-column="preinjection" data-id="<?php echo $_['defunt'][0]->id ?>" />
<ul class="preinjection-list"></ul>
</div>
</div>
@ -222,11 +222,11 @@
<div class="d-flex flex-row align-items-center col-12" style="margin-bottom: 16px">
<div class="col-3">Quantité(l)</div>
<div class="col-9">
<select class="gestion-select w-100" data-table="defunt" data-column="preinjection_qte" data-id="<?php echo $_['defunt'][0]->id ?>">
<?php for($i=0; $i<sizeof($quantiteOptions); $i++) { ?>
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if($_['defunt'][0]->preinjection_qte == $quantiteOptions[$i]) echo 'selected' ?>><?php echo $quantiteOptions[$i] ?></option>
<?php } ?>
</select>
<select class="gestion-select w-100" data-table="defunt" data-column="preinjection_qte" data-id="<?php echo $_['defunt'][0]->id ?>">
<?php for ($i = 0; $i < sizeof($quantiteOptions); $i++) { ?>
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if ($_['defunt'][0]->preinjection_qte == $quantiteOptions[$i]) echo 'selected' ?>><?php echo $quantiteOptions[$i] ?></option>
<?php } ?>
</select>
</div>
</div>
</div>
@ -237,7 +237,7 @@
<div class="d-flex flex-row col-12" style="margin-bottom: 8px">
<div class="col-3">Désignation</div>
<div class="col-9">
<input id="injection-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->injection ?>" data-table="defunt" data-column="injection" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input id="injection-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->injection ?>" data-table="defunt" data-column="injection" data-id="<?php echo $_['defunt'][0]->id ?>" />
<ul class="injection-list"></ul>
</div>
</div>
@ -245,11 +245,11 @@
<div class="d-flex flex-row align-items-center col-12" style="margin-bottom: 8px">
<div class="col-3">Diffusion</div>
<div class="col-9">
<select class="gestion-select w-100" data-table="defunt" data-column="injection_diffusion" data-id="<?php echo $_['defunt'][0]->id ?>">
<option>Selectionner un état</option>
<option value="mauvaise" <?php if(strcmp($_['defunt'][0]->injection_diffusion, 'mauvaise')==0) echo 'selected' ?>>Mauvaise</option>
<option value="bonne" <?php if(strcmp($_['defunt'][0]->injection_diffusion, 'bonne')==0) echo 'selected' ?>>Bonne</option>
</select>
<select class="gestion-select w-100" data-table="defunt" data-column="injection_diffusion" data-id="<?php echo $_['defunt'][0]->id ?>">
<option>Selectionner un état</option>
<option value="mauvaise" <?php if (strcmp($_['defunt'][0]->injection_diffusion, 'mauvaise') == 0) echo 'selected' ?>>Mauvaise</option>
<option value="bonne" <?php if (strcmp($_['defunt'][0]->injection_diffusion, 'bonne') == 0) echo 'selected' ?>>Bonne</option>
</select>
</div>
</div>
<!-- Quantité injection -->
@ -257,9 +257,9 @@
<div class="col-3">Quantité(l)</div>
<div class="col-9">
<select class="gestion-select w-100" data-table="defunt" data-column="injection_qte" data-id="<?php echo $_['defunt'][0]->id ?>">
<?php for($i=0; $i<sizeof($quantiteOptions); $i++) { ?>
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if($_['defunt'][0]->injection_qte == $quantiteOptions[$i]) echo 'selected' ?>><?php echo $quantiteOptions[$i] ?></option>
<?php } ?>
<?php for ($i = 0; $i < sizeof($quantiteOptions); $i++) { ?>
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if ($_['defunt'][0]->injection_qte == $quantiteOptions[$i]) echo 'selected' ?>><?php echo $quantiteOptions[$i] ?></option>
<?php } ?>
</select>
</div>
</div>
@ -271,7 +271,7 @@
<div class="d-flex flex-row col-12" style="margin-bottom: 8px">
<div class="col-3">Désignation</div>
<div class="col-9">
<input id="coinjection-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->coinjection ?>" data-table="defunt" data-column="coinjection" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input id="coinjection-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->coinjection ?>" data-table="defunt" data-column="coinjection" data-id="<?php echo $_['defunt'][0]->id ?>" />
<ul class="coinjection-list"></ul>
</div>
</div>
@ -279,11 +279,11 @@
<div class="d-flex flex-row align-items-center col-12" style="margin-bottom: 8px">
<div class="col-3">Quantité(l)</div>
<div class="col-9">
<select class="gestion-select w-100" data-table="defunt" data-column="coinjection_qte" data-id="<?php echo $_['defunt'][0]->id ?>">
<?php for($i=0; $i<sizeof($quantiteOptions); $i++) { ?>
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if($_['defunt'][0]->coinjection_qte == $quantiteOptions[$i]) echo 'selected' ?>><?php echo $quantiteOptions[$i] ?></option>
<?php } ?>
</select>
<select class="gestion-select w-100" data-table="defunt" data-column="coinjection_qte" data-id="<?php echo $_['defunt'][0]->id ?>">
<?php for ($i = 0; $i < sizeof($quantiteOptions); $i++) { ?>
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if ($_['defunt'][0]->coinjection_qte == $quantiteOptions[$i]) echo 'selected' ?>><?php echo $quantiteOptions[$i] ?></option>
<?php } ?>
</select>
</div>
</div>
</div>
@ -294,7 +294,7 @@
<div class="d-flex flex-row col-12" style="margin-bottom: 8px">
<div class="col-3">Désignation</div>
<div class="col-9">
<input id="drainage-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->drainage ?>" data-table="defunt" data-column="drainage" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input id="drainage-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->drainage ?>" data-table="defunt" data-column="drainage" data-id="<?php echo $_['defunt'][0]->id ?>" />
<ul class="drainage-list"></ul>
</div>
</div>
@ -302,11 +302,11 @@
<div class="d-flex flex-row align-items-center col-12" style="margin-bottom: 8px">
<div class="col-3">État</div>
<div class="col-9">
<select class="gestion-select w-100" data-table="defunt" data-column="drainage_etat" data-id="<?php echo $_['defunt'][0]->id ?>">
<option>Selectionner un état</option>
<option value="mauvaise" <?php if(strcmp($_['defunt'][0]->drainage_etat, 'mauvaise')==0) echo 'selected' ?>>Mauvaise</option>
<option value="bonne" <?php if(strcmp($_['defunt'][0]->drainage_etat, 'bonne')==0) echo 'selected' ?>>Bonne</option>
</select>
<select class="gestion-select w-100" data-table="defunt" data-column="drainage_etat" data-id="<?php echo $_['defunt'][0]->id ?>">
<option>Selectionner un état</option>
<option value="mauvaise" <?php if (strcmp($_['defunt'][0]->drainage_etat, 'mauvaise') == 0) echo 'selected' ?>>Mauvaise</option>
<option value="bonne" <?php if (strcmp($_['defunt'][0]->drainage_etat, 'bonne') == 0) echo 'selected' ?>>Bonne</option>
</select>
</div>
</div>
<!-- Quantité drainage -->
@ -314,9 +314,9 @@
<div class="col-3">Quantité(l)</div>
<div class="col-9">
<select class="gestion-select w-100" data-table="defunt" data-column="drainage_qte" data-id="<?php echo $_['defunt'][0]->id ?>">
<?php for($i=0; $i<sizeof($quantiteOptions); $i++) { ?>
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if($_['defunt'][0]->drainage_qte == $quantiteOptions[$i]) echo 'selected' ?>><?php echo $quantiteOptions[$i] ?></option>
<?php } ?>
<?php for ($i = 0; $i < sizeof($quantiteOptions); $i++) { ?>
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if ($_['defunt'][0]->drainage_qte == $quantiteOptions[$i]) echo 'selected' ?>><?php echo $quantiteOptions[$i] ?></option>
<?php } ?>
</select>
</div>
</div>
@ -328,7 +328,7 @@
<div class="d-flex flex-row col-12" style="margin-bottom: 8px">
<div class="col-3">Désignation</div>
<div id="ponction-input" class="col-9">
<input class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->ponction ?>" data-table="defunt" data-column="ponction" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->ponction ?>" data-table="defunt" data-column="ponction" data-id="<?php echo $_['defunt'][0]->id ?>" />
<ul class="ponction-list"></ul>
</div>
</div>
@ -337,9 +337,9 @@
<div class="col-3">Quantité(l)</div>
<div class="col-9">
<select class="gestion-select w-100" data-table="defunt" data-column="ponction_qte" data-id="<?php echo $_['defunt'][0]->id ?>">
<?php for($i=0; $i<sizeof($quantiteOptions); $i++) { ?>
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if($_['defunt'][0]->ponction_qte == $quantiteOptions[$i]) echo 'selected' ?>><?php echo $quantiteOptions[$i] ?></option>
<?php } ?>
<?php for ($i = 0; $i < sizeof($quantiteOptions); $i++) { ?>
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if ($_['defunt'][0]->ponction_qte == $quantiteOptions[$i]) echo 'selected' ?>><?php echo $quantiteOptions[$i] ?></option>
<?php } ?>
</select>
</div>
</div>
@ -351,7 +351,7 @@
<div class="d-flex flex-row col-12" style="margin-bottom: 8px">
<div class="col-3">Désignation</div>
<div class="col-9">
<input id="cavite-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->cavite ?>" data-table="defunt" data-column="cavite" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input id="cavite-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->cavite ?>" data-table="defunt" data-column="cavite" data-id="<?php echo $_['defunt'][0]->id ?>" />
<ul class="cavite-list"></ul>
</div>
</div>
@ -360,9 +360,9 @@
<div class="col-3">Quantité(l)</div>
<div class="col-9">
<select class="gestion-select w-100" data-table="defunt" data-column="cavite_qte" data-id="<?php echo $_['defunt'][0]->id ?>">
<?php for($i=0; $i<sizeof($quantiteOptions); $i++) { ?>
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if($_['defunt'][0]->cavite_qte == $quantiteOptions[$i]) echo 'selected' ?>><?php echo $quantiteOptions[$i] ?></option>
<?php } ?>
<?php for ($i = 0; $i < sizeof($quantiteOptions); $i++) { ?>
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if ($_['defunt'][0]->cavite_qte == $quantiteOptions[$i]) echo 'selected' ?>><?php echo $quantiteOptions[$i] ?></option>
<?php } ?>
</select>
</div>
</div>
@ -380,12 +380,12 @@
<div class="table-responsive col-12">
<table id="hypodermiques" class="table table-striped">
<thead>
<tr>
<th>Quantité</th>
<th>Désignation</th>
<th>Endroit</th>
<th>Actions</th>
</tr>
<tr>
<th>Quantité</th>
<th>Désignation</th>
<th>Endroit</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
</tbody>
@ -400,7 +400,7 @@
<div class="d-flex flex-row col-12" style="margin-bottom: 8px">
<div class="col-3">Désinfection</div>
<div class="col-9">
<input id="desinfection-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->desinfection ?>" data-table="defunt" data-column="desinfection" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input id="desinfection-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->desinfection ?>" data-table="defunt" data-column="desinfection" data-id="<?php echo $_['defunt'][0]->id ?>" />
<ul class="desinfection-list"></ul>
</div>
</div>
@ -408,7 +408,7 @@
<div class="d-flex flex-row col-12" style="margin-bottom: 8px">
<div class="col-3">Lavage</div>
<div class="col-9">
<input id="lavage-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->lavage ?>" data-table="defunt" data-column="lavage" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input id="lavage-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->lavage ?>" data-table="defunt" data-column="lavage" data-id="<?php echo $_['defunt'][0]->id ?>" />
<ul class="lavage-list"></ul>
</div>
</div>
@ -416,7 +416,7 @@
<div class="d-flex flex-row col-12 align-items-center" style="margin-bottom: 8px">
<div class="col-3">Rasage</div>
<div class="d-flex col-9 justify-content-start align-items-start">
<input class="gestion-checkbox" type="checkbox" <?php if($_['defunt'][0]->rasage==1) echo 'checked' ?> data-table="defunt" data-column="rasage" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input class="gestion-checkbox" type="checkbox" <?php if ($_['defunt'][0]->rasage == 1) echo 'checked' ?> data-table="defunt" data-column="rasage" data-id="<?php echo $_['defunt'][0]->id ?>" />
</div>
</div>
</div>
@ -427,7 +427,7 @@
<div class="d-flex flex-row col-12" style="margin-bottom: 8px">
<div class="col-3">Cosmétiques</div>
<div class="col-9">
<input id="cosmetiques-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->presentation_cosmetique ?>" data-table="defunt" data-column="presentation_cosmetique" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input id="cosmetiques-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->presentation_cosmetique ?>" data-table="defunt" data-column="presentation_cosmetique" data-id="<?php echo $_['defunt'][0]->id ?>" />
<ul class="cosmetiques-list"></ul>
</div>
</div>
@ -435,7 +435,7 @@
<div class="d-flex flex-row col-12" style="margin-bottom: 8px">
<div class="col-3">Sur</div>
<div class="col-9">
<input id="sur-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->presentation_sur ?>" data-table="defunt" data-column="presentation_sur" data-id="<?php echo $_['defunt'][0]->id ?>"/>
<input id="sur-input" class="gestion-input w-100" type="text" value="<?php echo $_['defunt'][0]->presentation_sur ?>" data-table="defunt" data-column="presentation_sur" data-id="<?php echo $_['defunt'][0]->id ?>" />
<ul class="sur-list"></ul>
</div>
</div>
@ -454,18 +454,20 @@
</div>
<div class="col-12" style="margin-bottom: 32px">
<div class="d-flex flex-row justify-content-between">
<div><h6>OBSERVATIONS</h6></div>
<div>
<h6>OBSERVATIONS</h6>
</div>
<button id="defuntAddObservation" class="btn btn-secondary" type="button">Ajouter une observation</button>
</div>
<hr>
<div class="table-responsive">
<table id="observations" class="table table-striped">
<thead>
<tr>
<th>Observation</th>
<th><?php p($l->t('Comment'));?></th>
<th>Actions</th>
</tr>
<tr>
<th>Observation</th>
<th><?php p($l->t('Comment')); ?></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
</tbody>
@ -474,20 +476,22 @@
</div>
<div class="col-12" style="margin-bottom: 32px">
<div class="d-flex flex-row justify-content-between">
<div><h6>BIJOU(X)</h6></div>
<div>
<h6>BIJOU(X)</h6>
</div>
<button id="defuntAddBijou" class="btn btn-secondary" type="button">Ajouter un bijou</button>
</div>
<hr>
<div class="table-responsive">
<table id="bijoux" class="table table-striped">
<thead>
<tr>
<th>Désignation</th>
<th><?php p($l->t('Comment'));?></th>
<th><?php p($l->t('Photo'));?></th>
<th><?php p($l->t('Nom de la personne qui a récupéré ces bijoux'));?></th>
<th>Actions</th>
</tr>
<tr>
<th>Désignation</th>
<th><?php p($l->t('Comment')); ?></th>
<th><?php p($l->t('Photo')); ?></th>
<th><?php p($l->t('Nom de la personne qui a récupéré ces bijoux')); ?></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
</tbody>
@ -497,26 +501,45 @@
</div>
<hr>
<div class="modal" id="saveRapportBijouxModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Générer le rapport de bijoux</h5>
</div>
<div class="modal-body">
<div class="radio-group">
<label>
<input type="radio" name="withPhotos" value="1"> Avec photos
</label>
<label>
<input type="radio" name="withPhotos" value="0"> Sans photos
</label>
</div>
</div>
<div class="modal-footer">
<button id="closeRapportBijouxModal" type="button" class="btn btn-secondary">Annuler</button>
<button id="exportBijouxRapport" type="button" class="btn btn-primary">Sauvegarder</button>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Générer le rapport de bijoux</h5>
</div>
<div class="modal-body">
<div class="radio-group">
<label>
<input type="radio" name="withPhotos" value="1"> Avec photos
</label>
<label>
<input type="radio" name="withPhotos" value="0"> Sans photos
</label>
</div>
</div>
<div class="modal-footer">
<button id="closeRapportBijouxModal" type="button" class="btn btn-secondary">Annuler</button>
<button id="exportBijouxRapport" type="button" class="btn btn-primary">Sauvegarder</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="confirmSendEmailModal" data-backdrop="false" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Confirmeation de l'envoi par email</h5>
</div>
<div class="modal-body">
<div class="form-group form-check d-flex align-items-center">
<input type="checkbox" style="cursor:pointer;margin-right:8px;" id="valueSendEmailModal">
<label class="form-check-label" for="valueSendEmailModal">Envoyer un email ?</label>
</div>
</div>
<div class="modal-footer">
<button id="closeSendEmailModal" type="button" class="btn btn-secondary">Annuler</button>
<button id="valdateSendEmailModal" type="button" class="btn btn-primary">Valider</button>
</div>
</div>
</div>
</div>
</div>