diff options
author | citizenz7 <citizenz7@protonmail.com> | 2017-04-20 18:50:55 +0200 |
---|---|---|
committer | citizenz7 <citizenz7@protonmail.com> | 2017-04-20 18:50:55 +0200 |
commit | 5fd9fa480f302902328b81f912dd67ce378284f8 (patch) | |
tree | 66234843ae2857fda12442e4f7577c527d48977c /Html/admin/messagerie.php | |
parent | ebe731862c7c741171138b1083906f391fc35aff (diff) | |
download | freetorrent-5fd9fa480f302902328b81f912dd67ce378284f8.tar.xz freetorrent-5fd9fa480f302902328b81f912dd67ce378284f8.zip |
V.1.4.6
Diffstat (limited to 'Html/admin/messagerie.php')
-rw-r--r-- | Html/admin/messagerie.php | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/Html/admin/messagerie.php b/Html/admin/messagerie.php new file mode 100644 index 0000000..075c6b2 --- /dev/null +++ b/Html/admin/messagerie.php @@ -0,0 +1,111 @@ +<?php +require_once('../includes/config.php'); + +// titre de la page +$pagetitle = 'Messagerie interne'; + +include_once('../includes/header.php'); +?> + +<body> +<div id="container"> + +<?php + include_once('../includes/header-logo.php'); + include_once('../includes/nav.php'); +?> + +<div id="body"> + <div id="content"> + +<?php +//On affiche le résultat de l'envoi de message interne +if(isset($_GET['message'])) { + echo '<div class="alert-msg rnd8 success">Le message a été envoyé avec succès.</div>'; +} + +if(isset($_GET['action']) && $_GET['action'] == 'messupprime'){ + echo '<div class="alert-msg rnd8 success">Le message a été supprimé de votre messagerie.</div>'; +} +?> + +<?php +try { + $stmt = $db->prepare('SELECT * FROM blog_members,xbt_users WHERE blog_members.memberID = xbt_users.uid AND username = :username'); + $stmt->bindvalue('username', $_GET['membre'], PDO::PARAM_STR); + $stmt->execute(); + $row = $stmt->fetch(); +} + + catch(PDOException $e) { + echo $e->getMessage(); + } +?> + +<?php +$pages = new Paginator('8','m'); +$stmt = $db->prepare('SELECT messages_id FROM blog_messages WHERE messages_id_destinataire = :destinataire'); +$stmt->execute(array( + ':destinataire' => $row['memberID'] +)); +$pages->set_total($stmt->rowCount()); + +// on prépare une requete SQL cherchant le titre, la date, l'expéditeur des messages pour le membre connecté +$stmt = $db->prepare('SELECT blog_messages.messages_titre, blog_messages.messages_date, blog_members.username as expediteur, blog_messages.messages_id as id_message, blog_messages.messages_lu FROM blog_messages, blog_members WHERE blog_messages.messages_id_destinataire = :id_destinataire AND blog_messages.messages_id_expediteur = blog_members.memberID ORDER BY blog_messages.messages_date DESC '.$pages->get_limit()); +$stmt->bindValue(':id_destinataire', $row['memberID'], PDO::PARAM_INT); +$stmt->execute(); +?> + +<table> + <tr> + <td colspan="5"> + <span style="font-size: 15pt; font-weight: bold;">Messagerie interne : + <a style="text-decoration: none; float:right;" href="<?php echo SITEURL; ?>/messages_envoyer.php"><input type="button" class="button" value="Envoyer un message à un membre" /></a> + </span> + </td> + </tr> + <tr> + <th style="width: 180px;">Date</th> + <th>Titre</th> + <th style="width: 120px;">Expéditeur</th> + </tr> + + <?php + while($data = $stmt->fetch()){ + echo '<tr>'; + sscanf($data['messages_date'], "%4s-%2s-%2s %2s:%2s:%2s", $annee, $mois, $jour, $heure, $minute, $seconde); + echo '<td style="font-size: 9pt;">le '.$jour.'-'.$mois.'-'.$annee.' à '.$heure.':'.$minute.':'.$seconde.'</td>'; + echo '<td>'; + if($data['messages_lu'] == 0) { + echo '<img style="vertical-align: text-bottom; width: 16px; height: 16px;" src="'.SITEURL.'/images/envelope-newmail.gif" /> '; + } + echo '<a style="text-decoration: none;" href="'.SITEURL.'/messages_lire.php?id_message='.$data['id_message'].'">'.html(trim($data['messages_titre'])).'</a>'; + echo '</td>'; + echo '<td>'.html(trim($data['expediteur'])).'</td>'; + echo '</tr>'; + } + ?> +</table> + +<?php + echo '<div style="text-align: center;">'; + echo $pages->page_links('?membre='.html($row['username']).'&'); + echo '</div>'; +?> + + <br /><br /> + + </div> + + <?php require('../sidebar.php'); ?> + + <div class="clear"></div> + </div> +</div> + +<div id="footer"> + <?php require('../includes/footer.php'); ?> +</div> + +</body> +</html> |