This commit is contained in:
KONE SOREL 2026-01-22 19:56:58 +00:00
parent 34d6ede61a
commit 2aafb10b30
3 changed files with 183 additions and 27 deletions

View File

@ -5816,15 +5816,17 @@ function remplacer_adherent()
{ {
v_msg="Cette famille en a déjà remplacé une autre, confirmez-vous son remplacement à son tour?"; v_msg="Cette famille en a déjà remplacé une autre, confirmez-vous son remplacement à son tour?";
v_msgEng="This family has already replaced another, do you confirm its replacement in turn?"; v_msgEng="This family has already replaced another, do you confirm its replacement in turn?";
if(confirm_ebene(v_msg, v_msgEng)) confirm_ebene(v_msg, v_msgEng)
{ .then((isConfirmed) => {
fiche_remplacer_adherent(); if (isConfirmed) {
} // L'utilisateur a confirmé
else fiche_remplacer_adherent();
{ } else {
consulter_remplacant_adherent(); // L'utilisateur a annulé
} consulter_remplacant_adherent();
}
});
} }
} }
else else
@ -5972,4 +5974,158 @@ function init_remplacement_adherent()
$(".datepicker" ).datepicker(); $(".datepicker" ).datepicker();
} }
}); });
}
function enregistrer_remplacement_adherent()
{
nom = $("#nom").val();
if ($("#nom").val()<" ")
{
v_msg="Veuillez saisir le nom de famille!";
v_msgEng="Please enter the last name!";
alert_ebene(v_msg, v_msgEng);
$("#nom").focus();
return;
}
prenoms = $("#prenoms").val();
if ($("#prenoms").val()<" ")
{
v_msg="Veuillez saisir le prénom!";
v_msgEng="Please enter the first name!";
alert_ebene(v_msg, v_msgEng);
$("#prenoms").focus();
return;
}
codeNaturePiece = $("#codeNaturePiece").val();
if ($("#codeNaturePiece").val()<" ")
{
v_msg="Veuillez saisir la nature de pièce d\'identité!";
v_msgEng="Please enter the nature of ID!";
alert_ebene(v_msg, v_msgEng);
$("#codeNaturePiece").focus();
return;
}
numeroPiece = $("#numeroPiece").val();
if ($("#numeroPiece").val()<" ")
{
v_msg="Veuillez saisir le No de la pièce d\'identité!";
v_msgEng="Please enter the ID number!";
alert_ebene(v_msg, v_msgEng);
$("#numeroPiece").focus();
return;
}
sexe = $("#sexe").val();
if ($("#sexe").val()<" ")
{
v_msg="Veuillez saisir le sexe!";
v_msgEng="Please enter the sex!";
alert_ebene(v_msg, v_msgEng);
$("#sexe").focus();
return;
}
dateNaissance = $("#dateNaissance").val();
if ($("#dateNaissance").val()<" ")
{
v_msg="Veuillez saisir la date de naissance!";
v_msgEng="Please enter the date of birth!";
alert_ebene(v_msg, v_msgEng);
$("#dateNaissance").focus();
return;
}
codeGroupeSanguin = $("#codeGroupeSanguin").val();
if ($("#codeGroupeSanguin").val()<" ")
{
v_msg="Veuillez saisir le groupe sanguin!";
v_msgEng="Please enter the blood type!";
alert_ebene(v_msg, v_msgEng);
$("#codeGroupeSanguin").focus();
return;
}
codeSituationFamille = $("#codeSituationFamille").val();
if ($("#codeSituationFamille").val()<" ")
{
v_msg="Veuillez saisir la situation familiale!";
v_msgEng="Please enter the family situation!";
alert_ebene(v_msg, v_msgEng);
$("#codeSituationFamille").focus();
return;
}
nombreEnfants = $("#nombreEnfants").val();
adresseGeo = $("#adresseGeo").val();
adressePostale = $("#adressePostale").val();
codePays = $("#codePays").val();
if ($("#codePays").val()<" ")
{
v_msg="Veuillez indiquer le pays!";
v_msgEng="Please indicate the country!";
alert_ebene(v_msg, v_msgEng);
$("#codePays").focus();
return;
}
telephonFixe = $("#telephonFixe").val();
telephonePortable = $("#telephonePortable").val();
email = $("#email").val();
fraisCarte = $("#fraisCarte").val();
donnees = 'nom='+nom+'&prenoms='+prenoms+'&codeNaturePiece='+codeNaturePiece;
donnees += '&numeroPiece='+numeroPiece+'&sexe='+sexe+'&dateNaissance='+dateNaissance;
donnees += '&codeGroupeSanguin='+codeGroupeSanguin+'&codeSituationFamille='+codeSituationFamille+'&nombreEnfants='+nombreEnfants;
donnees += '&adresseGeo='+adresseGeo+'&adressePostale='+adressePostale+'&codePays='+codePays;
donnees += '&telephonFixe='+telephonFixe+'&telephonePortable='+telephonePortable+'&email='+email+'&fraisCarte='+fraisCarte;
v_msg="Confirmez-vous le remplacement de famille?";
v_msgEng="Do you confirm family replacement?";
confirm_ebene(v_msg, v_msgEng)
.then((isConfirmed) => {
if (isConfirmed) {
// L'utilisateur a confirmé
$("#div_remplacement_adherent").html('<div style="padding-top:80px;"><img src="Bootstrap/images/loading.gif"/>&nbsp;&nbsp;<span style="font-size:15pt;">' + 'Veuillez patienter... / Please wait...' + '</span></div>');
$.ajax({
url: $("#racineWeb").val()+"Ajaxremplaceradherent/enregistrerremplacementadherent/",
type : 'post',
data: donnees,
error: function(errorData) {
},
success: function(data)
{
},
complete: function()
{
v_msg="Opération effectuée avec succès!";
v_msgEng="Operation successfully completed";
alert_ebene(v_msg, v_msgEng);
consulter_remplacement_adherent();
}
});
}
});
} }

View File

@ -62,32 +62,32 @@
<div class="card-body p-4"> <div class="card-body p-4">
<div class="row g-3 mb-4"> <div class="row g-3 mb-4">
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label small fw-bold"><?= _("Nom") ?></label> <label class="form-label small fw-bold text-uppercase"><?= _("Nom") ?></label>
<input class="form-control text-uppercase border-success" type="text" id="nom" name="nom" required> <input class="form-control text-uppercase border-success" type="text" id="nom" name="nom" required>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label small fw-bold"><?= _("Prénoms") ?></label> <label class="form-label small fw-bold text-uppercase"><?= _("Prénoms") ?></label>
<input class="form-control border-success" type="text" id="prenoms" name="prenoms" required> <input class="form-control border-success" type="text" id="prenoms" name="prenoms" required>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label class="form-label small text-muted"><?= _("Nature Pièce") ?></label> <label class="form-label small fw-bold text-uppercase"><?= _("Nature Pièce") ?></label>
<select class="form-select" id="codeNaturePiece" name="codeNaturePiece"> <select class="form-select" id="codeNaturePiece" name="codeNaturePiece">
<?php liste_options($naturepiece,""); ?> <?php liste_options($naturepiece,""); ?>
</select> </select>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label class="form-label small text-muted"><?= _("N° Pièce") ?></label> <label class="form-label small fw-bold text-uppercase"><?= _("N° Pièce") ?></label>
<input class="form-control" type="text" id="numeroPiece" name="numeroPiece"> <input class="form-control" type="text" id="numeroPiece" name="numeroPiece">
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<label class="form-label small text-muted"><?= _("Sexe") ?></label> <label class="form-label small fw-bold text-uppercase"><?= _("Sexe") ?></label>
<select class="form-select" id="sexe" name="sexe"> <select class="form-select" id="sexe" name="sexe">
<?php liste_options($sexe,""); ?> <?php liste_options($sexe,""); ?>
</select> </select>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label class="form-label small fw-bold"><?= _("Date Naissance") ?></label> <label class="form-label small fw-bold text-uppercase"><?= _("Date Naissance") ?></label>
<div class="input-group"> <div class="input-group">
<input class="form-control datepicker" type="text" id="dateNaissance" name="dateNaissance" onchange="controle_age($('#dateNaissance').datepicker('getDate'), 'A')"> <input class="form-control datepicker" type="text" id="dateNaissance" name="dateNaissance" onchange="controle_age($('#dateNaissance').datepicker('getDate'), 'A')">
<span class="input-group-text bg-light text-danger fw-bold" id="age_badge">Age: 0</span> <span class="input-group-text bg-light text-danger fw-bold" id="age_badge">Age: 0</span>
@ -99,57 +99,57 @@
<div class="row g-3 mb-4"> <div class="row g-3 mb-4">
<div class="col-md-3"> <div class="col-md-3">
<label class="form-label small text-muted"><?= _("Groupe Sanguin") ?></label> <label class="form-label small fw-bold text-uppercase"><?= _("Groupe Sanguin") ?></label>
<select class="form-select" id="codeGroupeSanguin" name="codeGroupeSanguin"> <select class="form-select" id="codeGroupeSanguin" name="codeGroupeSanguin">
<?php liste_options($groupesanguin,""); ?> <?php liste_options($groupesanguin,""); ?>
</select> </select>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label class="form-label small text-muted"><?= _("Situation Familiale") ?></label> <label class="form-label small fw-bold text-uppercase"><?= _("Situation Familiale") ?></label>
<select class="form-select" id="codeSituationFamille" name="codeSituationFamille"> <select class="form-select" id="codeSituationFamille" name="codeSituationFamille">
<?php liste_options($situationfamille,""); ?> <?php liste_options($situationfamille,""); ?>
</select> </select>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<label class="form-label small text-muted"><?= _("Nb Enfants") ?></label> <label class="form-label small fw-bold text-uppercase"><?= _("Nb Enfants") ?></label>
<input class="form-control" type="number" id="nombreEnfants" name="nombreEnfants" min="0" value="0"> <input class="form-control" type="number" id="nombreEnfants" name="nombreEnfants" min="0" value="0">
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label class="form-label small text-muted"><?= _("Pays") ?></label> <label class="form-label small fw-bold text-uppercase"><?= _("Pays") ?></label>
<select class="form-select" id="codePays" name="codePays"> <select class="form-select" id="codePays" name="codePays">
<?php liste_options($pays, $_SESSION['codePaysSociete']); ?> <?php liste_options($pays, $_SESSION['codePaysSociete']); ?>
</select> </select>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label small text-muted"><?= _("Adresse Géographique") ?></label> <label class="form-label small fw-bold text-uppercase"><?= _("Adresse Géographique") ?></label>
<input class="form-control form-control-sm" type="text" id="adresseGeo" name="adresseGeo"> <input class="form-control form-control-sm" type="text" id="adresseGeo" name="adresseGeo">
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="form-label small text-muted"><?= _("Adresse Postale") ?></label> <label class="form-label small fw-bold text-uppercase"><?= _("Adresse Postale") ?></label>
<input class="form-control form-control-sm" type="text" id="adressePostale" name="adressePostale"> <input class="form-control form-control-sm" type="text" id="adressePostale" name="adressePostale">
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label class="form-label small text-muted"><?= _("Téléphone Portable") ?></label> <label class="form-label small fw-bold text-uppercase"><?= _("Téléphone Portable") ?></label>
<input class="form-control" type="tel" id="telephonePortable" name="telephonePortable" value="<?= $_SESSION['indicatifTelephone'] ?>"> <input class="form-control" type="tel" id="telephonePortable" name="telephonePortable" value="<?= $_SESSION['indicatifTelephone'] ?>">
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label class="form-label small text-muted"><?= _("E-mail") ?></label> <label class="form-label small fw-bold text-uppercase"><?= _("E-mail") ?></label>
<input class="form-control" type="email" id="email" name="email" placeholder="exemple@mail.com"> <input class="form-control" type="email" id="email" name="email" placeholder="exemple@mail.com">
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label class="form-label small text-muted"><?= _("Frais de Carte") ?></label> <label class="form-label small fw-bold text-uppercase"><?= _("Frais de Carte") ?></label>
<div class="input-group"> <div class="input-group">
<input class="form-control border-primary fw-bold" type="text" id="fraisCarte" name="fraisCarte" value="<?=$adherentremplacanttemp['fraisCarte']?>"> <input class="form-control border-primary fw-bold" type="text" id="fraisCarte" name="fraisCarte" value="<?=$adherentremplacanttemp['fraisCarte']?>">
<span class="input-group-text">CFA</span> <span class="input-group-text"><?= $_SESSION['devise_C']?></span>
</div> </div>
</div> </div>
</div> </div>
<div class="row mt-4"> <div class="row mt-4">
<div class="col-12"> <div class="col-12">
<button type="button" class="btn btn-success w-100 py-3 fw-bold shadow-sm" onclick="javascript:enregistrer_remplacement_adherent();"> <button type="button" class="btn btn-success w-100 py-3 fw-bold shadow-sm" onclick="javascript:enregistrfw-bold text-uppercaseer_remplacement_adherent();">
<i class="fas fa-save me-2"></i> <?= _("VALIDER ET ENREGISTRER LE REMPLACEMENT") ?> <i class="fas fa-save me-2"></i> <?= _("VALIDER ET ENREGISTRER LE REMPLACEMENT") ?>
</button> </button>
</div> </div>

View File

@ -29,7 +29,7 @@
<div class="row g-3"> <div class="row g-3">
<div class="col-md-4"> <div class="col-md-4">
<label class="form-label small text-uppercase fw-bold mb-0"><?= _("Adhérent") ?></label> <label class="form-label small text-uppercase fw-bold mb-0"><?= _("Adhérent") ?></label>
<div class="fw-bold text-uppercase p-2 border rounded bg-white"> <div class="fw-bold text-uppercase p-2 border rounded bg-gray">
<?= $this->nettoyer($adherent['nom']) ?> <?= $this->nettoyer($adherent['prenoms']) ?> <?= $this->nettoyer($adherent['nom']) ?> <?= $this->nettoyer($adherent['prenoms']) ?>
</div> </div>
</div> </div>