<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
  require_once "/home/.pause/baobab/staging.baobabmarine.com/cms/lib/viewer_functions.php";

  list($brokerageRecords, $brokerageMetaData) = getRecords(array(
    'tableName'   => 'brokerage',
  ));

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Fiji Yachts for Sale - Baobab Marine Fiji</title>
	<link href="/lib/style.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript">
	<!--
	function MM_jumpMenu(targ,selObj,restore){ //v3.0
	  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	  if (restore) selObj.selectedIndex=0;
	}
	//-->
	</script>
</head>

<body>
<div id="nonfooter">
	<?php include("lib/_header.php"); ?>
	<div id="topwrap">
		<?php include("lib/_topnav.php"); ?>
		<div class="banner">
			<h1>Yacht Brokerage</h1>
		</div>
	</div>
	
	<div id="contentwrap">
		<div class="content">
		
		<div style="border: 1px solid #CCC;">
		<?php foreach ($brokerageRecords as $record): ?> 
		<?php if ($record['type'] == 'Yacht'): ?><h1 style="color: #c00;">Conditional Heading: Yacht</h1> 
		<?php elseif ($record['type'] == 'Power'): ?><h1 style="color: #c00;">Conditional Heading: Power</h1> 
		<?php elseif ($record['type'] == 'Commercial'): ?><h1 style="color: #c00;">Conditional Heading: Commercial</h1>
		<?php else: ?><h1>Brokerage</h1> 
		<?php endif ?> 
		<?php break ?>
		<?php endforeach; ?>
		</div>
		
			<div style="float: right;">
			<table><tr><td>Filter vessels by:</td><td>
			<form name="form" id="form">
				<select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)">
					<option>Please select...</option>
					<option value="/brokerage.php">Show All</option>
					<option value="/brokerage.php/type-yacht/">Yachts Only</option>
					<option value="/brokerage.php/type-power/">Power Boats Only</option>
					<option value="/brokerage.php/type-commercial/">Commercial Boats Only</option>
				</select>
			</form></td></tr></table>
			</div>
			<div style="border-bottom: 1px solid #efefef; padding-bottom: 10px; margin-bottom: 15px; padding-top: 5px;">The following vessels are currently available for sale:</div>
			
			<table class="data">
			<?php foreach ($brokerageRecords as $record): ?>
				<tr>
					<td style="text-align: right;">
						<?php foreach ($record['images'] as $upload): ?>
						<?php if ($upload['hasThumbnail']): ?>
						<img class="imgborder" src="<?php echo $upload['thumbUrlPath2'] ?>" width="<?php echo $upload['thumbWidth2'] ?>" height="<?php echo $upload['thumbHeight2'] ?>" alt="" />
						<?php else: ?>
						<!-- No Image Available -->
						<?php endif ?>
						<?php break ?>
						<?php endforeach ?>
					</td>
					<td style="padding-left: 15px;">
						<h2 style="margin: 0 0 5px 0;"><a href="<?php echo $record['_link'] ?>"><?php echo $record['boat_name'] ?> - <?php echo $record['availability'] ?></a></h2>
						<p style="margin: 0;"><?php echo $record['short_description'] ?></p>
						<p style="margin: 0;"><b>Price:</b> <?php echo $record['price'] ?></p>
					</td>
				</tr>
			<?php endforeach; ?>
			</table>
				
				<?php if (!$brokerageRecords): ?>
				No records were found!<br/><br/>
				<?php endif ?>
		</div>
	</div>
</div>
<div id="footerwrap">
	<?php include("lib/_footer.php"); ?>
</div>

</body>
</html>
