<?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.                                                       |
// +----------------------------------------------------------------------+
?>
<?php
include "includes/config.php";
include "includes/session.php";
include "includes/functions.php";
include_once "classes/cls_products.php";
include_once "classes/cls_cart.php";
/*display the active template*/
$active_template = displayTemplate();

$currency_attributes = displayCurrencyType();

// setting pagination limit From Admin settings

$limit=getPaginationLimit();

if($limit==0)
{
	$limit=12;
}	

$page=$_GET['page'];

if(empty($page))
	{
		$page = 1;
	}

//End pagination settings

include "includes/htmltop.php";


/* Top File Name */
//echo "includes/".$active_template[0];
include_once ("includes/".$active_template[0]); 

/* Center File */

include_once ("includes/centermain.php");

	$banner_value = getSettingsValue('ndisplay_banner');			
	
	if($banner_value == "Y")
	{													
																
		$select_bannner_count = "SELECT MIN(nbanner_display_count) AS banner_count 
								 FROM ".$tableprefix."banners 
								 WHERE vbannerdelete_status != 'Y'";				
		$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];		

    
   if(ENABLE_AMAZON_S3_IMAGES == "Y")  
         $homeFooterBanner = AMAZON_S3_DOMAIN_URL."banners/". $banner_row["vbanner_image"] ;
   else
     $homeFooterBanner =  SITE_URL . "/banners/". $banner_row["vbanner_image"]; 
    



?>																
<!--banner display starts here-->
	
				<div align="center" style="clear:both; padding-top:10px;">
					<a href="http://<?php echo htmlentities($banner_row["vbanner_locurl"]);?>" target="_blank">
					<img src="<?php echo $homeFooterBanner;?>" border="0" width="<?php echo $imgwidth?>" height="<?php echo $imgheight?>"></a>
				</div>	
				<br>
																	
<!--banner display ends here-->																
	
<?php					

		}
	
	}										
											
	$google_value = getSettingsValue('enable_google');		
	if($google_value == "Y")
	{
?>	
			<div align="center" style="clear:both; padding-top:10px;">
			<table cellpadding="0" cellspacing="0" width="80%">
				<tr>
					<td align="center">
						<?php echo stripslashes(getSettingsValue('google_adsense_value'));?>
					</td>
				</tr>		
			</table>
			</div>	
		
<?php	
	}								
	
include "includes/".$active_template[2];	/* Bottom File Name */
?>