<?
session_start();
include('_mgr.status.php');
include('../_db.connection.php');
include('../_functions.php');
include('_mgr.setup.php');

// Top Nav
$nav_title = array(1 => "Website Settings","Members","News","FAQs","Copy");
$nav_page = array(1 => "website_settings","members","news","faqs","copy");
?>
<table cellpadding="0" cellspacing="0" width="100%" height="100%">

	<tr>
		
		<td height="22" align="center" background="images/header.gif">
			
			<table cellpadding="0" cellspacing="0">
			
				<tr>
				
					<td><img src="images/header.div.gif"></td>	
					
					<?
					//**** Top Navigation ****/////////////////////////////////////////////////////////////
					
					$x = count($nav_title);
					$i = 1;
					while($i <= $x){
						if($n == $i){
					?>
							<td bgcolor="#ffffff" background="images/bg.<? echo $style->name; ?>.gif"><font face="verdana" size="1" color="<? echo $style->selected_nav_text; ?>">&nbsp; <b><? echo $nav_title[$i]; ?></b> &nbsp;</font></td>
					<?
						}
						else
						{
					?>
							<td><font face="verdana" size="1" color="#eeeeee">&nbsp; <a href="mgr.index.php?n=<? echo $i; ?>&p_mode=<? echo $nav_page[$i]; ?>" class="mgrnav"><? echo $nav_title[$i]; ?></a> &nbsp;</font></td>
					<?
						}
					?>
							<td><img src="images/header.div.gif"></td>
					<?
						$i++;
					}
					?>
					
					<td><font face="verdana" size="1" color="#eeeeee">&nbsp; <a href="index.php?logout=true" class="mgrnav">Logout</a>&nbsp;</font></td>
					
					<td><img src="images/header.div.gif"></td>
										
				</tr>
				
			</table>
		
		</td>
		
	</tr>
	
	<tr>
	
		<td align="center">
		
			<table cellpadding="0" cellspacing="0">
			
				<tr>
				
					<td height="20">&nbsp;</td>
				
				</tr>
			
				<tr>
				
					<td><img src="images/mgr.header.gif"></td>
					
				</tr>
				
				<tr>
				
					<td bgcolor="#ffffff" style="border-left: 1px solid #A0A1A3; border-right: 1px solid #A0A1A3;">
					
						<table cellpadding="0" cellspacing="0">
							
							<tr>
											
								<td width="3"></td>	
							
								<td valign="bottom"><img src="images/mgr.icon.gif"></td>
								
								<td><font face="verdana" size="2"><b><? if($n != ""){ echo $nav_title[$n]; } else { echo "Welcome"; } ?><? if($setup->demo_mode == 1){ echo " : <font color=\"#ff0000\">Demo Mode Is Active"; } ?></td>
								
							</tr>
							
						</table>
						
					</td>
					
				</tr>
				
				<tr>
				
					<td bgcolor="#ffffff" style="border-left: 1px solid #A0A1A3; border-right: 1px solid #A0A1A3;" align="center">
					
					<?
					/* Start Plugins */
					
					switch($p_mode){
						/* Website Settings	*/
						case "website_settings":
							include("plugins/website.settings.php");
						break;
						
						/* Members Manager */
						case "members":
							include("plugins/members.php");
						break;
						
						/* Edit Members */
						case "edit_mem":
							include("plugins/edit.member.php");
						break;
						
						/* Special Offers */
						case "offers":
							include("plugins/offers.php");
						break;
						
						/* News	*/
						case "news":
							include("plugins/news.php");
						break;
						
						/* FAQs	*/
						case "faqs":
							include("plugins/faqs.php");
						break;
												
						/* Copy Insert	*/
						case "copy":
							include("plugins/copy.php");
						break;
						
						/* Default Page	*/
						default:
							include("plugins/default.php");
										
						/* Log Time of Admin Login */					
						if($mgr_login_type == "site_manager"){
							$sql = "UPDATE setup SET admin_login_date='$current_time' WHERE setup_id = '1'";
							$result = mysql_query($sql);
						}							
						break;
					}
					?>
					
					</td>
					
				</tr>
				
				<tr>
				
					<td><img src="images/mgr.footer.gif"></td>
					
				</tr>
				
				<tr>
				
					<td>&nbsp;</td>
					
				</tr>
				<tr>
					
					<td>&nbsp;</td>
					
				</tr>
				
			</table>	
		
		</td>
		
	</tr>
		
	<tr>
		
		<td align="center"></td>
	
	</tr>
	
	<tr>
	
		<td height="100%"></td>
		
	</tr>
	
	<tr>
		
		<td height="22" align="center" background="images/footer.gif">
		
			<table cellpadding="0" cellspacing="0" width="100%">
						
				<tr>
										
					<td width="100%" align="right" valign="middle" height="23"><font face="verdana" size="1" color="#ffffff">Ktools.net Image Hosting Script v<? print($site_version); ?> Installed | Created by </font></td>
					
					<td align="right"><a><img src="images/ktools.gif" border="0"></a></td>
					
				</tr>
				
			</table>
		
		</td>
		
	</tr>

</table>

<?
mysql_close($db);
print($close);
?>