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
177ff56d
Commit
177ff56d
authored
Jan 20, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test mit SetData
parent
c864b9fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
7 deletions
+37
-7
api.class.php
api.class.php
+37
-7
No files found.
api.class.php
View file @
177ff56d
...
...
@@ -308,15 +308,45 @@ class MediaDBViewerAPI{
public
function
API_SetData
(
$GET_arr
,
$POST_arr
=
""
){
if
(
(
$this
->
API_Rechte
>=
3
)){
if
(
isset
(
$GET_arr
[
"Tabelle"
])){
if
(
$GET_arr
[
"Tabelle"
]
==
"Filme"
){
if
(
isset
(
$POST_arr
[
"imdbID"
])
AND
isset
(
$POST_arr
[
"3d"
])
){
if
((
isset
(
$POST_arr
[
"imdbID"
])
AND
isset
(
$POST_arr
[
"3d"
])
AND
(
$GET_arr
[
"Tabelle"
]
==
"Filme"
))
OR
(
isset
(
$POST_arr
[
"season_nr"
])
AND
isset
(
$POST_arr
[
"episodenumber"
])
AND
(
$GET_arr
[
"Tabelle"
]
==
"Episoden"
))){
//UPDATE ".$GET_arr["Tabelle"]." WHERE imdbID = ".$POST_arr["imdbID"];
if
((
$GET_arr
[
"Tabelle"
]
==
"Filme"
)){
$Where
=
"WHERE imdbID = '"
.
$POST_arr
[
"imdbID"
]
.
"' AND `3d` = '"
.
$POST_arr
[
"3d"
]
.
"'"
;
}
elseif
((
$GET_arr
[
"Tabelle"
]
==
"Episoden"
)){
$Where
=
"WHERE season_nr = '"
.
$POST_arr
[
"season_nr"
]
.
"' AND `episodenumber` = '"
.
$POST_arr
[
"episodenumber"
]
.
"'"
;
}
$Set
=
"SET "
;
$first
=
true
;
// = Filter:
if
(
isset
(
$POST_arr
[
"Gesehen"
])){
//AND is_numeric($GET_arr[$key])
$Set
.=
(
$first
?
""
:
" , "
)
.
"views = views+"
+
$POST_arr
[
"Gesehen"
];
$first
=
false
;
}
if
(
isset
(
$POST_arr
[
"checked"
])){
//AND is_numeric($GET_arr[$key])
$Set
.=
(
$first
?
""
:
" , "
)
.
"checked = '"
.
$POST_arr
[
"checked"
]
.
"'"
;
$first
=
false
;
}
if
(
isset
(
$POST_arr
[
"comment"
])){
//AND is_numeric($GET_arr[$key])
$Set
.=
(
$first
?
""
:
" , "
)
.
"comment = '"
.
$POST_arr
[
"comment"
]
.
"'"
;
$first
=
false
;
}
if
(
$first
){
// Fehler...
return
$this
->
error
(
1004
,
"Mindestens einer der folgenden Paramter war erwartet = Gesehen, checked, comment!"
);
}
else
{
$Query
=
"UPDATE Filme "
.
$Set
.
" "
.
$Where
.
";"
;
return
$this
->
error
(
1001
,
"Auszuführender Query: "
.
$Query
);
}
}
/*
else if(isset($POST_arr["season_nr"]) AND ($GET_arr["Tabelle"] == "Staffeln") ){
//UPDATE ".$GET_arr["Tabelle"]." WHERE imdbID = ".$POST_arr["imdbID"];
$Set = "SET ";
$first = true;
if(isset($POST_arr["Gesehen"])){ //AND is_numeric($GET_arr[$key])
$Set .= ($first?"":" , ")."views = views+1";
$first = false;
...
...
@@ -335,11 +365,11 @@ class MediaDBViewerAPI{
$Query = "UPDATE Filme ".$Set." WHERE imdbID = '".$POST_arr["imdbID"]."' AND `3d` = '".$POST_arr["3d"]."';";
return $this->error(1001, "Auszuführender Query: ".$Query);
}
}
}
*/
else
{
return
$this
->
error
(
1004
,
"Erwartet war
imdbID und 3d!"
);
return
$this
->
error
(
1004
,
"Erwartet war
Tabelle=(Filme und imdbID, 3d) ODER (Episoden und season_nr,episodenumber) ODER (Staffeln und season_nr)!"
);
}
}
}
else
{
return
$this
->
error
(
1004
,
"Erwartet war Tabelle!"
);
...
...
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