<?php $__env->startSection('css_link'); ?>
    <link rel="stylesheet" type="text/css" href="<?php echo asset('css/pdf.css'); ?>" media="screen,print">                
<?php $__env->stopSection(); ?>

<?php $__env->startSection('main_content'); ?>
    
    
    <div class="header">        
        <div class="info">
            <div class="year">
                <?php if (Helpers::strEqual($information['ap']->season, 'F')): ?>
                    <?php echo $information['ap']->school_year; ?>
                <?php elseif (Helpers::strEqual($information['ap']->season, 'W')): ?>
                    <?php echo $information['ap']->school_year; ?>-<?php echo substr($information['ap']->school_year, 2, 2) + 1; ?>
                <?php elseif (Helpers::strEqual($information['ap']->season, 'S')): ?>
                    <?php echo $information['ap']->school_year + 1; ?> 
                <?php endif; ?>   
            </div>
            <div class="division"><?php echo $information['ap']->division; ?></div>
            <div class="activity"><?php echo Helpers::getActivityName($information['ap']->activity); ?></div>       
        </div>
    </div>       

    <div class="footer">
        <div class="osaa">Oregon School Activities Association</div>
        <div class="osaa_website">www.osaa.org</div>                
    </div>

    <div class="team_name">
        <?php echo $information['ap']->name; ?>
        <?php echo $information['school']->mascot_name; ?>        
    </div>

    <div class="roster">
        <div class="title"><?php echo Helpers::getLevelName($information['team']->level); ?> Roster</div>

        <table>
            <thead>
                <th>No.</th>
                <th>Name</th>
                <th>Pos.</th>
                <th>Yr.</th>
                <th>Ht.</th>
                <?php if (Helpers::strEqual($information['ap']->activity, array('FBL', 'WRE'))): ?>
                    <th>Wt.</th>
                <?php endif; ?>                
            </thead>

            <tbody>
                <?php if (count($information['roster']) > 0): ?>
                    <?php $i = 0; ?>
                    <?php foreach ($information['roster'] as $player): ?>
                        <?php $i++; ?>
                        <tr <?php if ($i % 2 == 0): ?> class="row_offset" <?php endif; ?>>
                            <td><?php echo $player->number; ?></td>
                            <td><?php echo $player->name; ?></td>
                            <td><?php echo $player->position; ?></td>
                            <td><?php echo $player->grade; ?></td>
                            <td><?php echo $player->height; ?></td>
                            <?php if (Helpers::strEqual($information['ap']->activity, array('FBL', 'WRE'))): ?>
                                <td><?php echo $player->weight; ?></td>
                            <?php endif; ?>
                        </tr>
                        <?php
                            if ($i > 52)
                                break;
                        ?>
                    <?php endforeach; ?>
                <?php else: ?>
                    <?php if (Helpers::strEqual($information['ap']->activity, array('FBL', 'WRE'))): ?>
                        <td colspan="6" style="text-align: center;">Team roster was not provided by the school.</td>
                    <?php else: ?>
                        <td colspan="5" style="text-align: center;">Team roster was not provided by the school.</td>
                    <?php endif; ?>
                <?php endif; ?>
            </tbody>
        </table>
    </div>   

    <?php if (count($information['roster']) > 52): ?>
        <div class="schedule" style="margin-bottom:5em;">          
        
            <div class="title">&nbsp;</div>
            
            <table>
                <thead>
                    <th>No.</th>
                    <th>Name</th>
                    <th>Pos.</th>
                    <th>Yr.</th>
                    <th>Ht.</th>
                    <?php if (Helpers::strEqual($information['ap']->activity, array('FBL', 'WRE'))): ?>
                        <th>Wt.</th>
                    <?php endif; ?>                
                </thead>

                <tbody>
                    
                    <?php $i = 0; ?>                       
                    
                    <?php foreach ($information['roster'] as $player): ?>
                        <?php $i++; ?>
                        <?php if ($i > 53): ?>
                        <tr <?php if ($i % 2 == 0): ?> class="row_offset" <?php endif; ?>>
                            <td><?php echo $player->number; ?></td>
                            <td><?php echo $player->name; ?></td>
                            <td><?php echo $player->position; ?></td>
                            <td><?php echo $player->grade; ?></td>
                            <td><?php echo $player->height; ?></td>
                            <?php if (Helpers::strEqual($information['ap']->activity, array('FBL', 'WRE'))): ?>
                                <td><?php echo $player->weight; ?></td>
                            <?php endif; ?>
                        </tr>
                        <?php endif; ?>
                        
                    <?php endforeach; ?>
                    
                </tbody>
            </table>
        </div>        
    <?php endif; ?>

    <div class="schedule">
        <div class="title">Schedule<?php echo $information['overall_record']; ?></div>

        <table>
            <thead>
                <th class="date">Date</th>
                <th class="opponent">Opponent</th>
                <th class="result">Result</th>                
            </thead>

            <tbody>
                <?php if (count($information['schedule']) > 0): ?>
                    <?php $i = 0; ?>
                    <?php foreach ($information['schedule'] as $contest): ?>
                        <?php
                            // Skip jamborees
                            if ($contest['contest']->contest_type == 'J') continue;
                        ?>

                        <?php $i++; ?>
                        <tr <?php if ($i % 2 == 0): ?> class="row_offset" <?php endif; ?>>
                            <td class="date"><?php echo date('n/j', strtotime($contest['event']->start_at)); ?></td>
                            <td class="opponent"><?php echo $contest['contest']->opponent_name; ?></td>
                            <td class="result">
                                <?php if ($contest['event']->event_status == 'CXL'): ?>
                                    Canceled
                                <?php else: ?>
                                    <?php echo $contest['results']; ?>
                                <?php endif; ?>
                            </td>
                        </tr>
                    <?php endforeach; ?>
                <?php endif; ?>
            </tbody>
        </table>
    </div> 
    

    <div class="contacts">
        <div class="left">
            <dl>
                <dt>League</dt>
                    <dd><?php echo $information['ap']->league; ?> <?php echo Helpers::getLeagueName($information['ap']->league); ?></dd>
                <dt>Mascot</dt>
                    <dd><?php echo $information['ap']->getMascotName(); ?></dd>
                <dt>Colors</dt>
                    <dd><?php echo $information['ap']->getColorsList(); ?></dd>
            </dl>
            <br />           

            <dl>
                 <?php foreach ($information['school_staff'] as $staff): ?>
                <dt>
                    <?php echo $staff['title']; ?>
                </dt>
                    <dd>                       
                        <?php echo $staff['name']; ?>
                    </dd>
                <?php endforeach; ?>
            </dl>

        </div>

        <div class="logo">            
            <?php if(!is_null($information['school_logo'])): ?>
                <img src="<?php echo $information['school_logo']; ?>" alt="" title="" style="width:256px; height:256px;" />
            <?php endif; ?>
        </div>

        <div class="right">
            <dl>
                <?php if (count($information['team_staff']['Coach'][$information['team']->level]) > 0): ?>
                    <dt>
                        <?php if (count($information['team_staff']['Coach'][$information['team']->level]) > 1): ?>
                            Head Coaches
                        <?php else: ?>
                            Head Coach
                        <?php endif; ?>
                    </dt>
                        <dd>                       
                            <?php echo Helpers::arrayToList($information['team_staff']['Coach'][$information['team']->level]); ?>
                        </dd>
                <?php endif; ?>
                
                <?php if (count($information['team_staff']['Asst. Coach'][$information['team']->level]) > 0): ?>
                    <dt>
                        <?php if (count($information['team_staff']['Asst. Coach'][$information['team']->level]) > 1): ?>
                            Assistant Coaches
                        <?php else: ?>
                            Assistant Coach
                        <?php endif; ?>
                    </dt>
                        <dd>                       
                            <?php echo Helpers::arrayToList($information['team_staff']['Asst. Coach'][$information['team']->level]); ?>
                        </dd>
                <?php endif; ?>
                
                <?php if (count($information['team_staff']['Mngr.'][$information['team']->level]) > 0): ?>
                    <dt>
                        <?php if (count($information['team_staff']['Mngr.'][$information['team']->level]) > 1): ?>
                            Managers
                        <?php else: ?>
                            Manager
                        <?php endif; ?>
                    </dt>
                        <dd>                       
                            <?php echo Helpers::arrayToList($information['team_staff']['Mngr.'][$information['team']->level]); ?>
                        </dd>
                <?php endif; ?>
               
            </dl>
        </div>

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