Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
424 changes: 0 additions & 424 deletions bd/gestion_orphelinah.sql

This file was deleted.

486 changes: 486 additions & 0 deletions bd/musosa.sql

Large diffs are not rendered by default.

43 changes: 40 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,48 @@
<?php
include_once("connexion/connexion.php");
$annee_en_cours=date('Y');
$sel_annee=$connexion->prepare("SELECT * from anneeprestation order by id desc limit 1");
$sel_annee->execute();
if($select=$sel_annee->fetch())
{
$paquet=$select['paquet'];
$annee=$select['annee'];
$pourcentage=$select['pourcentage'];

if($annee_en_cours>$annee)
{

$req = $connexion->prepare("INSERT INTO `anneeprestation`(`annee`, `paquet`, `pourcentage`) VALUES (?,?,?)");
$req->execute(array($annee_en_cours, $paquet, $pourcentage));
}
else
{

}

}
else
{
$req = $connexion->prepare("INSERT INTO `anneeprestation`(`annee`) VALUES (?)");
$req->execute(array($annee_en_cours));

}




?>



<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">

<title>MUSOSA</title>
<title>MUSOSA </title>
<meta content="" name="description">
<meta content="" name="keywords">

Expand Down Expand Up @@ -54,7 +91,7 @@
</a>
<nav id="navbar" class="navbar">
<ul>
<li><a href="#about">Acceuil</a></li>
<li><a href="#about">Acceuil </a></li>
<li><a href="#produit">Produit</a></li>
<li><a href="#recent-posts">Information</a></li>
<li><a href="#contact">Contact</a></li>
Expand Down Expand Up @@ -84,7 +121,7 @@ class="bi bi-chevron-down dropdown-indicator"></i></a>
<div class="container" data-aos="fade-up">

<div class="section-header">
<h2>MUSOSA</h2>
<h2>MUSOSA </h2>
<p>Tous ensemble pour la Santé</p>
</div>

Expand Down
20 changes: 20 additions & 0 deletions models/add/add-bon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
include_once("../../connexion/connexion.php");
if (isset($_POST["valider"])) {
$supprimer=0;
$date=date('Y-m-d');
$beneficiaire=$_GET['ben'];
$user= $_SESSION['id'];
$fosa = htmlspecialchars($_POST["fosa"]);

echo $beneficiaire.$fosa;
$req = $connexion->prepare("INSERT INTO bonsoin(dates,matricule,fosa,utilisateur,supprimer) VALUES (?,?,?,?,?)");
$req->execute(array($date,$beneficiaire,$fosa,$user,$supprimer));
if ($req) {
$_SESSION["msg"] = "Enregistrement reussi";
header("location:../../views/bon.php");
} else {
$_SESSION["msg"] = "Echec d'enregistrement";
header("location:../../views/bon.php");
}
}
89 changes: 89 additions & 0 deletions models/add/add-episode.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php
include_once("../../connexion/connexion.php");
if (isset($_POST["valider_episode"])) {
$supprimer=0;
$date=date('Y-m-d');
$matricule=$_GET['ben'];
$facture = htmlspecialchars($_POST["facture"]);
$sejour=htmlspecialchars($_POST['sejour']);
$pathologie=htmlspecialchars($_POST['pathologie']);
$bon=$_GET['bon'];
$annee=date('Y');

$sel_an=$connexion->prepare("SELECT * FROM `anneeprestation` WHERE annee=? ORDER BY id DESC limit 1");
$sel_an->execute(array($annee));
$annee_pre=$sel_an->fetch();
$annee_prestation=$annee_pre['id'];

echo $matricule.$facture.$annee_prestation;
$req = $connexion->prepare("INSERT INTO episode(bonsoin,facture,matricule,date_op,annee_prestation,sejour,pathologie) VALUES (?,?,?,?,?,?,?)");
$req->execute(array($bon,$facture,$matricule,$date,$annee_prestation,$sejour,$pathologie));
if ($req) {
$_SESSION["msg"] = "Enregistrement reussi";
$sel_epi=$connexion->prepare("SELECT * from episode where bonsoin=? and facture=? and matricule=? and date_op=? and annee_prestation=? order by id desc limit 1");
$sel_epi->execute(array($bon,$facture,$matricule,$date,$annee_prestation));
if($epi=$sel_epi->fetch())
{
$episode=$epi['id'];
header("location:../../views/episode.php?neeew&episode=$episode");
}
else
{
$_SESSION["msg"] = "veillez mettre a jour l'annee de prestation";
header("location:../../views/episode.php");
}

} else {
$_SESSION["msg"] = "Echec d'enregistrement";
header("location:../../views/episode.php?neew");
}
}

if(isset($_POST['valider']))
{
$user= $_SESSION['id'];
$partmusosa=0;
$partbeneficiaire=0;
$episode=$_GET['episode'];
$annee=date('Y');
$service=htmlspecialchars($_POST['service']);

$montant=htmlspecialchars($_POST['montant']);
$sel_pour=$connexion->prepare("SELECT * FROM `anneeprestation` WHERE annee=? ORDER BY id DESC limit 1");
$sel_pour->execute(array($annee));
if($pourc=$sel_pour->fetch())
{
$pourcentage=$pourc['pourcentage'];
// echo $pourcentage;
}
else
{
$_SESSION["msg"] = "veillez mettre a jour l'annee de prestation";
header("location:../../views/episode.php");
}
if($service==0)
{
$partmusosa=0;
$partbeneficiaire=$montant;
echo $partbeneficiaire."/".$partmusosa;
}
else
{
$partmusosa=$montant*$pourcentage/100;
$partbeneficiaire=$montant-$partmusosa;

echo $partbeneficiaire."/".$partmusosa;
}
$req=$connexion->prepare("INSERT INTO episode_op(episode,service,total,partmusosa,partbeneficiare,utilisateur) values (?,?,?,?,?,?)");
$req->execute(array($episode,$service,$montant,$partmusosa,$partbeneficiaire,$user));
if ($req) {
$_SESSION["msg"] = "Enregistrement reussi";
header("location:../../views/episode.php?neeew&episode=$episode");
} else {
$_SESSION["msg"] = "Echec d'enregistrement";
header("location:../../views/episode.php?neeew");
}



}
18 changes: 18 additions & 0 deletions models/delete/del-bon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
include('../../connexion/connexion.php');
if (isset($_GET['idSup']) && !empty($_GET['idSup'])) {
$id = $_GET['idSup'];
$supprimer = 1;
$req = $connexion->prepare("UPDATE bonsoin SET supprimer=? WHERE id=?");
$resultat = $req->execute([$supprimer, $id]);

if ($resultat == true) {
$_SESSION['msg'] = "Suppression réussie";
header("location:../../views/bon.php");
} else {
$_SESSION['msg'] = "Echec de la suppression";
header("location:../../views/bon.php");
}
} else {
header("location:../../views/bon.php");
}
13 changes: 13 additions & 0 deletions models/select/select-bon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php if(isset($_GET['search']))
{
$recherche=$_GET['search'];
$selben=$connexion->prepare("SELECT * From beneficiaire where beneficiaire.supprimer=0 and beneficiaire.matricule LIKE ? OR beneficiaire.nom LIKE ? OR beneficiaire.postnom LIKE ? OR beneficiaire.prenom LIKE ? OR beneficiaire.tel LIKE ?");
$selben->execute(["%".$recherche."%","%".$recherche."%","%".$recherche."%","%".$recherche."%","%".$recherche."%"]);
$message="Aucun element correspond a votre recherche";

}
else{
$selben=$connexion->prepare("SELECT * from beneficiaire where supprimer=0");
$selben->execute();
$message="Veillez creer le beneficiaire";
}
13 changes: 13 additions & 0 deletions models/select/select-episode.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php if(isset($_GET['search']))
{
$recherche=$_GET['search'];
$selben=$connexion->prepare("SELECT beneficiaire.*,bonsoin.dates,bonsoin.id as idb,fosa.desingation FROM beneficiaire,bonsoin,fosa where bonsoin.fosa=fosa.id and beneficiaire.matricule=bonsoin.matricule and bonsoin.supprimer=0 and (bonsoin.id) NOT in (SELECT bonsoin from episode) and bonsoin.id=?");
$selben->execute(array($recherche));
$message="Aucun element correspond a votre recherche";

}
else{
$selben=$connexion->prepare("SELECT beneficiaire.*,bonsoin.dates,bonsoin.id as idb,fosa.desingation FROM beneficiaire,bonsoin,fosa where bonsoin.fosa=fosa.id and beneficiaire.matricule=bonsoin.matricule and bonsoin.supprimer=0 and (bonsoin.id) NOT in (SELECT bonsoin from episode);");
$selben->execute();
$message="Veillez ajouter un bon d'abord";
}
16 changes: 14 additions & 2 deletions views/aside.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,25 @@
<li><a href="services.php">Services</a></li>
</ul>
</li>
<li class="dropdown">

<!-- <li class="dropdown">
<a href="#" class="nav-link has-dropdown"><i class="bi bi-people"></i> <span>Bon de soin de Santé</span></a>
<ul class="dropdown-menu">
<li><a href="BonSoin.php"> Etablir Bon soin</a></li>
<li><a href="ListeBion.php">Liste Bon soin</a></li>
</ul>
</li>
</li> -->


<li class="dropdown">
<a href="#" class="nav-link has-dropdown"><i class="bi bi-people"></i> <span>facturation</span></a>
<ul class="dropdown-menu">
<li><a href="bon.php">Bon</a></li>
<li><a href="episode.php">Episode et facturation</a></li>

</ul>
</li>


<li>
<a class="nav-link active" href="user.php"><i class="bi bi-person"></i> <span>Utilisateurs</span></a>
Expand Down
Loading