<?php
// Файловый Менеджер + Текстовый Редактор
// Gmanager
//
// Версия: 0.5.7
// Автор: Gemorroj
// http://wapinet.ru
//
// Номера кошельков. Надеюсь понятно для чего =)
// WMR 167963845445
// WMZ 225757696726
require 'functions.php';
$current = c($_SERVER['QUERY_STRING'],$_GET['c']);
$type = strtoupper(strrchr($current,'.'));
$add_archive = $_GET['add_archive'];
send_header($_SERVER['HTTP_USER_AGENT']);
print str_replace('%dir%',$current,$top).'
<div class="w2">
'.$lng['title_index'].'<br/>
</div>
'.this($current);
if($string)
{
print '<div>
<form action="index.php?" method="get">
<div>';
if($add_archive)
{print '<input type="hidden" name="add_archive" value="'.$add_archive.'"/><input type="hidden" name="go" value="1"/>';}
print '<input type="text" name="c" value="'.str_replace('\\','/',realpath($current)).'" size="'.(strlen(realpath($current))+1).'"/><br/>
<input type="submit" value="'.$lng['go'].'"/>
</div>
</form>
</div>';
}
if(isset($_GET['checked']))
{$checked = '&checked';}
if(!$_GET['f'] && $type!='.GZ')
{
if(isset($_GET['time']))
{
print '<form action="change.php?c='.$current.'&go=1" method="post">
<div class="telo">
<table>
<tr>
<th>'.$lng['ch_index'].'</th>
<th><a href="?c='.$current.$checked.'">'.$lng['name'].'</a></th>
<th>'.$lng['type'].'</th>
<th>'.$lng['size'].'</th>
<th>'.$lng['change'].'</th>
<th>'.$lng['del'].'</th>
<th>'.$lng['chmod'].'</th>
<th class="red">'.$lng['date'].'</th>
<th>'.$lng['n'].'</th>
</tr>';
}
else
{
print '<form action="change.php?c='.$current.'&go=1" method="post">
<div class="telo">
<table>
<tr>
<th>'.$lng['ch_index'].'</th>
<th class="red">'.$lng['name'].'</th>
<th>'.$lng['type'].'</th>
<th>'.$lng['size'].'</th>
<th>'.$lng['change'].'</th>
<th>'.$lng['del'].'</th>
<th>'.$lng['chmod'].'</th>
<th><a href="?c='.$current.$checked.'&time">'.$lng['date'].'</a></th>
<th>'.$lng['n'].'</th>
</tr>';
}
}
if($type=='.ZIP' || $type=='.JAR')
{
if($_GET['f'])
{print look_zip_file($current,$_GET['f']);}
else
{
print list_zip_archive($current);
$archive = 1;
}
}
elseif($type=='.TAR' || $type=='.TGZ' || $type=='.BZ' || $type=='.BZ2')
{
if($_GET['f'])
{print look_tar_file($current,$_GET['f']);}
else
{
print list_tar_archive($current);
$archive = 1;
}
}
elseif($type=='.GZ')
{
print gz($current).'<div class="ch"><form action="change.php?c='.$current.'&go=1" method="post"><div><input type="submit" name="gz_extract" value="'.$lng['extract_archive'].'"/></div></form></div>';
$_GET['f'] = 1;
}
else
{look($current);}
if(file_exists($current))
{
$found = '<div class="rb">'.$lng['create'].' <a href="change.php?go=create_file&c='.$current.'">'.$lng['file'].'</a> / <a href="change.php?go=create_dir&c='.$current.'">'.$lng['dir'].'</a><br/></div>
<div class="rb"><a href="change.php?go=upload&c='.$current.'">'.$lng['upload'].'</a><br/></div>
<div class="rb"><a href="change.php?go=mod&c='.$current.'">'.$lng['mod'].'</a><br/></div>';
if($type=='.ZIP' || $type=='.JAR' || $type=='.GZ' || $type=='.TAR' || $type=='.TGZ' || $type=='.BZ' || $type=='.BZ2')
{$found = str_replace($current,dirname($current),$found);}
}
else
{$found = '<div class="red">'.$lng['not_found'].'<br/></div>';}
list($msec,$sec) = explode(' ',microtime());
$tm = '<div class="rb">'.round(($sec+$msec)-$ms,4).'<br/></div>';
if(!$_GET['f'] && !$archive && !$add_archive)
{print '</table><div class="ch"><input type="submit" name="full_chmod" value="'.$lng['chmod'].'"/><br/></div><div class="ch"><input type="submit" name="full_del" value="'.$lng['del'].'"/><br/></div><div class="ch"><input type="submit" name="full_rename" value="'.$lng['change'].'"/><br/></div><div class="ch"><input type="submit" name="create_archive" value="'.$lng['create_archive'].'"/></div></div></form>'.$found.$tm.$foot;}
elseif($archive)
{print '</table><div class="ch"><input type="submit" name="full_extract" value="'.$lng['extract_file'].'"/><br/></div><div class="ch"><input type="submit" name="mega_full_extract" value="'.$lng['extract_archive'].'"/><br/></div><div class="ch"><input type="submit" name="add_archive" value="'.$lng['add_archive'].'"/></div></div></form>'.$found.$tm.$foot;}
elseif($add_archive)
{print '</table><div class="ch"><input type="hidden" name="add_archive" value="'.$add_archive.'"/><input type="submit" name="name" value="'.$lng['add_archive'].'"/></div></div></form>'.$found.$tm.$foot;}
else
{print $found.$tm.$foot;}
?>