<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
  require_once "/home/luxurychartergroup/luxurychartergroup.com/cms/lib/viewer_functions.php";

  list($nl_multiRecords, $nl_multiMetaData) = getRecords(array(
    'tableName'   => 'nl_multi',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $nl_multiRecord = @$nl_multiRecords[0]; // get first record

  // show error message if no matching record is found
  if (!$nl_multiRecord) {
    header("HTTP/1.0 404 Not Found");
    print "Record not found!";
    exit;
  }

?>

<?php
  // Gets Banner for top of Newsletter
  $num = $nl_multiRecord['banner']; 
  if (!$num) { $num = 1; } // default num
  list($newsletter_bannersRecords, $newsletter_bannersMetaData) = getRecords(array(
    'tableName'   => 'newsletter_banners',
	'where' => "num ='$num'",
    'limit'       => '1',
	'allowSearch' => '0',
  ));
  $nl_multiRecord = @$nl_multiRecords[0]; // get first record
?>


<?php
  // Gets list of yachts
  $num2 = $nl_multiRecord['yachts']; 
  if (!$num2) { $num2 = 1; } // default num
  list($yachtsRecords, $yachtsMetaData) = getRecords(array(
	'tableName'   => 'yachts',
	'where' => "num LIKE '$num2'", //Gets multiple records
	'allowSearch' => '0',
  ));
?>

<?php
  // Gets default fields
  list($settingsRecords, $settingsMetaData) = getRecords(array(
    'tableName'   => 'settings',
    'loadUploads' => '0',
    'limit'       => '1',
	'allowSearch' => '0',
  ));
  $settingsRecord = @$settingsRecords[0]; // get first record
?>

<html>
<head>
<title><?php echo $nl_multiRecord['title'] ?></title>
</head>

<body>
<style>
<!--
p {
	margin: 10px 0;
}
div.announceText p {
	margin: 4px 0 0 0 !important;
}
-->
</style>
<table width="783" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td style="font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #666; padding-top: 10px; padding-bottom: 10px;">Dear [fullname,fallback=broker], you're receiving this email from Sail Connections (Luxury Charter Group) because you are subscribed to our <b>exclusive brokers list</b>.<br />
		Not interested anymore? <unsubscribe>Unsubscribe Instantly</unsubscribe>. Having trouble reading this email? <webversion>View it in your browser</webversion>.</td>
	</tr>
</table>
<table width="783" border="0" align="center" cellpadding="0" cellspacing="0" style=" border-collapse: collapse; border-top: 10px solid #eff0f0; border-left: 10px solid #eff0f0; border-right: 10px solid #eff0f0;">
<tr>
<td>

<table width="783" border="0" align="center" cellpadding="0" cellspacing="0" style="border-collapse: collapse;">
	<tr>
		<td width="522" rowspan="2" valign="top" bgcolor="#FFFFFF"><?php foreach ($newsletter_bannersRecords as $record): ?><?php foreach ($record['banner'] as $upload): ?><img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="<?php echo $record['title'] ?>" /><?php endforeach ?><?php endforeach ?></td>
		<td width="261" height="178" valign="top" bgcolor="#0f0352"><img src="img/lcg-logo.gif" width="261" height="178" alt="the Luxury Charter Group" /></td>
	</tr>
	<tr>
		<td valign="top" bgcolor="#b1b4b6" width="261" height="178">
			<div style="margin-top: 15px; margin-bottom: 10px; margin-left: 20px; margin-right: 20px; font-family: Arial, Helvetica, sans-serif;">
			
				<?php if ($nl_multiRecord['announce_title']): ?>
				<div style="color: #0f0352; font-weight: bold; font-size: 14px; margin-bottom: 4px; text-transform: uppercase;"><?php echo $nl_multiRecord['announce_title'] ?></div>
				<?php endif ?>
				
				<?php foreach ($nl_multiRecord['announce_image'] as $upload): ?>
            	<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" />
        		<?php endforeach ?>
				
				<?php if ($nl_multiRecord['announce_text']): ?>
					<div class="announceText" style="margin-top: 4px; font-size: 12px; line-height: normal; color: #333;"><?php echo $nl_multiRecord['announce_text'] ?></div>
				<?php endif ?>
				
			</div>
		</td>
	</tr>

	<tr>
		<td colspan="2" valign="top" style="font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; color: #333;">
			<div style="margin-top: 15px; margin-left: 20px; margin-bottom: 15px; margin-right: 20px;">
				
				<?php if ($nl_multiRecord['sub_title']): ?>
				<div style="text-transform: uppercase; font-weight: bold; font-size: 14px; color: #00427e; margin-bottom: 5px;"><?php echo $nl_multiRecord['sub_title'] ?></div>
				<?php endif ?>
				
				<?php if ($nl_multiRecord['title']): ?>
				<div style="text-transform: uppercase; font-size: 24px; color: #56a3e8; margin-bottom: 10px;"><?php echo $nl_multiRecord['title'] ?></div>
				<?php endif ?>
				
				<?php if ($nl_multiRecord['content_top']): ?>
				<?php echo $nl_multiRecord['content_top'] ?>
				<?php endif ?>


				<?php foreach ($yachtsRecords as $record): ?>
				Yacht Name: <?php echo $record['yacht_name'] ?><br/>
				<?php endforeach ?>
				
				
				<?php if ($nl_multiRecord['content_bottom']): ?>
				<?php echo $nl_multiRecord['content_bottom'] ?>
				<?php endif ?>
				
				</div>
			
		</td>
		</tr>
	<tr>
		<td width="522" valign="top" style="font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; color: #333;" bgcolor="#eff0f0">
		<div style="margin-top: 15px; margin-left: 20px; margin-bottom: 15px; margin-right: 20px;">
		
		<div style="text-transform: uppercase; font-weight: bold; font-size: 14px; color: #56a3e8; padding-bottom: 5px;">THE LUXURY CHARTER GROUP</div>
		<table border="0" cellspacing="0" cellpadding="0" style="font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; color: #333;">
			<tr>
				<td style="padding-right: 10px;"><span style="color: #666;">USA:</span></td>
				<td><?php echo $settingsRecord['phone_usa'] ?></td>
			</tr>
			<tr>
				<td style="padding-right: 10px;"><span style="color: #666;">AUSTRALIA:</span></td>
				<td><?php echo $settingsRecord['phone_au'] ?></td>
			</tr>
			<tr>
				<td style="padding-right: 10px;"><span style="color: #666;">INTL:</span></td>
				<td><?php echo $settingsRecord['phone_nz'] ?></td>
			</tr>
			<tr>
				<td style="padding-right: 10px;"><span style="color: #666;">FAX:</span></td>
				<td><?php echo $settingsRecord['fax'] ?></td>
			</tr>
			<tr>
				<td style="padding-right: 10px;"><span style="color: #666;">EMAIL:</span></td>
				<td><a href="mailto:<?php echo $settingsRecord['email'] ?>"><?php echo $settingsRecord['email'] ?></a></td>
			</tr>
			<tr>
				<td style="padding-right: 10px;"><span style="color: #666;">WEB:</span></td>
				<td><a href="http://<?php echo $settingsRecord['web'] ?>"><?php echo $settingsRecord['web'] ?></a></td>
			</tr>
		</table>
		</div>
		</td>
		<td width="261" valign="top" style="font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; color: #333;" bgcolor="#eff0f0">
		<div style="margin-top: 15px; margin-left: 20px; margin-bottom: 15px; margin-right: 20px;">
		<div style="text-transform: uppercase; font-weight: bold; font-size: 14px; color: #56a3e8; padding-bottom: 5px;">YOUR SUBSCRIPTION</div>
			<div>[fullname,fallback=]</div>
			<div><a href="mailto:[email]">[email]</a></div>
			<div><forwardtoafriend>Forward to a Friend</forwardtoafriend></div>
			<div><webversion>View this email in your Browser</webversion></div>
			<div><preferences>Update your Details / Unsubscribe</preferences></div>
		</div>
		</td>
	</tr>
</table>

</td>
</tr>
</table>

<table width="783" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td style="text-align: center; font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #666; line-height: 18px; padding-top: 10px; padding-bottom: 10px;"><i>You can't copy but please ask us if you want to present this boat on your website.</i><br />
Not interested anymore? <unsubscribe>Unsubscribe Instantly</unsubscribe></td>
	</tr>
</table>
</body>
</html>
