Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MediaDBViewerAPI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BA_SI-Projekt
MediaDBViewerAPI
Commits
1aa3149c
Commit
1aa3149c
authored
Jan 15, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
acodedeu Filter eingebaut
parent
d23289ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
23 deletions
+21
-23
api.class.php
api.class.php
+21
-23
No files found.
api.class.php
View file @
1aa3149c
...
...
@@ -28,31 +28,19 @@ class MediaDBViewerAPI{
$this
->
DB_Objekt
=
new
mysqli
(
$this
->
DB_Server
,
$this
->
DB_Username
,
$this
->
DB_Passwort
,
$this
->
DB_Database
);
if
(
$DB_Objekt
->
error
!=
null
){
$ret
=
false
;
}
else
{
$ret
=
true
;
}
}
else
{
$ret
=
false
;
}
}
else
{
$ret
=
false
;
}
}
else
{
$ret
=
true
;
}
}
else
{
$ret
=
false
;
}
}
else
{
$ret
=
false
;
}
$db
->
close
();
}
else
{
$ret
=
false
;
}
}
else
{
$ret
=
false
;
}
return
$ret
;
}
public
function
API_GetDataList
(
$GET_arr
,
$POST_arr
=
""
){
if
(
!
isset
(
$GET_arr
[
'Tabelle'
])
OR
(
$GET_arr
[
'Tabelle'
]
==
""
))
{
return
$this
->
error
(
1004
);
return
$this
->
error
(
1004
,
"Erwarteter Parameter: Tabelle"
);
}
else
{
// Wenn irgenein filter gesetzt ist
...
// Wenn irgenein filter gesetzt ist
Filterung nur für Tablle Filme!!
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'
])
OR
isset
(
$GET_arr
[
'SchauspielerSuche'
])
OR
isset
(
$GET_arr
[
'Englisch'
]))
...
...
@@ -73,6 +61,10 @@ class MediaDBViewerAPI{
$Where
.=
(
$first
?
""
:
" AND "
)
.
'acodeceng'
.
(
$GET_arr
[
'Englisch'
]
?
" IS NOT "
:
" IS "
)
.
'null'
;
$first
=
false
;
}
if
(
isset
(
$GET_arr
[
'Deutsch'
])
){
$Where
.=
(
$first
?
""
:
" AND "
)
.
'acodecdeu = "'
.
$GET_arr
[
'Deutsch'
]
.
'"'
;
$first
=
false
;
}
if
(
isset
(
$GET_arr
[
'Suche'
])){
$Suche
=
" `name` LIKE '%"
.
$GET_arr
[
'Suche'
]
.
"%' OR `md5` LIKE '%"
.
$GET_arr
[
'Suche'
]
.
"%' OR `comment` LIKE '%"
.
$GET_arr
[
'Suche'
]
.
"%'"
;
//OR `year` = '".$GET_arr['Suche']."' OR `resolution` LIKE '%".$GET_arr['Suche']."%'
...
...
@@ -125,6 +117,11 @@ class MediaDBViewerAPI{
}
}
}
// Wenn irgenein filter gesetzt ist Filterung nur für Tablle Filme!!
if
(
(
isset
(
$GET_arr
[
'imdbID'
])
OR
isset
(
$GET_arr
[
'3d'
])
)
AND
$GET_arr
[
'Tabelle'
]
==
"Staffeln"
){
// Filterung nur für Tablle Filme!!
}
// Überprüfen ob Schauspieler oder Genre gefordert wird
$SpaltenArr
=
explode
(
","
,
$GET_arr
[
'Spalten'
]);
$ListGenre
=
(
in_array
(
"Genre"
,
$SpaltenArr
)
?
true
:
false
);
...
...
@@ -234,9 +231,8 @@ class MediaDBViewerAPI{
"Antwort"
=>
$respons
);
}
//"Statistik" => $Statistik
//TODO Statistikausgabe hinzufügen
//"Statistik" => $Statistik
//TODO Statistikausgabe nur mit rechten!!
}
public
function
error
(
$ErrID
,
$Description
=
""
){
switch
(
$ErrID
)
{
...
...
@@ -250,11 +246,13 @@ class MediaDBViewerAPI{
break
;
case
1003
:
return
array
(
"FehlerID"
=>
$ErrID
,
"FehlerText"
=>
"Die gewünschte 'action' "
.
$_GET
[
'action'
]
.
" exisitiert nicht!"
);
"FehlerText"
=>
"Die gewünschte 'action' "
.
$_GET
[
'action'
]
.
" exisitiert nicht!"
,
"FehlerBeschreibung"
=>
$Description
);
break
;
case
1004
:
return
array
(
"FehlerID"
=>
$ErrID
,
"FehlerText"
=>
"Nicht alle Erwarteten Parameter übergeben!"
);
"FehlerText"
=>
"Nicht alle Erwarteten Parameter übergeben!"
,
"FehlerBeschreibung"
=>
$Description
);
break
;
case
1005
:
return
array
(
"FehlerID"
=>
$ErrID
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment