Sindbad~EG File Manager

Current Path : /usr/home/beeson/public_html/helpwithmath_old/italian/italian/
Upload File :
Current File : /usr/home/beeson/public_html/helpwithmath_old/italian/italian/examples.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- DW6 -->
<?php include ('include/head.php'); ?>
<body onmousemove="closesubnav(event);"> 
<?php include ('include/body.php'); 

echo "<div class=\"style1\" id=\"pageName\"> 
    <h2>Examples<img alt=\"small logo\" src=\"logo.jpg\" height=\"59\" width=\"66\"/></h2><br><br>\n";

if ( !isset($directory) ) {
	echo "<BR><BR><B>Select a category:</b><BR><ul>\n";
	$d = dir("examples/");
	while (false !== ($file = $d->read())) {
		if ( $file == "." or $file == ".." ) continue;
		if ( is_dir("examples/$file") ) {
			echo "<li><a href='examples.php?directory=$file'>$file</a></li>\n";
		}
	}
	echo "</ul>\n";
	$d->close();
} else if ( !isset($showfile) and isset($directory) ) {
	if ( !is_dir("examples/$directory") ) {
		echo "Category $directory does not exist.<br>Please try again.<br>";
		exit();
	}
	echo "<center><b>$directory</b></center><br><br>";
	echo "<center><table border=1>
	      <th>Input File</th><th>Output File</th><th>The Proof</th><th>Commentary</th><th>Date</th>\n";
	$d = dir("examples/$directory");
	while (false !== ($file = $d->read())) {
		if ( $file == "." or $file == ".." ) continue;

		if ( strstr($file,".in") ) {
			echo "<tr><td><a href='examples.php?directory=$directory&showfile=$file'>$file</a></td><td>";
			$filename = substr($file,0,-3);
			$prffile = $filename.".prf";
			$dscfile = $filename.".desc";
			$outfile = $filename.".out";
			$theDate = date("r",filemtime("examples/$directory/$file"));
			if ( file_exists("examples/$directory/$outfile") ) {
				echo "<a href='examples.php?directory=$directory&showfile=$outfile'>$outfile</a>";
			}
			echo "</td><td>";
			if ( file_exists("examples/$directory/$prffile") ) {
				echo "<a href='examples.php?directory=$directory&showfile=$prffile'>$prffile</a>";
			}
			echo "</td><td>";
			if ( file_exists("examples/$directory/$dscfile") ) {
				echo "<a href='examples.php?directory=$directory&showfile=$dscfile'>$dscfile</a>";
			}
			echo "</td><td>";
			echo $theDate;
			echo "</td></tr>\n";
		}
	}
	$d->close();
	echo "</table></center><p>&nbsp;</p>\n";
} else  {
	if ( file_exists("examples/$directory/$showfile") ) {
		if ( strstr($showfile,".in") ) {
			include ('include/functions.php');
			$ItIsAnInput = 1; 
		} else 
			$ItIsAnInput = 0;
		echo "<b><center>Examples -> $directory -> $showfile</center></b><br><br>";
		$fp = fopen("examples/$directory/$showfile", "rt", $use_include_path);
		$content = "";
		if ($fp) {
			while ( !feof($fp) ) {
				$line = fgets($fp,4096);
				if ( $ItIsAnInput == 1 ) $content .= $line;
				echo "$line<br>";
			}
			fclose($fp);
			if ( $ItIsAnInput == 1 ) {
				echo "<hr><br>\n";	
				echo "<form method=\"POST\" action=\"otter_simple2.php\">".
					 "<INPUT TYPE=\"HIDDEN\" NAME=\"OtterInput\" VALUE=\"$content\">".
					 "<center><input type=\"submit\" value=\"Run this example using Otter-&lambda;\" name=\"B1\"></center>".
					 "</form>\n";
			}
		} else {
			echo "ERROR: Could not open $showfile.<BR>";
		}
	} else {
		echo "ERROR: $showfile does not exist.<BR>";
	}
}

echo"</div>";   
include ('include/footer.php'); ?>
</body>
</html>

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists