return $sources;
}
+ function source_has_groupe($id_source, $id_groupe){
+ $sgbd = $this->sgbd();
+ $HAS_THIS_GROUP = 0;
+ try{
+ $sql =
+ "SELECT count(*) as n FROM #--sml_sources_authors"
+ ." WHERE id_source=".$this->eq($id_source)
+ ." AND id_author=".$this->eq($id_groupe);
+ $rst = $sgbd->query($sql);
+ if($v_rst = $sgbd->fetch_assoc($rst)) $HAS_THIS_GROUP = $v_rst["n"];
+ $sgbd->free_result($rst);
+ }
+ catch(Exception $e) { $HAS_THIS_GROUP = false; }
+ return $HAS_THIS_GROUP;
+ }
+
function add_source_groupe($id_source, $id_groupe, $id_groupe_status)
{ $sgbd = $this->sgbd();
try{
return true;
}
- function del_source_groupe($id)
- { $sgbd = $this->sgbd();
+ function del_source_groupe($id_source, $id_author){
+ $sgbd = $this->sgbd();
try{
- $sql = "DELETE FROM #--sml_sources_authors WHERE id=".$this->eq($id);
+ $sql =
+ "DELETE FROM #--sml_sources_authors"
+ ." WHERE id_source=".$this->eq($id_source)
+ ." AND id_author=".$this->eq($id_author);
$sgbd->query($sql);
}
catch(Exception $e) { return false; }