Hacked By AnonymousFox

Current Path : C:/AppServ/www/mfu/object/obj_filebrowser/
Upload File :
Current File : C:/AppServ/www/mfu/object/obj_filebrowser/object-ajax-form.php

<?
header( "Content-type: application/xhtml+xml; charset=tis-620" ); 
include("../../lib/session.php");
include("../../lib/config.php");
include("../../lib/function.php");
//include("../../webengine/mod_blog/config.php");  
include("lang/en.php");
if(0) { ?>
<html>
<head>
<title>JigsawOffice Object</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link href="css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
*{
font-family: tahoma;
font-size:12px;
}
a {
text-decoration:none;
}
</style>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<? } ?>

<?
if($CurrentPath=="") { $CurrentPath=$Object_FileBrowser_RootPath; }
$CurrentPath = UTF8toiso8859_11($CurrentPath);
$CurrentFolder = UTF8toiso8859_11($CurrentFolder);
$inputNewFolder = UTF8toiso8859_11($inputNewFolder);
$FileName = UTF8toiso8859_11($FileName);
?>
<?
###################
function formatImageSize($mySize) {
###################
	if($mySize>1024*1024) {
		return sprintf("%1.2f",$mySize/(1024*1024)) . " M";
	} else {
		return sprintf("%1.2f",$mySize/1024) . " K";
	}
}

###################
function removeEndSlash($myURL) {
###################
	if($myURL[strlen($myURL)-1]=="/") {
		return substr($myURL,0,strlen($myURL)-1);
	} else {
		return $myURL;
	}
}

###################
function removeEndURL($myURL) {
###################
	$myURLArray = explode("/",$myURL);
	$myURL  = $myURLArray[0];
	for($i=1;$i<count($myURLArray)-1;$i++) {
		$myURL =  $myURL . "/" . $myURLArray[$i];
	}
	return $myURL;
}

###################
function getFileOrFolderName($myURL) {
###################
	$myURLArray = explode("/",$myURL);
	return $myURLArray[count($myURLArray)-1];
}

###################
function getFileOrFolderNameUpload($myURL) {
###################
	$myURLArray = explode("\\",$myURL);
	return $myURLArray[count($myURLArray)-1];
}

###################
function getNowPlaying() {
###################
	global $filename,$realpathsize,$playlist_folder;
	if(is_file($filename)) {
		$fp = fopen($filename,"r");
		$myfile="";
		if ($fp) { while (!feof($fp)) $myfile .= fgetc($fp);  fclose($fp); }
		$myfile = substr($myfile,$realpathsize,strlen($myfile)-$realpathsize);
		$myfile = stripslashes($myfile);
		return $myfile;
	}
}
?>
<? 
if($JS_Action=="movefile") { 
	rename("../../upload/temp/".$FileName, $CurrentPath."/".$FileName);
?>
OK
<? } ?>
<? 
if($JS_Action=="addnewfolder") { 
	mkdir($CurrentPath."/".$inputNewFolder,0755);
?>
OK
<? } ?>
<? 
if($JS_Action=="deletefile") { 
	@unlink($CurrentPath."/".$CurrentFolder);
?>
OK
<? } ?>
<? 
if($JS_Action=="deletefolder") { 
	@rmdir($CurrentPath."/".$CurrentFolder);
?>
OK
<? } ?>
<? if($JS_Action=="loadfilebrowser") { ?>
<table width="100%" height="100%" border="0" cellpadding="2" cellspacing="0">
  <tr> 
    <td align="center" valign="top"> 
      <?
$ImagePath = $Object_FileBrowser_RootPath;
if($initPath<>"") { 
	$initPath = substr($initPath,0,strrpos($initPath,'/')+1);
	$CurrentPath = $initPath; 
}
if($CurrentPath=="") { $CurrentPath = $ImagePath; }
$CurrentPath =removeEndSlash($CurrentPath);
$UpPath = removeEndURL($CurrentPath);
$Jigsaw_Session_UploadPath = $CurrentPath;

if($Object_FileBrowser_FileFliter=="*.*" || $Object_FileBrowser_FileFliter=="") {
	$Object_FileBrowser_FileFliterArray[] = "";
} else {
	$Object_FileBrowser_FileFliterArray = explode(';',str_replace('*.','',$Object_FileBrowser_FileFliter));
}
?>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="5" height="5"><img src="../../object/obj_filebrowser/images/box1.gif" width="5" height="5"></td>
          <td height="5" background="../../object/obj_filebrowser/images/box2.gif"><img src="../../object/obj_filebrowser/images/box2.gif" width="5" height="5"></td>
          <td width="5" height="5"><img src="../../object/obj_filebrowser/images/box3.gif" width="5" height="5"></td>
        </tr>
        <tr>
          <td width="5" background="../../object/obj_filebrowser/images/box4.gif"><img src="../../object/obj_filebrowser/images/box4.gif" width="5" height="5"></td>
          <td><table width="100%" height="17" border="0" cellpadding="0" cellspacing="0" background="../../object/obj_filebrowser/images/box5-bg.gif">
              <tr> 
                <td width="2"><img src="../../object/obj_filebrowser/images/box5-start.gif" width="2" height="17"></td>
                <td align="left"><img src="../../object/obj_filebrowser/images/box5-name.gif" width="26" height="17" hspace="6"></td>
                <td width="1"><img src="../../object/obj_filebrowser/images/box5-end.gif" width="1" height="17"></td>
                <td width="2"><img src="../../object/obj_filebrowser/images/box5-start.gif" width="2" height="17"></td>
                <td width="45" align="left"><img src="../../object/obj_filebrowser/images/box5-size.gif" width="18" height="17" hspace="6"></td>
                <td width="1"><img src="../../object/obj_filebrowser/images/box5-end.gif" width="1" height="17"></td>
                <td width="2"><img src="../../object/obj_filebrowser/images/box5-start.gif" width="2" height="17"></td>
<? if($Object_FileBrowser_UploadFile_isEnable=="Yes") { ?>
                <td width="50"><img src="../../images/pixel.gif" width="1" height="1"></td>
<? } else { ?>
                <td width="15"><img src="../../images/pixel.gif" width="1" height="1"></td>
<? } ?>
              </tr>
            </table>
            <div align="left" style="height:<?=$Object_FileBrowser_Hight?>px; overflow:auto; "> 
              <table width="95%" border="0" cellpadding="0" cellspacing="0">
                <?
if(removeEndSlash($CurrentPath)!=removeEndSlash($ImagePath)) {
	$FullPathBaseURL = $FullPath . "/" . substr($CurrentPath,strlen($ImagePath)+1,strlen($CurrentPath));
?>
                <tr onMouseOver="this.style.background='#E2E2E2'" onMouseOut="this.style.background=''"> 
                  <td width="20" height="20" align="center" valign="middle"><img src="../../object/obj_filebrowser/images/folder_back.gif" width="16" height="16"></td>
                  <td height="20" align="left"> <a href="javascript:void(0)" onClick="
js3_chain.addChain_AJAX(function() { loadFileBrowser('<?=$UpPath . "/" . $file ?>'); });
js3_callAJAXChain();
				  "> ..</a> </td>
                  <td width="45" align="right" nowrap>&nbsp;</td>
<? if($Object_FileBrowser_UploadFile_isEnable=="Yes") { ?>
                  <td width="30" align="center" nowrap>&nbsp;</td>
<? } ?>
                </tr>
                <?
} else {
	$FullPathBaseURL = $FullPath;
}
// Get Folder
$handle = opendir($CurrentPath); 
while (false !== ($file = readdir($handle))) { 
    if ($file != "." && $file != "..") { 
		if(is_dir($CurrentPath . "/". $file)) {
				// Get Files Inside
				$FileInside=0;
				$ImageFileInside=0;
				$FileInsideHandle = opendir($CurrentPath . "/". $file); 
				while (false !== ($FileInsideFile = readdir($FileInsideHandle))) { 
					if ($FileInsideFile != "." && $FileInsideFile != "..") { 
							$FileInside++;
							if( is_file($CurrentPath . "/". $file . "/". $FileInsideFile) ) {
								//$size=GetImageSize($CurrentPath . "/". $file . "/". $FileInsideFile); 
								//if($size!=NULL) {
								$ImageFileInside++;
								//}
							}
						}
					}
					closedir($FileInsideHandle); 
			?>
                <tr onMouseOver="this.style.background='#E2E2E2'" onMouseOut="this.style.background=''"> 
                  <td width="20" height="20" align="center" valign="middle"> 
                    <? if($FileInside==0) { ?>
                    <img src="../../object/obj_filebrowser/images/folder_empty.gif" width="16" height="16"> 
                    <? } else { ?>
                    <img src="../../object/obj_filebrowser/images/folder.gif" width="16" height="16"> 
                    <? } ?>
                  </td>
                  <td height="20" align="left"><a href="javascript:void(0)" onClick="
js3_chain.addChain_AJAX(function() { loadFileBrowser('<?=addslashes($CurrentPath). "/" . addslashes($file) ?>'); });
js3_callAJAXChain();
				  ">
                    <?=$file?>
                    </a></td>
                  <td width="45" align="right" nowrap>&nbsp;</td>
<? if($Object_FileBrowser_UploadFile_isEnable=="Yes") { ?>
                  <td width="30" align="center" nowrap> 
                    <? if($FileInside==0) { ?>
                    <a href="javascript:void(0)" onClick="deleteFolder('<?
if(_SYSTEM_IS_URL_ENCODING_=="Yes") {  echo addslashes(str_replace("+","%20",str_replace("%2F","/",urlencode($CurrentPath)))); } else { echo addslashes($CurrentPath); } 
?>','<? 
if(_SYSTEM_IS_URL_ENCODING_=="Yes") { echo addslashes(str_replace("+","%20",urlencode($file))); } else { echo addslashes($file); } 
?>')"><font color="#FF0000"><?=$Object_Text["Delete"]?></font></a> 
                    <? } ?>
                  </td>
<? } ?>
                </tr>
                <?
		}
    } 
}
closedir($handle); 

// Get Files
$handle = opendir($CurrentPath); 
while (false !== ($file = readdir($handle))) { 
    if ($file != "." && $file != "..") { 
		if( is_file($CurrentPath . "/". $file) ) {
				// get File Type
				$myFileType=strtolower(substr($file,strrpos($file,".")+1,strlen($file)));
				$myFileTypeFile = "../../object/obj_filebrowser/images/file/".$myFileType.".gif";
				if($Object_FileBrowser_FileFliterArray[0]<>"") {
					$isShow=false;					
					for($i=0;$i<sizeof($Object_FileBrowser_FileFliterArray);$i++) {
						if($myFileType==$Object_FileBrowser_FileFliterArray[$i]) {
							$isShow=true;
							break;
						}
					}
				} else {
					$isShow=true;	
				}
				if($isShow) {
				?>
                <tr onMouseOver="this.style.background='#E2E2E2'" onMouseOut="this.style.background=''"> 
                  <td width="20" height="20" align="center" valign="middle">
				  <? if(is_file($myFileTypeFile)) { ?>
				  <img src="<?=$myFileTypeFile?>">
				  <? } else { ?>
				  <img src="../../object/obj_filebrowser/images/file.gif" width="16" height="16">
				  <? } ?>
                  </td>
                  <td height="20" align="left"> 
				  <? 
				  $ImageFullPath = str_replace('../../',$System_FullPath."/",$CurrentPath); 
				   //เปลี่ยนไฟล์ Path ให้เป็น Full เพื่อการนำไปแสดงผลใน javaword
				  ?><a href="javascript:void(0)" onClick="object_filebrowser_ClickFile('<?
if(_SYSTEM_IS_URL_ENCODING_=="Yes") {  echo addslashes(str_replace("+","%20",str_replace("%2F","/",urlencode($CurrentPath)))); } else { echo addslashes($ImageFullPath); } 
?>','<? 
if(_SYSTEM_IS_URL_ENCODING_=="Yes") { echo addslashes(str_replace("+","%20",urlencode($file))); } else { echo addslashes($file); } 
?>','<?=$myFileType?>')"> 
                    <?=$file?>
                    </a></td>
                  <td width="45" align="right" nowrap> 
                    <?=formatImageSize(filesize($CurrentPath . "/". $file))?>
                  </td>
<? if($Object_FileBrowser_UploadFile_isEnable=="Yes") { ?>
                  <td width="30" align="center" nowrap><a href="javascript:void(0)" onClick="
if(confirm('<?=$Object_Text["Are you sure to delete this file?"]?>')) {
	deleteFile('<?
if(_SYSTEM_IS_URL_ENCODING_=="Yes") {  echo addslashes(str_replace("+","%20",str_replace("%2F","/",urlencode($CurrentPath)))); } else { echo addslashes($CurrentPath); } 
?>','<? 
if(_SYSTEM_IS_URL_ENCODING_=="Yes") { echo addslashes(str_replace("+","%20",urlencode($file))); } else { echo addslashes($file); } 
?>');
}
"><font color="#FF0000"><?=$Object_Text["Delete"]?></font></a> 
<? } ?>
                  </td>
                </tr>
                <?
				}
		}
    } 
}
closedir($handle); 
?>
              </table>
            </div>
</td>
          <td width="5" background="../../object/obj_filebrowser/images/box6.gif"><img src="../../object/obj_filebrowser/images/box6.gif" width="5" height="5"></td>
        </tr>
        <tr>
          <td width="5" height="5"><img src="../../object/obj_filebrowser/images/box7.gif" width="5" height="5"></td>
          <td height="5" background="../../object/obj_filebrowser/images/box8.gif"><img src="../../object/obj_filebrowser/images/box8.gif" width="5" height="5"></td>
          <td width="5" height="5"><img src="../../object/obj_filebrowser/images/box9.gif" width="5" height="5"></td>
        </tr>
      </table>
<? if($Object_FileBrowser_UploadFile_isEnable=="Yes" || $Object_FileBrowser_NewFolder_isEnable=="Yes") { ?>
      <table width="100%" height="25" border="0" cellpadding="2" cellspacing="0">
        <tr>
<? if($Object_FileBrowser_UploadFile_isEnable=="Yes") { ?>
	<? $_xx = getBrowser(); ?>
    <td width="100" align="left" nowrap>
    	<input name="Button" type="button" class="input_bt_80px" value="<?=$Object_Text["Upload File"]?>" onClick="Popup('popupEmailWindow','popup_selectfile.php?SystemModuleKey=<?=$SystemModuleKey?>&myModule_Path_Files='+document.getElementById('myModule_Path_Files').value+'&Object_JavaWord_FullRootPath='+document.getElementById('Object_JavaWord_FullRootPath').value+'&Object_JavaWord_RootPath=<?=$Object_FileBrowser_RootPath?>&mediatype='+$('mediatype').value,400,250,1)" >
    </td>
<? } ?>
		  <td>&nbsp;</td>
<? if($Object_FileBrowser_NewFolder_isEnable=="Yes") { ?>
          <td align="right" nowrap><input name="inputNewFolder" type="text" class="input_left" id="inputNewFolder" size="20"> 
            <input name="Button" type="button" class="input_bt_80px" value="<?=$Object_Text["New Folder"]?>" onClick="createNewFolder('<?=$CurrentPath?>');">
          </td>
<? } ?>
        </tr>
      </table>
<? } ?>
	  </td>
  </tr>
</table>
<? } ?>
<? if(0) { ?>
</body>
</html>
<? } ?>

Hacked By AnonymousFox1.0, Coded By AnonymousFox