[feat]: add send email to client from defunt certificate

This commit is contained in:
Tsiresy Milà 2025-03-06 16:20:36 +03:00
parent 528afe379e
commit 8c9194e504
6 changed files with 329 additions and 147 deletions

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/

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/";
@ -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));
@ -2252,6 +2274,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;
return json_encode($res);
@ -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

@ -3444,6 +3444,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,

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,15 +100,17 @@ 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');
let selectedValue = null;
@ -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

@ -1,19 +1,19 @@
<?php
$quantiteOptions = [0];
for ($i = 1; $i <= 10; $i++) {
$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'];
}
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>
<a href="<?php echo ($_['url']['index']); ?>" class="icon-home"></a>
<span style="display: none;"></span>
</div>
<div class="crumb svg crumbhome">
@ -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,14 +61,14 @@
<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 -->
@ -76,8 +76,8 @@
<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>
<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>
@ -85,30 +85,30 @@
<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){
if ($_['defunt'][0]->product_photo != null) {
?>
<label id="pacemakerPhotoLabel" for=""><?php echo ($_['defunt'][0]->product_photo_name ?? "") ?></label>
<?php
@ -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,7 +192,7 @@
<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 -->
@ -201,8 +201,8 @@
<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>
<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>
@ -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>
@ -223,8 +223,8 @@
<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 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>
@ -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>
@ -247,8 +247,8 @@
<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>
<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>
@ -257,8 +257,8 @@
<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 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>
@ -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>
@ -280,8 +280,8 @@
<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 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>
@ -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>
@ -304,8 +304,8 @@
<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>
<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>
@ -314,8 +314,8 @@
<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 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>
@ -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,8 +337,8 @@
<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 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>
@ -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,8 +360,8 @@
<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 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>
@ -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,7 +454,9 @@
</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>
@ -463,7 +465,7 @@
<thead>
<tr>
<th>Observation</th>
<th><?php p($l->t('Comment'));?></th>
<th><?php p($l->t('Comment')); ?></th>
<th>Actions</th>
</tr>
</thead>
@ -474,7 +476,9 @@
</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>
@ -483,9 +487,9 @@
<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><?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>
@ -519,4 +523,23 @@
</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>