<?php
require_once "../../config/config.php";
?>
<html>
<head>
<style type="text/css">
body
{
font-family:Verdana,Arial,Helvetica,sans-serif;
font-size:13px;
}
</style>
</head>
<body>
<script language="javascript" type="text/javascript">
function toggleVisibility(tblId)
{
var tbl=document.getElementById(tblId);
if(tbl.style.display == 'none')
{
var imgid="img"+tblId;
var imgdir="images/subtract.gif";
document.getElementById(tblId).style.display = '';
var imgDest = document.getElementById(imgid);
imgDest.setAttribute("src", imgdir);
}
else
{
var imgid="img"+tblId;
var imgdir="images/add.gif";
document.getElementById(tblId).style.display = 'none' ;
var imgDest = document.getElementById(imgid);
imgDest.setAttribute("src", imgdir);
}
}
function CustomFunction(nodetext,file)
{
nodetextval=nodetext;
//parentNode = document.getElementById('parentNodeId').parentNode;
//childNodeText = parentNode.childNodes[0].innerHTML;
//alert(nodetext.length);
if(nodetextval!=file)
{
arrnodetext = nodetext.split('$');
nodetext = '';
for(i=0;i<arrnodetext.length;i++)
{
nodetext += arrnodetext[i]+'/';
}
nodetext = '/'+nodetext.substring(0,nodetext.length-2);
if(nodetextval!=file)
nodetext=nodetext+'/'+file;
}
else
nodetext="/"+nodetext;
if(window.opener)
{
window.opener.document.frmproduct.txtprodurl.value=nodetext;
window.close();
}
return false;
}
</script>
<center>
<table border="0" align="center" cellspacing="0" cellpadding="0" id="ctl00_ContentPlaceHolder1_UpdatePanel1" style="width:100%;padding-bottom:5px">
<tr>
<td>
<table border="0" align="center" cellspacing="0" cellpadding="0" style="width:100%;display:block;" id="ctl00_ContentPlaceHolder1_UpdateProgress1">
<tr>
<td style="padding-left:75px">
<center>
<img src="images/DBRestoreloader.gif" align="absmiddle"> <span class="Lable" id="ctl00_ContentPlaceHolder1_UpdatePanelProgressLoading1_lblmessage"> <b>Please wait while your request is being processed..</b></span>
</center>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
<?php
$rlvpath="";
function getDirectory( $path = '.', $level = 0, &$parentnode='' ){
global $rlvpath;
global $spaces;
$rootstr="";
$systemFolder=array();
$systemFolder[]='admin';
$systemFolder[]='config';
$systemFolder[]='cronjobs';
$systemFolder[]='css';
$systemFolder[]='images';
$systemFolder[]='includes';
$systemFolder[]='installation';
$systemFolder[]='js';
$systemFolder[]='member';
$systemFolder[]='PEAR';
$systemFolder[]='smarty';
$systemFolder[]='templates';
$systemFolder[]='templates_c';
$fileArr=array(
'.htaccess',
'affilates_redirect.php',
'checkcapability.php',
'check_server_requirements.php',
'check_server_requirements_mod_dir.php',
'implodedat.txt',
'installation_error.php',
'ipn.php',
'is_valid_request.php',
'is_valid_request_php_include.php',
'membersitenotallow.php',
'no_installation_found.php',
'phpinfo.php',
'postedArry.txt',
'readme.txt',
'robots.txt',
'site_is_not_approved.php',
'thankyou.php',
'user_banned.php',
'user_invalid_access.php',
'user_login.php',
'user_onetimeoffer_product_subscribe.php',
'user_onetimeoffer_signup.php',
'user_signup.php',
'user_validate.php');
$ignore = array( 'cgi-bin', '.', '..' );
// Directories to ignore when listing output. Many hosts
// will deny PHP access to the cgi-bin.
$dh = @opendir( $path );
// Open the directory to the handle $dh
while( false !== ( $file = readdir( $dh ) ) ){
// Loop through the directory
if( !in_array( $file, $ignore ) ){
// Check that this file is not to be ignored
$spaces = str_repeat( ' ', ( $level * 3 ) );
// Just to add spacing to the list, to better
// show the directory tree.
if( is_dir( "$path/$file" ) ){
if($level==0)
{
$style="font-family:verdana,arial,helvetica,sans-serif;font-size:13px;;";
//$parentnode=='';
$rlvpath=$file.'$';
}
else
{
$style="font-family:Verdana,Arial,Helvetica,Sans-serif;font-size:13px;";
if(strpos($rlvpath,'$')>0)
{
$parentnodearr = explode('$',$rlvpath);
$rlvpath='';
$iparentnodearrloop=0;
foreach($parentnodearr as $key=>$value)
{
if($iparentnodearrloop<$level)
$rlvpath .= $value.'$';
$iparentnodearrloop+=1;
}
$rlvpath = substr($rlvpath,0,strlen($rlvpath)-1);
}
$rlvpath= $rlvpath.'$'.$file.'$';
}
// Its a directory, so we need to keep reading down...
$uniquestr=uniqid(s);
if(!in_array(trim($file),$systemFolder))
{
echo "<div style=\"$style\">$spaces<a href=\"#\" style=\"border:0px;text-decoration:none;\"onclick=\"toggleVisibility('$uniquestr')\"><img src=\"images/add.gif\" id=\"img$uniquestr\" align=\"absmiddle\" style=\"margin-left:1px;padding-right:5px;border:0px\"/><font color=\"black\">$file</font></a><br /></div>";
echo "<div id=\"$uniquestr\" style='display:none'>";
getDirectory( "$path/$file", ($level+1) );
}
// Re-call this same function but on a new directory.
// this is what makes function recursive.
} else {
if(!in_array($file,$fileArr)){
if($level==0)
{
$rlvpath=$file;
$spaces.=' ';
}
else
{
if(strpos($rlvpath,'$')>0)
{
$parentnodearr = explode('$',$rlvpath);
$rlvpath='';
$iparentnodearrloop=0;
foreach($parentnodearr as $key=>$value)
{
if($iparentnodearrloop<$level)
$rlvpath .= $value.'$';
$iparentnodearrloop+=1;
}
$rlvpath = substr($rlvpath,0,strlen($rlvpath)-1);
}
$rlvpath= $rlvpath.'$';
}
//if($level==0)
if(isset($_GET['url']) and $_GET['url']=='drip')
{
if($path!=PHYSICAL_DIR)
$rootstr.="$spaces<a href=\"#\" style=\"border:none;text-decoration:none;\" onclick=\"return CustomFunction('$rlvpath','$file')\"> <img src=\"images/document.png\" style='border:0px;padding-right:5px' height=16px align=\"absmiddle\"/><font color=\"black\"; style=\"font-family:Verdana,Arial,Helvetica,Sans-serif;font-size:13px;\">$file</font></a><br />";
}
else
$rootstr.="$spaces<a href=\"#\" style=\"border:none;text-decoration:none;\" onclick=\"return CustomFunction('$rlvpath','$file')\"> <img src=\"images/document.png\" style='border:0px;padding-right:5px' height=16px align=\"absmiddle\"/><font color=\"black\"; style=\"font-family:Verdana,Arial,Helvetica,Sans-serif;font-size:13px;\">$file</font></a><br />";
//else
//echo "$spaces<a href=\"#\" style=\"border:none;text-decoration:none;\" onclick=\"return false;\"> <img src=\"images/document.png\" style='border:0px;padding-right:5px' height=17px align=\"absmiddle\"/><span style=\"margin-left:3px;color:#000000;\" id=\"spn{$parentnode}\" onclick=\"return CustomFunction('$rlvpath','$file')\">$file</a><br />";
// Just print out the filename
}
}
}
}
closedir( $dh );
echo $rootstr;
echo "</div>";
// Close the directory handle
}
echo "<div style=\"overflow:scroll;height:545px;width:585px;\">";
echo getDirectory(PHYSICAL_DIR,0,$parentnode);
echo "</div>";
?>
<script language=javascript>
document.getElementById('ctl00_ContentPlaceHolder1_UpdateProgress1').style.display='none';
</script>
</body>
</html>