109 lines
4.3 KiB
PHP
109 lines
4.3 KiB
PHP
<?php
|
|
include_once(realpath(dirname(__FILE__)) . "/../../../fonctions/authplugins.php");
|
|
|
|
autorisation("commentaires");
|
|
|
|
include_once(realpath(dirname(__FILE__)) . "/Commentaires.class.php");
|
|
$commentaires = new Commentaires();
|
|
?>
|
|
<div id="contenu_int">
|
|
<p align="left"><a href="accueil.php" class="lien04">Accueil </a> <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 commentaires</a>
|
|
</p>
|
|
<!-- bloc gestion des commentaires / colonne gauche -->
|
|
|
|
<?php
|
|
if(isset($action) && $action == "supprimer"){
|
|
$commentaires->charger($id);
|
|
$commentaires->delete();
|
|
|
|
$cache = new Cache();
|
|
$cache->vider("COMMENTAIRES", "%");
|
|
}
|
|
/*
|
|
if(isset($action) && $action == "valider"){
|
|
$commentaires->charger($id);
|
|
$commentaires->update();
|
|
|
|
$cache = new Cache();
|
|
$cache->vider("COMMENTAIRES", "%");
|
|
}
|
|
*/
|
|
if(isset($action) && $action == "visualiser"){
|
|
$commentaires->charger($id);
|
|
?>
|
|
<div class="entete_liste">
|
|
<div class="titre">DETAIL DU COMMENTAIRE</div>
|
|
<div class="fonction_valider"><a href="<?php echo $_SERVER['PHP_SELF'] ?>?nom=commentaires">RETOUR</a></div>
|
|
</div>
|
|
<ul class="ligne_fonce_BlocDescription">
|
|
<li style="width:130px">Date</li>
|
|
<li style="border-left:1px solid #C4CACE;"><?php echo($commentaires->date); ?></li>
|
|
</ul>
|
|
<ul class="ligne_claire_BlocDescription">
|
|
<li style="width:130px">Produit</li>
|
|
<li style="border-left:1px solid #C4CACE;"><a href="produit_modifier.php?ref=<?php echo $commentaires->ref; ?>" class="lien04"><?php echo $commentaires->ref; ?></a></li>
|
|
</ul>
|
|
<ul class="ligne_fonce_BlocDescription">
|
|
<li style="width:130px">Nom</li>
|
|
<li style="border-left:1px solid #C4CACE;"><?php echo($commentaires->commentateur); ?></li>
|
|
</ul>
|
|
<ul class="ligne_fonce_BlocDescription">
|
|
<li style="width:130px">Ville</li>
|
|
<li style="border-left:1px solid #C4CACE;"><?php echo($commentaires->ville); ?></li>
|
|
</ul>
|
|
<ul class="ligne_claire_BlocDescription">
|
|
<li style="width:130px">Titre</li>
|
|
<li style="border-left:1px solid #C4CACE;"><?php echo($commentaires->titre); ?></li>
|
|
</ul>
|
|
<ul class="ligne_claire_BlocDescription">
|
|
<li style="width:130px">Message</li>
|
|
<li style="border-left:1px solid #C4CACE;"><?php echo($commentaires->message); ?></li>
|
|
</ul>
|
|
|
|
<?php
|
|
} else if(! isset($action) || $action == "" || $action == "valider" || $action == "supprimer"){
|
|
|
|
?>
|
|
|
|
<div class="entete_liste">
|
|
<div class="titre">LISTES DES COMMENTAIRES</div>
|
|
</div>
|
|
<div class="bordure_bottom">
|
|
<ul class="Nav_bloc_description">
|
|
<li style="height:25px; width:130px; border-left:1px solid #96A8B5;">Date</li>
|
|
<li style="height:25px; width:150px; border-left:1px solid #96A8B5;">Référence produit</li>
|
|
<li style="height:25px; width:130px; border-left:1px solid #96A8B5;">Nom</li>
|
|
<li style="height:25px; width:130px; border-left:1px solid #96A8B5;">Ville</li>
|
|
<li style="height:25px; width:72px; border-left:1px solid #96A8B5;">Editer</li>
|
|
<li style="height:25px; width:50px; border-left:1px solid #96A8B5;">Supprimer</li>
|
|
</ul>
|
|
<?php
|
|
$commentaires = new Commentaires();
|
|
$query_commentaires = "select * from $commentaires->table order by date desc";
|
|
$resul_commentaires = mysql_query($query_commentaires, $commentaires->link);
|
|
$i = 0;
|
|
|
|
while($row = mysql_fetch_object($resul_commentaires)){
|
|
|
|
|
|
if(!($i%2)) $fond="ligne_claire_rub";
|
|
else $fond="ligne_fonce_rub";
|
|
$i++;
|
|
|
|
?>
|
|
<ul class="<?php echo($fond); ?>">
|
|
<li style="width:130px;"><?php echo $row->date; ?></li>
|
|
<li style="width:150px;"><a href="produit_modifier.php?ref=<?php echo $row->ref; ?>" class="lien04"><?php echo $row->ref; ?></a></li>
|
|
<li style="width:130px;"><?php echo $row->commentateur; ?></li>
|
|
<li style="width:130px;"><?php echo $row->ville; ?></li>
|
|
<li style="width:72px;"><a href="<?php echo $_SERVER['PHP_SELF'] ?>?nom=commentaires&action=visualiser&id=<?php echo $row->id; ?>">éditer </a></li>
|
|
<li style="width:50px; text-align:center"><a href="<?php echo $_SERVER['PHP_SELF'] ?>?nom=commentaires&action=supprimer&id=<?php echo $row->id; ?>"><img src="gfx/supprimer.gif" width="9" height="9" border="0" /></a></li>
|
|
</ul>
|
|
|
|
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|