<?php
error_reporting (0);
ini_alter ( "memory_limit", "1024M");
ob_implicit_flush (TRUE);
ignore_user_abort (0);
if( !ini_get('safe_mode') ){
            set_time_limit(60);
} 
define('vinaget', 'yes');

class JLeech
{
	function config(){
		include("config.php");
		if ($Secure == true) $this->Deny = true;
		foreach ($SecureID as $login_vng)
		if( $_COOKIE["secureid"] == md5($login_vng)) {
			$this->Deny = false;
			break;
		}
		$this->Secure = $Secure;
		$this->fileinfo_dir = $fileinfo_dir;
		$this->fileinfo_ext = $fileinfo_ext;
		$this->download_prefix = $download_prefix;
		$this->banned = explode(' ', '.htaccess .htpasswd .php .php3 .php4 .php5 .phtml .asp .aspx .cgi .pl');    // banned filetypes
		$this->unit = 1024; 
		$this->limitMBIP = $limitMBIP;
		$this->ttl = $ttl;
		$this->limitPERIP = $limitPERIP; 
        $this->ttl_ip = $ttl_ip; 
		$this->max_jobs_per_ip = $max_jobs_per_ip;  
		$this->max_size = $max_size;
		$this->max_jobs  = $max_jobs; 
		$this->max_load = $max_load;
		$this->title = $title;
		$this->zpag = $zpag;
		$this->link_zpag = $link_zpag;
		$this->colorfn = $colorfilename;
		$this->colorfs = $colorfilesize;
		$this->badword = $badword;
		$this->act = $action;
		$this->realall = $get_realall;
		$this->debridmax = $get_debridmax;
		$this->alldebrid = $get_alldebrid;
		$this->fastdebrid = $get_fastdebrid;
		$this->listfile = $listfile;
		$this->checkacc = $checkacc;
		$this->privatef = $privatefile;
		$this->privateip = $privateip;
		$this->linkcbox = $linkforcbox;
		$this->check3x = $checklinksex;
		$this->self = 'http://'.$_SERVER['HTTP_HOST'].preg_replace('/\?.*$/', '', isset($_SERVER['REQUEST_URI'])? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
  
	}

	function getFileInfo(){
		$this->fileinfo = "";
		$dir = opendir($this->fileinfo_dir);
		$lists = array();
		
		while ($file = readdir($dir))
		{
			if (substr($file,-strlen($this->fileinfo_ext)-1) == "." . $this->fileinfo_ext)
			{
				$lists[] = $this->fileinfo_dir . $file;
			}
		}
		closedir($dir);
		
		if (count($lists))
		{
			sort($lists);
			
			$this->fileinfo = array_pop($lists);
			
			foreach ($lists as $file)
			{
				@unlink($file);
			}
		}
	}

	function load_jobs(){
		if (isset($this->jobs))
		{
    		return;
		}
		$this->getFileInfo();
		$this->jobs_data = @file_get_contents($this->fileinfo);
		$this->jobs = @unserialize($this->jobs_data);		
		if (! is_array($this->jobs))
		{
			$this->jobs = array();
			$this->jobs_data = 'wtf';
		}
	}

	function save_jobs(){
		if (!isset($this->jobs))
		{
    		return;
		}
		$this->getFileInfo();
		$this->fileinfo = $this->fileinfo_dir . time() . "." . $this->fileinfo_ext;
		$tmp = serialize($this->jobs);
		if ($tmp !== $this->jobs_data)
		{
    		$this->jobs_data = $tmp;
			$fh = fopen($this->fileinfo, 'w') or die('<CENTER><font color=red size=3>Could not open file ! Try to chmod the folder "<B>files</B>" to 777</font></CENTER>');
			fwrite($fh, $this->jobs_data);
			fclose($fh);
			@chmod($this->fileinfo, 0666);
			return true;	
		}
	}

	function lookup_job($hash){
		$this->load_jobs();
		foreach ($this->jobs as $key=>$job)
		{
			if ($job['hash'] === $hash)
			{
				$job['url'] = $key;
				return $job;
			}
		}
		return false;
	}

	function lookup_ip($ip){
		$this->load_jobs();
		$cnt = 0;
		foreach ($this->jobs as $job)
		{
			if ($job['ip'] === $ip) $cnt++;
		}
		return $cnt;
	}
}

class JLeech_Local extends JLeech
{
	function jleech_local(){
		$this->config();
		$this->info .= 'Local';
		include("account.php");
		$this->cookies = '';
		$this->load_jobs();
        $this->clean_ip();
		if (isset($_REQUEST['file'])) $this->download();
		if (isset($_COOKIE['owner']))
		{
			$this->owner = $_COOKIE['owner'];
		}
		else
		{
			$this->owner = intval(rand()*10000);
			setcookie('owner', $this->owner, 0);	
		}
		$this->bypass = isset($_GET['all']);
	}

	function download(){      
		if (! $job = $this->lookup_job($_REQUEST['file'])) {
			return;
		}
		if ( JTools::get_IP() !== $job['ip'] && $this->privateip==true) {
			die(_errordl);
			
		}
		$filesize= $job['size'];
		$filename = $this->download_prefix.urlencode($job['filename']);
		if (preg_match('#^http://([a-z0-9]+\.)?filesonic\.([a-z]+)/#', $job['directlink']['url'])) {
			$url =$job['url'];
			$page = $this->curl($url,"","");
			preg_match('/Location: (.*)/', $page, $fsnlink);
			if (strpos($fsnlink[1],'filesonic')) $url = trim($fsnlink[1]);
			$cookies = $job['directlink']['cookies'];
            $page = $this->curl($url,$cookies,"");  
			preg_match('/Location: (.*)/', $page, $match);
			$link=trim($match[1]);
		}
		else {
			$link = $job['directlink']['url'];
			$cookies = $job['directlink']['cookies'];
		}
		if (ereg('rapidshare', $job['directlink']['url'])){
		
				list($user, $pass) = explode(':', $this->get_account('rapidshare.com'));
		}	
		$range = '';
		if (isset($_SERVER['HTTP_RANGE'])) {
			$range = substr($_SERVER['HTTP_RANGE'], 6);
			list($start, $end) = explode('-', $range);
			$new_length = $filesize - $start;
		}
		// Must be fresh start
		if( headers_sent() )
		die('Headers Sent');
		// Required for some browsers
		if(ini_get('zlib.output_compression'))
		ini_set('zlib.output_compression', 'Off'); 

		header("Pragma: public"); // required 
		header("Expires: 0"); 
		header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
		header("Cache-Control: private",false); // required for certain browsers 
		header("Content-Type: application/force-download");
		header("Content-Disposition: attachment; filename=".$filename);
		header("Content-Transfer-Encoding: binary"); 
		header("Accept-Ranges: bytes");
		if (empty($range)) {
			header("HTTP/1.1 200 OK");
			header("Content-Length: {$filesize}");
		} 
		else {
			header("HTTP/1.1 206 Partial Content");
			header("Content-Length: $new_length");
			header("Content-Range: bytes $range/{$filesize}");
		}		
		$schema = parse_url($link);
		list($path1, $path2)  = explode($schema['path'], $link);
		$path = $schema['path'].$path2;
		$data = "GET {$path} HTTP/1.1\r\n";
		$data .= "Host: {$schema['host']}\r\n";
		$data .= "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1\r\n";
		$data .= $cookies ? "Cookie: {$cookies}\r\n" : '';
		if ($user && $pass) {
			$data .= "Authorization: Basic " . base64_encode("{$user}:{$pass}") . "\r\n";
		}
		if (!empty($range)) $data .= "Range: bytes={$range}\r\n";
		$data .= "Connection: Close\r\n\r\n";
		$fp = fsockopen((($schema['scheme'] == 'https') ? 'ssl://' : '').$schema['host'], $schema['scheme'] == 'https' ? 443 : 80, $errno, $errstr);
		if (!$fp) {
			header("HTTP/1.0 404 Not Found");
			sleep(120);
			exit;
		}
		@stream_set_timeout($fp, 2);
		fputs($fp, $data);
		fflush($fp);
		$tmp = '';
		do {
			$tmp .= stream_get_line($fp, 128);
		} 
		while (strpos($tmp, "\r\n\r\n" ) === false);
		$tmp = explode("\r\n\r\n", $tmp);
		if ($tmp[1]) {
			print $tmp[1];
		}
		while (!feof($fp) && (connection_status()==0)) {
			$recv = @stream_get_line($fp, $this->unit);
			@print $recv;
			@flush();
			@ob_flush();
		}
		fclose($fp);
		exit;
	}

	function clean() {
		$oldest = time() - $this->ttl*60;
		$delete = array();
		foreach ($this->jobs as $key=>$job) {
			if ($job['mtime'] < $oldest) {
				$delete[] = $key;
			}
		}
		foreach ($delete as $url) {
			unset($this->jobs[$url]);
		}
		$this->save_jobs();
	}

	function clean_ip() {
		$xhandle = opendir ("tmp");
		while ($buin = readdir ($xhandle)) {
			if ($buin == "." || $buin == "..") {
					continue;
			}
			$xd = filemtime ( "tmp/$buin" );
			$altr = time() - $this->ttl_ip*60;
			if ($xd < $altr )  {
				if (is_dir ( "tmp/$buin" )){
					rmdir ( "tmp/$buin" );
				} else {
					unlink ( "tmp/$buin" );
				}
			}			
		}
		closedir ( $xhandle );		
	}

    function Checkjobs() {
		$REMOTE_ADDR = $_SERVER ['REMOTE_ADDR'];
		$heute = 0;
		$xhandle = opendir ( "tmp");
		while ( $buin = readdir ($xhandle)) {
			if (eregi ( "$REMOTE_ADDR", $buin )) {
				$heute++;}
		}
		return $heute;
		closedir ( $xhandle );
	}

	function get_num_jobs() {
		/*
		if($this->privatef==false) $numjobs = count($this->jobs);
		else {
			$numjobs = 0;
			foreach ($this->jobs as $job){
				if ($job['owner'] == $this->owner) $numjobs = $numjobs+1;		
			}
		}
		*/
	return count($this->jobs);
	}
	function create_hash($url,$filename) {
		$this->load_jobs();
		if (isset($this->jobs[$url]) && $this->jobs[$url]['owner']==$this->owner) {
			$S1 = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
			$n = strlen($S1);
			for($i = $n ; $i > 0 ; $i-- ) {
				if($S1[$i] == '/') {
					$i+=1;
					break;
				}
			}
			$S1 = substr($S1,0,$i);
			if($this->linkcbox)
				echo '[B][color=red]Repost Link ==> [/color][/b]';
			
		}
		return JTools::hash($url, $filename);
	}

	function cut_str($str, $left, $right)  {
		$str = substr ( stristr ( $str, $left ), strlen ( $left ) );
		$leftLen = strlen ( stristr ( $str, $right ) );
		$leftLen = $leftLen ? - ($leftLen) : strlen ( $str );
		$str = substr ( $str, 0, $leftLen );
		return $str;
	}

	function GetCookies($content){
		preg_match_all('/Set-Cookie: (.*);/U',$content,$temp);
		$cookie = $temp[1];
		$cookies = implode('; ',$cookie);
		return $cookies;
	}

	function GetAllCookies($page) {
		$lines = explode("\n", $page);
		$retCookie = "";
		foreach ($lines as $val) 
		{
			preg_match('/Set-Cookie: (.*)/',$val,$temp);
			if (isset($temp[1]))
			{
				if ($cook = substr($temp[1], 0, stripos($temp[1], ';')))
						$retCookie .= $cook . ";";
			}
		}
		return $retCookie;
    }

	function mf_str_conv($str_or)
	{
		$str_or = stripslashes($str_or);
		if (!preg_match("/unescape\(\W([0-9a-f]+)\W\);\w+=([0-9]+);[^\^]+\)([0-9\^]+)?\)\);eval/", $str_or, $match)) return $str_or;
		$match[3] = $match[3] ? $match[3] : "";
		for ($i = 0; $i < $match[2]; $i++){
			$c = HexDec(substr($match[1], $i*2, 2));
			eval ("\$c = \$c".$match[3].";");
			$str_re .= chr($c);
		}
		$str_re = str_replace($match[0], stripslashes($str_re), $str_or);
		if (preg_match("/unescape\(\W([0-9a-f]+)\W\);\w+=([0-9]+);[^\^]+\)([0-9\^]+)?\)\);eval/", $str_re, $dummy))
			$str_re = mf_str_conv($str_re);
		return $str_re;
	}
	function curl($url,$cookies,$post){
		$ch = @curl_init();
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_HEADER, 1);
		if ($cookies) curl_setopt($ch, CURLOPT_COOKIE, $cookies);
		curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1');
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		if ($post){
			curl_setopt($ch, CURLOPT_POST, 1);
			curl_setopt($ch, CURLOPT_POSTFIELDS, $post); 
		}
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
		curl_setopt($ch, CURLOPT_TIMEOUT, 30); 
		curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 30);
		$page = curl_exec( $ch);
		curl_close($ch); 
		return $page;
	}

	function getFilename($url,$begin,$end){ 
		$page = $this->curl($url,"","");
		$filename = trim ( $this->cut_str ( $page, $begin, $end) );
		return $filename;
	}

	function get_account($service){
		$acc = ':';
		if (isset($this->acc[$service]))
		{
			$service = $this->acc[$service];
			$this->max_size = $service['max_size'];
			$acc = $service['accounts'][rand(0, count($service['accounts'])-1)];
		}
		return $acc;
	}

	function get_cookie($service){
		$acc = ' ';
		if (isset($this->acc[$service]))
		{
			$service = $this->acc[$service];
			$this->max_size = $service['max_size'];
			$acc = $service['cookie'][rand(0, count($service['cookie'])-1)];
		}
		return $acc;
	}

	function leech($url){

		if ($this->get_num_jobs() >= $this->max_jobs){
			$dlhtml .= ('<center><b><i><font color=red>'._manyjob.'</font></i></b></center>');
			return $dlhtml;
		}
		if ($this->countMBIP >= $this->limitMBIP){
			$dlhtml .= ('<center><b><i><font color=red>'._limitfile1.' '.round($this->limitMBIP/(1024*1024),2).' GB '._limitfile4.' '.$this->ttl.' '._limitfile3.'</font></i></b></center>');
			return $dlhtml;
		}
		if ($this->Checkjobs() >= $this->limitPERIP){
			$dlhtml .= ('<center><b><i><font color=red>'._limitfile1.' '.$this->limitPERIP.' '._limitfile2.' '.$this->ttl_ip.' '._limitfile3.'</font></i></b></center>');
			return $dlhtml;
		}
		if ($this->lookup_ip(JTools::get_ip()) >= $this->max_jobs_per_ip){
			$dlhtml .= ('<center><b><i><font color=red>'._limitip.'</font></i></b></center>');
			return $dlhtml;
		}
        if ($this->lookup_ip(JTools::get_ip()) >= $this->ttl_ip*60){
			$dlhtml .= ('<center><b><i><font color=red>'._limitip.'</font></i></b></center>');
			return $dlhtml;
		}
		$url = trim($url);
		if (empty($url)) return;
		$accrealall = $this->get_account('real-debrid.com');
		$cookieall = $this->get_cookie('alldebrid.com');
		$accdebridmax = $this->get_account('debridmax.com');
		$accfastdebrid = $this->get_account('fast-debrid.com');
		//
		if($this->realall == true && empty($accrealall)== false) include ('hosts/real-debrid_com.php');
		else if($this->alldebrid == true && empty($cookieall)== false)  include ('hosts/alldebrid_com.php'); 
		else if($this->fastdebrid == true && empty($accfastdebrid)== false)  include ('hosts/fast-debrid_com.php');


		else if($this->debridmax == true && empty($accdebridmax)== false) include ('hosts/debridmax_com.php');
		else {
			include ("hosts/hosts.php");
			ksort($host);
			foreach ($host as $file => $site){
				$site = substr($site,0,-4);
				$site = str_replace("_",".",$site) ;
				if (preg_match('%'.$site.'%U', $url)){
					include ('hosts/'.$host[$file]);
				}

			}
		}
		if(!$URL){
			$filename = substr(strrchr($url, '/'), 1);
			$filesize = JTools::remote_size($url, $this);	
		}
		$filename =urldecode($filename);
		$filename=str_replace(".html","",$filename) ;
		$filename=str_replace(".htm","",$filename) ;
		$filename=str_replace("www","",$filename);
		$filename=str_replace("WWW","",$filename);
		$filename=str_replace("http","",$filename);
		$filename=str_replace("HTTP","",$filename);
		$filename=str_replace("'","_",$filename);
		$filename=str_replace("@","a",$filename);
		$filename=str_replace("&","_",$filename);
		$filename = str_replace($this->banned, '.xxx', $filename);
		$hash = $this->create_hash($url,$filename);
		if ($hash === false) {
			$dlhtml .= ('<center><b><i><font color=red>'._cantjob.'</font></i></b></center>');
			return $dlhtml;
		}

		if (($this->countMBIP+$filesize/(1024*1024)) >= $this->limitMBIP){
						$dlhtml .= ('<center><b><i><font color=red>'._limitfile1.' '.round($this->limitMBIP/(1024*1024),2).' GB '._limitfile4.' '.$this->ttl.' '._limitfile3.'</font></i></b></center>');
			return $dlhtml;
		}
		if ($filesize > $this->max_size*1024*1024) {
			if($this->linkcbox)
				echo '[B][color=blue]'.$url.'[/color][color=red] '.round($filesize/(1024*1024),2).' MB '._filebig.'  [/color][color=green]'._allowed.'[/color][color=#d71f83] '.$this->max_size.' MB[/color][/b][br]';
			$dlhtml .= ('<center><b><font color=#00CC00>'.$url.'</font> <font color=red>'.round($filesize/(1024*1024),2).' MB '._filebig.' </font><font color=#3399FF>'._allowed.'</font> <font color=#FFCC00>'.$this->max_size.' MB</font></b></center>');
			return $dlhtml;
		}
		
		if ($filesize <= 0){
			include("checklink.php");
			return $dlhtml;
		}

		$job = array(
			'hash'	=> $hash,
                        'path'	=> substr(md5(rand()), 0, 5),
			'filename'	=> $filename,
			'size'	=> $filesize,
			'msize'	=> 0,
			'mtime'	=> time(),
			'speed'	=> 0,
			'url'	=> $url,
			'owner'	=> $this->owner,
			'ip'	=> JTools::get_IP(),
			'type'	=> 'direct',
			'directlink'	=> array(
				'url'	=> $URL,
					'cookies'=> $this->cookies,
				),
		);
		$tiam = time();
		mkdir ( "tmp/$_SERVER[REMOTE_ADDR].$tiam", 0777 )   
		or die('<CENTER><font color=red size=4>Could not create folder! Try to chmod the folder "<B>tmp</B>" to 777</font></CENTER>');

		$filesize1 = $filesize*1/(1024*1024); 
		$filesize2 = round($filesize1, 2);
		$S2 = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'].'?file=';
		$linkdown = $S2.$job['hash'];
		if($this->zpag && empty($URL)==false ){ 
			
			##########Begin short link ############
			$ch = @curl_init();
			curl_setopt($ch, CURLOPT_URL, $this->link_zpag.$linkdown);
			curl_setopt($ch, CURLOPT_HEADER, 0);
			curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1');
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
			curl_setopt($ch, CURLOPT_TIMEOUT, 5); 
			curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5);
			$datalink = curl_exec( $ch);
			curl_close($ch); 
			if (preg_match('%(http:\/\/zpag\.es/.++)%U', $datalink, $shortlink)) $lik = trim($shortlink[1]);
			else $lik = $linkdown;

			############ End short link  ##########
		}
		else $lik = $linkdown;
		if($this->linkcbox)
			echo "[b][URL=".$lik."] ".$this->title." | [color=".$this->colorfn."] ".$job['filename']." [/color][color=".$this->colorfs."]($filesize2 MB)[/color][/url][/b][br]";

		$dlhtml .=  "<b><a href='$lik' style='TEXT-DECORATION: none'> <font color='#00CC00'>".$job['filename']."</font> <font color='#FF66FF'>($filesize2 MB)</font></a></b><br>";
		$this->jobs[$url] = $job;
		$this->save_jobs();
		return $dlhtml;
	}

	function datecmp($a, $b){
		return ($a[1] < $b[1]) ? 1 : 0;
	}

	function deljob(){	
		if($this->act['delete']==false) return;
		if ($_POST['checkbox']){
			echo "<form action='$this->self' method='post'>";
			for ($i=0; $_POST['checkbox'][$i]!= null; $i++){
				$temp = explode("+++",$_POST['checkbox'][$i]);
				$ftd = $temp[0];
				$name = $temp[1];
				echo "<br><b> $name </b>";
				echo '<input type="hidden" name="ftd[]" value="'.$ftd.'" />';
				echo '<input type="hidden" name="name[]" value="'.$name.'" />';
			}
			echo "<br><br><input type='submit' value='"._del."' name='remove'/> &nbsp; <input type='submit' value='"._canl."' name='Cancel'/><BR><BR>";
		}
		if ($_POST['remove']){	
			echo "<BR>";
			for ($i=0; $_POST['ftd'][$i]!= null; $i++){
				$ftd = $_POST['ftd'][$i];
				$name = $_POST['name'][$i];
				if ($this->jobs[$ftd]) {
					unset($this->jobs[$ftd]);
					echo "<center>File: <b>$name</b> "._deld;
				}
				else echo "<center>File: <b>$name</b> "._notF; 
				echo "</center>";
			}
			echo "<BR>";
			$this->save_jobs();
		}
		if ($_POST['Cancel']){	
			$this->fulllist();
		}
	}

	function renamejob(){	
		if($this->act['rename']==false) return;
		if ($_POST['checkbox']){
			echo "<form action='$this->self' method='post'>";
			for ($i=0; $_POST['checkbox'][$i]!= null; $i++){
				$temp = explode("+++",$_POST['checkbox'][$i]);
				$name = $temp[1];
				echo "<br><b> $name </b>";
				echo '<input type="hidden" name="name[]" value="'.$name.'" />';
				echo '<br>'._nname.': <input type="text" name="nname[]" value="'.$name.'"/ size="70"><br />';
			}
			echo "<br><input type='submit' value='"._rname."' name='renn'/><BR><BR>";
		}
		if ($_POST['renn']){
			for ($i=0; $_POST['name'][$i]!= null; $i++)
			{
				$orname = $_POST['name'][$i];
				$nname = $_POST['nname'][$i];
				$nname = str_replace(' ','',$nname);
				$nname = str_replace($this->banned,'',$nname);
				if ($nname == "") { echo "<BR>"._bname."<BR><BR>"; return; }
				else {
					echo "<br>";
					foreach ($this->jobs as $url=>$job){
						if ($job['filename'] == $orname){	
							$key = $url;
							//$hash = $this->create_hash($key,$nname);
							$jobn = array(
								'hash'	=> $job['hash'],
								'filename'	=> $nname,
								'size'	=> $job['size'],
								'mtime'	=> $job['mtime'],
								'url'	=> $key,
								'owner'	=> $job['owner'],
								'ip'	=> $job['ip'],
								'type'	=> 'direct',
								'directlink'	=> array(
									'url'	=> $job['directlink']['url'],
									'cookies'=> $job['directlink']['cookies'],
								),
							); 
						}	
					}
					if($key){
						$this->jobs[$key] = $jobn;
						$this->save_jobs();
						echo "File <b>$orname</b> "._rnameto." <b>$nname</b>";
					}
					else echo "File <b>$orname</b> "._notF;
					echo "<br><br>";
				}
			}
		}
	}

	function fulllist() {
		$act="";
		if($this->act['delete']==true) { $act.='<option value="del">'._del.'</option>'; }
		if($this->act['rename']==true)  { $act.='<option value="ren">'._rname.'</option>';}
		if ($act != ""){
			if ($_POST['checkbox'][0] != null || $_POST['renn'] || $_POST['remove']){ 
				echo '<table style="width: 80%; border-collapse: collapse" border="1" align="center"><tr><td><center>';
				switch ($_POST['option']){
					case 'del': $this->deljob(); break;
					case 'ren': $this->renamejob(); break;
				}
				if ($_POST['renn']) $this->renamejob();
				if ($_POST['remove']) $this->deljob();
				echo "</center></td></tr></table><br>";
			}
		}
		else echo '</select>';
		if ($this->totalMB == 0) { echo "<Center>"._notfile."<br><a href='$this->self'> ["._main."] </a></center>"; return;}
		echo "<script type=\"text/javascript\">function setCheckboxes(act){elts = document.getElementsByName(\"checkbox[]\");var elts_cnt  = (typeof(elts.length) != 'undefined') ? elts.length : 0;if (elts_cnt){ for (var i = 0; i < elts_cnt; i++){elts[i].checked = (act == 1 || act == 0) ? act : (elts[i].checked ? 0 : 1);} }}</script>";
		echo "<center><a href=javascript:setCheckboxes(1)> Check All </a> | <a href=javascript:setCheckboxes(0)> Un-Check All </a> | <a href=javascript:setCheckboxes(2)> Invert Selection </a></center><br>";	
		echo "<center><form action='$this->self' method='post' name='flist'><select onchange='javascript:void(document.flist.submit());'name='option'>";

		if ($act == "") echo "<option value=\"dis\"> "._acdis." </option>"; else echo '<option selected="selected">'._ac.'</option>'.$act;
		echo '</select>';

		echo '<div style="overflow: auto; height: auto; max-height: 450px; width: 800px;"><table id="table_filelist" class="filelist" align="left" cellpadding="3" cellspacing="1" width="100%"><thead><tr class="flisttblhdr" valign="bottom"><td id="file_list_checkbox_title" class="sorttable_checkbox">&nbsp;</td><td class="sorttable_alpha"><b>'._name.'</b></td><td><b>'._Size.'</b></td><td><b>'._Date.'</b></td></tr></thead><tbody>
		';
		foreach ($this->jobs as $job) {
			if ($job['owner']!=$this->owner && !$this->bypass && $this->privatef==true)
			{
				continue;
			}
			$files[] = array($job['url'], $job['mtime'], $job['hash'], $job['filename'],$job['size']);
		}
		usort($files, array($this, 'datecmp'));
		$scheme = "<tr class='flistmouseoff' align='center'><td><input name='checkbox[]' value='%s+++%s' type='checkbox'></td><td><a href='?file=%s' style='font-weight: bold; color: rgb(0, 0, 0);'>%s</a></td><td>%.2f MB</td><td><a href=http://www.google.com.vn/search?q=%s title='"._kickcheck."' target='%s'><font color=#000000>%.1f "._minago."</font></a></center></td></tr>";

		$data="";
		foreach ($files as $file)
		{
		$data .= sprintf($scheme, $file[0], $file[3], $file[2], $file[3], $file[4]/1024/1024, $file[0], $file[1],(time() - $file[1])/60);
		}
		//$this->CheckMBIP();
		echo $data;
		$totalall = $this->totalMB;
		if($totalall >= 1024) $totalall = round($totalall/1024, 1)." GB";
		else $totalall = $totalall." MB";
		$MB1IP = $this->countMBIP;
		if($MB1IP >= 1024) $MB1IP = round($MB1IP/1024, 1)."GB";
		else $MB1IP = $MB1IP."MB";
		$thislimitMBIP =	round($this->limitMBIP/1024,0);
		echo "</tbody><tbody><tr class='flisttblftr'><td>&nbsp;</td><td>"._Total.":</td><td>$totalall</td><td>&nbsp;</td></tr></tbody></table>
		</div></form><center><b>"._Total1." $MB1IP/$thislimitMBIP GB - "._Total2." $this->ttl "._Total3."</b></center><br/>";

		//echo "<center><br><a href='$this->self'> [Back to main] </a> &nbsp;&nbsp;&nbsp; <a href='#'> [Back to top]</a></center>";
	}

    function CheckMBIP(){
		$this->countMBIP = 0;
		$this->totalMB = 0;
		foreach ($this->jobs as $job){
			if ($job['ip'] == $_SERVER['REMOTE_ADDR']) {
				$this->countMBIP = $this->countMBIP + $job['size']/1024/1024;
			}
			if($this->privatef==false){
				$this->totalMB = $this->totalMB + $job['size']/1024/1024;
				$this->totalMB = round($this->totalMB);
			}
			else {
				if ($job['owner'] == $this->owner) {
					$this->totalMB = $this->totalMB + $job['size']/1024/1024;
					$this->totalMB = round($this->totalMB);
				}
			}

		}
		$this->countMBIP = round($this->countMBIP);
		if ($this->countMBIP >= $this->limitMBIP)
		return false;return true;
	}

	function main(){
		$this->clean();

		if (JTools::get_load() > $this->max_load){
			echo '<center><b><i><font color=red>'._svload.'</font></i></b></center>';
			return;
		}
		if ($_POST['urllist']) {
			$_POST['urllist'] = str_replace("\r", "",  $_POST['urllist']);
			$files = explode("\n", $_POST['urllist']);
			if($this->linkcbox){
				echo '<small style="color:#55bbff">'._linkcbox.'</small><hr /><BR>';
				echo "<center><input class='form' type='text' name='URL' size='100'  onclick='javascript:this.focus();this.select()' readOnly value='[center]";
			}
		}
		if ($files){
			$dlhtml = "";
			foreach ($files as $url){
				if(stristr($url,'http') && strlen($url) > 10){
					if(!$this->check3x) $dlhtml .= $this->leech($url);
					else{
						################### CHECK 3X #########################
						if(strpos($url,"|not3x")) {
							$url = str_replace("|not3x","",$url) ;
							//echo '[B][url=http://www.google.com.vn/search?q='.$url.'][color=green]Link sex ??? ==► [/url][/color][/b]';
						}
						else{
							$data =  $this->curl("http://www.google.com.vn/search?q=$url", "", "");
							$totalbadword = count ($this->badword);
							for($i = 0; $i < $totalbadword; $i++){
								if (ereg($this->badword[$i],$data )) {	
									$check3x = true;
									break;
								}
							}
							
						}
						if($check3x !== true) $dlhtml .= $this->leech($url);
						else {
							if($this->linkcbox)
								echo '[B][url=http://www.google.com.vn/search?q='.$url.'][color=red]'._sex.' [/color][color=blue]'.$url.'[/color][/b][/url][br]';
							$dlhtml .= '<B><font color=red>'._issex.' </font><a href=http://www.google.com.vn/search?q='.$url.'><font color=#00CC00>'.$url.'</font></a><br><font color=#FFCC00>'._ifnot.' </font><font color=#0066CC>'.$url.'</font><font color=#FF3300>|</font><font color=#ff9999 face=Arial>not3x</font></b><BR>';
							unset($check3x);
						}
						################### CHECK 3X #########################
					}
				}
				else $dlhtml .=  "<font color=red><B>"._errorlink."</B></font><BR>";
			}
		}

		if (!empty($_POST['urllist'])) {
			if($this->linkcbox) echo "[/center]'></center>\n";
			echo '<BR><hr /><small style="color:#55bbff">'._dlhere.'</small>';

			echo "<BR><CENTER>".$dlhtml."</center>";
		}
	}

}

class JLeech_Remote extends JLeech
{       
	function delete($hash){
		@unlink($this->dir.$hash);
	}
	
	function exec($hash){
		$this->log('exec');
		$job = $this->lookup_job($hash);
		if (file_exists($this->dir.$hash)){
			$dlhtml .= ('<center><b><i><font color=red>Job was launched before!</font></i></b></center>');
			return $dlhtml;
		}

		$fs = @fopen($job['url'], 'r');
		if (! $fs){
			$dlhtml .= ('<center><b><i><font color=red>Cannot open remote file.</font></i></b></center>');
			return $dlhtml;
		}
		$ft = @fopen($this->dir.$hash, 'w');
		if (! $ft){
			$dlhtml .= ('<center><b><i><font color=red>Cannot write to local file: '.$this->dir.$hash.'</font></i></b></center>');
			return $dlhtml;
		}
		@fclose($fs);
		@fclose($ft);
	}		
}

class JTools
{


	function remote_size($url,$obj){
		if (preg_match('#^https://([a-z0-9]+\.)?gigasize\.(com)/#', $url)) {$url = str_replace("https","http",$url) ;}
		$sch = parse_url($url);
		if (!isset($sch['scheme']) || !in_array($sch['scheme'], array('http', 'https', 'ftp', 'ftps'))){
			return -1;
		}
		if (($sch['scheme'] == "http") || ($sch['scheme'] == "https")){
			$ch = curl_init($url);
			curl_setopt($ch, CURLOPT_HEADER, 1);
			curl_setopt($ch, CURLOPT_RANGE, '0-64');	
			curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1');
			curl_setopt($ch, CURLOPT_TIMEOUT, 10); 
			curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 10);
			if (!empty($obj->cookies)) 
				curl_setopt($ch, CURLOPT_COOKIE, $obj->cookies);
				
			ob_start();
			$ok = curl_exec($ch);
			curl_close($ch);
			$head = ob_get_contents();
			ob_end_clean();
			$regex = '/Content-Range:.+?\/([0-9]+?)\s/';
			$count = preg_match($regex, $head, $matches);
			if(!$matches[1] && strpos($url,'fileserve')){
				$x = array_change_key_case(get_headers($url, 1),CASE_LOWER);
				if ( strcasecmp($x[0], 'HTTP/1.1 200 OK') != 0 ) { $x = $x['content-length'][1]; }
				else { $x = $x['content-length']; }
				$matches[1] = $x;
			}
			return isset($matches[1]) ? $matches[1] : -1;

		}
		if (($sch == "ftp") || ($sch == "ftps")){
			if (!$sch['host']) { return false; }
			if (!$sch['port']) { $sch['port'] = 21; }
			if (!$user) { $sch['user'] = "anonymous"; }
			if (!$pass) { $sch['pass'] = "phpos@"; }
			$fconnect = ($sch['scheme']=='ftp')? 'ftp_connect' : 'ftp_ssl_connect';
			$ftpid = $fconnect($sch['host'], $sch['host']);
			if (!$ftpid) { return false; }
			$login = ftp_login($ftpid, $sch['user'], $sch['pass']);
			if (!$login) { return false; }
			$ftpsize = ftp_size($ftpid, $sch['path']);
			ftp_close($ftpid);
			if ($ftpsize == -1) { return -1; }
			return $ftpsize;
		}
	}
    
	function filename($url,$obj) {
		ob_start();
		$ch = curl_init($url);
		curl_setopt($ch, CURLOPT_HEADER, 1);
		curl_setopt($ch, CURLOPT_NOBODY, 1);
		if (!empty($obj->cookies)) curl_setopt($ch, CURLOPT_COOKIE, $obj->cookies);
		$ok = curl_exec($ch);
		curl_close($ch);
		$head = ob_get_contents();
		ob_end_clean();
		$regex = '/filename\=\"(.+)\"/';
		$count = preg_match($regex, $head, $matches);
		return isset($matches[1]) ? $matches[1] : "unknown";
	}


	function hash($url, $filename)
	{
		     if(strpos($url,"rapidshare.com"))	$site = "RS.com_"; //rename_prefix
		else if(strpos($url,"megaupload.com"))	$site = "MU.com_";
		else if(strpos($url,"filefactory.com"))	$site = "FF.com_";
		else if(strpos($url,"fileserve.com"))	$site = "FS.com_";
		else if(strpos($url,"hotfile.com"))		$site = "HF.com_";		
		else if(strpos($url,"megaporn.com"))	$site = "MP.com_";
		else if(strpos($url,"megavideo.com"))	$site = "MV.com_";
		else if(strpos($url,"netload.in"))		$site = "NL.in_";
		else if(strpos($url,"filesonic.com"))		$site = "FSN.com_";
		else if(strpos($url,"depositfiles.com"))$site = "DF.com_";
		else if(strpos($url,"uploading.com"))$site = "ULD.com_";
		else if(strpos($url,"easy-share.com"))		$site = "E-S.com_";
		else if(strpos($url,"filesonic"))		$site = "FSN.com_";
		else if(strpos($url,"duckload.com"))		$site = "DL.com_";
		else if(strpos($url,"uploaded.to"))		$site = "UL.to_";
		else if(strpos($url,"megashares.com"))		$site = "MGS.com_";
		else if(strpos($url,"gigasize.com"))		$site = "GS.com_";
		else if(strpos($url,"bitshare.com"))		$site = "BS.com_";
		else $site = "Other_";

		
		$a = strlen($filename);
		$filename = preg_replace("/( )/",'_', $filename);
		$filename = preg_replace("/(à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ)/", 'a', $filename);
		$filename = preg_replace("/(è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ)/", 'e', $filename);
		$filename = preg_replace("/(ì|í|ị|ỉ|ĩ)/", 'i', $filename);
		$filename = preg_replace("/(ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ)/", 'o', $filename);
		$filename = preg_replace("/(ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ)/", 'u', $filename);
		$filename = preg_replace("/(ỳ|ý|ỵ|ỷ|ỹ)/", 'y', $filename);
		$filename = preg_replace("/(đ)/", 'd', $filename);
		$filename = preg_replace("/(À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ)/", 'A', $filename);
		$filename = preg_replace("/(È|É|Ẹ|Ẻ|Ẽ|Ê|Ề|Ế|Ệ|Ể|Ễ)/", 'E', $filename);
		$filename = preg_replace("/(Ì|Í|Ị|Ỉ|Ĩ)/", 'I', $filename);
		$filename = preg_replace("/(Ò|Ó|Ọ|Ỏ|Õ|Ô|Ồ|Ố|Ộ|Ổ|Ỗ|Ơ|Ờ|Ớ|Ợ|Ở|Ỡ)/", 'O', $filename);
		$filename = preg_replace("/(Ù|Ú|Ụ|Ủ|Ũ|Ư|Ừ|Ứ|Ự|Ử|Ữ)/", 'U', $filename);
		$filename = preg_replace("/(Ỳ|Ý|Ỵ|Ỷ|Ỹ)/", 'Y', $filename);
		$filename = preg_replace("/(Đ)/", 'D', $filename);
		
		for($i=0;$i<$a;$i++)
		{
			$strx .= preg_replace("/([^a-zA-Z0-9\._\-])/",'', $filename[$i]);
			//$strx .= preg_replace("/([^a-zA-Z0-9\._\-])/",'rename_suffix', $filename[$i]);
		}
		return $site.$strx;
	}
	function extractIP($ip){
		if (ereg ("^([0-9]{1,3}\.){3,3}[0-9]{1,3}", $ip, $array))
		return $array;else return false;
	}

	function get_IP(){
		if(@$_SERVER['REMOTE_HOST']){
			$array = self::extractIP($_SERVER['REMOTE_HOST']);
			if ($array && count($array) >= 1) return $array[0]; 
		}
		return $_SERVER['REMOTE_ADDR'];
	}

	function get_load($i = 0){
		$load = array('0', '0', '0');
		if (@file_exists('/proc/loadavg')){
			if ($fh = @fopen('/proc/loadavg', 'r')){
				$data = @fread($fh, 15);
				@fclose($fh);
				$load = explode(' ', $data);
			}
		}
		else{
			if ($serverstats = @exec('uptime')){
				if (preg_match('/(?:averages)?\: ([0-9\.]+),?[\s]+([0-9\.]+),?[\s]+([0-9\.]+)/', $serverstats, $matches)){
					$load = array($matches[1], $matches[2], $matches[3]);
				}
			}
		}
		return $i==-1 ? $load : $load[$i];
	}
}

$obj = (class_exists('JLeech_Local'))? new JLeech_Local() : new JLeech_Remote();
$maxsize = sprintf('File size limit: %d MB. Total jobs: %d (max: %d). Server load: %.2f (max allowed: %.2f).', 
$obj->max_size, 
$obj->get_num_jobs(), 
$obj->max_jobs,
JTools::get_load(),
$obj->max_load);

/*$obj->acc['rapidshare.com']['max_size'],
$obj->acc['hotfile.com']['max_size'],
$obj->acc['fileserve.com']['max_size'],
$obj->acc['megaupload.com']['max_size']);*/
$obj->CheckMBIP();
$MB1IP = $obj->countMBIP;
if($MB1IP >= 1024) $MB1IP = round($MB1IP/1024, 1)."GB";
else $MB1IP = $MB1IP."MB";
$thislimitMBIP =	round($obj->limitMBIP/1024,0) .' GB';

$status = sprintf('Your IP: '.$_SERVER['REMOTE_ADDR'].'. Your jobs: %d (max: %d).'._Total1.' '.$MB1IP .' (max: '.$thislimitMBIP.').' , 
$obj->lookup_ip(JTools::get_IP()),
$obj->max_jobs_per_ip);

?><?php
if($obj->Deny == false || $_GET['id']=='donate') {
if (!$_POST['urllist']) {
?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml"><head profile="http://gmpg.org/xfn/11">
	<link rel="SHORTCUT ICON" href="images/Download.gif.png" type="image/x-icon" />
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title><?php echo _title; ?></title>

	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta name="keywords" content="<?php echo _version; ?>, download, get, vinaget, file, generator, premium, link, sharing, real-debrid.com, debridmax.com, alldebrid.com, megaupload.com, hotfile.com, fileserve.com, filesonic.com, rapidshare.com, filefactory.com, depositfiles.com, netload.in, easy-share.com, uploading.com, duckload.com, uploaded.to, megashares.com, bitshare.com, gigasize.com, megavideo.com" />
	<link title="Rapidleech Style" href="rl_style_pm.css" rel="stylesheet" type="text/css" />
	</head><body>
	<script type="text/javascript" language="javascript" src="ajax.js"></script> 
<!--
<center><img src="images/logo.png" alt="RapidLeech PlugMod" border="0" /></center><br />
-->
<table align="center"><tbody>
<tr><td valign="top">
<table width="100%"  border="0">
<tr><td valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td width="140" height="100%"><div class="cell-plugin"><?php echo _plugin; ?></div></td></tr>
<tr><td><div align="center" class="plugincolhd"><b><small><?php echo count($obj->acc);?></small></b> <?php echo _plugin; ?></div></td></tr>
<tr><td height="100%" style="padding:3px;"><div dir="rtl" align="left" style="overflow-y:scroll; height:150px; padding-left:5px;">
<?php
	foreach ($obj->acc as $host => $value) 
	{
		$xout = array('');
		if (isset($obj->acc[$host]['cookie'])){
			$xout = $obj->acc[$host]['cookie'];
			$max_size = $obj->acc[$host]['max_size'];
		}
		else{
			$xout = $obj->acc[$host]['accounts'];
			$max_size = $obj->acc[$host]['max_size'];
		}

		echo '<span class="plugincollst">' .$host . '</span><br />';
	}

?>
</div>
<br />
<div class="cell-plugin"><?php echo _premium; ?></div>
<table border="0">
	<tr>
		<td height="100%" style="padding:3px;">
			<div dir="rtl" align="left" style="padding-left:5px;">
<?php
	foreach ($obj->acc as $host => $value) 
	{
		$xout = array('');
		if (isset($obj->acc[$host]['cookie'])){
			$xout = $obj->acc[$host]['cookie'];
			$max_size = $obj->acc[$host]['max_size'];
		}
		else{
			$xout = $obj->acc[$host]['accounts'];
			$max_size = $obj->acc[$host]['max_size'];
		}
			if($obj->realall)$host=str_replace("real-debrid.com","All Host real-debrid",$host) ;
			else $host=str_replace("real-debrid.com","",$host) ;
			if($obj->alldebrid)$host=str_replace("alldebrid.com","All Host alldebrid",$host) ;
			else $host=str_replace("alldebrid.com","",$host) ;
			if($obj->debridmax)$host=str_replace("debridmax.com","All Host debridmax",$host) ;
			else $host=str_replace("debridmax.com","",$host) ;
			if($obj->fastdebrid)$host=str_replace("fast-debrid.com","All Host fast-debrid",$host) ;
			else $host=str_replace("fast-debrid.com","",$host) ;
		if (empty($xout[0])==false && empty($host)==false){
			echo '<span class="plugincollst">' .$host . '</span>';
			echo ' '.count($xout).'<br>' ;
		}
	}

?>
<br />			</div>
		</td>
	</tr>

</table>
<br />


</td>
</tr>

</table>
</td>
</tr>
</table></td>
<td align="center" valign="top"><table border="0" cellpadding="0" cellspacing="1">
<tbody>
<tr>
<td class="cell-nav"><a class="ServerFiles" href="./"><?php echo _main; ?></a></td>
<td class="cell-nav"><a class="ServerFiles" href="./?id=donate"><?php echo _donate; ?></a></td>
<td class="cell-nav"><a class="ServerFiles" href="./?id=listfile"><?php echo _listfile; ?></a></td>
<td class="cell-nav"><a class="ServerFiles" href="./?id=check"><?php echo _check; ?></a></td>
<?php if ($obj->Secure == true) echo '<td class="cell-nav"><a class="ServerFiles" href="./login.php?go=logout"> '._log.'</a></td>'; ?>
</tr>
</tbody>

</table>
<table id="tb_content">
<tbody>
<tr>
<td align="center">

<tbody>
<?php 

if ($_GET['id']=='listfile' || $_POST['listfile'] || $_POST['option'] || $_POST['renn'] || $_POST['remove'])  {
	echo '<tr><td align="left">';
	if($obj->listfile==true)$obj->fulllist();
	else echo "<BR><BR><font color=red size=2>"._notaccess."</b></font>";
}

else if ($_GET['id']=='donate'){
?>
<tr>
<td align="left">
	<script language=javascript>
			if (window.parent && window.parent.location != window.location)
				window.parent.location = window.location;

			function show(select)
			{
				if (select=="account") {
					document.getElementById("account").style.display = 'block';
					document.getElementById("cookie").style.display = 'none';
				} else {
					document.getElementById("account").style.display = 'none';
					document.getElementById("cookie").style.display = 'block';
				}
			}
	</script>
          <form method="POST" action="add.php"></div>
          

<center>
	     <?php echo _donations; ?><br><br>
	
			<table>
			<tr><td>
				<?php echo _accctype; ?> <select name='type'>
							<option value=accountall onclick="show('account');">alldebrid.com</option>
							<option value=accrealall onclick="show('account');">real-debrid.com</option>
							<option value=cookieall onclick="show('cookie');">Cookie alldebrid</option>
							<option value=accountRS onclick="show('account');">Rapidshare.com</option>
							<option value=accountMU onclick="show('account');">Account M.U</option>
							<option value=cookieMU onclick="show('cookie');">Cookie M.U</option>
							<option value=accountHF onclick="show('account');">Account HF</option>
							<option value=cookieHF onclick="show('cookie');">Cookie HF</option>
							<option value=accountFS onclick="show('account');">Account F.S</option>
							<option value=accountFSN onclick="show('account');">Account FSN</option>
						</select>
						<br><br><br><br>	</td>
	<td>
				<div id="account" style="height:60px">
					&nbsp;&nbsp;<?php echo _user; ?>: <input type=text name=user><br><br>
					&nbsp;&nbsp;<?php echo _pass; ?>: <input type=password name=pass><br><br>
				</div>	</td>
	<td>
				<div id="cookie" style="display:none; height:60px">
					&nbsp;&nbsp;Cookie: <input type=text name=cookie><br>
				</div>	</td>
	<td>
	&nbsp; &nbsp; &nbsp;<input type=submit value="<?php echo _sbdonate; ?>"><BR><BR><BR><BR>
	</td></tr></table></b></form>
<? }
else if ($_GET['id']=='check'){
	echo '<tr><td align="center">';
	if($obj->checkacc==true) include("checkaccount.php");
	else echo "<BR><BR><font color=red size=2>"._notaccess."</b></font>";

}
else {
?>
<tr>
<td align="left">
	<center>
	<form action="javascript:get(document.getElementById('acctform'));" name="acctform" id="acctform">
	<?php echo _khaungu; ?><br><font face=Arial size=1><?php echo _line; ?></font><BR>

	<textarea id='urllist' style='width:550px;height:100px;' name='urllist'></textarea><BR>
	<?php echo _example; ?><BR>
	<input type=submit value='<?php echo _sbdown; ?>' onclick="return Tab_Click(this)"/>
	</form>
<BR>
</td>

</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">
 
<?	}
} #(!$_POST['urllist'])?>

<div align=\"center\">
<CENTER><div id="waiting"></div></CENTER>
<p>
<div id="showresults"></div>
</div>
<?php 
	$obj->main();
	if (!$_POST['urllist']) {

?>

</td>
</tr>
</tbody>
</table>
</form>

</tbody>
</table>

<table width="60%" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<div align="center" style="color:#ccc">
<div id="server_stats">
<hr />

<!-- Start Server Space Info -->

<?php 
if($obj->ttl > 1440) $timelive = round($obj->ttl/(60*24), 1)."</B> days";
elseif(1440 > $obj->ttl && $obj->ttl > 60) $timelive = round($obj->ttl/60, 1)."</B> hours";
else $timelive = $obj->ttl."</B> min";	


echo '<blink><font color=#cbac57>'._autodel.' <B>'.$timelive.'. '._autodel1.' <B>'.$obj->limitPERIP.'</B> '._autodel2.' <B>'.$obj->ttl_ip.'</B> '._autodel3.' <B>1</B> IP</font></blink>'; ?><BR>
<?php echo $status; ?><BR>
<?php echo $maxsize;?>



<!-- End Server Space -->



</div>


<hr />
<!-- Copyright please don't remove-->
	<SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10px; color:#FF8700"><STRONG>Code LeechViet. Developed by ..:: [H] ::..<BR><a href=http://vinaget.blogspot.com/>Powered by <?php echo _version; ?></a></SPAN><br/><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 11px"><?php echo _copyright; ?>. All rights reserved. </SPAN></center><br />
<!-- Copyright please don't remove-->
</div>
</td>
</tr>

</table>
</body>
</html>

<?
	} #(!$_POST['urllist'])
} else 
{
?>
	<html>
	<head>
	<meta http-equiv="Content-Language" content="en-us">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<link rel="SHORTCUT ICON" href="images/Download.gif.png" type="image/x-icon" />
	<meta name="keywords" content="<?php echo _version; ?>, download, get, vinaget, file, generator, premium, link, sharing, real-debrid.com, debridmax.com, alldebrid.com, megaupload.com, hotfile.com, fileserve.com, filesonic.com, rapidshare.com, filefactory.com, depositfiles.com, netload.in, easy-share.com, uploading.com, duckload.com, uploaded.to, megashares.com, bitshare.com, gigasize.com, megavideo.com" />
	<link rel="SHORTCUT ICON" href="images/Download.gif" type="image/x-icon" />
	<title><?php echo _title;?></title>
	<style>
	body {
		background: #000000 repeat-x;
		font: 75%/170% Arial, Helvetica, sans-serif;
		padding: 0px;
		margin: 0px;
		color: #333333;
	}
	a { color: #55aaff; }
	</style>
	</head>

	<body>
	<p align="center"><br>
<code><span style="color: #FF3300; FONT-SIZE: 14px"><B>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::<BR>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::<BR>
::HHHHHH::::::HHHHHH::HHHHHH::::HHHH::::::::::HHHH::::::HHHHHHHHHH::::::::::::HHHHHHHHHHHH::::::HHHHHHHHHHHHHH::HHHHHHHHHHHHHHHHHH::<BR>
::HHHHHH::::::HHHHHH::HHHHHH::::HHHHHH::::::::HHHH::::::HHHHHHHHHH::::::::::HHHHHHHHHHHHHHHH::::HHHHHHHHHHHHHH::HHHHHHHHHHHHHHHHHH::<BR>
::::HHHHHH::HHHHHH::::HHHHHH::::HHHHHHHH::::::HHHH::::HHHHHHHHHHHHHH::::::HHHHHHHH::::HHHHHH::::HHHHHH::::::::::::::::HHHHHH::::::::<BR>
::::HHHHHH::HHHHHH::::HHHHHH::::HHHHHHHHHH::::HHHH::::HHHHHH::HHHHHH::::::HHHHHH::::::::::::::::HHHHHH::::::::::::::::HHHHHH::::::::<BR>
::::HHHHHH::HHHHHH::::HHHHHH::::HHHH::HHHHHH::HHHH::::HHHHHH::HHHHHH::::::HHHHHH::::HHHHHHHH::::HHHHHHHHHHHHHH::::::::HHHHHH::::::::<BR>
::::::HHHH::HHHH::::::HHHHHH::::HHHH::HHHHHH::HHHH::::HHHHHH::HHHHHH::::::HHHHHH::::HHHHHHHH::::HHHHHHHHHHHHHH::::::::HHHHHH::::::::<BR>
::::::HHHH::HHHH::::::HHHHHH::::HHHH::::HHHHHHHHHH::::HHHHHHHHHHHHHH::::::HHHHHH::::::HHHHHH::::HHHHHH::::::::::::::::HHHHHH::::::::<BR>
::::::HHHHHHHHHH::::::HHHHHH::::HHHH::::::HHHHHHHH::HHHHHHHHHHHHHHHHHH::::HHHHHHHH::::HHHHHH::::HHHHHH::::::::::::::::HHHHHH::::::::<BR>
::::::::HHHHHH::::::::HHHHHH::::HHHH::::::::HHHHHH::HHHHHH::::::HHHHHH::::::HHHHHHHHHHHHHHHH::::HHHHHHHHHHHHHH::::::::HHHHHH::::::::<BR>
::::::::HHHHHH::::::::HHHHHH::::HHHH::::::::::HHHH::HHHHHH::::::HHHHHH::::::::HHHHHHHHHH::::::::HHHHHHHHHHHHHH::::::::HHHHHH::::::::<BR>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::<BR>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::<BR>
</B><BR></span>
</code>
	<form method="POST" action="login.php">
	<div align="center">


		<font face="Arial" color=#FFFFFF><b><?php echo _login;?></b></font>
		
		<table border="0" width="500" height="32">
		<tr>
			<td height="28" width="108">
			<font face="Bookman Old Style" color="#CCCCCC"><b><?php echo _password;?></b></font></td>
			<td height="28" width="316"><input type="password" name="secure" size="44"></td>
			<td height="28" width="56">
			<input type="submit" value="Submit" name="submit"></td>
		</tr>
	</table>
	<center><b></b></center>
	</div>
	</form>
	<br>
<!-- Copyright please don't remove-->
	<center><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10px; color:#FF8700"><STRONG>Code LeechViet. Developed by ..:: [H] ::..<BR><a href=http://vinaget.blogspot.com/>Powered by <?php echo _version; ?></a></SPAN><br/><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 11px"><?php echo _copyright; ?>. All rights reserved. </SPAN></center><br />
<!-- Copyright please don't remove-->	
	</body>
	</html>
<?
}
?>