Commit c1374940 authored by Nico Schallehn's avatar Nico Schallehn

Übersetzung Table zu Tabelle

parent 9debda05
...@@ -51,13 +51,13 @@ class MediaDBViewerAPI{ ...@@ -51,13 +51,13 @@ class MediaDBViewerAPI{
public function API_GetDataListe($GET_arr, $POST_arr =""){ public function API_GetDataListe($GET_arr, $POST_arr =""){
if(!isset($GET_arr['Table']) OR ($GET_arr['Table'] == "")) { if(!isset($GET_arr['Tabelle']) OR ($GET_arr['Tabelle'] == "")) {
return $this->error(1004); return $this->error(1004);
} }
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['Table'] == "Filme" ){ // Filterung nur für Tablle Filme!! 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!!
$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'])){
...@@ -70,9 +70,8 @@ class MediaDBViewerAPI{ ...@@ -70,9 +70,8 @@ class MediaDBViewerAPI{
$first = false; $first = false;
} }
if(isset($GET_arr['Suche'])){ if(isset($GET_arr['Suche'])){
$Suche = " `name` LIKE '%".$GET_arr['Suche']."%' OR $Suche = " `name` LIKE '%".$GET_arr['Suche']."%' OR `md5` LIKE '%".$GET_arr['Suche']."%' OR `comment` LIKE '%".$GET_arr['Suche']."%'";
`md5` LIKE '%".$GET_arr['Suche']."%' OR //OR `year` = '".$GET_arr['Suche']."' OR `resolution` LIKE '%".$GET_arr['Suche']."%'
`comment` LIKE '%".$GET_arr['Suche']."%'"; //OR `year` = '".$GET_arr['Suche']."' OR `resolution` LIKE '%".$GET_arr['Suche']."%'
$Where .= (($first?"":" AND ").$Suche); $Where .= (($first?"":" AND ").$Suche);
$first = false; $first = false;
} }
...@@ -113,6 +112,8 @@ class MediaDBViewerAPI{ ...@@ -113,6 +112,8 @@ 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!!!
} }
// Überprüfen ob Schauspieler oder Genre gefordert wird // Überprüfen ob Schauspieler oder Genre gefordert wird
...@@ -140,7 +141,7 @@ class MediaDBViewerAPI{ ...@@ -140,7 +141,7 @@ class MediaDBViewerAPI{
$Query= "SELECT ".$Select. $Query= "SELECT ".$Select.
" FROM ".$GET_arr['Table']." " " FROM ".$GET_arr['Tabelle']." "
.$Where .$Where
.$this->iset($GET_arr['Order'], " ", " ORDER BY ", " ") .$this->iset($GET_arr['Order'], " ", " ORDER BY ", " ")
.$this->iset($GET_arr['Limit'],"", " Limit "," ") .$this->iset($GET_arr['Limit'],"", " Limit "," ")
...@@ -164,8 +165,7 @@ class MediaDBViewerAPI{ ...@@ -164,8 +165,7 @@ class MediaDBViewerAPI{
$tempArray[$val->name] = utf8_encode($entry[$val->name]); $tempArray[$val->name] = utf8_encode($entry[$val->name]);
} }
} }
// Genre oder Schauspielerblock hinzufügen wenn es gewünscht ist
//TODO Diesen block in den Hauptquery einbauen?!
if($ListGenre){ if($ListGenre){
$Query = 'SELECT group_concat(g.gername) AS Genre FROM FilmGenre AS fg JOIN Genre AS g ON fg.genreID = g.genreID WHERE fg.imdbID="'.$entry["imdbID"].'" ORDER BY g.gername'; $Query = 'SELECT group_concat(g.gername) AS Genre FROM FilmGenre AS fg JOIN Genre AS g ON fg.genreID = g.genreID WHERE fg.imdbID="'.$entry["imdbID"].'" ORDER BY g.gername';
......
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