<?php
  include_once($_SERVER['DOCUMENT_ROOT'] . "/admin/inc/class.features.inc.php");
  $aFeatObj = new stores();
  
  $currentHotDeals = $aFeatObj->getActiveDeals();
  $numDeals = count($currentHotDeals);
  
  if($numDeals > 0){
	if($numDeals > 1){
		$dealEnding = "s:";
		$optionalSpan = "<span class='offsetPadLeft' style='display: block'>";
		$optionalSpanEnding = "</span>";
		$optionalStyle = "style='display: block'";
	}else{
		$dealEnding = ":";
		$optionalSpan = "";
		$optionalSpanEnding = "";
		$optionalStyle = "";
	}
?>
	<div class="hotDealContainer offsetPadLeft">
        <div class="alert alert-primary">
            <a class="close" data-dismiss="alert" href="#">x</a>Check out our most recent <b>Hot Deal<?php echo $dealEnding; ?> </b>
				<?php
					echo $optionalSpan; 
					foreach($currentHotDeals as $aDeal){
				?>
					<a href="/hotDeals" <?php echo $optionalStyle; ?>><?php echo $aDeal['deal_name']; ?></a>
				<?php
					}
					echo $optionalSpanEnding
				?>
        </div>
	</div>
<?php
  }
?>