Hacked By AnonymousFox
home/missmand/public_html/learning/forum/abusReponse.php 0000644 00000006273 15177775066 0017574 0 ustar 00 <?php
include '../lib/init.php';
include "../lib/class/phpmailer/class.phpmailer.php";
Utilisateur::verif_connect();
if(isset($_GET['reponse'])){
$utilisateurId = $_SESSION['utilisateur']['id'];
$reponseId = $_GET['reponse'];
/* Informations sur le sujet */
$sql = $bdd->query("SELECT sujetNom, reponseContenu FROM forum_reponse
INNER JOIN forum_sujet ON reponseSujet = sujetId
WHERE reponseId = $reponseId ");
$data = $sql->fetchObject();
$sujetNom = $data->sujetNom;
$reponseContenu = $data->reponseContenu;
/* Vérifier qu'il existe pas déjà une entrée en BDD pour cette abus */
$sql = $bdd->query("SELECT * FROM forum_reponse_abus
WHERE abusUtilisateur = $utilisateurId
AND abusReponse = $reponseId
AND abusEtat = 1 ");
if($sql->rowCount() == 0){
/* Alors j'ajoute l'abus en BDD */
$sql2 = $bdd->prepare("INSERT INTO forum_reponse_abus
(abusCreated, abusUtilisateur, abusReponse)
VALUES
(:created, :utilisateur, :reponse) ");
$sql2->execute(array(
'created' => time(),
'utilisateur' => $utilisateurId,
'reponse' => $reponseId
)
);
/* Notification à l'administrateur */
$emailAdmin = Utilisateur::emailAdmin($bdd);
$mail = new PHPmailer();
$mail->CharSet = 'UTF-8';
$mail->IsHTML(true);
$mail->From='noreply@missmandarine.com';
$mail->FromName='Miss Mandarine';
foreach ($emailAdmin as $email) { $mail->AddAddress($email); }
$mail->Subject= notifReponseTitre;
$mail->Body='
<html><body>
<table cellpadding="0" cellspacing="0" style="font-family:sans-serif;" align="center">
<tr width="602" height="130">
<td colspan="2">
<img src="'.BASEFRONT.'img/notification/header.jpg"/>
</td>
</tr>
<tr width="602" height="20">
<td colspan="2"><td>
</tr>
<tr>
<td width="20"></td>
<td width="582">
<span style="font-size:15px; color: #999999; margin:0px; padding:0px; margin-bottom:4px;">'.notifReponseLigne1.'</span>
</td>
</tr>
<tr width="602" height="20">
<td colspan="2"><td>
</tr>
<tr>
<td width="20"></td>
<td width="582">
<span style="font-size:15px; color: #999999; margin:0px; padding:0px; margin-bottom:4px;"><strong>'.notifReponseSujet.'</strong> '.$sujetNom.'</span>
<br />
<br />
<span style="font-size:15px; color: #999999; margin:0px; padding:0px; margin-bottom:4px;">'.Forum::autolink($reponseContenu).'</span>
</td>
</tr>
<tr width="602" height="20">
<td colspan="2"><td>
</tr>
<tr>
<td width="20"></td>
<td width="582">
<span style="font-size:15px; color: #999999; margin:0px; padding:0px; margin-bottom:4px;">'.notifReponseLigne2.'</span>
</td>
</tr>
<tr width="602" height="20">
<td colspan="2"><td>
</tr>
<tr width="602" height="4">
<td colspan="2" bgColor="#171d2a"><td>
</tr>
</table>
</body></html>';
$mail->Send();
unset($mail);// <-- Fin de notification
/* Le lien de confirmation */
echo '<a href="#">'.afficheReponseAbusSignale.'</a>';
}
}
?>