<?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" style="">
        <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="team_photo">
        <?php if (!is_null($information['team_photo'])): ?>
            <img src="<?php echo $information['team_photo']; ?>" alt="" title="" />
        <?php else: ?>
            <p>This team has not provided a team photo.</p>
        <?php endif; ?>
    </div>

    <div class="under_photo">        

        <?php if (Helpers::strEqual($information['ap']->activity, array('FBL'))): ?>
            <div class="roster">
        <?php else: ?>
            <div class="roster" style="width: 45%; margin-left: 0.5in;">
        <?php endif; ?>

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

            <?php if (Helpers::strEqual($information['ap']->activity, array('FBL'))): ?>
                <div class="left">
            <?php else: ?>
                <div class="left" style="width: 100%;">
            <?php endif; ?>

                <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>

                    <?php if (Helpers::strEqual($information['ap']->activity, array('FBL'))): ?>
                        <tbody>
                    <?php else: ?>
                        <tbody style="font-size: 22pt;">
                    <?php endif; ?>
                        <?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 > 37)
                                        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']) > 37): ?>
                <div class="right">

                    <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 > 38): ?>
                            <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>      

        <?php if (Helpers::strEqual($information['ap']->activity, array('FBL'))): ?>
            <div class="schedule">
        <?php else: ?>
            <div class="schedule" style="width: 45%; margin-right: 0.5in;">
        <?php endif; ?>
            <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" style="height: 370px; bottom: 1em;">
            <div class="left">
                <dl>
                    <dt><b>League</b></dt>
                        <dd><?php echo $information['ap']->league; ?> <?php echo Helpers::getLeagueName($information['ap']->league); ?></dd>
                    <dt><b>Location</b></dt>
                        <dd><?php echo $information['school']->location; ?></dd>
                    <dt><b>Mascot</b></dt>
                        <dd><?php echo $information['ap']->getMascotName(); ?></dd>
                    <dt><b>Colors</b></dt>
                        <dd><?php echo $information['ap']->getColorsList(); ?></dd>                    
                </dl>
                <br />           

                <dl>
                     <?php foreach ($information['school_staff'] as $staff): ?>
                    <dt>
                        <b><?php echo $staff['title']; ?></b>
                    </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>
                            <b>
                            <?php if (count($information['team_staff']['Coach'][$information['team']->level]) > 1): ?>
                                Head Coaches
                            <?php else: ?>
                                Head Coach
                            <?php endif; ?>
                            </b>
                        </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>
                            <b>
                            <?php if (count($information['team_staff']['Asst. Coach'][$information['team']->level]) > 1): ?>
                                Assistant Coaches
                            <?php else: ?>
                                Assistant Coach
                            <?php endif; ?>
                            </b>
                        </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>
                            <b>
                            <?php if (count($information['team_staff']['Mngr.'][$information['team']->level]) > 1): ?>
                                Managers
                            <?php else: ?>
                                Manager
                            <?php endif; ?>
                            </b>
                        </dt>
                            <dd>                       
                                <?php echo Helpers::arrayToList($information['team_staff']['Mngr.'][$information['team']->level]); ?>
                            </dd>
                    <?php endif; ?>
                   
                </dl>
            </div>

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