diff --git a/html/adhesion/index.php b/html/adhesion/index.php index 493cd19f..06159774 100755 --- a/html/adhesion/index.php +++ b/html/adhesion/index.php @@ -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; + } @@ -257,6 +262,19 @@ $pendingColor = "#878787"; echo ('Annuler'); } else { echo ('DemandeenvoyéeDemandevalidéeCotisationpayée'); + 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 ('
'); + echo ('
' . $result[0]['firstname'] . ' ' . $result[0]['lastname'] . '
'); + echo ('
' . $result[0]['memberid'] . '
'); + echo ('
' . $result[0]['email'] . '
'); + echo ('
' . $result[0]['name'] . '
'); + echo ('
'); + } } ?> diff --git a/html/admin/adherents.php b/html/admin/adherents.php index 70a9060e..2e1377a2 100644 --- a/html/admin/adherents.php +++ b/html/admin/adherents.php @@ -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 ('
'); 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 ('
'); - echo ('
'); - echo ('
' . $memberID . '
' . $row['firstname'] . ' ' . $row['lastname'] . '
' . $row['validation_date'] . '
'); + echo ('
' . $row['memberid'] . '
' . $row['firstname'] . ' ' . $row['lastname'] . '
' . $row['validation_date'] . '
'); } echo (''); } else { diff --git a/html/admin/adhesions-non-payees.php b/html/admin/adhesions-non-payees.php index dcd43ce5..ccdc57a8 100644 --- a/html/admin/adhesions-non-payees.php +++ b/html/admin/adhesions-non-payees.php @@ -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 ('
'); echo (''); - echo ('
' . $row['firstname'] . ' ' . $row['lastname'] . '
' . $row['email'] . '
' . $row['validation_date'] . '
'); + echo ('
' . $row['firstname'] . ' ' . $row['lastname'] . '
' . $row['email'] . '
' . $row['validation_date'] . '
Envoyer un rappel
'); echo ('
'); } echo (''); diff --git a/html/admin/adhesions.php b/html/admin/adhesions.php index 91814a98..67dc68e1 100755 --- a/html/admin/adhesions.php +++ b/html/admin/adhesions.php @@ -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 = "Demande d'adhesion acceptee

Votre demande d'adhesion a ete validee

Votre demande d'adhesion a l'association E59-UVSQ a ete validee.

Vous trouverez ci-dessous un lien vers la page de paiement de la cotisation.

pay.e59.fr/cotisation
"; + $mail->Body = "Demande d'adhesion acceptee

Votre demande d'adhesion a ete validee

Votre demande d'adhesion a l'association E59-UVSQ a ete validee.

Votre statut de membre sera valable après paiement de la cotisation fixée à 1€/an

pay.e59.fr/cotisation
"; $mail->AltBody = 'Veuillez payer votre cotisation sur pay.e59.fr/cotisation'; // Envoyer l'email diff --git a/html/admin/sendmail.php b/html/admin/sendmail.php new file mode 100644 index 00000000..1ab53efe --- /dev/null +++ b/html/admin/sendmail.php @@ -0,0 +1,69 @@ + "Rappel adhésion" +); + +$httpMails = array( + "rappel" => "Rappel adhésion

Votre cotisation est en attente de paiement

Votre statut de membre adhérent de la E59 débutera après paiement de la cotisation.

pay.e59.fr/cotisation

Si vous souhaitez annuler votre demande d'adhésion, contactez-nous sur Discord

" +); + +$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"); + +?> \ No newline at end of file diff --git a/html/assets/banners/53.png b/html/assets/banners/12.png similarity index 100% rename from html/assets/banners/53.png rename to html/assets/banners/12.png diff --git a/html/assets/banners/55.png b/html/assets/banners/13.png similarity index 100% rename from html/assets/banners/55.png rename to html/assets/banners/13.png diff --git a/html/assets/banners/44.png b/html/assets/banners/44.png deleted file mode 100755 index 85c1c6df..00000000 Binary files a/html/assets/banners/44.png and /dev/null differ diff --git a/html/assets/banners/7.png b/html/assets/banners/7.png index be444894..85c1c6df 100755 Binary files a/html/assets/banners/7.png and b/html/assets/banners/7.png differ diff --git a/html/assets/pp/53.png b/html/assets/pp/12.png similarity index 100% rename from html/assets/pp/53.png rename to html/assets/pp/12.png diff --git a/html/assets/pp/55.png b/html/assets/pp/13.png similarity index 100% rename from html/assets/pp/55.png rename to html/assets/pp/13.png diff --git a/html/assets/pp/44.png b/html/assets/pp/44.png deleted file mode 100755 index 6a04af1f..00000000 Binary files a/html/assets/pp/44.png and /dev/null differ diff --git a/html/assets/pp/46.png b/html/assets/pp/46.png deleted file mode 100755 index cc9699f1..00000000 Binary files a/html/assets/pp/46.png and /dev/null differ diff --git a/html/assets/pp/7.png b/html/assets/pp/7.png index fe570dd0..6a04af1f 100755 Binary files a/html/assets/pp/7.png and b/html/assets/pp/7.png differ diff --git a/html/assets/pp/9.png b/html/assets/pp/9.png index d3837b08..cc9699f1 100755 Binary files a/html/assets/pp/9.png and b/html/assets/pp/9.png differ diff --git a/html/login/google-callback.php b/html/login/google-callback.php index 7c30d801..516af6d5 100755 --- a/html/login/google-callback.php +++ b/html/login/google-callback.php @@ -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'); diff --git a/html/login/microsoft-callback.php b/html/login/microsoft-callback.php index 6cfc120b..b64775e2 100755 --- a/html/login/microsoft-callback.php +++ b/html/login/microsoft-callback.php @@ -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();