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
f69560db
Commit
f69560db
authored
Jan 15, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test: Statistikausgabe
parent
cf73532a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
api.class.php
api.class.php
+17
-5
No files found.
api.class.php
View file @
f69560db
...
...
@@ -11,6 +11,7 @@ class MediaDBViewerAPI{
private
$DB_Passwort
;
private
$DB_Database
;
private
$Statistik
=
array
(
"QueryCounter"
=>
0
);
private
$Querys
;
public
$DB_Objekt
;
function
APIinit
(
$KEY
)
{
...
...
@@ -79,6 +80,7 @@ class MediaDBViewerAPI{
$Where
.=
((
$first
?
""
:
" AND "
)
.
$Suche
);
$first
=
false
;
}
// Attribute von Filmen die nur über eine M:N Verbindung vorhanden sind:
if
(
isset
(
$GET_arr
[
'GenreID'
])
OR
isset
(
$GET_arr
[
'Genre'
])
OR
isset
(
$GET_arr
[
'SchauspielerID'
])
OR
isset
(
$GET_arr
[
'Schauspieler'
])
OR
isset
(
$GET_arr
[
'SchauspielerSuche'
])){
if
(
isset
(
$GET_arr
[
'GenreID'
])){
foreach
(
explode
(
","
,
$GET_arr
[
'GenreID'
])
as
$value
)
{
...
...
@@ -102,7 +104,8 @@ class MediaDBViewerAPI{
}
// Alle Querys Ausführen und Ergebnis in einen Großen Arry Speichern
foreach
(
$Querys
as
$Query
)
{
$result
=
$this
->
DB_Objekt
->
query
(
$Query
);
//$result = $this->DB_Objekt->query($Query);
$result
=
$this
->
query
(
$Query
);
if
(
$this
->
DB_Objekt
->
error
!=
""
){
return
$this
->
error
(
1005
,
$this
->
DB_Objekt
->
error
);}
$imdbIDString
=
$result
->
fetch_array
();
$imdbArr
[
$imdbArrToCompar
++
]
=
explode
(
","
,
$imdbIDString
[
"imdbIDs"
]);
...
...
@@ -181,7 +184,8 @@ class MediaDBViewerAPI{
.
";"
;
$this
->
DebugOut
(
$Query
.
" >>Zeile:"
.
__LINE__
);
//TODO Debugausgabe entfernen
$entrys
=
$this
->
DB_Objekt
->
query
(
$Query
);
//$entrys = $this->DB_Objekt->query($Query);
$entrys
=
$this
->
query
(
$Query
);
if
(
$this
->
DB_Objekt
->
error
!=
""
){
return
$this
->
error
(
1005
,
$this
->
DB_Objekt
->
error
);}
$TitelArray
=
array
();
$finfo
=
$entrys
->
fetch_fields
();
...
...
@@ -238,9 +242,16 @@ class MediaDBViewerAPI{
private
function
DebugOut
(
$Output
){
echo
(
strpos
(
$_SERVER
[
"HTTP_USER_AGENT"
],
"Android"
)
==
0
?
$Output
.
"
\r\n
"
:
""
);
}
private
function
Query
(
$Query
){
$this
->
Statistik
[
"QueryCounter"
]
++
;
return
$this
->
DB_Objekt
->
query
(
$Query
);
private
function
query
(
$Query
){
//$this->Statistik["QueryCounter"]++;
$ret
=
$this
->
DB_Objekt
->
query
(
$Query
);
$this
->
Querys
[
$this
->
Statistik
[
"QueryCounter"
]
++
]
=
array
(
"Query"
=>
$Query
,
"MySQLNumRows"
=>
$this
->
DB_Objekt
->
field_count
,
"MySQLerror"
=>
$this
->
DB_Objekt
->
error
);
return
$ret
;
}
/*
* Funktion nur ändern, Um Markus zu ärgern ;-)
...
...
@@ -260,6 +271,7 @@ class MediaDBViewerAPI{
"Antwort"
=>
$respons
);
}
$this
->
DB_Objekt
->
close
();
//"Statistik" => $Statistik
//TODO Statistikausgabe nur mit rechten!!
}
...
...
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