<?php
/*
*-------------------------------phpMyBitTorrent--------------------------------*
*--- The Ultimate BitTorrent Tracker and BMS (Bittorrent Management System) ---*
*--------------   Created By Antonio Anzivino (aka DJ Echelon)   --------------*
*-------------               http://www.p2pmania.it               -------------*
*------------ Based on the Bit Torrent Protocol made by Bram Cohen ------------*
*-------------              http://www.bittorrent.com             -------------*
*------------------------------------------------------------------------------*
*------------------------------------------------------------------------------*
*--   This program is free software; you can redistribute it and/or modify   --*
*--   it under the terms of the GNU General Public License as published by   --*
*--   the Free Software Foundation; either version 2 of the License, or      --*
*--   (at your option) any later version.                                    --*
*--                                                                          --*
*--   This program is distributed in the hope that it will be useful,        --*
*--   but WITHOUT ANY WARRANTY; without even the implied warranty of         --*
*--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          --*
*--   GNU General Public License for more details.                           --*
*--                                                                          --*
*--   You should have received a copy of the GNU General Public License      --*
*--   along with this program; if not, write to the Free Software            --*
*-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA --*
*--                                                                          --*
*------------------------------------------------------------------------------*
*------              ©2005 phpMyBitTorrent Development Team              ------*
*-----------               http://phpmybittorrent.com               -----------*
*------------------------------------------------------------------------------*
*/
error_reporting(E_ALL ^ E_NOTICE);
if (defined('IN_PMBT'))die ("You can't include this file");
define("IN_PMBT",true);

ob_start("ob_gzhandler");
ob_implicit_flush(0);

define("_VERSION","2.0.3");

if (!ini_get("register_globals")) {
    @import_request_variables("GPC");
}


if (!isset($step) OR !is_numeric($step)) $step = 0;

/*
Operating System Analysis
Useful for setup help
*/
if (strtoupper(substr(PHP_OS,0,3)) == "WIN") $os = "Windows";
else $os = "Linux";


require_once("graphics/graphics.php");

echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html>\n";
echo "<head>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">\n";
echo "<title>phpMyBitTorrent - Setup</title>\n";
echo "<link rel=\"StyleSheet\" href=\"graphics/style.css\" type=\"text/css\">\n";

if (isset($language) AND $language != "" AND is_readable("language/".$language.".php")) {
        require_once("language/".$language.".php");
        $langpic = "language/".$language.".png";
} else $langpic = "graphics/blank.gif";

echo "<script type=\"text/javascript\" src=\"../overlib/overlib.js\"><!-- overLIB (c) Erik Bosrup --></script>\n";
echo "<script type=\"text/javascript\" src=\"../overlib/overlib_shadow.js\"><!-- overLIB (c) Erik Bosrup --></script>\n";
echo <<<EOF
<script type="text/javascript" language="JavaScript">
function expand(id) {
        var i=1;
        var obj;
        while (obj = document.getElementById(id+"_"+i)) {
                if (obj.className == 'show') {
                        obj.className = 'hide';
                } else {
                        obj.className = 'show';
                }
                i++;
        }

}
</script>
EOF;

echo "</head>\n";


echo "<body>\n";
echo "<div id=\"overDiv\" style=\"position:absolute; visibility:hidden; z-index:1000;\"></div>\n";
echo "<table width=782 border=0 cellpadding=0 cellspacing=0 align=\"center\">\n";
echo "<tr><td>";
makeheader();
echo "</td>\n</tr>\n";
echo "<tr><td>\n";


#HERE COMES THE SCRIPT
echo "<table>\n";
echo "<tr><td width=\"259\">\n";
#LEFT SIDE

$stepimg = stepimage();
$stepimg = "graphics/".$stepimg;

echo "<table border=\"0\" width=\"100%\">\n";
echo "<tr>\n";
echo "<td colspan=1 style=\"background:url(graphics/r4.jpg)\" width=135 height=66><div align=\"center\"><img src=\"".$langpic."\" alt=\"Language\" width=\"48\" height=\"48\" /></div></td>\n";
echo "<td colspan=1 style=\"background:url(graphics/r5.jpg)\" width=124 height=66></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td colspan=1 style=\"background:url(graphics/r6.jpg)\" width=135 height=62><div align=\"center\"><img src=\"".$stepimg."\" alt=\"Current Step\" width=\"48\" height=\"48\" /></div></td>\n";
echo "<td colspan=1 style=\"background:url(graphics/r7.jpg)\" width=124 height=62></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td colspan=1 style=\"background:url(graphics/r8.jpg)\" width=135 height=65><div align=\"center\"><img src=\"graphics/".$os.".png\" alt=\"Operating System\" width=\"48\" height=\"48\" /></div></td>\n";
echo "<td colspan=1 style=\"background:url(graphics/r9.jpg)\" width=124 height=65></td>\n";
echo "</tr>\n";
echo "</table>";

echo "</td>\n<td width=\"512\">\n";

echo "<form action=\"index.php\" method=\"POST\">\n";
if (isset($language)) echo "<input type=\"hidden\" name=\"language\" value=\"".$language."\" />\n";


#INTERFACE HERE
require_once("steps/".$step.".php");

echo "</form>\n";
echo "</td>\n</tr>";
echo "</table>\n";

/*
DEBUG INFORMATION

echo "<p>Debug: GET = ";
print_r($_GET);
echo " POST = ";
print_r($_POST);
echo "</p>";
*/

echo "</td>\n<tr><td>";
makefooter();
echo "</td>\n</tr>\n";
echo "</table>\n";
echo "</body>\n";
echo "</html>";
ob_end_flush();
die();
?>
