<?PHP
/* JAG Online -------------------------------------------------------- v1.30 [6.5~7.1] */
/*                                                                                     */
/*      ////////// //\\ \\\\\\\\\\       Created by Dashe at http://nsd.jagamarog.com  */
/*             // //  \\ \\                                                            */
/*            // //    \\ \\             Email Address:           dashe@jagamarog.com  */
/*           // /////\\\\\ \\   \\\\\                                                  */
/*          // //        \\ \\      \\                                                 */
/*         // //          \\ \\\\\\\\\\                                                */
/* /////////  a g a m a r o g . c o m   N u k e   S c r i p t   D e v e l o p m e n t  */
/*                                                                                     */     
/* Created By Dashe -> http://nsd.jagamarog.com                                        */ 
/* تعريب ملتقى العرب  http://arabmultaqa.com                                                                                    */
/* ----------------------------------------------------------------------------------- */

/* DO NOT EDIT BELOW UNLESS YOU KNOW WHAT YOU ARE DOING ------------------------------ */

/* Set Global Variables & General Variables ------------------------------------------ */
global $prefix, $db, $dbname, $admin, $sitename, $nukeurl, $adminmail;

/* GT Work around to undefined function error ---------------------------------------- */
$nextgen_name = "JAG_Online";

/* Set Up Common Functions ----------------------------------------------------------- */
function CheckAdmin()
	{
	global $admin, $Red;
	
	if (!is_admin($admin))
		{
		include_once("JAG_Online_Install/JAG_Online_Step_1.php");
		}
	}
	
function table_exists($table, $dbname) 
	{ 
	$tables = mysql_list_tables($dbname); 
	while (list($temp) = mysql_fetch_array($tables)) 
		{ 
  		if($temp == $table) 
  			return TRUE; 
		}	 
	return FALSE; 
	} 

function EndNow($ErrorMsg)
	{
	global $goto, $Red;
	
	echo "	<TR>\n";
	echo "		<TD CLASS='row2' HEIGHT='20' ALIGN='LEFT' VALIGN='TOP'>\n";
	echo "			<FONT COLOR='$Red'>\n";
	echo "				$ErrorMsg\n";
	echo "			</FONT></TD>\n";
	echo "		<TD CLASS='row2' HEIGHT='20' ALIGN='CENTER' VALIGN='MIDDLE'>\n";
	echo "			<A HREF='".$_SERVER['PHP_SELF']."?goto=$goto'><B>RECHECK</B></A></TD>\n";
	echo "  </TR>\n";
	echo "</TABLE>\n";
	
	CloseTable();
	include_once("footer.php");				
	die();
	}

function BlankRow()
	{
	echo "	<TR>\n";
	echo "		<TD CLASS='row3' HEIGHT='10' ALIGN='LEFT' VALIGN='TOP' COLSPAN='2'>\n";
	echo "			</TD>\n";
	echo "  </TR>\n";		
	}

function NextStep($Curr_Step)
	{
	$Next_Step = $Curr_Step + 1;
	
	echo "	<FORM NAME='NextStep' ACTION='".$_SERVER['PHP_SELF']."' METHOD='POST'>\n";
	echo "	<INPUT TYPE='HIDDEN' NAME='goto' VALUE='$Next_Step'>\n";
	echo "	<TR>\n";
	echo "		<TD CLASS='row3' HEIGHT='20' ALIGN='RIGHT' VALIGN='MIDDLE' COLSPAN='2'>\n";
	echo "			<INPUT TYPE='SUBMIT' VALUE='Next Step'></TD>\n";
	echo "  </TR>\n";
	echo "	</FORM>\n";
	echo "</TABLE>\n";
	
	CloseTable();
	include_once("footer.php");				
	}	
						  
/* Start The Script For Install ------------------------------------------------------ */
include_once("header.php");
	OpenTable();	
	$ThemeSel 		= get_theme();
	
	$Green			= "#808000";
	$Red			= "#FF0000";
	$BlockName 		= "JAG Online";
	$BlockVersion 	= "v1.31";

	$checktable1 = "".$prefix."_jag_online";
	$checktable2 = "".$prefix."_jag_online_botlist";
	$checktable3 = "".$prefix."_jag_online_config";
	$checktable4 = "".$prefix."_jag_online_icons";
	$checktable5 = "".$prefix."_jag_online_iplookup";
	
	echo "<LINK REL='StyleSheet' HREF='themes/$ThemeSel/forums/forums.css' TYPE='text/css'>\n";

/* The Install Block ----------------------------------------------------------------- */
	echo "<TABLE BORDER='0' CELLPADDING='4' CELLSPACING='1' WIDTH='100%' CLASS='forumline'>\n";
	echo "	<TR>\n";
	echo "		<TH			    ALIGN='CENTER' CLASS='thTop' HEIGHT='25' COLSPAN='1'>&nbsp;Discription&nbsp;</TH>\n";
	echo "	  	<TH WIDTH='150' ALIGN='CENTER' CLASS='thTop'>&nbsp;Result&nbsp;</TH>\n";
	echo "	</TR>\n";

if ($goto == "") $goto = "1";

switch ($goto)
	{
	case "1":
		include_once("JAG_Online_Install/JAG_Online_Step_1.php");
	break;

	case "2":
		include_once("JAG_Online_Install/JAG_Online_Step_2.php");
	break;

	case "3":
		include_once("JAG_Online_Install/JAG_Online_Step_3.php");
	break;
	
	case "4":
		include_once("JAG_Online_Install/JAG_Online_Step_4.php");
	break;

	case "5":
		include_once("JAG_Online_Install/JAG_Online_Step_5.php");
	break;
	
	case "6":
		include_once("JAG_Online_Install/JAG_Online_Step_6.php");
	break;
	
	case "7":
		include_once("JAG_Online_Install/JAG_Online_Step_7.php");
	break;
	}
