<?php  /* STEP 1: LOAD RECORDS - Copy this PHP code block to the TOP of your page BEFORE anything else. */  require_once "/home/tcfs/public_html/cmsAdmin/lib/viewer_functions.php";  list($featured_carsRecords, $featured_carsMetaData) = getRecords(array(   'tableName'   => 'featured_cars',    'where'       => 'featured_video_ad = 1',     ));?><!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>  <title></title>  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />  <style type="text/css">    body          { font-family: arial; }    .instructions { border: 3px solid #000; background-color: #EEE; padding: 10px; text-align: left; margin: 25px}  </style> </head><body topmargin="0">		<div align="left">			<table width="360" border="0">				<tr><?php $currentDateTime = time(); ?><?php foreach ($featured_carsRecords as $record): ?><?php if (strtotime($record['videoStartDate']) <= $currentDateTime && strtotime($record['videoEndDate']) >= $currentDateTime): ?>					<td width="360">						<table width="360" border="0" cellspacing="0" cellpadding="0">							<tr height="120">								<td valign="top" width="360" height="230"><?php foreach ($record['featured_video'] as $upload): ?><?php if ($upload['hasThumbnail']): ?><a href="<?php echo $record['_link'] ?>" target="_blank"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="360" height="230" border="0" alt="" hspace="0" vspace="5" /></a><?php elseif ($upload['isImage']): ?><img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><?php else: ?><a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><?php endif ?><?php break; ?><?php endforeach ?><br />								</td>								<td valign="top" width="188" height="120"><font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">										<table border="0" cellspacing="0" cellpadding="0">											<tr height="15">												<td align="left" valign="top" width="58" height="15"></td>												<td align="left" valign="top" width="129" height="15"></td>											</tr>										</table>									</font></td>							</tr>						</table>					</td>					<?php $maxCols=1; if (@++$count % $maxCols == 0): ?></tr>				<tr><?php endif ?><?php endif; ?><?php endforeach ?></tr>			</table>			<div align="left">							</div>		</div>	</body></html>