118 lines
3.5 KiB
PHP
118 lines
3.5 KiB
PHP
<?php
|
|
include_once(realpath(dirname(__FILE__)) . "/../../../fonctions/authplugins.php");
|
|
autorisation("contact");
|
|
|
|
include_once(realpath(dirname(__FILE__)) . "/Contact.class.php");
|
|
if(isset($_REQUEST["action"]) && $_REQUEST["action"] == "supprimer"){
|
|
$contact = new Contact();
|
|
$contact->charger($_REQUEST["id"]);
|
|
$contact->delete();
|
|
}
|
|
if(isset($_REQUEST["request"]) == "reply"){
|
|
$nomf = $_POST["nomf"];
|
|
$admail = $_POST["email"];
|
|
$tel = $_POST["tel"];
|
|
$sujet = $_POST["sujet"];
|
|
$message = nl2br($_POST["remsg"]);
|
|
|
|
$datenow = date("Y-m-d H:i:s");
|
|
|
|
mysql_query("INSERT INTO contact (id,nom,prenom,email,tel,sujet,message,adresse,cpostal,ville,date,lu) VALUES ('',
|
|
'RE\:".addslashes($nomf)."',
|
|
'',
|
|
'".$admail."',
|
|
'".addslashes($tel)."',
|
|
'".addslashes($sujet)."',
|
|
'".addslashes($message)."',
|
|
'',
|
|
'',
|
|
'',
|
|
'".$datenow."',
|
|
'1');");
|
|
$to = $admail;
|
|
$subject= $sujet;
|
|
$from = "LE MATELOT <contact@lematelot.com>";
|
|
|
|
// message
|
|
$message = '<html>
|
|
<head>
|
|
<title>'.$sujet.'</title>
|
|
</head>
|
|
<body>
|
|
<table>
|
|
<tr>
|
|
<td>'.$message.'</td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html>';
|
|
|
|
// To send HTML mail, the Content-type header must be set
|
|
$headers = 'MIME-Version: 1.0' . "\r\n";
|
|
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
|
|
$headers .= "From:" . $from;
|
|
//@mail($to, $subject, $message, $headers);
|
|
echo "Message envoyé!";
|
|
}
|
|
|
|
?>
|
|
<script type="text/javascript">
|
|
function supprimer(id){
|
|
if(confirm("Voulez-vous vraiment supprimer ce message?")) location="module.php?nom=contact&id=" + id + "&action=supprimer";
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
<div id="contenu_int">
|
|
<p align="left"><span class="lien04"><a href="accueil.php" class="lien04">Accueil</a></span> <img src="gfx/suivant.gif" width="12" height="9" border="0" /><a href="module_liste.php" class="lien04">Modules</a> <img src="gfx/suivant.gif" width="12" height="9" border="0" /><a href="#" class="lien04"> Gestion des contacts</a></p>
|
|
|
|
<div class="entete_liste_config">
|
|
<div class="titre">LISTE DES CONTACTS</div>
|
|
<div class="fonction_ajout">
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<ul id="Nav">
|
|
<li style="height:25px; width:127px; border-left:1px solid #96A8B5;">Date</li>
|
|
<li style="height:25px; width:552px; border-left:1px solid #96A8B5;">Sujet</li>
|
|
<li style="height:25px; width:87px; border-left:1px solid #96A8B5;">Nom</li>
|
|
<li style="height:25px; width:78px; border-left:1px solid #96A8B5;">Visualiser</li>
|
|
<li style="height:25px; width:44px; border-left:1px solid #96A8B5;">Lu</li>
|
|
<li style="height:25px; width:30px; border-left:1px solid #96A8B5;">Suppr.</li>
|
|
</ul>
|
|
|
|
<div class="bordure_bottom" id="resul">
|
|
|
|
<?php
|
|
$contact = new Contact();
|
|
$query = "select * from $contact->table ORDER by date DESC";
|
|
$resul = mysql_query($query,$contact->link);
|
|
$i=0;
|
|
while($row = mysql_fetch_object($resul)){
|
|
|
|
|
|
if(!($i%2)) $fond="ligne_claire_rub";
|
|
else $fond="ligne_fonce_rub";
|
|
$i++;
|
|
|
|
|
|
?>
|
|
<ul class="<?php echo($fond); ?>">
|
|
<li style="width:120px;"><?php echo $row->date; ?></li>
|
|
<li style="width:545px"><?php echo $row->sujet; ?></li>
|
|
<li style="width:80px;"><?php echo $row->nom; ?></li>
|
|
<li style="width:71px;"><a href="module.php?nom=contact&vue=view&id=<?php echo $row->id; ?>">Visualiser</a></li>
|
|
<li style="width:37px;"><?php if($row->lu) echo "oui"; else echo "non"; ?></li>
|
|
<li style="width:30px;text-align:center;"><a href="module.php?nom=contact&action=supprimer&id=<?php echo $row->id; ?>"><img src="gfx/supprimer.gif" width="9" height="9" border="0" /></a></li>
|
|
</ul>
|
|
|
|
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|