feat ajout attestation absent pacemacker
This commit is contained in:
parent
86e872e14d
commit
fa1405ea67
53
.gitignore
vendored
53
.gitignore
vendored
@ -1,11 +1,46 @@
|
||||
*
|
||||
# Dépendances (tous niveaux)
|
||||
**/node_modules/
|
||||
**/vendor/
|
||||
**/bower_components/
|
||||
|
||||
# Artifacts de build / caches (tous niveaux)
|
||||
**/dist/
|
||||
**/build/
|
||||
**/.cache/
|
||||
**/.parcel-cache/
|
||||
**/.vite/
|
||||
**/coverage/
|
||||
**/.next/
|
||||
**/.nuxt/
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Fichiers d'environnement
|
||||
.env
|
||||
.env.*.local
|
||||
docker-compose.yml
|
||||
|
||||
# Fichiers système / IDE
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
.idea/
|
||||
.vscode/
|
||||
|
||||
# Dumps & fichiers sensibles courants
|
||||
*.sql
|
||||
|
||||
!.gitignore
|
||||
|
||||
!calendar/
|
||||
!gestion/
|
||||
!Jenkinsfile
|
||||
|
||||
!calendar/**
|
||||
!gestion/**
|
||||
# Spécifiques Nextcloud (si jamais présents dans le repo)
|
||||
data/
|
||||
config/
|
||||
themes/
|
||||
apps-external/
|
||||
.updater-*
|
||||
occ
|
||||
autotest.sh
|
||||
tests/
|
||||
coverage/
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'routes' => [
|
||||
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
|
||||
@ -97,6 +98,7 @@ return [
|
||||
|
||||
// generation attestation pacemaker, rapport de soins, de bijoux
|
||||
['name' => 'page#saveAttestationPacemaker', 'url' => '/saveAttestationPacemaker', 'verb' => 'POST'],
|
||||
['name' => 'page#saveAttestationAbsentPacemaker', 'url' => '/saveAttestationAbsentPacemaker', 'verb' => 'POST'],
|
||||
['name' => 'page#saveRapportSoin', 'url' => '/saveRapportSoin', 'verb' => 'POST'],
|
||||
['name' => 'page#saveRapportBijoux', 'url' => '/saveRapportBijoux', 'verb' => 'POST'],
|
||||
|
||||
@ -104,7 +106,7 @@ return [
|
||||
['name' => 'page#getProduits', 'url' => '/getProduits', 'verb' => 'PROPFIND'],
|
||||
['name' => 'page#getProduitsById', 'url' => '/getProduitsById', 'verb' => 'POST'],
|
||||
['name' => 'page#insertProduit', 'url' => '/produit/insert', 'verb' => 'POST'],
|
||||
|
||||
|
||||
// bibliotheque
|
||||
['name' => 'page#getBibliotheques', 'url' => '/getBibliotheques', 'verb' => 'PROPFIND'],
|
||||
['name' => 'page#insertBibliotheque', 'url' => '/bibliotheque/insert', 'verb' => 'POST'],
|
||||
@ -121,7 +123,7 @@ return [
|
||||
['name' => 'page#savePDF', 'url' => '/savePDF', 'verb' => 'POST'],
|
||||
['name' => 'page#saveDocumentRecap', 'url' => '/saveDocumentRecap', 'verb' => 'POST'],
|
||||
['name' => 'page#saveNewPDF', 'url' => '/saveNewPDF', 'verb' => 'POST'],
|
||||
|
||||
|
||||
['name' => 'admin#backup', 'url' => '/backup', 'verb' => 'GET'],
|
||||
|
||||
|
||||
@ -181,7 +183,7 @@ return [
|
||||
//invoice controller
|
||||
['name' => 'invoice#sendInvoicePdfViaMail', 'url' => '/invoice/{factureId}/sendInvoicePdfViaMail', 'verb' => 'POST'],
|
||||
['name' => 'invoice#getInvoicePdfContent', 'url' => '/invoice/{factureId}/getInvoicePdfContent', 'verb' => 'GET'],
|
||||
|
||||
|
||||
['name' => 'page#apiReloadFec', 'url' => '/apiReloadFec', 'verb' => 'POST' ],
|
||||
]
|
||||
];
|
||||
|
||||
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
@ -4090,6 +4090,29 @@ class PageController extends Controller
|
||||
return $this->myDb->createDefaultGroupFacturation();
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
* @param int $defuntId
|
||||
*/
|
||||
|
||||
public function saveAttestationAbsentPacemaker($defuntId, $email = '')
|
||||
{
|
||||
|
||||
try {
|
||||
$careCertificateFilename = $this->certificateService->generatePacemakerAbsentCertificate($defuntId, $this->idNextcloud);
|
||||
if($careCertificateFilename != null && trim($email) != '') {
|
||||
//send email
|
||||
$this->sendAttachmentToClientByDefunt($defuntId, $careCertificateFilename, $email, "Retrait de pile", "Vous trouverez en pièce jointe l'attestation de retrait de pile ", true);
|
||||
|
||||
}
|
||||
return $careCertificateFilename;
|
||||
|
||||
} catch(\OCP\Files\NotFoundException $e) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
|
||||
@ -29,119 +29,124 @@ namespace OCA\Gestion\Service\Certificate;
|
||||
use DateTime;
|
||||
use DateTimeImmutable;
|
||||
use OCA\Gestion\Db\Bdd;
|
||||
use OCP\Files\IRootFolder;
|
||||
use OCA\Gestion\Helpers\DateHelpers;
|
||||
use OCA\Gestion\Service\Certificate\PdfHandler\CareCertificatePdfHandler;
|
||||
use OCA\Gestion\Service\Certificate\PdfHandler\PacemakerCertificatePdfHandler;
|
||||
use OCP\Files\IRootFolder;
|
||||
use OCA\Gestion\Service\Certificate\PdfHandler\PacemakerAbsentCertificatePdfHandler;
|
||||
|
||||
class CertificateService {
|
||||
/** @var Bdd */
|
||||
private $gestionBdd;
|
||||
class CertificateService
|
||||
{
|
||||
/** @var Bdd */
|
||||
private $gestionBdd;
|
||||
|
||||
/** @var IRootFolder */
|
||||
private $rootFolder;
|
||||
private $rootFolder;
|
||||
|
||||
private const DEFAULT_NEXTCLOUD_ADMIN = "admin";
|
||||
public function __construct(
|
||||
Bdd $gestionBdd,
|
||||
IRootFolder $rootFolder) {
|
||||
public function __construct(
|
||||
Bdd $gestionBdd,
|
||||
IRootFolder $rootFolder
|
||||
) {
|
||||
$this->gestionBdd = $gestionBdd;
|
||||
$this->rootFolder = $rootFolder;
|
||||
}
|
||||
}
|
||||
|
||||
private function signatureImageExists(){
|
||||
private function signatureImageExists()
|
||||
{
|
||||
$storage = $this->rootFolder->getUserFolder(self::DEFAULT_NEXTCLOUD_ADMIN);
|
||||
try{
|
||||
if(isset($storage)){
|
||||
$storage->get("/.gestion/sign.png");
|
||||
try {
|
||||
if(isset($storage)) {
|
||||
$storage->get("/.gestion/sign.png");
|
||||
$signatureExist = true;
|
||||
}else{
|
||||
$signatureExist = false;
|
||||
}
|
||||
}
|
||||
catch(\OCP\Files\NotFoundException $e) {
|
||||
$signatureExist = false;
|
||||
}
|
||||
return $signatureExist;
|
||||
}
|
||||
private function tamponImageExist(){
|
||||
} else {
|
||||
$signatureExist = false;
|
||||
}
|
||||
} catch(\OCP\Files\NotFoundException $e) {
|
||||
$signatureExist = false;
|
||||
}
|
||||
return $signatureExist;
|
||||
}
|
||||
private function tamponImageExist()
|
||||
{
|
||||
$storage = $this->rootFolder->getUserFolder(self::DEFAULT_NEXTCLOUD_ADMIN);
|
||||
try{
|
||||
if(isset($storage)){
|
||||
$storage->get("/.gestion/sign.jpg"); // tampon image
|
||||
try {
|
||||
if(isset($storage)) {
|
||||
$storage->get("/.gestion/sign.jpg"); // tampon image
|
||||
$signatureExist = true;
|
||||
}else{
|
||||
$signatureExist = false;
|
||||
}
|
||||
}
|
||||
catch(\OCP\Files\NotFoundException $e) {
|
||||
$signatureExist = false;
|
||||
}
|
||||
return $signatureExist;
|
||||
}
|
||||
} else {
|
||||
$signatureExist = false;
|
||||
}
|
||||
} catch(\OCP\Files\NotFoundException $e) {
|
||||
$signatureExist = false;
|
||||
}
|
||||
return $signatureExist;
|
||||
}
|
||||
|
||||
private function getLogo(){
|
||||
private function getLogo()
|
||||
{
|
||||
$storage = $this->rootFolder->getUserFolder(self::DEFAULT_NEXTCLOUD_ADMIN);
|
||||
try{
|
||||
try {
|
||||
if(isset($storage)){
|
||||
$file = $storage->get('/.gestion/logo.png');
|
||||
}else{
|
||||
return "nothing";
|
||||
}
|
||||
} catch(\OCP\Files\NotFoundException $e) {
|
||||
$file = $storage->get('/.gestion/logo.jpeg');
|
||||
}
|
||||
}
|
||||
catch(\OCP\Files\NotFoundException $e) {
|
||||
return "nothing";
|
||||
}
|
||||
return base64_encode($file->getContent());
|
||||
}
|
||||
try {
|
||||
try {
|
||||
if(isset($storage)) {
|
||||
$file = $storage->get('/.gestion/logo.png');
|
||||
} else {
|
||||
return "nothing";
|
||||
}
|
||||
} catch(\OCP\Files\NotFoundException $e) {
|
||||
$file = $storage->get('/.gestion/logo.jpeg');
|
||||
}
|
||||
} catch(\OCP\Files\NotFoundException $e) {
|
||||
return "nothing";
|
||||
}
|
||||
return base64_encode($file->getContent());
|
||||
}
|
||||
|
||||
private function setDevisOfDefuntDefaultValue($devisOfDefunt){
|
||||
private function setDevisOfDefuntDefaultValue($devisOfDefunt)
|
||||
{
|
||||
$devisOfDefunt["devis_date"] = new DateTimeImmutable($devisOfDefunt["devis_date"]);
|
||||
$locationOfDevis = "";
|
||||
if($devisOfDefunt['lieu_nom'] != null){
|
||||
if($devisOfDefunt['lieu_nom'] != null) {
|
||||
$locationOfDevis .= $devisOfDefunt['lieu_nom'];
|
||||
}
|
||||
if($devisOfDefunt['lieu_adresse'] != null){
|
||||
if($devisOfDefunt['lieu_adresse'] != null) {
|
||||
$locationOfDevis .= " ". $devisOfDefunt['lieu_adresse'];
|
||||
}
|
||||
$devisOfDefunt['location_of_devis'] = $locationOfDevis;
|
||||
if($devisOfDefunt['thanato_nom'] == null){
|
||||
if($devisOfDefunt['thanato_nom'] == null) {
|
||||
$devisOfDefunt['thanato_nom'] = "";
|
||||
}
|
||||
if($devisOfDefunt['thanato_prenom'] == null){
|
||||
if($devisOfDefunt['thanato_prenom'] == null) {
|
||||
$devisOfDefunt['thanato_prenom'] = "";
|
||||
}
|
||||
if($devisOfDefunt['thanato_reference'] == null){
|
||||
if($devisOfDefunt['thanato_reference'] == null) {
|
||||
$devisOfDefunt['thanato_reference'] = "";
|
||||
}
|
||||
if($devisOfDefunt['client_nom'] == null){
|
||||
if($devisOfDefunt['client_nom'] == null) {
|
||||
$devisOfDefunt['client_nom'] = "";
|
||||
}
|
||||
if($devisOfDefunt['client_prenom'] == null){
|
||||
if($devisOfDefunt['client_prenom'] == null) {
|
||||
$devisOfDefunt['client_prenom'] = "";
|
||||
}
|
||||
if($devisOfDefunt['client_entreprise'] == null){
|
||||
if($devisOfDefunt['client_entreprise'] == null) {
|
||||
$devisOfDefunt['client_entreprise'] = "";
|
||||
}
|
||||
if($devisOfDefunt['client_adresse'] == null){
|
||||
if($devisOfDefunt['client_adresse'] == null) {
|
||||
$devisOfDefunt['client_adresse'] = "";
|
||||
}
|
||||
return $devisOfDefunt;
|
||||
}
|
||||
|
||||
public function generateCareCertificate($defuntId,$idNextCloud){
|
||||
public function generateCareCertificate($defuntId, $idNextCloud)
|
||||
{
|
||||
$storage = $this->rootFolder->getUserFolder($idNextCloud);
|
||||
$configs = json_decode($this->gestionBdd->getConfiguration(self::DEFAULT_NEXTCLOUD_ADMIN));
|
||||
$currentConfig = $configs[0];
|
||||
$logo = $this->getLogo();
|
||||
$devisOfDefunt = $this->gestionBdd->getDevisOfDefunt($defuntId);
|
||||
if($devisOfDefunt == null){
|
||||
return null;
|
||||
}
|
||||
$currentConfig = $configs[0];
|
||||
$logo = $this->getLogo();
|
||||
$devisOfDefunt = $this->gestionBdd->getDevisOfDefunt($defuntId);
|
||||
if($devisOfDefunt == null) {
|
||||
return null;
|
||||
}
|
||||
$devisOfDefunt["configuration"] = $currentConfig;
|
||||
$devisOfDefunt = $this->setDevisOfDefuntDefaultValue($devisOfDefunt);
|
||||
$clean_folder = html_entity_decode(string: $currentConfig->path).'/';
|
||||
@ -150,63 +155,73 @@ class CertificateService {
|
||||
$pdfFilename = $this->GetCareCertificateFilename($devisOfDefunt);
|
||||
$filenamePath = $clean_folder.$careCertificateFolder.$pdfFilename.'.pdf';
|
||||
$pdf = new CareCertificatePdfHandler();
|
||||
$pdf->AddFont('ComicSans','','Comic Sans MS.php');
|
||||
$pdf->AddFont('ComicSans','B','comic-sans-bold.php');
|
||||
$pdf->AddFont('ComicSans', '', 'Comic Sans MS.php');
|
||||
$pdf->AddFont('ComicSans', 'B', 'comic-sans-bold.php');
|
||||
$signatureImageExist = $this->signatureImageExists();
|
||||
$tamponImageExist = $this->tamponImageExist();
|
||||
$pdf->SetCareCertificateData($devisOfDefunt,$logo,$signatureImageExist ,$tamponImageExist);
|
||||
$pdf->SetCareCertificateData($devisOfDefunt, $logo, $signatureImageExist, $tamponImageExist);
|
||||
$pdf->SetCareCertificate();
|
||||
try {
|
||||
$storage->newFolder($folderDestination);
|
||||
}
|
||||
catch(\OCP\Files\NotPermittedException $e) {
|
||||
} catch(\OCP\Files\NotPermittedException $e) {
|
||||
}
|
||||
$pdfContent = $pdf->Output('','S');
|
||||
$pdfContent = $pdf->Output('', 'S');
|
||||
$storage->newFile($filenamePath);
|
||||
$pdfFile = $storage->get($filenamePath);
|
||||
$pdfFile->putContent($pdfContent);
|
||||
return $filenamePath;
|
||||
}
|
||||
|
||||
private function getCareCertificateFolder($devisOfDefunt){
|
||||
private function getCareCertificateFolder($devisOfDefunt)
|
||||
{
|
||||
$careCertificateFolder = 'CLIENTS/'
|
||||
.mb_strtoupper($devisOfDefunt["client_nom"],'UTF-8')
|
||||
.mb_strtoupper($devisOfDefunt["client_nom"], 'UTF-8')
|
||||
.'/DEFUNTS/'
|
||||
.mb_strtoupper($devisOfDefunt["defunt_nom"],'UTF-8').'/'
|
||||
.mb_strtoupper($devisOfDefunt["defunt_nom"], 'UTF-8').'/'
|
||||
.'ATTESTATION/';
|
||||
|
||||
return $careCertificateFolder;
|
||||
}
|
||||
|
||||
private function GetCareCertificateFilename($devisOfDefunt){
|
||||
$filename = 'ATTESTATION_SOIN_'.mb_strtoupper($devisOfDefunt['defunt_nom'],'UTF-8');
|
||||
private function GetCareCertificateFilename($devisOfDefunt)
|
||||
{
|
||||
$filename = 'ATTESTATION_SOIN_'.mb_strtoupper($devisOfDefunt['defunt_nom'], 'UTF-8');
|
||||
return $filename;
|
||||
}
|
||||
|
||||
private function getPacemakerCertificateFolder($devisOfDefunt){
|
||||
private function getPacemakerCertificateFolder($devisOfDefunt)
|
||||
{
|
||||
$folder = 'CLIENTS/'
|
||||
.mb_strtoupper($devisOfDefunt["client_nom"],'UTF-8')
|
||||
.mb_strtoupper($devisOfDefunt["client_nom"], 'UTF-8')
|
||||
.'/DEFUNTS/'
|
||||
.mb_strtoupper($devisOfDefunt["defunt_nom"],'UTF-8').'/'
|
||||
.mb_strtoupper($devisOfDefunt["defunt_nom"], 'UTF-8').'/'
|
||||
.'ATTESTATION/';
|
||||
|
||||
return $folder;
|
||||
}
|
||||
|
||||
private function getPacemakerCertificateFilename($devisOfDefunt){
|
||||
$filename = 'ATTESTATION_PACEMAKER_'.mb_strtoupper($devisOfDefunt['defunt_nom'],'UTF-8');
|
||||
private function getPacemakerCertificateFilename($devisOfDefunt)
|
||||
{
|
||||
$filename = 'ATTESTATION_PACEMAKER_'.mb_strtoupper($devisOfDefunt['defunt_nom'], 'UTF-8');
|
||||
return $filename;
|
||||
}
|
||||
|
||||
public function generatePacemakerCertificate($defuntId,$idNextCloud){
|
||||
private function getPacemakerAbsentCertificateFilename($devisOfDefunt)
|
||||
{
|
||||
$filename = 'ATTESTATION_ABSENCE_PACEMAKER_'.mb_strtoupper($devisOfDefunt['defunt_nom'], 'UTF-8');
|
||||
return $filename;
|
||||
}
|
||||
|
||||
public function generatePacemakerCertificate($defuntId, $idNextCloud)
|
||||
{
|
||||
$storage = $this->rootFolder->getUserFolder($idNextCloud);
|
||||
$configs = json_decode($this->gestionBdd->getConfiguration(self::DEFAULT_NEXTCLOUD_ADMIN));
|
||||
$currentConfig = $configs[0];
|
||||
$logo = $this->getLogo();
|
||||
$devisOfDefunt = $this->gestionBdd->getDevisOfDefunt($defuntId);
|
||||
if($devisOfDefunt == null){
|
||||
return null;
|
||||
}
|
||||
$currentConfig = $configs[0];
|
||||
$logo = $this->getLogo();
|
||||
$devisOfDefunt = $this->gestionBdd->getDevisOfDefunt($defuntId);
|
||||
if($devisOfDefunt == null) {
|
||||
return null;
|
||||
}
|
||||
$devisOfDefunt["configuration"] = $currentConfig;
|
||||
$devisOfDefunt = $this->setDevisOfDefuntDefaultValue($devisOfDefunt);
|
||||
$clean_folder = html_entity_decode(string: $currentConfig->path).'/';
|
||||
@ -215,22 +230,55 @@ class CertificateService {
|
||||
$pdfFilename = $this->getPacemakerCertificateFilename($devisOfDefunt);
|
||||
$filenamePath = $clean_folder.$pacemakerCertificateFolder.$pdfFilename.'.pdf';
|
||||
$pdf = new PacemakerCertificatePdfHandler();
|
||||
$pdf->AddFont('ComicSans','','Comic Sans MS.php');
|
||||
$pdf->AddFont('ComicSans','B','comic-sans-bold.php');
|
||||
$pdf->AddFont('ComicSans', '', 'Comic Sans MS.php');
|
||||
$pdf->AddFont('ComicSans', 'B', 'comic-sans-bold.php');
|
||||
$signatureImageExist = $this->signatureImageExists();
|
||||
$tamponImageExist = $this->tamponImageExist();
|
||||
$pdf->SetPacemakerCertificateData($devisOfDefunt,$logo,$signatureImageExist ,$tamponImageExist);
|
||||
$pdf->SetPacemakerCertificateData($devisOfDefunt, $logo, $signatureImageExist, $tamponImageExist);
|
||||
$pdf->SetPacemakerCertificate();
|
||||
try {
|
||||
$storage->newFolder($folderDestination);
|
||||
}
|
||||
catch(\OCP\Files\NotPermittedException $e) {
|
||||
} catch(\OCP\Files\NotPermittedException $e) {
|
||||
}
|
||||
$pdfContent = $pdf->Output('','S');
|
||||
$pdfContent = $pdf->Output('', 'S');
|
||||
$storage->newFile($filenamePath);
|
||||
$pdfFile = $storage->get($filenamePath);
|
||||
$pdfFile->putContent($pdfContent);
|
||||
return $filenamePath;
|
||||
}
|
||||
|
||||
public function generatePacemakerAbsentCertificate($defuntId, $idNextCloud)
|
||||
{
|
||||
$storage = $this->rootFolder->getUserFolder($idNextCloud);
|
||||
$configs = json_decode($this->gestionBdd->getConfiguration(self::DEFAULT_NEXTCLOUD_ADMIN));
|
||||
$currentConfig = $configs[0];
|
||||
$logo = $this->getLogo();
|
||||
$devisOfDefunt = $this->gestionBdd->getDevisOfDefunt($defuntId);
|
||||
if($devisOfDefunt == null) {
|
||||
return null;
|
||||
}
|
||||
$devisOfDefunt["configuration"] = $currentConfig;
|
||||
$devisOfDefunt = $this->setDevisOfDefuntDefaultValue($devisOfDefunt);
|
||||
$clean_folder = html_entity_decode(string: $currentConfig->path).'/';
|
||||
$pacemakerCertificateFolder = $this->getPacemakerCertificateFolder($devisOfDefunt);
|
||||
$folderDestination = $clean_folder.$pacemakerCertificateFolder;
|
||||
$pdfFilename = $this->getPacemakerAbsentCertificateFilename($devisOfDefunt);
|
||||
$filenamePath = $clean_folder.$pacemakerCertificateFolder.$pdfFilename.'.pdf';
|
||||
$pdf = new PacemakerAbsentCertificatePdfHandler();
|
||||
$pdf->AddFont('ComicSans', '', 'Comic Sans MS.php');
|
||||
$pdf->AddFont('ComicSans', 'B', 'comic-sans-bold.php');
|
||||
$signatureImageExist = $this->signatureImageExists();
|
||||
$tamponImageExist = $this->tamponImageExist();
|
||||
$pdf->SetPacemakerCertificateData($devisOfDefunt, $logo, $signatureImageExist, $tamponImageExist);
|
||||
$pdf->SetPacemakerCertificate();
|
||||
try {
|
||||
$storage->newFolder($folderDestination);
|
||||
} catch(\OCP\Files\NotPermittedException $e) {
|
||||
}
|
||||
$pdfContent = $pdf->Output('', 'S');
|
||||
$storage->newFile($filenamePath);
|
||||
$pdfFile = $storage->get($filenamePath);
|
||||
$pdfFile->putContent($pdfContent);
|
||||
return $filenamePath;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,233 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* Calendar App
|
||||
*
|
||||
* @copyright 2021 Anna Larch <anna.larch@gmx.net>
|
||||
*
|
||||
* @author Anna Larch <anna.larch@gmx.net>
|
||||
* @author Richard Steinmetz <richard@steinmetz.cloud>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Gestion\Service\Certificate\PdfHandler;
|
||||
|
||||
use DateTime;
|
||||
use FPDF;
|
||||
use OCA\Gestion\Helpers\DateHelpers;
|
||||
use OCA\Gestion\Helpers\FileExportHelpers;
|
||||
use OCA\Gestion\Helpers\PriceHelpers;
|
||||
|
||||
class PacemakerAbsentCertificatePdfHandler extends FPDF
|
||||
{
|
||||
private $devisOfDefunt = [];
|
||||
private $logo = null;
|
||||
private $signatureImageExist = false;
|
||||
private $tamponImageExist = false;
|
||||
private $imagePath = "/var/www/html/data/admin/files/.gestion/";
|
||||
|
||||
public function Header()
|
||||
{
|
||||
if ($this->logo != "nothing") {
|
||||
$this->Image($this->imagePath . "logo.png", 10, 10, 50, 35);
|
||||
}
|
||||
|
||||
// En-tête avec les informations de l'entreprise - SOUS le logo
|
||||
$this->SetXY(10, 50); // Position sous le logo
|
||||
$this->SetFont('Arial', 'B', 12);
|
||||
$this->Cell(0, 5, FileExportHelpers::FormatTextForExport($this->devisOfDefunt['configuration']->entreprise), 0, 1);
|
||||
$this->SetFont('Arial', '', 10);
|
||||
$this->MultiCell(0, 4, FileExportHelpers::FormatTextForExport($this->devisOfDefunt['configuration']->adresse), 0, 'L');
|
||||
|
||||
if (isset($this->devisOfDefunt['configuration']->telephone)) {
|
||||
$this->Cell(0, 4, 'Tel : ' . FileExportHelpers::FormatTextForExport($this->devisOfDefunt['configuration']->telephone), 0, 1);
|
||||
}
|
||||
|
||||
if (isset($this->devisOfDefunt['thanato_reference'])) {
|
||||
$this->Cell(0, 4, 'Habilitation : ' . FileExportHelpers::FormatTextForExport($this->devisOfDefunt['thanato_reference']), 0, 1);
|
||||
}
|
||||
|
||||
if (isset($this->devisOfDefunt['configuration']->siret)) {
|
||||
$this->Cell(0, 4, 'Siret : ' . FileExportHelpers::FormatTextForExport($this->devisOfDefunt['configuration']->siret), 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public function Footer()
|
||||
{
|
||||
$this->SetY(-15);
|
||||
$this->MultiCell(0, 5, utf8_decode(html_entity_decode($this->devisOfDefunt['configuration']->legal_one)), 0, 'C');
|
||||
$this->MultiCell(0, 5, utf8_decode(html_entity_decode($this->devisOfDefunt['configuration']->adresse)), 0, 'C');
|
||||
}
|
||||
|
||||
public function SetPacemakerCertificateData(array $devisOfDefunt, $logo = null, $signatureImageExist = false, $tamponImageExist = false)
|
||||
{
|
||||
$this->devisOfDefunt = $devisOfDefunt;
|
||||
$this->logo = $logo;
|
||||
$this->signatureImageExist = $signatureImageExist;
|
||||
$this->tamponImageExist = $tamponImageExist;
|
||||
}
|
||||
|
||||
public function SetPacemakerCertificate()
|
||||
{
|
||||
$this->AddPage();
|
||||
$this->SetMargins(left: 20, top: 0, right: 20);
|
||||
$this->SetPacemakerCertificateTitle();
|
||||
$this->SetPacemakerCertificateContent();
|
||||
}
|
||||
|
||||
private function SetPacemakerCertificateContent()
|
||||
{
|
||||
$this->SetY(100); // Position réduite après le titre
|
||||
|
||||
$this->SetFont('Arial', '', 12);
|
||||
|
||||
// Déterminer le genre selon la civilité
|
||||
$civilite = isset($this->devisOfDefunt['thanato_civilite']) ? $this->devisOfDefunt['thanato_civilite'] : 'Madame';
|
||||
$pronom = 'Je soussignée';
|
||||
$profession = 'thanatopractrice diplômée';
|
||||
|
||||
// Adaptation selon la civilité
|
||||
if (strtolower($civilite) === 'monsieur' || strtolower($civilite) === 'm.' || strtolower($civilite) === 'mr') {
|
||||
$pronom = 'Je soussigné';
|
||||
$profession = 'thanatopracteur diplômé';
|
||||
}
|
||||
|
||||
// Texte principal avec genre adapté
|
||||
$mainText = $pronom . ', ' . $civilite . ' ' .
|
||||
$this->devisOfDefunt['thanato_prenom'] . ' ' . $this->devisOfDefunt['thanato_nom'] .
|
||||
', ' . $profession . ', certifie ne pas avoir constaté, à la palpation, la présence d\'un pacemaker pour :';
|
||||
|
||||
$this->MultiCell(0, 6, FileExportHelpers::FormatTextForExport($mainText));
|
||||
$this->Ln(8);
|
||||
|
||||
// Nom du défunt
|
||||
$this->SetFont('Arial', 'B', 12);
|
||||
$this->Cell(20, 8, 'Nom :', 0, 0);
|
||||
$this->SetFont('Arial', '', 12);
|
||||
$this->Cell(0, 8, FileExportHelpers::FormatTextForExport($this->devisOfDefunt['defunt_nom']), 0, 1);
|
||||
$this->Ln(3);
|
||||
|
||||
// Date
|
||||
$this->SetFont('Arial', 'B', 12);
|
||||
$this->Cell(20, 8, 'Date :', 0, 0);
|
||||
$this->SetFont('Arial', '', 12);
|
||||
if (isset($this->devisOfDefunt['devis_date'])) {
|
||||
$this->Cell(0, 8, $this->devisOfDefunt['devis_date']->format('d/m/Y'), 0, 1);
|
||||
} else {
|
||||
$this->Cell(0, 8, '', 0, 1);
|
||||
}
|
||||
$this->Ln(3);
|
||||
|
||||
// Lieu d'intervention
|
||||
$this->SetFont('Arial', 'B', 12);
|
||||
$this->Cell(40, 8, 'Lieu d\'intervention :', 0, 0);
|
||||
$this->SetFont('Arial', '', 12);
|
||||
$lieu = isset($this->devisOfDefunt['lieu_intervention']) ?
|
||||
$this->devisOfDefunt['lieu_intervention'] :
|
||||
$this->devisOfDefunt['location_of_devis'];
|
||||
$this->Cell(0, 8, FileExportHelpers::FormatTextForExport($lieu), 0, 1);
|
||||
|
||||
// Signatures et cachet - juste après le lieu d'intervention
|
||||
$this->Ln(30); // Petit espace après le lieu d'intervention
|
||||
|
||||
if ($this->signatureImageExist) {
|
||||
$this->Image($this->imagePath."sign.png", 140, $this->GetY(), 40, 16);
|
||||
}
|
||||
|
||||
if($this->tamponImageExist) {
|
||||
$this->SetXY(120, $this->GetY() + 20);
|
||||
$this->Image($this->imagePath."sign.jpg", 120, $this->GetY(), 80, 35);
|
||||
}
|
||||
}
|
||||
|
||||
private function SetPacemakerCertificateTitle()
|
||||
{
|
||||
$this->SetY(y: 85); // Titre plus bas pour éviter l'en-tête
|
||||
$this->SetFont('Arial', 'B', 16);
|
||||
$this->Cell(0, 10, FileExportHelpers::FormatTextForExport('ATTESTATION D\'ABSENCE DE PACEMAKER'), 0, 1, 'C');
|
||||
$this->Ln(5); // Espace réduit après le titre
|
||||
}
|
||||
|
||||
public function MultiAlignCell($w, $h, $text, $border = 0, $ln = 0, $align = 'L', $fill = false)
|
||||
{
|
||||
// Store reset values for (x,y) positions
|
||||
$x = $this->GetX() + $w;
|
||||
$y = $this->GetY();
|
||||
|
||||
// Make a call to FPDF's MultiCell
|
||||
$this->MultiCell($w, $h, $text, $border, $align, $fill);
|
||||
|
||||
// Reset the line position to the right, like in Cell
|
||||
if ($ln == 0) {
|
||||
$this->SetXY($x, $y);
|
||||
}
|
||||
}
|
||||
|
||||
public function NbLines($w, $txt)
|
||||
{
|
||||
// Compute the number of lines a MultiCell of width w will take
|
||||
if (!isset($this->CurrentFont)) {
|
||||
$this->Error('No font has been set');
|
||||
}
|
||||
$cw = $this->CurrentFont['cw'];
|
||||
if ($w == 0) {
|
||||
$w = $this->w - $this->rMargin - $this->x;
|
||||
}
|
||||
$wmax = ($w - 2 * $this->cMargin) * 1000 / $this->FontSize;
|
||||
$s = str_replace("\r", '', (string) $txt);
|
||||
$nb = strlen($s);
|
||||
if ($nb > 0 && $s[$nb - 1] == "\n") {
|
||||
$nb--;
|
||||
}
|
||||
$sep = -1;
|
||||
$i = 0;
|
||||
$j = 0;
|
||||
$l = 0;
|
||||
$nl = 1;
|
||||
while ($i < $nb) {
|
||||
$c = $s[$i];
|
||||
if ($c == "\n") {
|
||||
$i++;
|
||||
$sep = -1;
|
||||
$j = $i;
|
||||
$l = 0;
|
||||
$nl++;
|
||||
continue;
|
||||
}
|
||||
if ($c == ' ') {
|
||||
$sep = $i;
|
||||
}
|
||||
$l += $cw[$c];
|
||||
if ($l > $wmax) {
|
||||
if ($sep == -1) {
|
||||
if ($i == $j) {
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
$i = $sep + 1;
|
||||
}
|
||||
$sep = -1;
|
||||
$j = $i;
|
||||
$l = 0;
|
||||
$nl++;
|
||||
} else {
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
return $nl;
|
||||
}
|
||||
}
|
||||
@ -4,7 +4,7 @@ import "datatables.net-dt/css/jquery.dataTables.css";
|
||||
import "../css/mycss.css";
|
||||
|
||||
import "./listener/main_listener";
|
||||
import { getBibliotheques, exportCareCertificate,getBijouxById, getHypodermiquesyId, getObservationsById, getproduits, saveAttestationPacemaker, saveRapportBijoux, saveRapportSoin, setBijouxPhoto, setDefuntCover, setDefuntPacemakerPhoto, updateDB } from "./modules/ajaxRequest.mjs";
|
||||
import { getBibliotheques, exportCareCertificate,getBijouxById, getHypodermiquesyId, getObservationsById, getproduits, saveAttestationPacemaker, saveAttestationAbsentPacemaker, saveRapportBijoux, saveRapportSoin, setBijouxPhoto, setDefuntCover, setDefuntPacemakerPhoto, updateDB } from "./modules/ajaxRequest.mjs";
|
||||
import { globalConfiguration } from "./modules/mainFunction.mjs";
|
||||
|
||||
let bibliotheques = [];
|
||||
@ -77,6 +77,7 @@ window.addEventListener("DOMContentLoaded", function () {
|
||||
});
|
||||
|
||||
var pacemakerBtn = document.getElementById("pacemakerBtn");
|
||||
var pacemakerAbsentBtn = document.getElementById("pacemakerAbsentBtn");
|
||||
var rapportSoinBtn = document.getElementById("rapportSoinBtn");
|
||||
var exportCareCertificateButton = document.getElementById("exportCareCertificate");
|
||||
var setDefuntCoverButton = this.document.getElementById("coverProductsSetButton");
|
||||
@ -144,6 +145,9 @@ window.addEventListener("DOMContentLoaded", function () {
|
||||
case 'pacemaker':
|
||||
saveAttestationPacemaker({ defuntId: defuntid ,email: isSendEmail ? email: ''});
|
||||
break;
|
||||
case 'pacemakerAbsent':
|
||||
saveAttestationAbsentPacemaker({ defuntId: defuntid ,email: isSendEmail ? email: ''});
|
||||
break;
|
||||
case 'rapport-soin':
|
||||
saveRapportSoin({ numdefunt: defuntid ,email: isSendEmail ? email: ''});
|
||||
break;
|
||||
@ -182,6 +186,12 @@ window.addEventListener("DOMContentLoaded", function () {
|
||||
modalElement.modal('show')
|
||||
// saveAttestationPacemaker({ defuntId: defuntid });
|
||||
});
|
||||
pacemakerAbsentBtn.addEventListener("click", function(){
|
||||
modalTitle.text("Générer l'attestation d'absence pacemaker")
|
||||
modalElement.data('export-type', 'pacemakerAbsent')
|
||||
modalElement.modal('show')
|
||||
// saveAttestationPacemaker({ defuntId: defuntid });
|
||||
});
|
||||
|
||||
rapportSoinBtn.addEventListener("click", function(){
|
||||
modalElement.data('export-type', 'rapport-soin')
|
||||
|
||||
@ -678,6 +678,30 @@ export function saveAttestationPacemaker(myData) {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Save pdf in nextcloud
|
||||
* @param {*} myData
|
||||
*/
|
||||
export function saveAttestationAbsentPacemaker(myData) {
|
||||
showLoader();
|
||||
$.ajax({
|
||||
url: baseUrl + '/saveAttestationAbsentPacemaker',
|
||||
type: 'POST',
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify(myData)
|
||||
}).done(function (response) {
|
||||
if(!response) {
|
||||
showMessage('Ce defunt n\'appartient à aucun devis.');
|
||||
} else {
|
||||
showSuccess('Sauvegardé dans '+ response);
|
||||
}
|
||||
}).fail(function (response, code) {
|
||||
showMessage(t('gestion', 'Erreur dans la génération d\'attestation pacemaker'));
|
||||
}).always(function () {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Save pdf in nextcloud
|
||||
* @param {*} myData
|
||||
|
||||
@ -1,11 +1,15 @@
|
||||
<?php
|
||||
$quantiteOptions = [0];
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
$quantiteOptions[] = $i / 10;
|
||||
$quantiteOptions[] = $i / 10;
|
||||
}
|
||||
for ($i = 1; $i <= 15; $i++) {
|
||||
if ($i > 1) $quantiteOptions[] = $i;
|
||||
if ($i < 15) $quantiteOptions[] = $i + 0.5;
|
||||
if ($i > 1) {
|
||||
$quantiteOptions[] = $i;
|
||||
}
|
||||
if ($i < 15) {
|
||||
$quantiteOptions[] = $i + 0.5;
|
||||
}
|
||||
}
|
||||
$coverProducts = $_['coverProducts'];
|
||||
?>
|
||||
@ -13,7 +17,7 @@ $coverProducts = $_['coverProducts'];
|
||||
<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">
|
||||
@ -26,6 +30,7 @@ $coverProducts = $_['coverProducts'];
|
||||
<div class="div">
|
||||
<button id="exportCareCertificate" class="btn btn-secondary" type="button">Générer l'attestation de soins</button>
|
||||
<button id="pacemakerBtn" class="btn btn-secondary" type="button">Générer l'attestation retrait de pile</button>
|
||||
<button id="pacemakerAbsentBtn" class="btn btn-secondary" type="button">Générer l'attestation d'Absence de Pacemacker</button>
|
||||
<button id="rapportSoinBtn" class="btn btn-secondary" type="button">Générer le rapport de soins</button>
|
||||
<button id="showRapportBijouxExportModal" class="btn btn-secondary" type="button" data-toggle="modal" data-target="#saveRapportBijouxModal">Générer le rapport des bijoux</button>
|
||||
</div>
|
||||
@ -76,8 +81,12 @@ $coverProducts = $_['coverProducts'];
|
||||
<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> -->
|
||||
@ -109,11 +118,11 @@ $coverProducts = $_['coverProducts'];
|
||||
<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
|
||||
}
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -202,8 +211,12 @@ $coverProducts = $_['coverProducts'];
|
||||
<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>
|
||||
@ -225,7 +238,9 @@ $coverProducts = $_['coverProducts'];
|
||||
<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>
|
||||
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if ($_['defunt'][0]->preinjection_qte == $quantiteOptions[$i]) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $quantiteOptions[$i] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
@ -248,8 +263,12 @@ $coverProducts = $_['coverProducts'];
|
||||
<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>
|
||||
@ -259,7 +278,9 @@ $coverProducts = $_['coverProducts'];
|
||||
<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>
|
||||
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if ($_['defunt'][0]->injection_qte == $quantiteOptions[$i]) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $quantiteOptions[$i] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
@ -282,7 +303,9 @@ $coverProducts = $_['coverProducts'];
|
||||
<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>
|
||||
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if ($_['defunt'][0]->coinjection_qte == $quantiteOptions[$i]) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $quantiteOptions[$i] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
@ -305,8 +328,12 @@ $coverProducts = $_['coverProducts'];
|
||||
<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>
|
||||
@ -316,7 +343,9 @@ $coverProducts = $_['coverProducts'];
|
||||
<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>
|
||||
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if ($_['defunt'][0]->drainage_qte == $quantiteOptions[$i]) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $quantiteOptions[$i] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
@ -339,7 +368,9 @@ $coverProducts = $_['coverProducts'];
|
||||
<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>
|
||||
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if ($_['defunt'][0]->ponction_qte == $quantiteOptions[$i]) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $quantiteOptions[$i] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
@ -362,7 +393,9 @@ $coverProducts = $_['coverProducts'];
|
||||
<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>
|
||||
<option value="<?php echo $quantiteOptions[$i] ?>" <?php if ($_['defunt'][0]->cavite_qte == $quantiteOptions[$i]) {
|
||||
echo 'selected';
|
||||
} ?>><?php echo $quantiteOptions[$i] ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
@ -417,7 +450,9 @@ $coverProducts = $_['coverProducts'];
|
||||
<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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user