<?php $__env->startSection('page_title'); ?>
    OSAA - Notify Staff
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_sub_title'); ?>    
    
    Notify <?php echo $info['staff']->getDisplayName(); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    @parent
    
    <style type="text/css">
      	h3 {
      		color: #1C43A6 !important;
      	}    	

      	.success_bar {
      		position: fixed;
      		top: 600px;
      		left: 0;
      		width: 100%;
      		padding: 0.25em 0;
      		line-height: 1.5em;
      		background-color: rgba(176, 255, 190, 0.0);
      		border-bottom: 2px solid rgba(13, 88, 27, 0.50);
      		border-top: 2px solid rgba(13, 88, 27, 0.50);
      		z-index: 500;
      	}

      	.success_bar .message {
      		width: 1200px;
      		margin: 0 auto;
      		font-size: 14pt;
      		color: #151515;
      	}    	
      	

        label, .label {
            font-weight: bold;
            width: 125px;
            text-align: right;
            margin-right: 25px;
            display: inline-block;
            position: relative;
        }     
        
        
    </style>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('jquery_init'); ?>
			
  	// Success bar
  	$('.success_bar').animate({ 'top' : 32, 'background-color' : 'rgba(176, 255, 190, 1.0)'}, 1600, 'easeOutQuad', function ()
  	{		
  		$(this).delay(6000).fadeOut(4000);	

  		$(this).hover(function ()
  		{
  			$(this).stop(true).css('opacity', '1.0');
  		},
  		function ()
  		{
  			$(this).fadeOut(4000);
  		})
  	});


    // Back button
    $('#back_button')
        .button({'icons' : {'primary' : 'ui-icon-circle-close'}})
        .css({'font-size' : '9pt'});

    // Submit button
    $('input[type="submit"]')
        .button()
        .css({'font-size' : '9pt'});        
    
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_functions'); ?>    
    
    <a href="<?php echo url('/schools/' . $info['school']->id); ?>" id="back_button">Cancel</a>

<?php $__env->stopSection(); ?>


<?php $__env->startSection('main_content'); ?>    		  

   	<?php /*  Success Bar  */ ?>
   	<?php if (Session::has('success')): ?>
  		<div class="success_bar">
  			<div class="message">				
  				<?php echo Session::get('success'); ?>
  			</div>			
  		</div>
  	<?php endif; ?> 


    <?php /*  Errors  */ ?>
     <?php if (Session::has('errors')): ?>                
        <div class="error ui-state-error" style="font-weight: bold; padding: 0.5em; margin-bottom: 2em; position: relative; top: 1em;">
            <span class="ui-icon ui-icon-alert box_icon"></span>
            <?php foreach ($errors->all() as $error): ?>
                <?php echo $error; ?>
            <?php endforeach; ?>
        </div>
    <?php endif; ?> 

    
    <br />

    <h2>E-Mail Header</h2>
   
    <div class="label" style="width: 75px;">To:</div><?php echo $info['staff']->getDisplayName(); ?> (<?php echo $info['staff']->email; ?>)<br />
    <div class="label" style="width: 75px;">CC:</div><?php echo Auth::user()->getDisplayFullName(); ?> (<?php echo Auth::user()->email; ?>)<br />
    <div class="label" style="width: 75px;">From:</div>OSAA Website (on behalf of <?php echo Auth::user()->getDisplayFullName(); ?>)<br />
    <div class="label" style="width: 75px;"></div><span style="font-size: 9pt;"><i>Replies will be directed to <?php echo Auth::user()->email; ?></i></span>
    <br /><br />
    <div class="label" style="width: 75px;">Subject:</div>OSAA Coaching Certification Alert<br />
    <br />
    
    <h2>Preview</h2>
    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; ?>  

    <?php /*  Expired  */ ?>
    <?php if (count($info['expired']) > 0): ?>            
        <br /><br />
        <?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 />
                    <span style="font-size: 9pt;">
                        <?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>
                    </span>
                </li>
            <?php endforeach; ?>
        </ul>
    <?php endif; ?>    
    
    <?php /*  Expiring Soon  */ ?>
    <?php if (count($info['warning']) > 0): ?>            
        <br /><br />
        <?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 />
                    <span style="font-size: 9pt;">
                        <?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>
                    </span>
                </li>
            <?php endforeach; ?>
        </ul>
    <?php endif; ?>

    <?php /*  Missing  */ ?>
    <?php if (count($info['missing']) > 0): ?>            
        <br /><br />
        <?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 />
                    <span style="font-size: 9pt;">
                        <?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>
                    </span>
                </li>
            <?php endforeach; ?>
        </ul>
    <?php endif; ?>

    <br /><br />

    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 echo Form::open(array('url' => '/schools/' . $info['school']->id . '/staff/' . $info['staff']->id . '/notify')); ?>

        <?php echo Form::hidden('school', $info['school']->id); ?>
        <?php echo Form::hidden('staff', $info['staff']->id); ?>

        <br />

        <h2>Custom Notes</h2>
        <span style="font-size: 9pt;"><i>Add custom text or special instructions below.  This text will be appended to the e-mail body.</i></span>

        <?php echo Form::textarea('notes', null, array('style' => 'width: 100%; height: 8em;')); ?>
    
        <br />

        <div class="horizontal_divider" style="width: 100%;"></div>

        <br />

        <?php echo Form::submit('Send E-Mail'); ?>

        <br class="clear" /><br />

    <?php echo Form::close(); ?>    
    
<?php $__env->stopSection(); ?>
