Implementation de la suppression d'un auteur
This commit is contained in:
parent
e2933f8858
commit
725605243f
@ -59,6 +59,12 @@ if ($action == 'delcat')
|
|||||||
$livre->unlinkcategorie($catid);
|
$livre->unlinkcategorie($catid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'delauteur' && $auteurid)
|
||||||
|
{
|
||||||
|
$livre = new Livre($db);
|
||||||
|
$livre->fetch($id);
|
||||||
|
$livre->auteur_unlink($auteurid);
|
||||||
|
}
|
||||||
|
|
||||||
if ($action == "status")
|
if ($action == "status")
|
||||||
{
|
{
|
||||||
@ -263,7 +269,10 @@ else
|
|||||||
|
|
||||||
foreach ($auteurs as $key => $value)
|
foreach ($auteurs as $key => $value)
|
||||||
{
|
{
|
||||||
print '<a href="../auteur/fiche.php?id='.$key.'">'.$value."<br>\n";
|
print '<a href="fiche.php?id='.$id.'&action=delauteur&auteurid='.$key.'">';
|
||||||
|
print '<img src="/theme/'.$conf->theme.'/img/editdelete.png" height="16" width="16" alt="Supprimer" border="0"></a> ';
|
||||||
|
print '<a href="../auteur/fiche.php?id='.$key.'">';
|
||||||
|
print $value."</a><br>\n";
|
||||||
}
|
}
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
print '<tr><td>Prix</td><TD>'.price($livre->price).'</td></tr>';
|
print '<tr><td>Prix</td><TD>'.price($livre->price).'</td></tr>';
|
||||||
|
|||||||
@ -156,6 +156,27 @@ class Livre {
|
|||||||
print $this->db->error();
|
print $this->db->error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Function auteur_unlink($auteur_id)
|
||||||
|
{
|
||||||
|
|
||||||
|
$sql = "DELETE FROM llx_livre_to_auteur ";
|
||||||
|
|
||||||
|
$sql .= " WHERE fk_livre=".$this->id;
|
||||||
|
$sql .= " AND fk_auteur=".$auteur_id;
|
||||||
|
|
||||||
|
if ( $this->db->query($sql) )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $this->db->error() . ' in ' . $sql;
|
||||||
|
}
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user