Commit ee846e19 authored by Nico Schallehn's avatar Nico Schallehn

SchauspielerSuche hinzugefügt

parent c1374940
...@@ -57,7 +57,8 @@ class MediaDBViewerAPI{ ...@@ -57,7 +57,8 @@ class MediaDBViewerAPI{
else{ else{
// Wenn irgenein filter gesetzt ist... // Wenn irgenein filter gesetzt ist...
if( (isset($GET_arr['imdbID']) OR isset($GET_arr['3d']) OR isset($GET_arr['GenreID']) OR isset($GET_arr['Genre']) OR if( (isset($GET_arr['imdbID']) OR isset($GET_arr['3d']) OR isset($GET_arr['GenreID']) OR isset($GET_arr['Genre']) OR
isset($GET_arr['SchauspielerID']) OR isset($GET_arr['Schauspieler']) OR isset($GET_arr['Suche']) ) AND $GET_arr['Tabelle'] == "Filme" ){ // Filterung nur für Tablle Filme!! isset($GET_arr['SchauspielerID']) OR isset($GET_arr['Schauspieler']) OR isset($GET_arr['Suche']) OR isset($GET_arr['SchauspielerSuche']) )
AND $GET_arr['Tabelle'] == "Filme" ){ // Filterung nur für Tablle Filme!!
$first = true; $first = true;
$Where = "WHERE "; $Where = "WHERE ";
if(isset($GET_arr['imdbID']) AND is_numeric($GET_arr['imdbID'])){ if(isset($GET_arr['imdbID']) AND is_numeric($GET_arr['imdbID'])){
...@@ -84,7 +85,7 @@ class MediaDBViewerAPI{ ...@@ -84,7 +85,7 @@ class MediaDBViewerAPI{
$first = false; $first = false;
} }
if( isset($GET_arr['Genre'])){ if( isset($GET_arr['Genre'])){
$Query = 'SELECT group_concat(fg.imdbID) AS imdbIDs FROM FilmGenre AS fg JOIN Genre AS g ON fg.genreID = g.genreID WHERE g.gername IN ("'.str_replace(",", '","', $GET_arr['Genre']).'") '; $Query = 'SELECT group_concat(fg.imdbID) AS imdbIDs FROM FilmGenre AS fg JOIN Genre AS g ON fg.genreID = g.genreID WHERE g.engname IN ("'.str_replace(",", '","', $GET_arr['Genre']).'") ';
$Genre = $this->DB_Objekt->query($Query); $Genre = $this->DB_Objekt->query($Query);
if($this->DB_Objekt->error != ""){ return $this->error(1005, $this->DB_Objekt->error);} if($this->DB_Objekt->error != ""){ return $this->error(1005, $this->DB_Objekt->error);}
$GenreArr = $Genre->fetch_array(); $GenreArr = $Genre->fetch_array();
...@@ -112,7 +113,17 @@ class MediaDBViewerAPI{ ...@@ -112,7 +113,17 @@ class MediaDBViewerAPI{
$Where .= (strlen($SchauspielerArr["imdbIDs"])>0?($first?"":" AND ").str_replace(",)", ")", 'imdbID in ('.$SchauspielerArr["imdbIDs"].')'): ($first?" 0 ":"")); $Where .= (strlen($SchauspielerArr["imdbIDs"])>0?($first?"":" AND ").str_replace(",)", ")", 'imdbID in ('.$SchauspielerArr["imdbIDs"].')'): ($first?" 0 ":""));
$first = false; $first = false;
} }
//TODO Hier gemeinsame Auswertunf für die imdbIDs von Genre und schauspieler!!! if( isset($GET_arr['SchauspielerSuche'])){
$Query = 'SELECT group_concat(fs.imdbID) AS imdbIDs FROM FilmSchauspieler AS fs JOIN Schauspieler AS s ON fs.schauspielerID = s.schauspielerID WHERE s.name LIKE "%'.$GET_arr['SchauspielerSuche'].'%" ';
//$this->DebugOut($Query." >>Zeile:".__LINE__);
$Schauspieler = $this->DB_Objekt->query($Query);
if($this->DB_Objekt->error != ""){ return $this->error(1005, $this->DB_Objekt->error);}
$SchauspielerArr = $Schauspieler->fetch_array();
//$this->DebugOut($SchauspielerArr["imdbIDs"].">".strlen($SchauspielerArr["imdbIDs"])." >>Zeile:".__LINE__);
$Where .= (strlen($SchauspielerArr["imdbIDs"])>0?($first?"":" AND ").str_replace(",)", ")", 'imdbID in ('.$SchauspielerArr["imdbIDs"].')'): ($first?" 0 ":""));
$first = false;
}
//TODO Hier gemeinsame Auswertung für die imdbIDs von Genre und Schauspieler!!!
} }
...@@ -143,8 +154,8 @@ class MediaDBViewerAPI{ ...@@ -143,8 +154,8 @@ class MediaDBViewerAPI{
$Query= "SELECT ".$Select. $Query= "SELECT ".$Select.
" FROM ".$GET_arr['Tabelle']." " " FROM ".$GET_arr['Tabelle']." "
.$Where .$Where
.$this->iset($GET_arr['Order'], " ", " ORDER BY ", " ") .$this->iset($GET_arr['Sortierung'], " ", " ORDER BY ", " ")
.$this->iset($GET_arr['Limit'],"", " Limit "," ") .$this->iset($GET_arr['Anzahl'],"", " Limit "," ")
.";"; .";";
$this->DebugOut($Query." >>Zeile:".__LINE__); $this->DebugOut($Query." >>Zeile:".__LINE__);
...@@ -192,7 +203,7 @@ class MediaDBViewerAPI{ ...@@ -192,7 +203,7 @@ class MediaDBViewerAPI{
public function API_serverinfo($GET_arr = "", $POST_arr =""){ public function API_serverinfo($GET_arr = "", $POST_arr =""){
return array( "time" => time(), return array( "time" => time(),
"time_h" => date(time()), "time_h" => date("",time()),
"HTTP_USER_AGENT" => $_SERVER['HTTP_USER_AGENT'], "HTTP_USER_AGENT" => $_SERVER['HTTP_USER_AGENT'],
"REMOTE_ADDR" => $_SERVER['REMOTE_ADDR'], "REMOTE_ADDR" => $_SERVER['REMOTE_ADDR'],
"Datenbank" => array( "Datenbankserver" => $this->DB_Server, "Datenbank" => array( "Datenbankserver" => $this->DB_Server,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment