<?php session_start();
include('../api.class.php');
define("Fanart_Key","9902c9197f457401ff7a7eba839213ba");
function jsonCacheDecoder($url){
	$CacheFolderName = "jsoncache/";
	exec("rm ".$CacheFolderName.date("y-W_",time()-14*24*3600)."*");
	exec("rm ".$CacheFolderName.date("y-W_",time()-7*24*3600)."*");
	if(!is_dir($CacheFolderName)){
		exec( "mkdir ".$CacheFolderName);
	}
	$filename= date("y-W_",time()).md5($url).".json";
	if(!file_exists($CacheFolderName.$filename)){
		file_put_contents($CacheFolderName.$filename, file_get_contents($url));
	}
	return json_decode(file_get_contents($CacheFolderName.$filename), true);
}
function TableRowRights($Api, $Key = null, $Data = null){
	$ret = 	'<form action="index.php?action=rechte" method="post"><tr>'.
			'<td><input type="text" value="'.$Data["from"].'" name="from"></td> <td><input type="text" value="'.$Data["to"].'" name="to"></td>';
	
	$Api->SpaltenFilme;
	foreach ($Api->SpaltenFilme as $value) {
		if(in_array($value, array("name",  "imdbID", "3d"))){
			$ret .= '<td><input type="checkbox" name="filme_list[]"  value="'.$value.'" checked readonly onclick="return false"></td>';
		}else{
			if(!($Data == null)){
				$ret .= '<td><input type="checkbox" name="filme_list[]"'.(in_array($value, $Data["SpaltenFil"])?"checked":"").' value="'.$value.'"></td>';
			}else {
				$ret .= '<td><input type="checkbox" name="filme_list[]"  value="'.$value.'"></td>';
			}
		}
	}
	$Api->SpaltenEpisoden;
	foreach ($Api->SpaltenEpisoden as $value) {
		if(in_array($value, array("name",  "episodenumber", "season_nr", "series_nr"))){
			$ret .= '<td><input type="checkbox" name="Episoden_list[]"  value="'.$value.'" checked readonly onclick="return false"></td>';
		}else{
			if(!($Data == null)){
				$ret .= '<td><input type="checkbox" name="Episoden_list[]"'.(in_array($value, $Data["SpaltenEpi"])?"checked":"").'  value="'.$value.'"></td>';
			}else {
				$ret .= '<td><input type="checkbox" name="Episoden_list[]"  value="'.$value.'"></td>';
			}
		}
	}
	$Api->StatistikViews;
	foreach ($Api->StatistikViews as $value) {
		
		if(!($Data == null)){
			$ret .= '<td><input type="checkbox" name="Statistik_list[]"'.(in_array($value, $Data["StatiViews"])?"checked":"").'  value="'.$value.'"></td>';
		}else {
			$ret .= '<td><input type="checkbox" name="Statistik_list[]"  value="'.$value.'"></td>';
		}
		
	}
	$ret .= '<td><input type="checkbox" name="webapp" '.($Data["webapp"]==true?"checked":"").'></td>';
	$ret .= '<td><input type="checkbox" name="Update" '.($Data["Update"]==true?"checked":"").'></td>';
	$ret .= '<td><input type="checkbox" name="DebugO" '.($Data["DebugO"]==true?"checked":"").'></td>';
	$ret .= '<td><input type="submit" name="POST" value="'.(($Data == null)?"Anlegen":"Speichern").'">
					<input type="hidden" name="ID" value="'.$Key.'"></td>';
	$ret .=	'</tr></form>';
	return $ret;
}

if(isset($_GET["logoff"])){
	//echo "abmelden!!";
	unset($_SESSION);
	$_SESSION = array();
	setcookie ("api-key", "", time() - 3600,'/');
	setcookie ("api-secret", "", time() - 3600,'/');
	setcookie(session_name(), '', time()-3600,'/');
	session_destroy();
	
	header('location: /');
}
// Anmeldung übeprüfen...
if((isset($_SESSION['api-key']) OR (isset($_COOKIE['api-key']) AND isset($_COOKIE['api-secret'])))){
	$dologin = false;
	if(isset($_SESSION['api-key'])){ // Login aus Session verhanden?
		$dologin = true;
	}
	// Login in Cookie vorhanden?
	else if((md5($_SERVER['HTTP_USER_AGENT'].$_SERVER['REMOTE_ADDR']) == $_COOKIE['api-secret']) AND isset($_COOKIE['api-key'])){
		$dologin = true;
		$_SESSION['api-key'] = $_COOKIE['api-key'];
	}

	if($dologin){
		$API = new MediaDBAPI ();
		if (!$API->APIinit($_SESSION['api-key'])) {			header('location: /');		}
	}
}else{	header('location: /');}

$StatistikArray = $API->API_GetStatistic(array("Statistik"=>"DBstatistik"));

/// Ausgabe der Einzelnen Webseiten...


if($_GET["action"] == "filme"){
	$titel = "Filme";
	$MovieArray = $API->API_GetDataList(array("Tabelle"=>"Filme", "Spalten"=>"imdbID,3d,name,added","3d"=>"0","Gesehenzaehler"=>"0","Sortierung"=>"added DESC", "Anzahl" =>"17"));
	$movies ="";
	//var_dump($MovieArray);
	foreach ($MovieArray["Data"] as $key => $value) {
		//echo "http://webservice.fanart.tv/v3/movies/tt".$value["imdbID"]."?api_key=".Fanart_Key.PHP_EOL;
		//$fanart = jsonCacheDecoder("http://webservice.fanart.tv/v3/movies/tt".$value["imdbID"]."?api_key=".Fanart_Key);
		//var_dump();
		//if(isset($fanart["moviethumb"][0]["url"])){
			//echo $value["name"];
			$movies .= '<li><img src="/cover/Filme/low/'.$value["imdbID"].'.jpg" class="img-responsive"/>
					<div class="grid-flex"><a href="index.php?action=filme&imdbID='.$value["imdbID"].'">'.substr($value["name"],0,25).'</a><p>'.$value["added"].'</p></div></li>';
		//}
	}
	$content = '<div class="content"><h1 class="recent">Zuletzt hinzugefügt:</h3>
				<ul id="flexiselDemo3">
						'.$movies.'
				    </ul>
				    <script type="text/javascript">
					 $(window).load(function() {
						$("#flexiselDemo3").flexisel({
							visibleItems: 5,
							animationSpeed: 1000,
							autoPlay: true,
							autoPlaySpeed: 3000,    		
							pauseOnHover: true,
							enableResponsiveBreakpoints: true,
					    	responsiveBreakpoints: { 
					    		portrait: { 
					    			changePoint:480,
					    			visibleItems: 1
					    		}, 
					    		landscape: { 
					    			changePoint:640,
					    			visibleItems: 2
					    		},
					    		tablet: { 
					    			changePoint:768,
					    			visibleItems: 3
					    		}
					    	}
					    });
					    
					});
				   </script>
					<script type="text/javascript" src="js/jquery.flexisel.js"></script></div>';
	
}else if($_GET["action"] == "rechte"){

	$titel = "Rechteverwaltung";
	$content = '<div class="content"><h1>Rechteverwaltung</h1>';

	$JavaScript = '<style>
					th{text-align: center;
						vertical-align: bottom;}
					th.rotate {
					  /* Something you can count on */
					  height: 140px;
					  white-space: nowrap;
					}
					
					th.rotate > div {
					  transform: 
					    /* Magic Numbers */
					    translate(15px, -6px)
					    /* 45 is really 360 - 45 */
					    rotate(315deg);
					  width: 25px;10
					}
					th.rotate > div > span {
					  border-bottom: 1px solid #ccc;
					  padding: 1px 10px;
					}
					td {
					  text-align: center;
					  padding: 10px 5px;
					  border: 1px solid #ccc;
					}</style>';
	if(!file_exists(API_Rights)){
		// defaultdatei anlegen...
		$content .= "Erzeuge Default Rechtedatei <br>".PHP_EOL;
		$rights = array(1 => array(	"from" => 0, 
									"to" => 100,
									"SpaltenFil" => array(),
									"SpaltenEpi" => array(),
									"StatiViews" => array(),
									"webapp" => true,
									"Update" => true,
									"DebugO" => true)
				
						);
		file_put_contents(API_Rights, json_encode($rights,JSON_PRETTY_PRINT));
	}
	if(file_exists(API_Rights)){
		$Data = json_decode(file_get_contents(API_Rights), true);
		
		if(isset($_POST["POST"])){
			/*ob_start();
			var_dump($_POST);
			$content .= "<pre>".ob_get_clean()."</pre><br><br>";*/
			$content .= "<pre>Daten Erfolgreich Erneuert</pre>";
			$Data[$_POST["ID"]]["from"] =  $_POST["from"];
			$Data[$_POST["ID"]]["to"] =  $_POST["to"];
			
			$Data[$_POST["ID"]]["SpaltenFil"] =array();
			if(!empty($_POST["filme_list"])){
				// Loop to store and display values of individual checked checkbox.
				
				foreach($_POST["filme_list"] as $selected){
					array_push($Data[$_POST["ID"]]["SpaltenFil"],$selected);
					//echo $selected."</br>";
				}
			}
			$Data[$_POST["ID"]]["SpaltenEpi"] =array();
			if(!empty($_POST["Episoden_list"])){
				// Loop to store and display values of individual checked checkbox.
			
				foreach($_POST["Episoden_list"] as $selected){
					array_push($Data[$_POST["ID"]]["SpaltenEpi"],$selected);
					//echo $selected."</br>";
				}
			}
			$Data[$_POST["ID"]]["StatiViews"] =array();
			if(!empty($_POST["Statistik_list"])){
				// Loop to store and display values of individual checked checkbox.
					
				foreach($_POST["Statistik_list"] as $selected){
					array_push($Data[$_POST["ID"]]["StatiViews"],$selected);
					//echo $selected."</br>";
				}
			}
			
			
			$Data[$_POST["ID"]]["webapp"] = (isset($_POST["webapp"])?true:false);
			$Data[$_POST["ID"]]["Update"] = (isset($_POST["Update"])?true:false);
			$Data[$_POST["ID"]]["DebugO"] = (isset($_POST["DebugO"])?true:false);
				
			
			file_put_contents(API_Rights, json_encode($Data,JSON_PRETTY_PRINT));
				
		}
		
		
		ob_start();
		//var_dump($Data);TableRowRights
		$content .= ob_get_clean();
		$content .= '<div style="width: 100%;   overflow: auto;"><table>'.PHP_EOL;
		$content .= '  <tr><th >Von</th> <th> Bis</th> ';
						
		foreach ($API->SpaltenFilme as $value) {
			$content .= '<th class="rotate"><div><span>'.$value.'</span></div></th>';
		}
		foreach ($API->SpaltenEpisoden as $value) {
			$content .= '<th class="rotate"><div><span>'.$value.'</span></div></th>';
		}
		foreach ($API->StatistikViews as $value) {
			$content .= '<th class="rotate"><div><span>'.$value.'</span></div></th>';
		}
		$content .= '<th class="rotate"><div><span>Webapp</th>';
		$content .= '<th class="rotate"><div><span>Update</th>';
		$content .= '<th class="rotate"><div><span>Debug</th>';
		$content .= '<th>Speichern</th>';
		$content .= '</tr>  '.PHP_EOL;
		$lastKey = 0;
		foreach ($Data as $Key => $value) {
			$content .= TableRowRights($API,$Key, $value);
			$lastKey = $Key;
		}
		$content .= TableRowRights($API, ($lastKey+1));
		$content .= ' </table></div>'.PHP_EOL;
		
	}
	$content .= "</div>";
	
	
}else if($_GET["action"] == "vergleich"){

	$titel = "Vergleich von 2 DB";
	$MovieArray = jsonCacheDecoder("http://mediadb.ddns.net/api.php?key=ee3aTi5soo&action=GetDataList&Tabelle=Filme&Spalten=imdbID,3d,name,md5,added,size,resolution,rating,summary,youtube&3d=0&Sortierung=added%20DESC");
	$movies="";
	//var_dump($MovieArray["Antwort"]);
	$counterNeu = 0;
	$countermd5 = 0;
	$countereql = 0;
	foreach ($MovieArray["Antwort"]["Data"] as $key => $value) {
		$MovieArray = $API->API_GetDataList(array("Tabelle"=>"Filme", "Spalten"=>"imdbID,name,3d,md5,size,resolution","imdbID"=>$value["imdbID"]));
		//$fanart = jsonCacheDecoder("http://webservice.fanart.tv/v3/movies/tt".$value["imdbID"]."?api_key=".Fanart_Key);
		//		if(isset($fanart["movieposter"][0]["url"]))	{
		if(!isset($MovieArray["Data"][0]["imdbID"])){
			$youtubearray = explode(":", $value["youtube"]);
			$youtube = (isset($youtubearray[1])?$youtubearray[1]:"");
			$movies .= '<tr><td><img src="http://mediadb.ddns.net/cover/Filme/low/'.$value["imdbID"].'.jpg"><br>'.$value["imdbID"].", ".substr($value["name"],0,50)." ".$value["3d"]."</td>
					<td>".$value["added"]."<br>".$value["resolution"]."<br>".$value["rating"]."*<br>".round($value["size"]/pow(1024,3),2)."GB<br>".$youtube."</td>
							<td>".$value["summary"]."</td></tr>";
			$counterNeu++;
		}else if(!($MovieArray["Data"][0]["md5"] == $value["md5"]) AND ($MovieArray["Data"][0]["3d"] == $value["3d"])){
			$movies .= "<tr><td>".$value["imdbID"].", ".substr($value["name"],0,50)." ".$value["3d"]."</td><td>".$MovieArray["Data"][0]["resolution"]."<>".$value["resolution"]."<br>".round($MovieArray["Data"][0]["size"]/pow(1024,3) , 3)."<>".round($value["size"]/pow(1024,3) , 3)."</td><td>MD5 unterschiedlich!!</td></tr>";
			$countermd5++;
		}else{
			$countereql++;
		}
		
		
	}
	$content = '<div class="content">neue Filme:'.$counterNeu.'<br>defekte Filme:'.$countermd5.'<br>Vorhandene Filme Filme:'.$countereql.'<br>
			<table><tr><th>Filmname</th><th>Daten</th></tr>'.$movies.'</table></div>';
}else if (isset($_GET["action"])){
	$titel = "404 - Nicht gefunden";
	$content = '<div class="content"><div class="error-404 text-center">
				<h2>404</h2>
				<p>Diese Seite konnte nicht gefunden werden!</p>
				<a class="b-home" href="index.php">zur Startseite</a>
			</div></div>';
}else{// Startseite!
	$titel = "Startseite";
	$JavaScript = '<script src="js/responsiveslides.min.js"></script>
					<script>
					    $(function () {
					      $("#slider").responsiveSlides({
					      	auto: true,
					      	nav: true,
					      	speed: 1000,
					        namespace: "callbacks",
					        pager: true,
					      });
					    });
					</script>';
	//Filme für Coverflow holen...
	$MovieArray = $API->API_GetDataList(array("Tabelle"=>"Filme", "Spalten"=>"imdbID,3d,name","3d"=>"0","Gesehenzaehler"=>"0","Sortierung"=>"rating DESC", "Anzahl" =>"6"));
	$movies ="";
	foreach ($MovieArray["Data"] as $key => $value) {
		//echo "http://webservice.fanart.tv/v3/movies/tt".$value["imdbID"]."?api_key=".Fanart_Key.PHP_EOL;
		$fanart = jsonCacheDecoder("http://webservice.fanart.tv/v3/movies/tt".$value["imdbID"]."?api_key=".Fanart_Key);
		//var_dump();
		if(isset($fanart["moviethumb"][0]["url"])){
			$movies .= '<li><img src="'.$fanart["moviethumb"][0][url].'" class="img-responsive"
							alt="" />
							<div class="button">
								<a href="index.php?action=filme&imdbID='.$value["imdbID"].'" class="hvr-shutter-out-horizontal">Details anzeigen</a>
							</div>
						</li>';
		}
		
	}
	$content = '
			<div class="slider">
				<div class="callbacks_container">
					<ul class="rslides" id="slider">
						'.$movies.'
					</ul>
				</div>
				<div class="banner_desc">
					<div class="col-md-7">
						<ul class="list_1">
							<li>Filme Insgesamt: <span class="m_1">'.$StatistikArray["Data"][0]["Anzahl Filme"].'</span></li>
							<li>Letztes Update <span class="m_1">'.$StatistikArray["Data"][0]["FilmeLastAdded"].'</span></li>
						</ul>
					</div>
				</div>
			</div>
			<div class="content">
				<div class="box_1">
					<h1 class="m_2">Neue Filme</h1>
					<div class="search">
						<form>
							<input type="text" value="Suche..." onfocus="this.value=\'\';"
								onblur="if (this.value == \'\') {this.value =\'Suche...\';}"> <input
								type="submit" value="">
						</form>
					</div>
					<div class="clearfix"></div>
				</div>
								
			';
	$MovieArray = $API->API_GetDataList(array("Tabelle"=>"Filme", "Spalten"=>"imdbID,name,duration,year,rating,Genre,resolution","3d"=>"0","Gesehenzaehler"=>"0","Sortierung"=>"added DESC", "Anzahl" =>"40"));
	$movies ="";
	foreach ($MovieArray["Data"] as $key => $value) {
		//echo "http://webservice.fanart.tv/v3/movies/tt".$value["imdbID"]."?api_key=".Fanart_Key.PHP_EOL;
		$fanart = jsonCacheDecoder("http://webservice.fanart.tv/v3/movies/tt".$value["imdbID"]."?api_key=".Fanart_Key);
		//var_dump();
		if(isset($fanart["movieposter"][0]["url"]))	{
			$posterURL = $fanart["movieposter"][0]["url"];
			foreach ($fanart["movieposter"] as $key2 => $value2){
				if($value2["lang"] == "de"){
					$posterURL = $value2["url"];
				}
				
			}
			$movies .= '<div class="movie movie-test movie-test-dark movie-test-left">
                                <div class="movie__images">
                                    <a href="index.php?action=ShowDetails&imdbID='.$value["imdbID"].'" class="movie-beta__link">
                                        <img alt="" src="'.$fanart["movieposter"][0]["url"].'" class="img-responsive">
                                    </a>
                                </div>
								<div class="movie__info">
                                    <a href="index.php?action=ShowDetails&imdbID='.$value["imdbID"].'" class="movie__title">'.$value["name"].' ('.$value["year"].')  </a>
                                    <p class="movie__time">'.($value["duration"]/60).' min</p>
									<!--<p class="movie__option"><a href="single.html">Contray</a> | <a href="single.html">Dolor sit</a> | <a href="single.html">Drama</a></p>-->
                                    <ul class="list_6">
						    			<!--<li><i class="icon1"> </i><p>2,548</p></li>
						    			<li><i class="icon3"> </i><p>546</p></li>-->
						    			<li>Genre : &nbsp; &nbsp;<p>'.implode(", ", $value["Genre"]).'</p></li>
                                    	<li>Rating : &nbsp; &nbsp;<p>'.$value["rating"].'</p></li>
                                    	<li>Auflösung : &nbsp; &nbsp;<p>'.$value["resolution"].'</p></li>
						    					
						    			<div class="clearfix"> </div>
						    		</ul>
                                 </div>
                                <div class="clearfix"> </div>
                            </div>';
		}
	}
	$content .= '<div class="movie_top">
				<div class="col-md-12 movie_box">
				'.$movies.'
				</div>
				</div>
				<div class="clearfix"> </div>		
			</div>';
}

?><!--A Design by W3layouts
Author: W3layout
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE HTML>
<html>
<head>
<title><?php echo $titel;?> - MediaDB</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="MediaDB" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- start plugins -->
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<!--  --><link href='http://fonts.googleapis.com/css?family=Roboto+Condensed:100,200,300,400,500,600,700,800,900' rel='stylesheet' type='text/css'>
<?php echo $JavaScript; ?>
</head>
<body>
	<div class="container">
		<div class="container_wrap">
			<div class="header_top">
				<div class="col-sm-3 logo">
					<a href="index.php"><img src="images/logo.png" alt="" /></a>
				</div>
				<div class="col-sm-9  nav ">
					<ul>
						<li><span class="simptip-position-bottom simptip-movable" data-tooltip="Startseite"><a href="index.php"> </a></span></li>
						<li><span class="simptip-position-bottom simptip-movable" data-tooltip="Filme"><a href="index.php?action=filme"> </a> </span></li>
						<li><span class="simptip-position-bottom simptip-movable" data-tooltip="Serien"><a href="index.php?action=serien"> </a></span></li>
						<li><span class="simptip-position-bottom simptip-movable" data-tooltip="Statistik"><a href="index.php?action=statistik"> </a></span></li>
						<li><span class="simptip-position-bottom simptip-movable" data-tooltip="Rechte"><a href="index.php?action=rechte"> </a></span></li>
						<li><span class="simptip-position-bottom simptip-movable" data-tooltip="Schlüssel"><a href="index.php?action=schluessel"> </a></span></li>
						<li><span class="simptip-position-bottom simptip-movable" data-tooltip="Vergleich"><a href="index.php?action=vergleich"> </a></span></li>		
						<li><span class="simptip-position-bottom simptip-movable" data-tooltip="Einstellungen"><a href="index.php?action=einstellungen"> </a></span></li>
						<li><span class="simptip-position-bottom simptip-movable" data-tooltip="Abmelden"><a href="index.php?logoff"> </a></span></li>	
						
					</ul>
				</div>
				<div class="clearfix"></div>
			</div>
			
			<?php echo $content;?>
			<!-- 
			<div class="content">
				
				<div class="box_2">
					<div class="col-md-5 grid_3">
						<div class="row_1">
							<div class="col-md-6 grid_4">
								<a href="single.html">
									<div class="grid_2">
										<img src="images/pic1.jpg" class="img-responsive" alt="" />
										<div class="caption1">
											<ul class="list_3">
												<li><i class="icon5"> </i>
												<p>3,548</p></li>
											</ul>
											<i class="icon4"> </i>
											<p class="m_3">Guardians of the Galaxy</p>
										</div>
									</div>
									<div class="grid_2 col_1">
										<img src="images/pic2.jpg" class="img-responsive" alt="" />
										<div class="caption1">
											<ul class="list_3">
												<li><i class="icon5"> </i>
												<p>3,548</p></li>
											</ul>
											<i class="icon4"> </i>
											<p class="m_3">Guardians of the Galaxy</p>
										</div>
									</div>
								</a>
							</div>
							<div class="col-md-6 grid_7">
								<div class="col_2">
									<ul class="list_4">
										<li><i class="icon1"> </i>
										<p>2,548</p></li>
										<li><i class="icon2"> </i>
										<p>215</p></li>
										<li><i class="icon3"> </i>
										<p>546</p></li>
										<li>Rating : &nbsp;&nbsp;
											<p>
												<img src="images/rating1.png" alt="" />
											</p>
										</li>
										<li>Release Date : &nbsp;<span class="m_4">Mar 15, 2015</span>
										</li>
										<div class="clearfix"></div>
									</ul>
									<div class="m_5">
										<a href="single.html"><img src="images/pic3.jpg"
											class="img-responsive" alt="" /></a>
									</div>
								</div>
							</div>
							<div class="clearfix"></div>
						</div>
						<div class="row_2">
							<a href="single.html"><img src="images/pic4.jpg"
								class="img-responsive" alt="" /></a>
						</div>
					</div>
					<div class="col-md-5 content_right">
						<div class="row_3">
							<div class="col-md-6 content_right-box">
								<a href="single.html">
									<div class="grid_2">
										<img src="images/pic6.jpg" class="img-responsive" alt="" />
										<div class="caption1">
											<ul class="list_5">
												<li><i class="icon5"> </i>
												<p>3,548</p></li>
											</ul>
											<i class="icon4 icon6"> </i>
											<p class="m_3">Guardians of the Galaxy</p>
										</div>
									</div>
								</a>
							</div>
							<div class="col-md-6 grid_5">
								<a href="single.html">
									<div class="grid_2">
										<img src="images/pic7.jpg" class="img-responsive" alt="" />
										<div class="caption1">
											<ul class="list_5">
												<li><i class="icon5"> </i>
												<p>3,548</p></li>
											</ul>
											<i class="icon4 icon6"> </i>
											<p class="m_3">Guardians of the Galaxy</p>
										</div>
									</div>
								</a>
							</div>
							<div class="clearfix"></div>
						</div>
						<div class="video">
							<iframe width="100%" height=""
								src="https://www.youtube.com/embed/s1QeoSedWmM" frameborder="0"
								allowfullscreen></iframe>
						</div>
						<div class="row_5">
							<div class="col-md-6">
								<div class="col_2">
									<ul class="list_4">
										<li><i class="icon1"> </i>
										<p>2,548</p></li>
										<li><i class="icon2"> </i>
										<p>215</p></li>
										<li><i class="icon3"> </i>
										<p>546</p></li>
										<li>Rating : &nbsp;&nbsp;
											<p>
												<img src="images/rating1.png" alt="">
											</p>
										</li>
										<div class="clearfix"></div>
									</ul>

								</div>
							</div>
							<div class="col-md-6 m_6">
								<a href="single.html"> <img src="images/pic8.jpg"
									class="img-responsive" alt="" />
								</a>
							</div>
						</div>
					</div>
					<div class="col-md-2 grid_6">
						<div class="m_7">
							<a href="single.html"><img src="images/pic9.jpg"
								class="img-responsive" alt="" /></a>
						</div>
						<div class="caption1">
							<ul class="list_5">
								<li><i class="icon5"> </i>
								<p>3,548</p></li>
							</ul>
							<i class="icon4 icon6"> </i>
							<p class="m_3">Guardians of the Galaxy</p>
						</div>
						<div class="col_2 col_3">
							<ul class="list_4">
								<li><i class="icon1"> </i>
								<p>2,548</p></li>
								<li><i class="icon2"> </i>
								<p>215</p></li>
								<li><i class="icon3"> </i>
								<p>546</p></li>
								<li>Rating : &nbsp;&nbsp;
									<p>
										<img src="images/rating1.png" alt="">
									</p>
								</li>
								<li>Release : &nbsp;<span class="m_4">Mar 15, 2015</span>
								</li>
								<div class="clearfix"></div>
							</ul>
							<div class="m_8">
								<a href="single.html"><img src="images/pic10.jpg"
									class="img-responsive" alt="" /></a>
							</div>
						</div>
					</div>
					<div class="clearfix"></div>
				</div>
			</div>
			
			 -->
			
			
		</div>
	</div>

	<div class="container"> 
 <footer id="footer">
 	<div id="footer-3d">
		<div class="gp-container">
			<span class="first-widget-bend"></span>
		</div>		
	</div>
    <div id="footer-widgets" class="gp-footer-larger-first-col">
		<div class="gp-container">
            <div class="footer-widget footer-1">
            	<div class="wpb_wrapper">
					<img src="images/f_logo.png" alt=""/>
				</div> 
	          <br>
	          <p>Diese Webseite beruht auf der MediaDB API Version <?php echo API_VERSION;?>.</p>
			  <p class="text">Zusätzlich zu dieser Weboberfläche gibt es eine Android-App.</p>
			 </div>
			 <div class="footer_box">
			  <div class="col_1_of_3 span_1_of_3">
					<h3>Inhalt</h3>
					<ul class="first">
						<li><a href="index.php?action=filme">Filme</a></li>
						<li><a href="index.php?action=serien">Serien</a></li>
					</ul>
		     </div>
		     <div class="col_1_of_3 span_1_of_3">
					<h3>Information</h3>
					<ul class="first">
						<li><a href="index.php?action=statistik">Statistik</a></li>
						<li><a href="index.php?action=einstellungen">Einstellungen</a></li>
					</ul>
		     </div>
		     <div class="col_1_of_3 span_1_of_3">
					<div class="copy">
				      <p>&copy; 2015 Template by <a href="http://w3layouts.com" target="_blank"> w3layouts</a></p>
			        </div>
		     </div>
		    <div class="clearfix"> </div>
	        </div>
	        <div class="clearfix"> </div>
		</div>
	</div>
  </footer>
</div>		
</body>
</html>