<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts Multicart                     |
// +----------------------------------------------------------------------+
// | Authors: Programmer<programmer@armia.com>        		              |
// +----------------------------------------------------------------------+
// | Copyrights Armia Systems, Inc and iScripts.com © 2005                |
// | All rights reserved                                                  |
// +----------------------------------------------------------------------+
// | This script may not be distributed, sold, given away for free to     |
// | third party, or used as a part of any internet services such as      |
// | webdesign etc.                                                       |
// +----------------------------------------------------------------------+
?>
<?
include "includes/config.php";
include "includes/session.php";
include "includes/functions.php";

if (get_magic_quotes_gpc()) {
    $_POST = array_map('stripslashes_deep', $_POST);
    $_GET = array_map('stripslashes_deep', $_GET);
    $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
}
include "includes/htmltop.php";


/*display the active template*/

$active_template = displayTemplate();

?>
<body topmargin="0">
<table width="804" border="0" align="center" cellpadding="0" cellspacing="0" >
	<tr>
		<td align="center" >
			<table width="802" border="0" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td >
						<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
            				<tr>
              					<td>
									<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="maintext">
                  						<tr>
                    						<td> 
											<form name="frmTop" method="post" action="#">
												<?php include "includes/".$active_template[0]; /* Top File Name */?> 
											</form>	
												
												<table cellspacing="0" cellspacing="0" width="100%" border="1">
 
												
												<table width="100%"  border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td valign="top" bgcolor="#FFFFFF" >
<?php 
																include "includes/topmenu.php"; 
																include "includes/dotline.php";
																include "includes/centermain.php";
																include "includes/dotline.php";
																include "includes/bottommenu.php";
																
	$banner_value = getSettingsValue('ndisplay_banner');			
	
	if($banner_value == "Y")
	{													
																
		$select_bannner_count = "SELECT MIN(nbanner_display_count) AS banner_count FROM ".$tableprefix."banners";				
		$result_banner_count = mysql_query($select_bannner_count) or die(mysql_error());
		$banner_count_row = mysql_fetch_assoc($result_banner_count);
	
		if($banner_count_row['banner_count'] != "")
		{
	
			$select_banner = "SELECT nbanner_id,vbanner_locurl,vbanner_image FROM ".$tableprefix."banners 
							  WHERE nbanner_display_count = ".$banner_count_row['banner_count'].
							  " AND vbannerdelete_status != 'Y'";
						  
			$result_banner = mysql_query($select_banner) or die(mysql_error());	
	
			if(mysql_num_rows($result_banner) > 0)
			{
		
			$banner_row = mysql_fetch_assoc($result_banner);		
			
			displayBannerHome($banner_row['nbanner_id']);											
			
			}
	
	
/*taken from general settings*/
		
			$banner_image_size = explode(',',getSettingsValue('banner_size'));
			$imgwidth = $banner_image_size[0];
			$imgheight = $banner_image_size[1];																
?>																
<!--banner display starts here-->
																
													<table width="100%"  border="0" cellspacing="0" cellpadding="0">
														<tr>
															<td  align="center"><a href="<? echo htmlentities($banner_row["vbanner_locurl"]);?>" target="_blank"><img src="./banners/<? echo $banner_row["vbanner_image"];?>" border="0" width="<?=$imgwidth?>" height="<?=$imgheight?>"></a></td>
														</tr>
													</table><br>
																
<!--banner display ends here-->																
	
<?php					

		}
	
	}										
											
	$google_value = getSettingsValue('enable_google');		
	if($google_value == "Y")
	{
?>	
	
	
		<table width="100%"  border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td  align="center"><?php echo getSettingsValue('google_adsense_value');?></td>
			</tr>
		</table>
	
	
	
<?php	
	}								
											
											
																
															
?>
														</td>
                          							</tr>
                      							</table>
											</td>
                  						</tr>
									</table>
								</td>
 							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<?
include "includes/".$active_template[2];	/* Bottom File Name */
?>
</body>
</html>