1.7.6
@ -98,6 +98,7 @@ if (isset($_POST['lastname']) && isset($_POST['firstname']) && isset($_POST['ema
|
||||
$mail->Password = 'WTFdoto5678TFWT'; // Mot de passe SMTP
|
||||
$mail->SMTPSecure = 'tls'; // Activer le cryptage TLS
|
||||
$mail->Port = 587; // Port TCP pour TLS
|
||||
$mail->CharSet = "UTF-8";
|
||||
|
||||
// Destinataires
|
||||
$mail->setFrom('service-adhesions@e59.fr', 'Adhesions');
|
||||
@ -204,6 +205,10 @@ $pendingColor = "#878787";
|
||||
text-align: center;
|
||||
padding: 0.5em;
|
||||
}
|
||||
.member-info {
|
||||
text-align: left;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
@ -257,6 +262,19 @@ $pendingColor = "#878787";
|
||||
echo ('<a href="/" class="hidden-button" style="margin-right: 2em;">Annuler</a><button type="submit">Envoyer</button>');
|
||||
} else {
|
||||
echo ('<svg id="avancement-adhesion" data-name="Avancement Adhésion" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 621.85 174.92"><defs></defs><circle class="step-1" cx="65.07" cy="136.34" r="34.92"/><circle class="step-2" cx="308.65" cy="136.34" r="34.92"/><circle class="step-3" cx="552.24" cy="136.34" r="34.92"/><line class="line step-2" x1="248.28" y1="136.34" x2="125.44" y2="136.34"/><line class="step-3" x1="491.87" y1="136.34" x2="369.03" y2="136.34"/><polyline class="step-check-1" points="50.66 139.2 61.81 149.72 79.48 128.34"/><polyline class="step-check-2" points="294.24 139.2 305.4 149.72 323.07 128.34"/><polyline class="step-check-3" points="537.83 139.2 548.99 149.72 566.65 128.34"/><text class="step-text-1" transform="translate(-2.64 22.37)"><tspan x="0" y="0">Demande</tspan><tspan x="8.39" y="36">envoyée</tspan></text><text class="step-text-2" transform="translate(241.34 22.37)"><tspan x="0" y="0">Demande</tspan><tspan class="cls-10" x="17.39" y="36">validée</tspan></text><text class="step-text-3" transform="translate(480.33 22.5)"><tspan x="0" y="0">Cotisation</tspan><tspan x="29.08" y="36">payée</tspan></text></svg>');
|
||||
if ($step == 3) {
|
||||
$sqlRequest = "SELECT adherents.ID, adherents.firstname, adherents.lastname, adherents.email, clubs.name, adherents.memberid FROM adherents JOIN clubs ON adherents.club = clubs.ID WHERE adherents.userid = :userID";
|
||||
$request = $pdo->prepare($sqlRequest);
|
||||
$request->bindParam(":userID", $_SESSION['userID']);
|
||||
$request->execute();
|
||||
$result = $request->fetchAll(PDO::FETCH_ASSOC);
|
||||
echo ('<div class="member-info">');
|
||||
echo ('<div>' . $result[0]['firstname'] . ' ' . $result[0]['lastname'] . '</div>');
|
||||
echo ('<div>' . $result[0]['memberid'] . '</div>');
|
||||
echo ('<div>' . $result[0]['email'] . '</div>');
|
||||
echo ('<div>' . $result[0]['name'] . '</div>');
|
||||
echo ('</div>');
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
@ -117,12 +117,8 @@ $pdo = sqlConnect($sqlDatabaseHost, $sqlDatabaseName, $sqlDatabaseUser, $sqlData
|
||||
margin: 0.5em;
|
||||
border-bottom: 1px solid var(--text);
|
||||
padding: 1em 1em 1em 1em;
|
||||
}
|
||||
.user-row form {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.user-row button {
|
||||
display: inline;
|
||||
@ -175,7 +171,7 @@ $pdo = sqlConnect($sqlDatabaseHost, $sqlDatabaseName, $sqlDatabaseUser, $sqlData
|
||||
|
||||
$search = isset($_GET['search']) ? '%' . $_GET['search'] . '%' : '%%';
|
||||
|
||||
$sqlRequest = "SELECT adherents.ID, adherents.firstname, adherents.lastname, adherents.email, adherents.club, adherents.validation_date FROM adherents WHERE adherents.lastname LIKE :search OR adherents.firstname LIKE :search";
|
||||
$sqlRequest = "SELECT adherents.ID, adherents.firstname, adherents.lastname, adherents.email, adherents.club, adherents.validation_date, adherents.memberid FROM adherents WHERE adherents.lastname LIKE :search OR adherents.firstname LIKE :search";
|
||||
$request = $pdo->prepare($sqlRequest);
|
||||
$request->bindParam(":search", $search);
|
||||
$request->execute();
|
||||
@ -184,12 +180,8 @@ $pdo = sqlConnect($sqlDatabaseHost, $sqlDatabaseName, $sqlDatabaseUser, $sqlData
|
||||
if ($result) {
|
||||
echo ('<div class="users-list">');
|
||||
foreach($result as $row) {
|
||||
$clubFormatted = str_pad($row['club'], 2, "0", STR_PAD_LEFT);
|
||||
$idFormatted = str_pad($row['ID'], 4, "0", STR_PAD_LEFT);
|
||||
$memberID = "59" . $clubFormatted . $idFormatted;
|
||||
echo ('<div class="user-row">');
|
||||
echo ('<form action="#" method="post">');
|
||||
echo ('<div>' . $memberID . '</div><div>' . $row['firstname'] . ' ' . $row['lastname'] . '</div><div>' . $row['validation_date'] . '</div></div>');
|
||||
echo ('<div>' . $row['memberid'] . '</div><div>' . $row['firstname'] . ' ' . $row['lastname'] . '</div><div>' . $row['validation_date'] . '</div></div>');
|
||||
}
|
||||
echo ('</div>');
|
||||
} else {
|
||||
|
@ -23,30 +23,58 @@ if (isset($_POST['adhesion-id'])) {
|
||||
$userID = (int)$_POST['adhesion-id'];
|
||||
try {
|
||||
// Requête SQL pour déplacer la ligne
|
||||
|
||||
$sql = "
|
||||
INSERT INTO adherents (firstname, lastname, born, promo, club, email, validation_date, userid)
|
||||
SELECT firstname, lastname, born, promo, club, email, validation_date, userid
|
||||
FROM adhesions_non_payees
|
||||
WHERE ID = ?";
|
||||
|
||||
$sql2 = "DELETE FROM adhesions_non_payees WHERE ID = ?;";
|
||||
$sql2 = "SELECT club FROM adhesions_non_payees WHERE ID = ?;";
|
||||
|
||||
$sql3 = "DELETE FROM adhesions_non_payees WHERE ID = ?;";
|
||||
|
||||
|
||||
$clubStmt = $pdo->prepare($sql2);
|
||||
$clubStmt->bindParam(1, $userID, PDO::PARAM_INT);
|
||||
$clubStmt->execute();
|
||||
$clubID = $clubStmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$insertStmt = $pdo->prepare($sql);
|
||||
$insertStmt->bindParam(1, $userID, PDO::PARAM_INT);
|
||||
|
||||
// Préparation de la requête
|
||||
if ($insertStmt->execute()) {
|
||||
$adherentID = $pdo->lastInsertId();
|
||||
// Requête pour supprimer la ligne de la table d'origine
|
||||
$sqlDelete = "DELETE FROM adhesions_non_payees WHERE ID = ?";
|
||||
|
||||
// Préparation de la requête de suppression
|
||||
$deleteStmt = $pdo->prepare($sql2);
|
||||
$deleteStmt = $pdo->prepare($sql3);
|
||||
$deleteStmt->bindParam(1, $userID, PDO::PARAM_INT);
|
||||
|
||||
// Exécution de la requête de suppression
|
||||
if ($deleteStmt->execute()) {
|
||||
// Valider la transaction
|
||||
$status = "Adhésion validée";
|
||||
$sql4 = "SELECT ID FROM `adherents` WHERE club = :clubid";
|
||||
$clubLocalIDStmt = $pdo->prepare($sql4);
|
||||
$clubLocalIDStmt->bindParam(":clubid", $clubID[0]['club'], PDO::PARAM_INT);
|
||||
$clubLocalIDStmt->execute();
|
||||
$clubLocalIDList = $clubLocalIDStmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$clubLocalID = sizeof($clubLocalIDList);
|
||||
|
||||
$clubFormatted = str_pad($clubID[0]['club'], 2, "0", STR_PAD_LEFT);
|
||||
$idFormatted = str_pad($clubLocalID, 2, "0", STR_PAD_LEFT);
|
||||
$memberID = "59" . $clubFormatted . $idFormatted;
|
||||
|
||||
$sql5 = "UPDATE adherents SET memberid = :memberID WHERE ID = :adherentID";
|
||||
$updateStmt = $pdo->prepare($sql5);
|
||||
$updateStmt->bindParam(":memberID", $memberID, PDO::PARAM_INT);
|
||||
$updateStmt->bindParam(":adherentID", $adherentID, PDO::PARAM_INT);
|
||||
if ($updateStmt->execute()) {
|
||||
$status = "Adhésion validée";
|
||||
} else {
|
||||
$status = "Erreur lors de la création du memberID";
|
||||
}
|
||||
|
||||
/*$mail = new PHPMailer(true);
|
||||
|
||||
@ -194,7 +222,7 @@ if (isset($_POST['adhesion-id'])) {
|
||||
foreach($result as $row) {
|
||||
echo ('<div class="user-row">');
|
||||
echo ('<form action="#" method="post">');
|
||||
echo ('<div>' . $row['firstname'] . ' ' . $row['lastname'] . '</div><div>' . $row['email'] . '</div><div>' . $row['validation_date'] . '</div><div><input type="hidden" name="adhesion-id" value="' . $row['ID'] . '"><input type="hidden" name="adhesion-email" value="' . $row['email'] . '"><input type="hidden" name="adhesion-userid" value="' . $row['userid'] . '"><button type="submit" style="margin-left: 1em;">Valider le paiement</button></div>');
|
||||
echo ('<div>' . $row['firstname'] . ' ' . $row['lastname'] . '</div><div>' . $row['email'] . '</div><div>' . $row['validation_date'] . '</div><div><input type="hidden" name="adhesion-id" value="' . $row['ID'] . '"><input type="hidden" name="adhesion-email" value="' . $row['email'] . '"><input type="hidden" name="adhesion-userid" value="' . $row['userid'] . '"><a href="sendmail.php?target=' . $row['email'] . '&type=rappel" class="button">Envoyer un rappel</a><button type="submit" style="margin-left: 1em;">Valider le paiement</button></div>');
|
||||
echo ('</form></div>');
|
||||
}
|
||||
echo ('</div>');
|
||||
|
@ -58,7 +58,8 @@ if (isset($_POST['adhesion-id'])) {
|
||||
$mail->Username = 'smtp@e59.fr'; // Nom d'utilisateur SMTP
|
||||
$mail->Password = 'WTFdoto5678TFWT'; // Mot de passe SMTP
|
||||
$mail->SMTPSecure = 'tls'; // Activer le cryptage TLS
|
||||
$mail->Port = 587; // Port TCP pour TLS
|
||||
$mail->Port = 587;
|
||||
$mail->CharSet = "UTF-8"; // Port TCP pour TLS
|
||||
|
||||
// Destinataires
|
||||
$mail->setFrom('service-adhesions@e59.fr', 'Adhesions E59');
|
||||
@ -76,7 +77,7 @@ if (isset($_POST['adhesion-id'])) {
|
||||
// Contenu de l'email
|
||||
$mail->isHTML(true); // Activer le format HTML pour l'email
|
||||
$mail->Subject = "Demande d'adhesion validee";
|
||||
$mail->Body = "<!DOCTYPE html><html lang='fr'><head><meta charset='UTF-8'><meta name='viewport' content='width=device-width, initial-scale=1.0'><title>Demande d'adhesion acceptee</title><style>.content {font-family: Bahnschrift;margin: 0 auto;width: 80%;text-align: center;}</style></head><body><div class='content'><h1>Votre demande d'adhesion a ete validee</h1><p>Votre demande d'adhesion a l'association E59-UVSQ a ete validee.</p><p>Vous trouverez ci-dessous un lien vers la page de paiement de la cotisation.</p><a href='https://pay.e59.fr/cotisation'>pay.e59.fr/cotisation</a></div></body></html>";
|
||||
$mail->Body = "<!DOCTYPE html><html lang='fr'><head><meta charset='UTF-8'><meta name='viewport' content='width=device-width, initial-scale=1.0'><title>Demande d'adhesion acceptee</title><style>.content {font-family: Bahnschrift;margin: 0 auto;width: 80%;text-align: center;}</style></head><body><div class='content'><h1>Votre demande d'adhesion a ete validee</h1><p>Votre demande d'adhesion a l'association E59-UVSQ a ete validee.</p><p>Votre statut de membre sera valable après paiement de la cotisation fixée à 1€/an</p><a href='https://pay.e59.fr/cotisation'>pay.e59.fr/cotisation</a></div></body></html>";
|
||||
$mail->AltBody = 'Veuillez payer votre cotisation sur pay.e59.fr/cotisation';
|
||||
|
||||
// Envoyer l'email
|
||||
|
69
html/admin/sendmail.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
||||
require './vendor/autoload.php';
|
||||
|
||||
session_start();
|
||||
|
||||
if (!isset($_SESSION['userRole']) || $_SESSION['userRole'] < 50) {
|
||||
http_response_code(403);
|
||||
die("Vous n'êtes pas autorisé à accéder à cette ressource");
|
||||
}
|
||||
|
||||
$mailHeaders = array(
|
||||
"rappel" => "Rappel adhésion"
|
||||
);
|
||||
|
||||
$httpMails = array(
|
||||
"rappel" => "<!DOCTYPE html><html lang='fr'><head><meta charset='UTF-8'><meta name='viewport' content='width=device-width, initial-scale=1.0'><title>Rappel adhésion</title><style>.content {font-family: Bahnschrift;margin: 0 auto;width: 80%;text-align: center;}</style></head><body><div class='content'><h1>Votre cotisation est en attente de paiement</h1><p>Votre statut de membre adhérent de la E59 débutera après paiement de la cotisation.<br><br><a href='https://pay.e59.fr/cotisation'>pay.e59.fr/cotisation</a><br><br>Si vous souhaitez annuler votre demande d'adhésion, contactez-nous sur Discord</p></div></body></html>"
|
||||
);
|
||||
|
||||
$altMails = array(
|
||||
"rappel" => "Votre cotisation n'est toujours pas payée."
|
||||
);
|
||||
|
||||
$mail = new PHPMailer(true);
|
||||
|
||||
try {
|
||||
// Paramètres du serveur SMTP
|
||||
$mail->isSMTP(); // Utiliser SMTP
|
||||
$mail->Host = 'outlook.office365.com'; // Serveur SMTP Exchange
|
||||
$mail->SMTPAuth = true; // Activer l'authentification SMTP
|
||||
$mail->Username = 'smtp@e59.fr'; // Nom d'utilisateur SMTP
|
||||
$mail->Password = 'WTFdoto5678TFWT'; // Mot de passe SMTP
|
||||
$mail->SMTPSecure = 'tls'; // Activer le cryptage TLS
|
||||
$mail->Port = 587; // Port TCP pour TLS
|
||||
$mail->CharSet = "UTF-8";
|
||||
|
||||
// Destinataires
|
||||
$mail->setFrom('service-adhesions@e59.fr', 'Adhesions E59');
|
||||
$mail->addAddress($_GET['target']);
|
||||
|
||||
// Vous pouvez ajouter d'autres destinataires en utilisant $mail->addAddress()
|
||||
// $mail->addAddress('autre-destinataire@example.com');
|
||||
// Vous pouvez aussi ajouter des destinataires en copie (CC) ou en copie cachée (BCC)
|
||||
// $mail->addCC('cc@example.com');
|
||||
// $mail->addBCC('bcc@example.com');
|
||||
|
||||
// Pièces jointes (si nécessaire)
|
||||
// $mail->addAttachment('/path/to/file.pdf'); // Ajouter un fichier joint
|
||||
|
||||
// Contenu de l'email
|
||||
$mail->isHTML(true); // Activer le format HTML pour l'email
|
||||
$mail->Subject = $mailHeaders[$_GET['type']];
|
||||
$mail->Body = $httpMails[$_GET['type']];
|
||||
$mail->AltBody = $altMails[$_GET['type']];
|
||||
|
||||
// Envoyer l'email
|
||||
$mail->send();
|
||||
|
||||
// Préparation de la requête de suppression
|
||||
} catch (Exception $e) {
|
||||
error_log("Erreur de Mailer: {$mail->ErrorInfo}");
|
||||
}
|
||||
|
||||
header("Location: index.php");
|
||||
|
||||
?>
|
Before Width: | Height: | Size: 681 KiB After Width: | Height: | Size: 681 KiB |
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 928 KiB |
Before Width: | Height: | Size: 748 KiB After Width: | Height: | Size: 928 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 23 KiB |
@ -64,6 +64,7 @@ if (isset($_GET['code'])) {
|
||||
$mail->Password = 'WTFdoto5678TFWT'; // Mot de passe SMTP
|
||||
$mail->SMTPSecure = 'tls'; // Activer le cryptage TLS
|
||||
$mail->Port = 587; // Port TCP pour TLS
|
||||
$mail->CharSet = "UTF-8";
|
||||
|
||||
// Destinataires
|
||||
$mail->setFrom('service-adhesions@e59.fr', 'Adhesions');
|
||||
|
@ -143,6 +143,7 @@ if (isset($_GET['code'])) {
|
||||
$mail->Subject = 'Nouvel Utilisateur';
|
||||
$mail->Body = $name . ' a cree un compte sur e59.fr';
|
||||
$mail->AltBody = $name . ' a cree un compte sur e59.fr';
|
||||
$mail->CharSet = "UTF-8";
|
||||
|
||||
// Envoyer l'email
|
||||
$mail->send();
|
||||
|