<?php
header('Content-Type: text/html; charset=windows-1251');
?>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>ARCHIVE CONTENT</title>
</head>
<body background="../d~e~f/bkg.gif" leftMargin=0 id=bod topMargin=0 style="overflow:hidden;" width=100% height=100% >
<?php
ini_set('display_errors', 1);     //
error_reporting(E_ALL);
if (isset($_REQUEST['typ']))
{$typ=$_REQUEST['typ'];}
else
{$typ="";}
include "../f.php";   // 

echo "<h3>ARCHIVE CONTENT</h3> ";
////////////////////////
// 
////////////////////////
if ($typ=="6" or $typ=="7" )
{ini_set('max_execution_time', 900);
//*************************************************************
 if  (strstr(" ".php_uname(), 'Windows'))   //
//************************************************************* 
{$za = new ZipArchive();
if ($typ=="6")
{echo '<h2 style=color:red;text-align:center>The archive of all pages (pages.zip) contains the following pages and files:</h2>';
$za->open('../../pages.zip');
}
else
{echo '<h2 style=color:red;text-align:center>The archive of selected pages (pages2.zip) contains the following pages:</h2>';
$za->open('../../pages2.zip');
}
echo '<center><button onclick=for2.elements("B1").click() style="background:white;color:red"  title="Click me to continue" >Continue.</button></center>';
echo '<hr><div style="height:85%;width:100%;OVERFLOW: scroll;background:white"><ol>';
for ($i=0; $i<$za->numFiles;$i++) {
$one_file = $za->statIndex($i);
$mname=explode("/", $one_file["name"]);
if  (strstr($mname[1], '.php'))   
{echo "<li>".rtr(str_replace(".php","",$mname[1]))."<br>\r\n";
}
else
{if  (strstr($mname[1], '.txt') )   
{echo "<li>".$mname[1]."<br>\r\n";
}}
echo $za->getFromIndex($i);
}
echo '</ol></div>';
}
//***************************
else     // 
//***************************
{$mmm=array();  
$pathdir=str_replace('otd','',getcwd());
$pathdir2=str_replace('/gidra','',$pathdir);
//

if ($typ=="6")
{echo '<h2 style=color:red;text-align:center>The archive of all pages pages.tar.gz contains the following pages and files:</h2>';
$za='../../pages.tar.gz ';
}
else
{echo '<h2 style=color:red;text-align:center>The archive of the selected pages pages2.tar contains the following pages:</h2>';
$za='../../pages2.tar ';
}
//echo exec('tar -tvf ../../pages2.tar' ,$mmm,$www);
exec('tar -tvf '.$za,$mmm,$www);
sort($mmm);
echo '<div style="height:450;width:100%;OVERFLOW: scroll;background:white"><ol>';
for ($i=0; $i<=count($mmm)-1;$i++) 
{$mname=explode("/", $mmm[$i]);
if (strstr($mname[2], ".php"))  
{echo "<li>".rtr(str_replace('.php','', $mname[2])) ."\r\n";
}
if  (strstr($mname[2], '.txt') )   
{echo "<li>".$mname[2]."\r\n";
}}
echo '</ol></div>';
}
echo '</body></html>';
}
?>