<?php	include "sys/lib.php"; 

	$search="";
	if(isset($_POST["key"])) {
		$search = $_POST["key"];
	}

	$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";		
	$URL=parse_url($actual_link);	
	$filetype = array('mp4','avi','mkv','m4v');
	
	
	echo "<div id=\"TITLE-LIST\" class=\"TITLE-LIST\" >";	
	echo "<div class=\"TITLE-BANNER\" >VIDEOS</div>";
	
	echo "<table class=\"TITLE-MODES\"><tr>";	
	echo "<td class=\"TITLE-MODES\" onclick=\"changeView('GALLERY')\" >Galery</td>";
	echo "<td class=\"TITLE-MODES\" onclick=\"changeView('COMPACT-VIEW')\" >Compact</td>";	
	echo "<td class=\"TITLE-MODES\" onclick=\"changeView('LIST-VIEW')\" >ListView</td>";	
	
	echo "</tr></table>";
	echo "</div>";

	
	echo "<div id=\"FULL-LIST\" class=\"LISTBASE\">";	
	
	$path="/home/usuario/AndroidStudioProjects/www/mmfire/Videos/";	
	getDirContents($path,$filetype,$search,"/www/mmfire/Videos/",true);
	
	//showDirContents(getDirContents($path,$filetype,$search,"/www/mmfire/Videos/"));	

	//$path="/home/usuario/AndroidStudioProjects/www/mmfire/Torrents/";
	//showDirContents(getDirContents($path,$filetype,$search,"/www/mmfire/Torrent"));		
	
	$path="/home/usuario/AndroidStudioProjects/www/movies/";	
	getDirContents($path,$filetype,$search,"/www/movies/",true);
	//showDirContents(getDirContents($path,$filetype,$search,"/www/movies/",false));	

	//$path="/home/usuario/AndroidStudioProjects/www/mmfire/Videos/";		
	//showOnlyArray(getDirContents($path,$filetype,$search,"/www/mmfire/Videos/",false));

	
	echo "</div>";	
	
	echo "<div id=\"DEBUG001\" style=\"font-size:9px;\"></div>";

	
	
?>


