<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
  require_once "/home/ovation2/public_html/mriintranet/admin/lib/viewer_functions.php";

  list($blogRecords, $blogMetaData) = getRecords(array(
    'tableName'   => 'blog',
	'limit'       => '8',
  ));
?>
<?php 
/* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
  require_once "/home/ovation2/public_html/mriintranet/admin/lib/viewer_functions.php";
// load records
  list($blog_avatarsRecords, $blog_avatarsMetaData) = getRecords(array(
    'tableName'   => 'blog_avatars',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $blog_avatarsRecord = @$blog_avatarsRecords[0]; // get first record
?>
<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
	require_once "/home/ovation2/public_html/mriintranet/admin/lib/viewer_functions.php";

  list($accountsRecords, $accountsMetaData) = getRecords(array(
    'tableName'   => 'accounts',
	'orderBy'     => 'fullname ASC',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $accountsRecord = @$accountsRecords[0]; // get first record
?>
<?php if (!$CURRENT_USER) { websiteLogin_redirectToLogin(); } ?>
<!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">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>:: MRI INTRANET ::</title>
<link href="css/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">
	<div id="header">
		<?php include("includes/header.php"); ?>
	</div>
	<div id="navbar">
		<?php include("includes/login_menu.php"); ?>
	</div>
	<div id="container_blog">  
		<div id="contents">
			<div id="menu_div">
				
			</div>
			<div id="basic_contents">
				<div id="blog_bg">
					<div id="blog_records">
						<?php $count = 0; ?>
						<span style="font-size:18px;">GENERAL</span>
						<?php foreach ($blogRecords as $record): ?>
							<?php if ($record['category'] != 'General') { continue; } ?>
								<div class="divider_line"></div><br />
								<?php if ($record['embed_code']): ?>
									<?php echo $record['embed_code'] ?><br /><br />
								<?php endif ?>
								<?php foreach ($record['blog_image'] as $upload): ?>
									<div style="border:#83857a thin solid; width:<?php echo $upload['width'] ?>px"><img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="<?php echo $upload['alt'] ?>" /><br/></div><br />
								<?php endforeach ?>
								<table width="596" border="0" cellpadding="0" cellspacing="0">
									<tr>
										<td width="75" valign="top"><div style="border:#83857a thin solid;">
										
<!-- //////////////// Avatar Image Code /////////////// -->

<?php if ($record['createdBy.avatar']): ?> 
<?php foreach ($blog_avatarsRecord['avatar'] as $upload): ?>    
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo 
$upload['thumbHeight'] ?>" />
<?php endforeach ?> 
<?php else : ?> 
 <img src="images/fpo_avatar.jpg" width="75" height="75" /> 
<?php endif ?> 

<!-- //////////////// End Avatar Image Code /////////////// -->									

										
										
										</div></td>
										<td style="padding:0px 20px 0px 15px;">
										<div class="title"><?php echo $record['title'] ?></div>
										<p class="subtitle"><a href="/employeedir.php#<?php echo $record['createdBy.fullname'] ?>"><?php echo $record['createdBy.fullname'] ?></a> &ndash; <?php echo date("D, M jS, Y", strtotime($record['createdDate'])) ?></p>
										<span class="blog_body"><?php echo $record['content'] ?></span><?php if ($record['article_link']): ?><br /><a class="blog_body_link" href="<?php echo $record['article_link'] ?>">VIEW FULL RELEASE</a><br /><?php endif ?>
										</td>
									</tr>
								</table><br /><br />
						<?php $maxCols=1; if (@++$count % $maxCols == 0): ?>
						<?php endif; ?> 
						<?php endforeach ?>
						<?php if ($count == 0): ?>
							<p class="blog_body">No posts available!</p>
						<?php endif ?>
					</div>
					<div id="calendar_container">
						<div class="side_title_green">COMPANY CALENDAR</div>
						<div id="calendar">
						</div>
						<div style="padding:0px 0px 30px 0px;">
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="push"></div>
</div>
<div id="footer">
	<?php include("includes/footer.php"); ?>
</div>
</body>
</html>