<?php $__env->startSection('page_title'); ?>
    OSAA - Submit Scores
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_sub_title'); ?>    
    Submit Scores -
    <?php echo Helpers::getActivityName($information['activity']); ?> 
<?php $__env->stopSection(); ?>

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

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


<?php $__env->startSection('header_button_left'); ?>
    <a href="#" class="jqm-navmenu-link ui-nodisc-icon ui-alt-icon ui-btn-left ui-btn ui-icon-arrow-l ui-btn-icon-notext ui-corner-all" onClick="window.history.back(); return false;">Back</a>

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

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


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


<?php $__env->startSection('page_functions'); ?>
    <a href="<?php echo Session::get('return_from', URL::previous()); ?>" id="cancel_button">Exit</a>
<?php $__env->stopSection(); ?>


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

<div style="position: relative;">

    <div class="away-team-box">
        <h2 style="text-align: center">
            <?php echo $information['away_team_name']; ?>
            <?php if (!is_null($information['away_team']) and !Helpers::strEqual($information['away_team']->level, 'V')): ?>
                [<?php echo $information['away_team']->level; ?>]
            <?php endif; ?>
            <br>
            <span class="half-faded">Away</span>
        </h2>
    </div>
    <div class="home-team-box">
        
        <h2 style="text-align: center;">
            <?php echo $information['home_team_name']; ?>
            <?php if (!is_null($information['home_team']) and !Helpers::strEqual($information['home_team']->level, 'V')): ?>
                [<?php echo $information['home_team']->level; ?>]
            <?php endif; ?>
            <br>
            <span class="half-faded">Home</span>
        </h2>
    </div>

    <h2 style="text-align: center; width: 100%; font-size: 2em; top: 0; position: absolute;">
        @
    </h2>
</div>



<p style="text-align: center; margin-bottom: 2em;">
    <?php echo $information['date']; ?> <?php echo $information['time']; ?>
</p>

<?php if (Helpers::strEqual($information['activity'], array('BBL', 'SBL'))): ?>
    <a href="<?php echo url('contests/' . $information['contest']->id . '/edit'); ?>" class="ui-btn" style="color: #990000;">Edit / Postpone / Cancel</a>
<?php endif; ?>

<p style="margin-bottom: 3em; font-size: 0.7em">
    For both teams, you must provide the final scores.
    <?php if (Helpers::strEqual($information['activity'], 'FBL')): ?>
        If applicable, you can also optionally enter scores per quarter or overtime notes.
    <?php elseif (Helpers::strEqual($information['activity'], 'VBL')): ?>
        You must enter set scores.
    <?php elseif (Helpers::strEqual($information['activity'], array('BSC', 'GSC'))): ?>
        If applicable, you can also optionally enter scores per half, overtime notes, and results from kicks from the penalty mark.
    <?php elseif (Helpers::strEqual($information['activity'], array('BBX', 'GBX'))): ?>
        If applicable, you can also optionally enter period scores.
    <?php elseif (Helpers::strEqual($information['activity'], array('BBL', 'SBL'))): ?>
        If applicable, you can also optionally enter scores per inning.
    <?php endif; ?>
    You can also enter in notes if you'd like.
</p>


<?php echo Form::open(array('url' => url('/mobile/contests/submit-scores'), 'class' => 'submitScores', 'id' => 'submit_scores')); ?>

    <?php echo Form::hidden('contest_id', $information['contest_id']); ?>
    <?php echo Form::hidden('exists', true); ?>
    <?php echo Session::flash('return_from', Session::get('return_from', URL::previous())); ?>
    
    <ul data-role="listview" class="ui-listview ui-shadow">
        <li data-role="list-divider" role="heading" class="ui-li-divider ui-first-child">
            <h2>Final Scores</h2>
        </li>
        
        
        <li class="ui-field-contain">
            <label for="home_score">
                <?php echo $information['home_team_name']; ?>
                <?php if (!is_null($information['home_team']) and !Helpers::strEqual($information['home_team']->level, 'V')): ?>
                    [<?php echo $information['home_team']->level; ?>]
                <?php endif; ?>
                :
            </label>
            <?php echo Form::text('home_score', $information['home_scores']['score']); ?>
            <div style="float: right;">H</div>
        </li>
        
        <li class="ui-field-contain">
            <label for="away_score">
                <?php echo $information['away_team_name']; ?><?php if (!is_null($information['away_team']) and !Helpers::strEqual($information['away_team']->level, 'V')): ?>
                    [<?php echo $information['away_team']->level; ?>]
                <?php endif; ?>
                :
            </label>
            <?php echo Form::text('away_score', $information['away_scores']['score']); ?>
            <div style="float: right;">A</div>
        </li>
        
        <?php if (Helpers::strEqual($information['activity'], array('BBL', 'SBL'))): ?>

            
                <label for="is_swap_designation" style="margin-top: 3em;">Home batted first?</label>
                <input name="is_swap_designation" type="checkbox" value="1" id="is_swap_designation" style="z-index: 1000;" />                
            

        <?php endif; ?>
        

    
    </ul>







    <ul data-role="listview" class="ui-listview ui-shadow" style="margin-top: 4em; margin-bottom: 3em;">
        <li data-role="list-divider" role="heading" class="ui-li-divider ui-first-child">
            <h2>
                <?php if (Helpers::strEqual($information['activity'], 'FBL')): ?>
                    Quarters:
                <?php elseif (Helpers::strEqual($information['activity'], 'VBL')): ?>
                    Sets:
                <?php elseif (Helpers::strEqual($information['activity'], array('BSC', 'GSC'))): ?>   
                    Score per Half:
                <?php elseif (Helpers::strEqual($information['activity'], array('BBX', 'GBX'))): ?>
                    Periods:
                <?php elseif (Helpers::strEqual($information['activity'], array('BBL', 'SBL'))): ?>
                    Innings:
                <?php endif; ?>
            </h2>
        </li>
        
        
    
        <?php if (Helpers::strEqual($information['activity'], 'FBL')): ?>
            <li class="ui-field-contain">
                <label for="period_A1">
                    <?php echo $information['home_team_name']; ?>
                    <?php if (!is_null($information['home_team']) and !Helpers::strEqual($information['home_team']->level, 'V')): ?>
                        [<?php echo $information['home_team']->level; ?>]
                    <?php endif; ?>
                    :
                </label>
                <?php echo Form::text('period_H1', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 1), array('placeholder' => '1st')); ?>
                <?php echo Form::text('period_H2', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 2), array('placeholder' => '2nd')); ?>
                <?php echo Form::text('period_H3', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 3), array('placeholder' => '3rd')); ?>
                <?php echo Form::text('period_H4', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 4), array('placeholder' => '4th')); ?>
            </li>
            <li class="ui-field-contain">
                <label for="period_A1">
                    <?php echo $information['away_team_name']; ?><?php if (!is_null($information['away_team']) and !Helpers::strEqual($information['away_team']->level, 'V')): ?>
                        [<?php echo $information['away_team']->level; ?>]
                    <?php endif; ?>
                    :
                </label>
                <?php echo Form::text('period_A1', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 1), array('placeholder' => '1st')); ?>
                <?php echo Form::text('period_A2', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 2), array('placeholder' => '2nd')); ?>
                <?php echo Form::text('period_A3', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 3), array('placeholder' => '3rd')); ?>
                <?php echo Form::text('period_A4', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 4), array('placeholder' => '4th')); ?>
            </li>
          
        <?php elseif (Helpers::strEqual($information['activity'], 'VBL')): ?>
            <li class="ui-field-contain">
                <label for="period_A1">
                    <?php echo $information['home_team_name']; ?>
                    <?php if (!is_null($information['home_team']) and !Helpers::strEqual($information['home_team']->level, 'V')): ?>
                        [<?php echo $information['home_team']->level; ?>]
                    <?php endif; ?>
                    :
                </label>
                <?php echo Form::text('period_H1', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 1), array('placeholder' => '1st')); ?>
                <?php echo Form::text('period_H2', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 2), array('placeholder' => '2nd')); ?>
                <?php echo Form::text('period_H3', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 3), array('placeholder' => '3rd')); ?>
                <?php echo Form::text('period_H4', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 4), array('placeholder' => '4th')); ?>
                <?php echo Form::text('period_H5', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 5), array('placeholder' => '5th')); ?>
            </li>
            <li class="ui-field-contain">
                <label for="period_A1">
                    <?php echo $information['away_team_name']; ?><?php if (!is_null($information['away_team']) and !Helpers::strEqual($information['away_team']->level, 'V')): ?>
                        [<?php echo $information['away_team']->level; ?>]
                    <?php endif; ?>
                    :
                </label>
                <?php echo Form::text('period_A1', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 1), array('placeholder' => '1st')); ?>
                <?php echo Form::text('period_A2', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 2), array('placeholder' => '2nd')); ?>
                <?php echo Form::text('period_A3', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 3), array('placeholder' => '3rd')); ?>
                <?php echo Form::text('period_A4', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 4), array('placeholder' => '4th')); ?>
                <?php echo Form::text('period_A5', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 5), array('placeholder' => '5th')); ?>
            </li>
        
        <?php elseif (Helpers::strEqual($information['activity'], array('BSC', 'GSC'))): ?>   
            <li class="ui-field-contain">
                <label for="period_A1">
                    <?php echo $information['home_team_name']; ?>
                    <?php if (!is_null($information['home_team']) and !Helpers::strEqual($information['home_team']->level, 'V')): ?>
                        [<?php echo $information['home_team']->level; ?>]
                    <?php endif; ?>
                    :
                </label>
                <?php echo Form::text('period_H1', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 1), array('placeholder' => '1st')); ?>
                <?php echo Form::text('period_H2', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 2), array('placeholder' => '2nd')); ?>
            </li>
            <li class="ui-field-contain">
                <label for="period_A1">
                    <?php echo $information['away_team_name']; ?><?php if (!is_null($information['away_team']) and !Helpers::strEqual($information['away_team']->level, 'V')): ?>
                        [<?php echo $information['away_team']->level; ?>]
                    <?php endif; ?>
                    :
                </label>
                <?php echo Form::text('period_A1', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 1), array('placeholder' => '1st')); ?>
                <?php echo Form::text('period_A2', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 2), array('placeholder' => '2nd')); ?>
            </li>
            
            
        <?php elseif (Helpers::strEqual($information['activity'], array('BBX', 'GBX'))): ?>
            <li class="ui-field-contain">
                <label for="period_A1">
                    <?php echo $information['home_team_name']; ?>
                    <?php if (!is_null($information['home_team']) and !Helpers::strEqual($information['home_team']->level, 'V')): ?>
                        [<?php echo $information['home_team']->level; ?>]
                    <?php endif; ?>
                    :
                </label>
                <?php echo Form::text('period_H1', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 1), array('placeholder' => '1st')); ?>
                <?php echo Form::text('period_H2', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 2), array('placeholder' => '2nd')); ?>
                <?php echo Form::text('period_H3', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 3), array('placeholder' => '3rd')); ?>
                <?php echo Form::text('period_H4', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 4), array('placeholder' => '4th')); ?>
            </li>
            <li class="ui-field-contain">
                <label for="period_A1">
                    <?php echo $information['away_team_name']; ?><?php if (!is_null($information['away_team']) and !Helpers::strEqual($information['away_team']->level, 'V')): ?>
                        [<?php echo $information['away_team']->level; ?>]
                    <?php endif; ?>
                    :
                </label>
                <?php echo Form::text('period_A1', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 1), array('placeholder' => '1st')); ?>
                <?php echo Form::text('period_A2', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 2), array('placeholder' => '2nd')); ?>
                <?php echo Form::text('period_A3', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 3), array('placeholder' => '3rd')); ?>
                <?php echo Form::text('period_A4', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 4), array('placeholder' => '4th')); ?>
            </li>
            
        <?php elseif (Helpers::strEqual($information['activity'], array('BBL', 'SBL'))): ?>
        
            
            <li class="ui-field-contain">
                <label for="period_A1">
                    <?php echo $information['home_team_name']; ?>
                    <?php if (!is_null($information['home_team']) and !Helpers::strEqual($information['home_team']->level, 'V')): ?>
                        [<?php echo $information['home_team']->level; ?>]
                    <?php endif; ?>
                    :
                </label>
                <?php echo Form::text('period_H1', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 1), array('placeholder' => '1st')); ?>
                <?php echo Form::text('period_H2', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 2), array('placeholder' => '2nd')); ?>
                <?php echo Form::text('period_H3', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 3), array('placeholder' => '3rd')); ?>
                <?php echo Form::text('period_H4', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 4), array('placeholder' => '4th')); ?>
                <?php echo Form::text('period_H5', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 5), array('placeholder' => '5th')); ?>
                <?php echo Form::text('period_H6', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 6), array('placeholder' => '6th')); ?>
                <?php echo Form::text('period_H7', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 7), array('placeholder' => '7th')); ?>
            </li>
            
            <li class="ui-field-contain">
                <label for="period_A1">
                    <?php echo $information['away_team_name']; ?><?php if (!is_null($information['away_team']) and !Helpers::strEqual($information['away_team']->level, 'V')): ?>
                        [<?php echo $information['away_team']->level; ?>]
                    <?php endif; ?>
                    :
                </label>
                <?php echo Form::text('period_A1', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 1), array('placeholder' => '1st')); ?>
                <?php echo Form::text('period_A2', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 2), array('placeholder' => '2nd')); ?>
                <?php echo Form::text('period_A3', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 3), array('placeholder' => '3rd')); ?>
                <?php echo Form::text('period_A4', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 4), array('placeholder' => '4th')); ?>
                <?php echo Form::text('period_A5', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 5), array('placeholder' => '5th')); ?>
                <?php echo Form::text('period_A6', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 6), array('placeholder' => '6th')); ?>
                <?php echo Form::text('period_A7', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 7), array('placeholder' => '7th')); ?>
            </li>
        <?php endif; ?>
    </ul>


    <?php
        if (Helpers::strEqual($information['activity'], array('FBL')))
        {
            $overtime_notes_label = 'Overtime Notes';
            $overtime_notes_place = 'Ex: "OT", "2OT"';
        }
        if (Helpers::strEqual($information['activity'], array('BSC', 'GSC')))
        {
            $overtime_notes_label = 'Overtime Notes';
            $overtime_notes_place = 'Ex: "OT", "OT, PK 3-2"';
        }
        if (Helpers::strEqual($information['activity'], array('BBX', 'GBX')))
        {
            $overtime_notes_label = 'Overtime Notes';
            $overtime_notes_place = 'Ex: "OT", "2OT"';
        }
        if (Helpers::strEqual($information['activity'], array('BBL', 'SBL')))
        {
            $overtime_notes_label = 'Inning Notes';
            $overtime_notes_place = '5 inn., 9 inn. (if not 7)';
        }
    ?>

    <?php if (isset($overtime_notes_label)): ?>


        <?php echo Form::label('overtime_notes', $overtime_notes_label, array('style' => 'font-weight: bold; margin-top: 2em;')); ?>

        <?php echo Form::text('overtime_notes', $information['overtime_notes'], array('placeholder' => $overtime_notes_place)); ?>
    <?php endif; ?>

    <?php echo Form::label('notes', "Additional notes, if any", array('style' => 'font-weight: bold; margin-top: 2em;')); ?>
    <?php echo Form::textarea('notes', $information['notes'], array('placeholder' => '')); ?>
     

    <?php echo Form::submit('Submit Scores', array('class' => 'button float_right tooltip', 'title' => 'Save all information and submit scores for this contest.')); ?>


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