<!DOCTYPE html>
<html lang="en-US">
	<head>
		<meta charset="utf-8">
		<style type="text/css">
			* {margin:0; padding:0;}
			body {font-family:Lucida Grande,Lucida Sans,Arial,sans-serif; font-size: 9pt; line-height:120%; color:#151515; background:#ffffff; width:800px;}

			h1 {font-size: 18pt; width: 800px; padding-bottom: 4px; border-bottom: 2px solid #1c43a6; color: #1c43a6;}
			h2 {font-weight: bold; font-size: 14pt; color: #990000;}
			h3 {font-weight: bold; font-size: 12pt; color: #0d2458; margin: 0 0 0.5em 0;}

			table {border-collapse: collapse;}

			.line  {border-bottom: 1px solid #7d7b7d;}			
		</style>
	</head>
	<body>
		
		<h1>OSAA Coach Certification Alert</h1>

		Hello <?php echo $info['staff']->getDisplayName(); ?>,
	    
	    <br /><br />        
	    
	    This e-mail is intended to notify you that you have
	    <?php if ((count($info['expired']) + count($info['missing']) + count($info['warning'])) == 1): ?>
	    	a required certification in the OSAA database that is
	    <?php else: ?>
	    	required certifications in the OSAA database that are
	    <?php endif; ?>
	    expired, expiring soon, or missing.  Please refer to the details below for additional information.
	    
	    <br /><br />

	    The OSAA database shows you have the following <?php echo (count ($info['roles'])) ? 'role' : 'roles'; ?> for <?php echo $info['school']->short_name; ?>:<br />
	    <?php foreach ($info['roles'] as $role): ?>
	        &nbsp;&nbsp;&nbsp;&nbsp;- <?php echo $role; ?><br />
	    <?php endforeach; ?>
	    <br />
	    
	    <?php /*  Expired  */ ?>
	    <?php if (count($info['expired']) > 0): ?>            
	        
	        <?php if (count($info['expired']) == 1): ?>
	            <b>Expired Certification</b>
	        <?php else: ?>
	            <b>Expired Certifications</b>
	        <?php endif; ?>
	        <ul>
	            <?php foreach ($info['expired'] as $slug): ?>
	                <?php
	                    $course = $info['courses']->filter(function($training_course) use($slug)
	                    {
	                        return (Helpers::strEqual($training_course->slug, $slug));
	                    })->first();
	                ?>

	                <li>
	                    <?php echo $course->name; ?> (<b>Expired <?php echo date('n/j/Y', strtotime($info['dates'][$slug])); ?></b>)<br />
	                    
	                    <?php echo $course->frequency; ?> requirement by <?php echo $course->required_by; ?>
	                    link: <a href="<?php echo $course->url; ?>" target="_blank"><?php echo $course->url; ?></a>
	                    
	                </li>
	            <?php endforeach; ?>
	        </ul>
	    <?php endif; ?>    
	    
	    <?php /*  Expiring Soon  */ ?>
	    <?php if (count($info['warning']) > 0): ?>            	        
	        <?php if (count($info['warning']) == 1): ?>
	            <b>Certification Expiring Soon</b>
	        <?php else: ?>
	            <b>Certifications Expiring Soon</b>
	        <?php endif; ?>
	        <ul>
	            <?php foreach ($info['warning'] as $slug): ?>
	                <?php
	                    $course = $info['courses']->filter(function($training_course) use($slug)
	                    {
	                        return (Helpers::strEqual($training_course->slug, $slug));
	                    })->first();
	                ?>

	                <li>
	                    <?php echo $course->name; ?> (<b>Expires <?php echo date('n/j/Y', strtotime($info['dates'][$slug])); ?></b>)<br />
	                    
	                    <?php echo $course->frequency; ?> requirement by <?php echo $course->required_by; ?>
	                    link: <a href="<?php echo $course->url; ?>" target="_blank"><?php echo $course->url; ?></a>
	                    
	                </li>
	            <?php endforeach; ?>
	        </ul>
	    <?php endif; ?>

	    <?php /*  Missing  */ ?>
	    <?php if (count($info['missing']) > 0): ?>            	        
	        <?php if (count($info['missing']) == 1): ?>
	            <b>Missing Required Certification</b>
	        <?php else: ?>
	            <b>Missing Required Certifications</b>
	        <?php endif; ?>
	        <ul>
	            <?php foreach ($info['missing'] as $slug): ?>
	                <?php
	                    $course = $info['courses']->filter(function($training_course) use($slug)
	                    {
	                        return (Helpers::strEqual($training_course->slug, $slug));
	                    })->first();
	                ?>

	                <li>
	                    <?php echo $course->name; ?> (<b>No Record on File</b>)<br />
	                    
	                    <?php echo $course->frequency; ?> requirement by <?php echo $course->required_by; ?>
	                    link: <a href="<?php echo $course->url; ?>" target="_blank"><?php echo $course->url; ?></a>
	                    
	                </li>
	            <?php endforeach; ?>
	        </ul>
	    <?php endif; ?>
	    
	    Please update your <?php echo ((count($info['expired']) + count($info['missing']) + count($info['warning'])) == 1) ? 'certification' : 'certifications'; ?> and let me know so we can update your information.
		
		<br /><br />

		<?php if (!Helpers::strIsEmpty($info['notes'])): ?>
			
			<?php echo $info['notes']; ?>
			<br /><br />

		<?php endif; ?>
		
		<?php echo $info['user']->getDisplayFullName(); ?><br />
		<?php echo $info['school']->name; ?>		

		<br /><br />	

		<p style="font-size: 8pt; line-height: 110%;">
			This is an OSAA automatically generated message and was sent to <?php echo Helpers::arrayToList ($info['to']); ?>			
			<?php if (count($info['cc']) > 0): ?>
				and copied to <?php echo Helpers::arrayToList ($info['cc']); ?>
			<?php endif; ?>			
		</p>
		
	</body>
</html>