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

    OSAA - Submit Scores

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



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

    <?php /*  Scores for <?php echo $information['sub_title']; ?>  */ ?>

    Submit a <?php echo Helpers::getActivityName($information['activity']); ?> 

    <?php if (Helpers::strEqual($information['activity'], array('FBL', 'BBX', 'GBX', 'BBL', 'SBL'))): ?>

        Game

    <?php elseif (Helpers::strEqual($information['activity'], array('VBL', 'BSC', 'GSC'))): ?>

        Match

    <?php endif; ?>

    Result

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



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

    @parent



	

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



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

	$('.tooltip').tooltip();



	$('.button').button();

    $('.button.notext').button({text:false});

    $('.button.add').button({ icons : {primary : 'ui-icon-plus'}});

    $('.button.edit').button({ icons : {primary : 'ui-icon-pencil'}});



	$('#cancel_button').button({ icons : { primary : 'ui-icon-circle-close'}}).css('font-size', '10pt').tooltip().attr('title', 'Cancel editing and do not save changes.');



    $('.button.ot_add').click(function () 

    {

        var i = $(this).attr('extra-data');        



        <?php /* 



            Todo: this needs to be corrected to offset already shown overtimes when editing



         */ ?>



        var a_name = 'ot_A' + i;

        var h_name = 'ot_H' + i;       



        $("input[name='" + a_name + "']").show();

        $("input[name='" + h_name + "']").show();



        $(this).attr('extra-data', parseInt(i) + 1);





        var a_name = 'ot_A' + i;

        

        if ($("input[name='" + a_name + "']").size() < 1)

        {

            $(this).hide();

        }



    });	



    $('.button.ot_add_soccer').click(function ()

    {

        $('input:hidden').show();

        $(this).hide();

    });



    $('[placeholder]').focus(function()

    {

        var input = $(this);

        if (input.val() == input.attr('placeholder'))

        {

            input.val('');

            input.removeClass('placeholder');

        }

    }).blur(function()

    {

        var input = $(this);

        if (input.val() == '' || input.val() == input.attr('placeholder'))

        {

            input.addClass('placeholder');

            input.val(input.attr('placeholder'));

        }

    }).blur();



    $('[placeholder]').parents('form').submit(function()

    {

        $(this).find('[placeholder]').each(function()

        {

            var input = $(this);

            if (input.val() == input.attr('placeholder'))

            {

                input.val('');

            }

        })

    });



    /* Display any success messages */

    $('.success_message').delay(5000).fadeOut({'duration' : 2500});

    $('.success_message .ui-icon-close').click(function ()

    {

        $('.success_message').hide();

    });

   

    // Update forfeit type description and update notes, if not already noted
    $('#is_forfeit').on('change', function()
    {
        updateForfeitDescription();
        var notes = $('[name="notes"]');
        var existing_notes = notes.val();        
        
        var index = existing_notes.indexOf("Forfeit posted by OSAA");

        if (index === -1)
        {
            var forfeit_note = "Forfeit posted by OSAA on <?php echo date('n/j/Y', time()); ?>.";            
            if (existing_notes == "" || existing_notes == notes.attr('placeholder'))
            {                
                notes.val(forfeit_note);             
            }
            else
            {
                notes.val(existing_notes + " " + forfeit_note);
            }

            if (notes.hasClass('placeholder'))
            {
                notes.removeClass('placeholder');
            }

            notes.focus();
        }
    });

    function updateForfeitDescription()
    {
        var holder = $('[name="forfeit-description"]');
        var select = $('#is_forfeit');
        var option = $('option:selected', select);
        var description = option.attr('data-description');

        holder.fadeOut(400, function() {
            holder.text(description);
            holder.fadeIn(400);
        });
    }

    updateForfeitDescription();
  
    
    // Confirm score submission
    $('input[type="submit"]').on('click', function(event)
    {            
        event.preventDefault();
        var form = $('#submit_scores');

        $('<div></div>')
            .appendTo('body')
            .dialog(
            {                       
                draggable : false,
                resizable : false,
                modal : true,
                height : 500,
                width : 600,                    
                title : 'Please Confirm',
                buttons: [                                
                    {
                        text : "Submit Scores",
                        'style' : "float: left;",
                        'data-autofocus' : "true",
                        icons : { primary : 'ui-icon-check'},
                        click : function()
                                {                                        
                                    form.submit();                                    

                                    // Close the dialog box
                                    $(this).dialog("close");                           
                                }
                    },
                    {
                        text : "Cancel",
                        'style' : "float: right;",                                   
                        icons : { primary : 'ui-icon-close'},
                        click : function()
                                {
                                    // Close the dialog box
                                    $(this).dialog("close");                           
                                }
                    }
                ],
                open : function ()
                    {  
                        var away_score = parseInt($('input[name="away_score"]').val());
                        var home_score = parseInt($('input[name="home_score"]').val());

                        var dialog_object = $(this);

                        var html = '<br /><div style="text-align: center; font-weight: bold;">Are You Sure?</div><br /><div style="font-size: 10pt;">Please confirm the following information is correct.<br /><br /><ul style="padding-left: 20px;">';

                        html += '<li>This contest was played on <b><?php echo $information['date']; ?> at <?php echo $information['time']; ?></b>.</li>';
                        html += '<li>The contest was played to completion, or enough to be considered complete.</li>';
                        html += '<li>The contest was not cancelled or postponed.</li>';

                        <?php if (!Auth::user()->isOsaaUser()): ?>
                            html += '<li>Neither team forfeited - if a team did forfeit, do not submit a score and contact the OSAA at (503) 682-6722.</li>';
                        <?php endif; ?>

                        html += '</ul><br />';

                        html += '<div style="font-weight: bold; display: inline-block; width: 20%;">Away Team</div>';
                        html += '<div style="display: inline-block; width: 10%;">' + away_score + '</div>';
                        html += '<div style="display: inline-block; width: 65%;"><?php echo $information['away_team_name']; ?></div>';
                        html += '<br /><br />';

                        html += '<div style="font-weight: bold; display: inline-block; width: 20%;">Home Team</div>';
                        html += '<div style="display: inline-block; width: 10%;">' + home_score + '</div>';
                        html += '<div style="display: inline-block; width: 65%;"><?php echo $information['home_team_name']; ?></div>';
                        html += '<br /><br />';

                        html += '<div class="ui-state-highlight" style="padding:5px;"><div class="ui-icon ui-icon-alert float_left margin-right:1em;"></div> If this information is not correct, <b>DO NOT ENTER A SCORE</b>! Go back to the contest editor and update any contest details.  Once you submit the score, rankings and records will be updated.</div>'

                        dialog_object.html(html);                                   
                        
                        $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt');
                        $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');   

                        $('[data-autofocus="true"]').focus();
                    
                        $('.ui-widget-header').css('background', '#f6a828 url(http://download.jqueryui.com/themeroller/images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x').css('border-color', '#f6a828');                                     
                        $('.ui-widget-content').css('border-color', '#dddddd');
                                            
                        $('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '10pt');
                        $('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');
                    },
                show : { effect : "shake",
                         duration : 200},
                close : function ()
                    {
                        var dialog_object = $(this);
                        $(dialog_object).remove();
                    }                
            });            
    });


   


<?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'); ?>  



    <?php if (Session::get('success')): ?>

        <div class="success_message"><span class="ui-icon ui-icon-close box_icon"></span><span class="ui-icon ui-icon-check" style="display:inline-block;"></span><?php echo Session::get('success'); ?></div>

    <?php endif; ?>   	



	<h2>Contest Information</h2>				 	



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



		<?php if (Session::has('errors')): ?>                

            <div class="error ui-state-error"><span class="ui-icon ui-icon-alert box_icon"></span><?php foreach ($errors->all() as $error): ?><?php echo $error; ?> <?php endforeach; ?></div>

        <?php endif; ?>    



        <?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())); ?>



        <div class="columns">



            <div class="half">





                <div class="input_label">Away Team</div>



                <?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 /><br />





                <div class="input_label">Home Team</div><?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; ?>

               

            </div>



            <div class="half">



                <div class="input_label">Date</div><?php echo $information['date']; ?>



                <br /><br />



                <div class="input_label">Time</div><?php echo $information['time']; ?>        

            </div>



        </div>



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



        <a href="<?php echo url('/contests/' . $information['contest_id'] . '/edit'); ?>" class="button edit tooltip" style="font-size:9pt;" title="Edit contest information like team names, home and away, date, and time.">Edit Contest</a>

        <span class="small gray note">If the information is incorrect, please edit the contest before submitting a score.</span>



        <br /><br />



        <h2>Submit Scores</h2>



        <p>

            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.

            <?php elseif (Helpers::strEqual($information['activity'], 'VBL')): ?>

                Please be sure to enter set scores.

            <?php elseif (Helpers::strEqual($information['activity'], array('BSC', 'GSC'))): ?>                        

                If applicable, you can also optionally enter scores per half, overtime play, 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>        



        <table class="submitScoresTable">

            <thead>

                <tr>

                    <th style="width:50px;">H/A</th>

                    <th style="width:150px; overflow:hidden; text-overflow:ellipsis; white-space: nowrap;">Team</th>                    

                    <th style="width:200px;">Final Score</th>

                    <th style="width:400px;">

                        <?php if (Helpers::strEqual($information['activity'], 'FBL')): ?>

                            Score per Quarter

                            <div class="button notext add tooltip ot_add" style="width:16px; margin-top:-1px;" title="Click to add an overtime period." extra-data="1"></div>

                        <?php elseif (Helpers::strEqual($information['activity'], 'VBL')): ?>

                            Set Scores

                        <?php elseif (Helpers::strEqual($information['activity'], array('BSC', 'GSC'))): ?>                        

                            Score per Half

                            <div class="button notext add tooltip ot_add_soccer" style="width:16px; margin-top:-1px;" title="Click to add overtime." extra-data="1"></div>

                        <?php elseif (Helpers::strEqual($information['activity'], array('BBX', 'GBX'))): ?>

                            Period Scores

                             <div class="button notext add tooltip ot_add" style="width:16px; margin-top:-1px;" title="Click to add an overtime period." extra-data="1"></div>

                        <?php elseif (Helpers::strEqual($information['activity'], array('BBL', 'SBL'))): ?>

                            Innings

                            <div class="button notext add tooltip ot_add" style="width:16px; margin-top:-1px;" title="Click to add an extra inning." extra-data="1"></div>

                        <?php endif; ?>

                    </th>

                </tr>

            </thead>



            <tbody>

                <tr style="height: .75em;"></tr>

                <tr>                    

                    <td class="designation">

                        Away

                    </td>

                    <td>

                        <b>

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

                        </b>

                    </td>

                    <td>

                        <?php echo Form::text('away_score', $information['away_scores']['score'], array('style' => 'width:75px;', 'placeholder' => 'Final')); ?>

                    </td>

                    <td>

                        <?php if (Helpers::strEqual($information['activity'], 'FBL')): ?>

                            <?php echo Form::text('period_A1', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 1), array('style' => 'width:25px;', 'placeholder' => '1st')); ?>

                            <?php echo Form::text('period_A2', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 2), array('style' => 'width:25px;', 'placeholder' => '2nd')); ?>

                            <?php echo Form::text('period_A3', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 3), array('style' => 'width:25px;', 'placeholder' => '3rd')); ?>

                            <?php echo Form::text('period_A4', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 4), array('style' => 'width:25px;', 'placeholder' => '4th')); ?>



                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 5))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A1', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 5), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'OT1')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 6))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A2', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 6), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'OT2')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 7))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A3', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 7), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'OT3')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 8))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A4', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 8), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'OT4')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 9))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A5', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 9), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'OT5')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 10))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A6', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 10), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'OT6')); ?>                            

                          

                        <?php elseif (Helpers::strEqual($information['activity'], 'VBL')): ?>

                            <?php echo Form::text('period_A1', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 1), array('style' => 'width:25px;', 'placeholder' => '1st')); ?>

                            <?php echo Form::text('period_A2', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 2), array('style' => 'width:25px;', 'placeholder' => '2nd')); ?>

                            <?php echo Form::text('period_A3', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 3), array('style' => 'width:25px;', 'placeholder' => '3rd')); ?>

                            <?php echo Form::text('period_A4', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 4), array('style' => 'width:25px;', 'placeholder' => '4th')); ?>

                            <?php echo Form::text('period_A5', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 5), array('style' => 'width:25px;', 'placeholder' => '5th')); ?>

                        

                        <?php elseif (Helpers::strEqual($information['activity'], array('BSC', 'GSC'))): ?>                        

                            <?php echo Form::text('period_A1', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 1), array('style' => 'width:25px;', 'placeholder' => '1st')); ?>

                            <?php echo Form::text('period_A2', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 2), array('style' => 'width:25px;', 'placeholder' => '2nd')); ?>



                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 3))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A1', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 3), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'OT1')); ?>

                            <?php echo Form::text('ot_A2', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 4), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'OT2')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 5))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A3', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 5), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'Kicks')); ?>

                            

                        <?php elseif (Helpers::strEqual($information['activity'], array('BBX', 'GBX'))): ?>

                            <?php echo Form::text('period_A1', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 1), array('style' => 'width:25px;', 'placeholder' => '1st')); ?>

                            <?php echo Form::text('period_A2', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 2), array('style' => 'width:25px;', 'placeholder' => '2nd')); ?>

                            <?php echo Form::text('period_A3', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 3), array('style' => 'width:25px;', 'placeholder' => '3rd')); ?>

                            <?php echo Form::text('period_A4', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 4), array('style' => 'width:25px;', 'placeholder' => '4th')); ?>



                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 5))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A1', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 5), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '5th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 6))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A2', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 6), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '6th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 7))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A3', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 7), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '7th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 8))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A4', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 8), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '8th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 9))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A5', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 9), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '9th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 10))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A6', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 10), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '10th')); ?>

                            

                        <?php elseif (Helpers::strEqual($information['activity'], array('BBL', 'SBL'))): ?>

                            <?php echo Form::text('period_A1', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 1), array('style' => 'width:25px;', 'placeholder' => '1st')); ?> 

                            <?php echo Form::text('period_A2', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 2), array('style' => 'width:25px;', 'placeholder' => '2nd')); ?> 

                            <?php echo Form::text('period_A3', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 3), array('style' => 'width:25px;', 'placeholder' => '3rd')); ?> 

                            <?php echo Form::text('period_A4', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 4), array('style' => 'width:25px;', 'placeholder' => '4th')); ?> 

                            <?php echo Form::text('period_A5', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 5), array('style' => 'width:25px;', 'placeholder' => '5th')); ?> 

                            <?php echo Form::text('period_A6', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 6), array('style' => 'width:25px;', 'placeholder' => '6th')); ?> 

                            <?php echo Form::text('period_A7', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 7), array('style' => 'width:25px;', 'placeholder' => '7th')); ?> 



                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 8))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A1', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 8), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '8th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 9))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A2', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 9), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '9th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 10))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A3', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 10), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '10th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 11))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A4', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 11), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '11th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 12))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A5', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 12), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '12th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 13))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A6', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 13), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '13th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['away_scores']['sub_scores'], 14))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_A7', Helpers::getPeriodScore($information['away_scores']['sub_scores'], 14), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '14th')); ?>                            

                        <?php endif; ?>                    

                    

                    </td>                            

                   

                </tr>



                <tr>                    

                    <td class="designation" style="position: relative;">

                        Home





                         <?php if (Helpers::strEqual($information['activity'], array('BBL', 'SBL'))): ?>



                            <div style="position: absolute; top: 2em; left: 75px; color: #0d581b; width: 200px;">

                            

                                <?php echo Form::label('is_swap_designation', 'Home batted first?', array('style' => 'font-size: 10pt;')); ?>

                                <?php echo Form::checkbox('is_swap_designation', true, $information['contest']->is_swap_designation, array('style' => 'position: relative; top: 2px;')); ?>                        



                            </div>



                        <?php endif; ?>

                

                    </td>

                    <td>

                        <b>

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

                        </b>

                    </td>

                    <td>

                        <?php echo Form::text('home_score', $information['home_scores']['score'], array('style' => 'width:75px;', 'placeholder' => 'Final')); ?>

                    </td>

                    <td>

                        <?php if (Helpers::strEqual($information['activity'], 'FBL')): ?>

                            <?php echo Form::text('period_H1', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 1), array('style' => 'width:25px;', 'placeholder' => '1st')); ?>

                            <?php echo Form::text('period_H2', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 2), array('style' => 'width:25px;', 'placeholder' => '2nd')); ?>

                            <?php echo Form::text('period_H3', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 3), array('style' => 'width:25px;', 'placeholder' => '3rd')); ?>

                            <?php echo Form::text('period_H4', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 4), array('style' => 'width:25px;', 'placeholder' => '4th')); ?>



                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 5))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H1', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 5), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'OT1')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 6))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H2', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 6), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'OT2')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 7))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H3', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 7), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'OT3')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 8))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H4', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 8), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'OT4')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 9))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H5', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 9), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'OT5')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 10))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H6', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 10), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'OT6')); ?>                            

                          

                        <?php elseif (Helpers::strEqual($information['activity'], 'VBL')): ?>

                            <?php echo Form::text('period_H1', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 1), array('style' => 'width:25px;', 'placeholder' => '1st')); ?>

                            <?php echo Form::text('period_H2', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 2), array('style' => 'width:25px;', 'placeholder' => '2nd')); ?>

                            <?php echo Form::text('period_H3', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 3), array('style' => 'width:25px;', 'placeholder' => '3rd')); ?>

                            <?php echo Form::text('period_H4', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 4), array('style' => 'width:25px;', 'placeholder' => '4th')); ?>

                            <?php echo Form::text('period_H5', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 5), array('style' => 'width:25px;', 'placeholder' => '5th')); ?>

                        

                        <?php elseif (Helpers::strEqual($information['activity'], array('BSC', 'GSC'))): ?>                        

                            <?php echo Form::text('period_H1', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 1), array('style' => 'width:25px;', 'placeholder' => '1st')); ?>

                            <?php echo Form::text('period_H2', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 2), array('style' => 'width:25px;', 'placeholder' => '2nd')); ?>



                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 3))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H1', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 3), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'OT1')); ?>

                            <?php echo Form::text('ot_H2', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 4), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'OT2')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 5))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H3', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 5), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => 'Kicks')); ?>

                            

                        <?php elseif (Helpers::strEqual($information['activity'], array('BBX', 'GBX'))): ?>

                            <?php echo Form::text('period_H1', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 1), array('style' => 'width:25px;', 'placeholder' => '1st')); ?>

                            <?php echo Form::text('period_H2', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 2), array('style' => 'width:25px;', 'placeholder' => '2nd')); ?>

                            <?php echo Form::text('period_H3', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 3), array('style' => 'width:25px;', 'placeholder' => '3rd')); ?>

                            <?php echo Form::text('period_H4', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 4), array('style' => 'width:25px;', 'placeholder' => '4th')); ?>



                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 5))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H1', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 5), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '5th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 6))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H2', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 6), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '6th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 7))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H3', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 7), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '7th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 8))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H4', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 8), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '8th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 9))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H5', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 9), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '9th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 10))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H6', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 10), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '10th')); ?>

                            

                        <?php elseif (Helpers::strEqual($information['activity'], array('BBL', 'SBL'))): ?>

                            <?php echo Form::text('period_H1', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 1), array('style' => 'width:25px;', 'placeholder' => '1st')); ?> 

                            <?php echo Form::text('period_H2', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 2), array('style' => 'width:25px;', 'placeholder' => '2nd')); ?> 

                            <?php echo Form::text('period_H3', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 3), array('style' => 'width:25px;', 'placeholder' => '3rd')); ?> 

                            <?php echo Form::text('period_H4', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 4), array('style' => 'width:25px;', 'placeholder' => '4th')); ?> 

                            <?php echo Form::text('period_H5', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 5), array('style' => 'width:25px;', 'placeholder' => '5th')); ?> 

                            <?php echo Form::text('period_H6', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 6), array('style' => 'width:25px;', 'placeholder' => '6th')); ?> 

                            <?php echo Form::text('period_H7', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 7), array('style' => 'width:25px;', 'placeholder' => '7th')); ?> 



                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 8))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H1', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 8), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '8th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 9))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H2', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 9), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '9th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 10))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H3', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 10), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '10th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 11))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H4', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 11), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '11th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 12))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H5', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 12), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '12th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 13))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H6', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 13), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '13th')); ?>

                            <?php $display_none = (is_null(Helpers::getPeriodScore($information['home_scores']['sub_scores'], 14))) ? ' display: none;' : null; ?>

                            <?php echo Form::text('ot_H7', Helpers::getPeriodScore($information['home_scores']['sub_scores'], 14), array('style' => 'width:25px;' . $display_none, 'data-extra' => 'true', 'placeholder' => '14th')); ?>                            

                        <?php endif; ?>                    

                    

                    </td>                            

                   

                </tr>



                



            </tbody>

        </table>



        <br />



        <?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-right: 8px;')); ?>


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

            <br />

            <div class="small gray note">

                These <?php echo $overtime_notes_label; ?> will be displayed on the contest summary or on the bracket for playoff contests.

            </div>



            <br />

        <?php endif; ?>


        <?php /*  Enter Forfeit (OSAA Staff: Gibby, Kyle, Kris)  */ ?>
        <?php if (Auth::user()->isOsaaUser() and Helpers::strEqual(Auth::user()->email, array('gibbyr@osaa.org', 'kyles@osaa.org', 'krisw@osaa.org'))): ?>
            
            <div id="forfeit_area" style="padding: 0.5em 0.5em; margin-bottom: 1em; background-color: #dedede;">

                <b>Mark Contest as Forfeit</b><span class="small gray note" style="margin-left: 40px;">Only available to OSAA Staff: Cindy, Kris, and Gibby</span><br />

                <?php
                    $forfeit_types = forfeittype::orderBy('display_order')
                                                ->get();
                ?>

                <label for="is_forfeit" class="input_label">Type of Forfeit</label>
                <select name="is_forfeit" id="is_forfeit" style="">
                    <option value="0" <?php if (is_null($information['contest']->is_forfeit)): ?> selected="selected" <?php endif; ?> data-description="This contest will not be marked as a forfeit.">None - Not a Forfeiture</option>
                    <?php foreach ($forfeit_types as $forfeit_type): ?>
                        <option
                            value="<?php echo $forfeit_type->id; ?>"
                            data-description="<?php echo $forfeit_type->description; ?>"
                            <?php if ($information['contest']->is_forfeit == $forfeit_type->id): ?> selected="selected" <?php endif; ?>>
                            <?php echo $forfeit_type->name; ?>
                        </option>
                    <?php endforeach; ?>
                </select>
                <br />
                <span class="small gray note" style="margin-left: 170px;">Select a forfeit type to see additional information.  This additional information will automatically be included in the contest's notes section.</span>

                <br /><br />

                <div name="forfeit-description" style="height: 3.5em;"></div>
                
            </div>

            

        <?php endif; ?>



        <b>Contest Notes</b><br />
        <?php echo Form::textarea('notes', $information['notes'], array('style' => 'width:100%; height:5em;',
                                                                'placeholder' => 'Notes, if any')); ?>

         

        


        <div class="horizontal_divider" style="width:100%;"></div>
        
        <br />
        
        <a href="<?php echo url('/contests/' . $information['contest_id'] . '/edit'); ?>" class="button edit tooltip float_left" style="font-size:10pt;" title="Edit contest information like team names, home and away, date, and time.">Postpone Contest</a>

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

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

    <?php echo Form::close(); ?>         

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



