Gestion de la suppression
This commit is contained in:
parent
c951e7dc5d
commit
c26788fb1f
@ -48,6 +48,14 @@ if ($_GET["id"])
|
|||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($_GET["action"] == 'del')
|
||||||
|
{
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."telephonie_societe_commentaire";
|
||||||
|
$sql .= " WHERE rowid = '".$_GET["commid"]."'";
|
||||||
|
$sql .= " AND fk_user = '".$user->id."';";
|
||||||
|
$db->query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$soc->perm_read)
|
if (!$soc->perm_read)
|
||||||
{
|
{
|
||||||
print "Lecture non authorisée";
|
print "Lecture non authorisée";
|
||||||
@ -127,7 +135,7 @@ if ($_GET["id"])
|
|||||||
|
|
||||||
/* Commentaires */
|
/* Commentaires */
|
||||||
|
|
||||||
$sql = "SELECT c.commentaire, u.firstname, u.name, u.code";
|
$sql = "SELECT c.commentaire, u.firstname, u.name, u.code, c.rowid";
|
||||||
$sql .= " , ".$db->pdate("c.datec") ." as datec";
|
$sql .= " , ".$db->pdate("c.datec") ." as datec";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_commentaire as c";
|
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_commentaire as c";
|
||||||
$sql .= " , ".MAIN_DB_PREFIX."user as u";
|
$sql .= " , ".MAIN_DB_PREFIX."user as u";
|
||||||
@ -140,7 +148,7 @@ if ($_GET["id"])
|
|||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
print '<tr class="liste_titre"><td width="15%" valign="center">Date';
|
print '<tr class="liste_titre"><td width="15%" valign="center">Date';
|
||||||
print '</td><td>Commentaire</td><td align="center">Auteur</td>';
|
print '</td><td>Commentaire</td><td align="center" colspan="2">Auteur</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
while ($obj = $db->fetch_object($resql))
|
while ($obj = $db->fetch_object($resql))
|
||||||
@ -149,17 +157,18 @@ if ($_GET["id"])
|
|||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print '<td>'.nl2br(stripslashes($obj->commentaire))."</td>\n";
|
print '<td>'.nl2br(stripslashes($obj->commentaire))."</td>\n";
|
||||||
print '<td align="center">'.$obj->code."</td>\n";
|
print '<td align="center">'.$obj->code."</td>\n";
|
||||||
|
print '<td align="right">';
|
||||||
|
print '<a href="commentaires.php?id='.$soc->id.'&commid='.$obj->rowid.'&action=del">';
|
||||||
|
print img_delete().'</a></td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $sql;
|
print $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user