Compare commits
31 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b14060fd9f | ||
|
aae15b6693 | ||
|
1361815ceb | ||
|
fbb806123f | ||
|
0e88f5691b | ||
|
d318398632 | ||
|
34234fd5fc | ||
|
30b3cf0e62 | ||
|
7f42c1dc8f | ||
|
382275409e | ||
|
64c161d157 | ||
|
05246a1c9b | ||
|
479b33b6b5 | ||
|
4dbb9dbb02 | ||
|
e7ccb15c44 | ||
|
0ed841df0f | ||
|
b07b3ff28f | ||
|
44e8d2d357 | ||
|
ac9209740d | ||
|
61c8fdc536 | ||
|
f1ccd39f15 | ||
|
901b0b7693 | ||
|
755a9451b4 | ||
|
0debe9ff84 | ||
|
22c5a34c06 | ||
|
050a79dd07 | ||
|
d6ba333df3 | ||
|
d32990ad03 | ||
|
f914096f8c | ||
|
808ae02761 | ||
|
2ae9bb9cee |
|
@ -86,3 +86,7 @@ ATTENTION : Pour la saisie du nombre de jour, le séparateur décimal est le poi
|
||||||
Vous voilà maintenant prêt à utiliser cet utilitaire de gestion des congés !
|
Vous voilà maintenant prêt à utiliser cet utilitaire de gestion des congés !
|
||||||
|
|
||||||
Faites-en bon usage ! ;-)
|
Faites-en bon usage ! ;-)
|
||||||
|
|
||||||
|
## III. DÉMO
|
||||||
|
|
||||||
|
[Accéder à la démo](https://demo.am-networks.fr/GestionConges-PHP)
|
||||||
|
|
|
@ -4,11 +4,10 @@
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
<meta name="viewport" content="width=device-width">
|
<meta name="viewport" content="width=device-width">
|
||||||
<?php
|
<?php
|
||||||
require('sqlconnect.php');
|
require('class.sqlconnect.php');
|
||||||
?>
|
?>
|
||||||
</head>
|
</head>
|
||||||
<?php
|
<?php
|
||||||
require('sqlconnect.php');
|
|
||||||
|
|
||||||
$datedebut = $_POST['datedebut'];
|
$datedebut = $_POST['datedebut'];
|
||||||
$datefin = $_POST['datefin'];
|
$datefin = $_POST['datefin'];
|
||||||
|
@ -21,7 +20,7 @@ $req = "INSERT INTO $table VALUES ('$datedebut','$datefin','$nbjours','$type');"
|
||||||
$resultat = $mysqli->query($req);
|
$resultat = $mysqli->query($req);
|
||||||
if ($resultat) {
|
if ($resultat) {
|
||||||
echo "<p>La saisie a été ajoutée !</p>";
|
echo "<p>La saisie a été ajoutée !</p>";
|
||||||
header("refresh:2; url=index.php");
|
header("refresh:2; url=../index.php");
|
||||||
}else{
|
}else{
|
||||||
echo "<p>Erreur</p>";
|
echo "<p>Erreur</p>";
|
||||||
};
|
};
|
||||||
|
|
13
class/class.clearcp.php
Normal file
13
class/class.clearcp.php
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?php
|
||||||
|
require('class.sqlconnect.php');
|
||||||
|
$mysqli = new mysqli($servername, $username, $password, $dbname);
|
||||||
|
$mysqli->set_charset("utf8");
|
||||||
|
$req = "DELETE FROM $table WHERE type = 'cp' ;";
|
||||||
|
$resultat = $mysqli->query($req);
|
||||||
|
if ($resultat) {
|
||||||
|
echo "<p>Les congés payés ont été supprimés !</p>";
|
||||||
|
header("refresh:2; url=../index.php");
|
||||||
|
}else{
|
||||||
|
echo "<p>Erreur</p>";
|
||||||
|
};
|
||||||
|
?>
|
13
class/class.clearrtt.php
Normal file
13
class/class.clearrtt.php
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?php
|
||||||
|
require('class.sqlconnect.php');
|
||||||
|
$mysqli = new mysqli($servername, $username, $password, $dbname);
|
||||||
|
$mysqli->set_charset("utf8");
|
||||||
|
$req = "DELETE FROM $table WHERE type = 'rtt' ;";
|
||||||
|
$resultat = $mysqli->query($req);
|
||||||
|
if ($resultat) {
|
||||||
|
echo "<p>Les RTT ont été supprimés !</p>";
|
||||||
|
header("refresh:2; url=../index.php");
|
||||||
|
}else{
|
||||||
|
echo "<p>Erreur</p>";
|
||||||
|
};
|
||||||
|
?>
|
|
@ -3,7 +3,7 @@
|
||||||
//require('config.php');
|
//require('config.php');
|
||||||
|
|
||||||
function soldertt($table, $rttparan, $conn){
|
function soldertt($table, $rttparan, $conn){
|
||||||
$resultrtt = mysqli_query($conn, "SELECT SUM(nbjours) AS decomptertt FROM $table WHERE type='RTT' AND datedebut LIKE ");
|
$resultrtt = mysqli_query($conn, "SELECT SUM(nbjours) AS decomptertt FROM $table WHERE type='RTT'");
|
||||||
$rowrtt = mysqli_fetch_assoc($resultrtt);
|
$rowrtt = mysqli_fetch_assoc($resultrtt);
|
||||||
$sumrtt = $rowrtt['decomptertt'];
|
$sumrtt = $rowrtt['decomptertt'];
|
||||||
$rtt = ($rttparan - $sumrtt);
|
$rtt = ($rttparan - $sumrtt);
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
<meta name="viewport" content="width=device-width">
|
<meta name="viewport" content="width=device-width">
|
||||||
<?php
|
<?php
|
||||||
require('sqlconnect.php');
|
require('class.sqlconnect.php');
|
||||||
|
//require('config.php');
|
||||||
|
//require('class.functions.php');
|
||||||
?>
|
?>
|
||||||
</head>
|
</head>
|
||||||
<?php
|
<?php
|
||||||
require('sqlconnect.php');
|
|
||||||
|
|
||||||
$actual_link = $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
$actual_link = $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
||||||
$url_components = parse_url($actual_link);
|
$url_components = parse_url($actual_link);
|
||||||
parse_str($url_components['query'], $params);
|
parse_str($url_components['query'], $params);
|
||||||
|
@ -22,8 +22,8 @@ $req = "DELETE FROM $table WHERE datedebut = '$datedebut' AND datefin = '$datefi
|
||||||
$resultat = $mysqli->query($req);
|
$resultat = $mysqli->query($req);
|
||||||
if ($resultat) {
|
if ($resultat) {
|
||||||
echo "<p>La saisie a été supprimée !</p>";
|
echo "<p>La saisie a été supprimée !</p>";
|
||||||
header("refresh:2; url=index.php");
|
header("refresh:2; url=../index.php");
|
||||||
}else{
|
}else{
|
||||||
echo "<p>Erreur</p>";
|
echo "<p>Erreur</p>";
|
||||||
};
|
}
|
||||||
?>
|
?>
|
||||||
|
|
10
index.php
10
index.php
|
@ -13,7 +13,7 @@
|
||||||
<body>
|
<body>
|
||||||
<h1>Gestion des congés - Affichage</h1>
|
<h1>Gestion des congés - Affichage</h1>
|
||||||
<h2>Année en cours : <?php echo date('Y'); ?></h2>
|
<h2>Année en cours : <?php echo date('Y'); ?></h2>
|
||||||
<a href="saisie.php">Saisir des congés</a>
|
<button onclick="window.location.href='saisie.php'" class="button">Saisir des congés</button>
|
||||||
<br><br>
|
<br><br>
|
||||||
<?php
|
<?php
|
||||||
$sql = "SELECT * FROM $table";
|
$sql = "SELECT * FROM $table";
|
||||||
|
@ -42,7 +42,10 @@ if ($result->num_rows > 0) {
|
||||||
$findate = str_replace('-"', '/', $row["datefin"]);
|
$findate = str_replace('-"', '/', $row["datefin"]);
|
||||||
$datefin = date("d/m/Y", strtotime($findate));
|
$datefin = date("d/m/Y", strtotime($findate));
|
||||||
$nombrejours = $row["nbjours"];
|
$nombrejours = $row["nbjours"];
|
||||||
echo "<tr><td> " . $datedebut. " </td><td> " . $datefin. " </td><td> " . $nombrejours . " jour(s) </td><td> ". $row["type"]." </td><td><a href=\"class.remove.php?datedebut=" . $row["datedebut"] . "&datefin=" . $row["datefin"]. "\">Supprimer la ligne</a></td></tr>";
|
$link = 'class/class.remove.php?datedebut=' . $row["datedebut"] . '&datefin=' . $row["datefin"];
|
||||||
|
echo "<tr><td> " . $datedebut. " </td><td> " . $datefin. " </td><td> " . $nombrejours . " jour(s) </td><td> " . $row["type"] . " </td><td><button onclick='window.location.href=" . '"' . $link . '"' . "' class='button'>Supprimer la ligne</button></td></tr>";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "<tr colspan='4'><td>Pas de résultat</td></tr>";
|
echo "<tr colspan='4'><td>Pas de résultat</td></tr>";
|
||||||
|
@ -51,6 +54,9 @@ $conn->close();
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<br>
|
||||||
|
<button onclick="window.location.href='class/class.clearcp.php'" class="button">Supprimer les congés payés</button>
|
||||||
|
<button onclick="window.location.href='class/class.clearrtt.php'" class="button">Supprimer les RTT</button>
|
||||||
<br><br>
|
<br><br>
|
||||||
<?php require('solde.php') ?>
|
<?php require('solde.php') ?>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<body>
|
<body>
|
||||||
<h1>Gestion des congés - Saisie</h1>
|
<h1>Gestion des congés - Saisie</h1>
|
||||||
<a href="index.php">Afficher les congés</a><br><br>
|
<a href="index.php">Afficher les congés</a><br><br>
|
||||||
<form class="generated-form" method="POST" action="class.ajout.php" target="_self">
|
<form class="generated-form" method="POST" action="class/class.ajout.php" target="_self">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend> Saisie de congés </legend>
|
<legend> Saisie de congés </legend>
|
||||||
<label for="datedebut">Date de début :</label><br>
|
<label for="datedebut">Date de début :</label><br>
|
||||||
|
|
|
@ -38,12 +38,6 @@ require('config.php');
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
|
||||||
<td>RTT</td>
|
|
||||||
|
|
||||||
<td><?php echo cumuln1rtt($rttparmois); ?> jour(s)</td>
|
|
||||||
<td>Entre en vigueur le : 1er janvier <?php anneeplus(); ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>Congés payés</td>
|
<td>Congés payés</td>
|
||||||
<td><?php echo cumuln1cp($cpparmois); ?> jour(s)</td>
|
<td><?php echo cumuln1cp($cpparmois); ?> jour(s)</td>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user