<div class="team_view_page_header">
                        
    <?php /*  School Logo & Colors  */ ?>
    <div style="float: left; width: 150px; height: 180px;">
        <?php
            $image_url = ImagesController::getImageURL($information['school']->short_name, 'logo', '128x128');
        
            if (!is_null($image_url))
            {
                $src = $image_url;
            }
            else
            {
                $src = asset('images/no_logo.png');
            }

        ?>
       
        <img src="<?php echo $src; ?>" alt="" title="" style="width:128px; height:128px; margin-bottom: 1em;" />
       
        <?php /* <div style="font-size: 10pt; font-weight: bold; color: #1C43A6; margin-bottom: 0.25em;">Team Colors</div> */ ?>
        
        <?php if (!is_null($information['colors'][0])): ?>

            <div style="width: 30px; height: 30px; background-color: #<?php echo $information['colors'][0]->hex; ?>; border: 1px solid #d9e1e0; float: left; margin-right: 10px; <?php if (is_null($information['colors'][1])): ?> margin-left: 60px; <?php elseif (is_null($information['colors'][2])): ?> margin-left: 27px; <?php else: ?> margin-left: 7px; <?php endif; ?>"></div>
        
        <?php endif; ?>

        <?php if (!is_null($information['colors'][1])): ?>
            <div style="width: 30px; height: 30px; background-color: #<?php echo $information['colors'][1]->hex; ?>; border: 1px solid #d9e1e0; float: left; margin-right: 10px;"></div>
        <?php endif; ?>

        <?php if (!is_null($information['colors'][2])): ?>
            <div style="width: 30px; height: 30px; background-color: #<?php echo $information['colors'][2]->hex; ?>; border: 1px solid #d9e1e0; float: left;"></div>
        <?php endif; ?>
    </div>


    <?php /*  School and Team Information  */ ?>    
    <div style="float: left; width: 880px;">
        
        <div style="float: left; width: 320px; margin-right: 25px; min-height: 180px;">
            
            <?php /*  School Information  */ ?>
            <div style="font-size: 10pt; font-weight: bold; color: #1C43A6; margin-bottom: 0.25em;">School</div>
        
            <dl>
                
                <dt style="width: 100px;">
                    Classification
                </dt>
                <dd style="width: 210px;">
                    <?php echo $information['school_classification']->classification; ?>
                    
                    <?php if (Helpers::strEqual($information['school']->school_type, array('PUB', 'CHR'))): ?>
                        (Public)
                    <?php else: ?>
                        (Private)
                    <?php endif; ?>
                </dd>
               
                <dt style="width: 100px;">
                    Regular District
                </dt>
                <dd style="width: 210px;">                    
                    <?php if (!is_null($information['school_league'])): ?>
                        <?php echo preg_replace('/\(.*\)/', '', $information['school_league']->league->slug); ?> <?php echo $information['school_league']->league->name; ?>
                    <?php else: ?>
                        None
                    <?php endif; ?>
                </dd>

            </dl>

            <br />

            <?php /*  Team Staff  */ ?>
            <div style="font-size: 10pt; font-weight: bold; color: #1C43A6; margin-bottom: 0.25em; margin-top: 2em;">Team Staff</div>

            <?php

                $team_ap_staff_display_count = 0;

            ?>

            <?php if (count($information['staff']) > 0): ?>

                <dl>

                    <?php foreach ($information['staff'] as $level => $team_staff): ?>                

                        <?php foreach ($team_staff as $role => $ap_staff): ?>

                            <?php
                                $count = count($ap_staff);
                            ?>

                            <?php if ($count > 0): ?>

                                <?php

                                    if (Helpers::strEqual($role, 'Coach'))
                                    {
                                        $display_role = 'Head Coach';

                                        if ($count > 1)
                                        {
                                            $display_role = 'Head Coaches';
                                        }
                                    }

                                    if (Helpers::strEqual($role, 'Asst. Coach'))
                                    {
                                        $display_role = 'Asst. Coach';

                                        if ($count > 1)
                                        {
                                            $display_role = 'Asst. Coaches';
                                        }
                                    }

                                    if (Helpers::strEqual($role, 'Mngr.'))
                                    {
                                        $display_role = 'Manager';

                                        if ($count > 1)
                                        {
                                            $display_role = 'Managers';
                                        }
                                    }

                                    if (!Helpers::strEqual($level, 'V'))
                                    {
                                        $display_role = $level . ' ' . $display_role;
                                    }
                                ?>                    

                                <dt style="width: 100px;">
                                    <?php echo $display_role; ?>
                                </dt>
                                
                                <dd style="width: 210px; overflow: visible; white-space: initial;">

                                    <?php                        
                                        $team_ap_staff_display_count++;

                                        $i = 0;
                                        $ap_staff->each(function($staff) use($count, &$i)
                                        {
                                            $i++;                                    

                                            if ($staff->is_email_public)
                                            {
                                                echo '<a href="mailto:' . Helpers::obfuscateEmailAddress($staff->school_staff->email) . '">' . $staff->school_staff->getDisplayName() . '</a>';
                                            }
                                            else
                                            {
                                                echo $staff->school_staff->getDisplayName();    
                                            }
                                            

                                            if ($i < $count)
                                            {
                                                echo ', ';
                                            }

                                        });
                                    ?>

                                </dd>
                                
                            <?php endif; ?>

                        <?php endforeach; ?>

                    <?php endforeach; ?>

                </dl>            
                  
            <?php endif; ?>

            <?php if ($team_ap_staff_display_count < 1): ?>            

                No team staff have been entered by this school.

                <?php if (Auth::check() and Auth::user()->canAccessTeamTask($information['activity_program']->id, 'ADMIN', true)): ?>
                    <br /><br />
                    You can add team staff from your <a href="<?php echo url('/schools/' . $information['activity_program']->host_school . '/edit-staff'); ?>">Manage Staff</a> page.  Be sure the staff contact is set to be shown on rosters.
                <?php endif; ?>

            <?php endif; ?>
        </div>
        
        <div style="float: left; width: 320px; margin-right: 25px;">

            <?php /*  Team Information  */ ?>
            <div style="font-size: 10pt; font-weight: bold; color: #1C43A6; margin-bottom: 0.25em;">Program Information</div>
            
            <dl>

                <dt style="width: 100px;">Classification</dt>
                <dd style="width: 210px;">
                    <?php echo $information['activity_program']->division; ?>
                    (<?php echo $information['activity_program']->school_year; ?>-<?php echo intval(substr($information['activity_program']->school_year, 2, 2) + 1); ?>)
                </dd>
                
                <dt style="width: 100px;">League</dt>
                <dd style="width: 210px;">
                    <?php if (!Helpers::strIsEmpty($information['activity_program']->league)): ?>
                        <a href="<?php echo url('/activities/' . strtolower($information['activity_program']->activity) . '/teams-leagues?div=' . $information['activity_program']->division . '#' . preg_replace('/\(.*\)/', '', $information['activity_program']->league)); ?>">
                    <?php else: ?>
                        <a href="<?php echo url('/activities/' . strtolower($information['activity_program']->activity) . '/teams-leagues?div=' . $information['activity_program']->division); ?>">
                    <?php endif; ?>
                        <?php echo $information['activity_program']->display_league; ?></a>
                </dd>
            
                <dt style="width: 100px;">Levels</dt>
                <dd style="width: 210px;">
                    <?php if (!is_null($information['teams'])): ?>
                        <?php
                            $count = count($information['teams']);                
                            $i = 0;
                            $information['teams']->each(function($team) use($count, &$i)
                            {
                                $i++;
                                
                                //echo Helpers::getLevelName($team->level);
                                echo $team->level;

                                if ($i < $count)
                                {
                                    echo ', ';
                                }

                            });
                        ?>
                    <?php else: ?>
                        - -
                    <?php endif; ?>
                </dd>

                <?php if (!is_null($information['rankings_info'])): ?>
                    <dt style="width: 100px;">Varsity Contests</dt>
                    <dd style="width: 210px; position: relative;">
                        <div class="progress_label" <?php if (Helpers::strEqual($information['activity_program']->activity, array('VBL'))): ?> style="left: 26%;" <?php endif; ?>>
                            <?php echo $information['rankings_info']->contest_completed; ?> / <?php echo $information['rankings_info']->contest_count; ?>

                            <?php if (Helpers::strEqual($information['activity_program']->activity, array('VBL'))): ?>
                                on <?php echo count($information['rankings_info']->dates); ?> dates
                            <?php endif; ?>
                        </div>
                        <div id="contest_progress_bar" <?php if ($information['rankings_info']->is_over_contest_limit): ?> class="over_contest_limit" <?php endif; ?>></div>
                    </dd>
                <?php endif; ?>

            </dl>               

        </div>  
        
        <div style="float: left; width: 190px;">

            <?php /*  Acheivement  */ ?>
            
            <?php /*  Download Grabber  */ ?>
            <div class="grabber_button">Print/Download</div>

            <ul id="grabber_list">
                <?php foreach ($information['teams'] as $team): ?>
                    <li>
                        <a href="#" style="padding-left: 28px;"><?php echo Helpers::getLevelName($team->level); ?></a>
                        <ul>
                            <li><a href="<?php echo url('/teams/' . $team->id . '/schedule'); ?>" target="_blank"><img src="<?php echo asset('/images/icons/csv_file_16px.png'); ?>" alt="" title="" /><?php echo $team->level; ?> Schedule</a></li>
                            <li><a href="<?php echo url('/teams/' . $team->id . '/roster'); ?>" target="_blank"><img src="<?php echo asset('/images/icons/pdf_file_16px.png'); ?>" alt="" title="" /><?php echo $team->level; ?> Media Roster</a></li>
                            <li><a href="<?php echo url('/teams/' . $team->id . '/roster/2'); ?>" target="_blank"><img src="<?php echo asset('/images/icons/pdf_file_16px.png'); ?>" alt="" title="" /><?php echo $team->level; ?> Program Roster</a></li>
                        </ul>                        
                    </li>
                <?php endforeach; ?>
                <li><a href="<?php echo url('/teams/' . $team->id . '/multi-schedule'); ?>" target="_blank"><img src="<?php echo asset('/images/icons/csv_file_16px.png'); ?>" alt="" title="" />Multi-Team Schedule</a></li>
                <li><a href="<?php echo url('/teams/' . $information['teams'][0]->id . '/roster/3'); ?>" target="_blank"><img src="<?php echo asset('/images/icons/pdf_file_16px.png'); ?>" alt="" title="" />Multi-Team Roster</a></li>
            </ul>                            

        </div>         

        <?php if (Helpers::strEqual(Helpers::getActivityType($information['activity_program']->activity), 'TS')): ?>
            <?php /*  Rankings  */ ?>
            <div style="float: left; width: 535px; margin-top: 1em;">   

                <div style="float: right; font-size: 9pt;">
                    <a href="<?php echo url('/activities/' . strtolower($information['activity_program']->activity)) . '/rankings?div=' . $information['activity_program']->division; ?>">
                        All <?php echo $information['activity_program']->division; ?> <?php echo Helpers::getActivityName($information['activity_program']->activity); ?> Rankings
                    </a>
                </div>

                <div style="font-size: 10pt; font-weight: bold; color: #1C43A6; margin-bottom: 0.25em;">Ranking Information</div>

                <?php if (!is_null($information['rankings_info']) and !is_null($information['rankings_info']->ranking) and !Helpers::strEqual($information['rankings_info']->ranking->calc_label, 'Rankings Are Unavailable')): ?>

                    <div class="columns">

                        <div class="float_left" style="width: 170px; padding-right: 5px;">

                            <dl>

                                <dt style="width: 100px;">Overall Record</dt>
                                <dd style="width: 60px;">
                                    <?php echo Helpers::displayRecord($information['rankings_info']->record['OAR']); ?>
                                </dd>
                            
                                <dt style="width: 100px;">League Record</dt>
                                <dd style="width: 60px;">
                                    <?php echo Helpers::displayRecord($information['rankings_info']->record['LR']); ?>
                                </dd>

                                <dt style="width: 100px;">OSAA Rank</dt>
                                <dd style="width: 60px;">
                                    #<?php echo $information['rankings_info']->ranking->rank; ?>
                                </dd>

                            </dl>

                        </div>

                        <div class="float_left" style="width: 170px; padding-right: 5px;">

                            <dl>
                                
                                <dt style="width: 100px;">RPI Record</dt>
                                <dd style="width: 60px;">
                                    <?php echo Helpers::displayRecord($information['rankings_info']->record['RCR']); ?>
                                </dd>                            
                                
                                <dt style="width: 100px;">RPI Rating</dt>
                                <dd style="width: 60px;">
                                    <?php echo number_format($information['rankings_info']->ranking->rpi * 1000, 3, '.', ''); ?>
                                </dd>

                                <dt style="width: 100px;">RPI Rank</dt>
                                <dd style="width: 60px;">
                                    #<?php echo $information['rankings_info']->ranking->rpi_rank; ?>      
                                </dd>                            

                            </dl>
                            
                        </div>

                        <div class="float_left" style="width: 170px;">
                            
                            <dl>
                                
                                <dt style="width: 100px;">Colley Record</dt>
                                <dd style="width: 60px;">
                                    <?php echo Helpers::displayRecord($information['rankings_info']->record['CRR']); ?>
                                </dd>                            

                                <dt style="width: 100px;">Colley Rating</dt>
                                <dd style="width: 60px;">
                                    <?php echo number_format($information['rankings_info']->ranking->colley * 1000, 3, '.', ''); ?>
                                </dd>

                                <dt style="width: 100px;">Colley Rank</dt>
                                <dd style="width: 60px;">
                                    #<?php echo $information['rankings_info']->ranking->colley_rank; ?>                        
                                </dd>                            

                            </dl>

                        </div>
                    </div>

                    <br />

                    <dl>                            
                        <dt style="width: 100px;"><?php echo $information['rankings_info']->ranking->calc_label; ?></dt>
                        <dd style="width: 165px;">
                            <?php echo $information['rankings_info']->ranking->calc_date; ?>
                        </dd>                  

                <?php else: ?>

                    Ranking information is not available.

                <?php endif; ?>            

            </div>
        <?php endif; ?>
        
    </div>        

</div>
