<?php $__env->startSection('content'); ?>
    <div class="container">
        <div class="page-header">
            <h1>Enter Winners</h1>
            <div class="form-group">
                <label class="control-label" for="">Choose Week:</label>
                <select name="" id="week-select" class="form-control">
                    <?php foreach($weeks as $sweek): ?>
                        <option<?php echo ($sweek->id==$week->id)? ' selected="selected"':''; ?> value="<?php echo e($sweek->id); ?>"><?php echo e($sweek->name); ?></option>
                    <?php endforeach; ?>
                </select>
            </div>
        </div>
        <?php echo Form::open(['action'=>['WinnersController@store']]); ?>

        <input type="hidden" name="week_id" value="<?php echo e($week->id); ?>"/>
        <?php foreach($week->games as $game): ?>
            <section class="game">
                <h2 class=""><?php echo e($game->away_team->name); ?> at <?php echo e($game->home_team->name); ?></h2>
                <div class="radio-inline">
                    <label>
                        <input type="radio" name="<?php echo e($game->id); ?>"
                               value="<?php echo e($game->away_team->id); ?>" <?php echo ($game->winner_id && $game->winner_id==$game->away_team->id)?' checked="checked"':''; ?>>
                        <?php echo e($game->away_team->name); ?>

                    </label>
                </div>
                <div class="radio-inline">
                    <label>
                        <input type="radio" name="<?php echo e($game->id); ?>"
                               value="<?php echo e($game->home_team->id); ?>" <?php echo ($game->winner_id && $game->winner_id==$game->home_team->id)?' checked="checked"':''; ?>>
                        <?php echo e($game->home_team->name); ?>

                    </label>
                </div>
            </section>
        <?php endforeach; ?>
        <button type="submit" class="btn btn-success">Save</button>
        <?php echo Form::close(); ?>









        <?php /*<section class="game">*/ ?>
        <?php /*<h2 class="">Team A vs. Team B</h2>*/ ?>
        <?php /*<div class="radio-inline">*/ ?>
        <?php /*<label>*/ ?>
        <?php /*<input type="radio" name="" value="">*/ ?>
        <?php /*Team A*/ ?>
        <?php /*</label>*/ ?>
        <?php /*</div>*/ ?>
        <?php /*<div class="radio-inline">*/ ?>
        <?php /*<label>*/ ?>
        <?php /*<input type="radio" name="" value="">*/ ?>
        <?php /*Team B*/ ?>
        <?php /*</label>*/ ?>
        <?php /*</div>*/ ?>
        <?php /*</section>    */ ?>
        <?php /*<?php endfor; ?>*/ ?>
        <?php /*<section class="game game-in-progress">*/ ?>
        <?php /*<h2 class="">Team A vs. Team B</h2>*/ ?>
        <?php /*<div class="radio-inline">*/ ?>
        <?php /*<label>*/ ?>
        <?php /*<input type="radio" disabled="diasbled" name="" value="">*/ ?>
        <?php /*Team A*/ ?>
        <?php /*</label>*/ ?>
        <?php /*</div>*/ ?>
        <?php /*<div class="radio-inline">*/ ?>
        <?php /*<label>*/ ?>
        <?php /*<input type="radio" disabled="diasbled" name="" value="">*/ ?>
        <?php /*Team B*/ ?>
        <?php /*</label>*/ ?>
        <?php /*</div>*/ ?>
        <?php /*</section>*/ ?>
        <?php /*<section class="game game-complete">*/ ?>
        <?php /*<h2 class="">Team A vs. Team B</h2>*/ ?>
        <?php /*<div class="has-success">*/ ?>
        <?php /*<div class="radio-inline">*/ ?>
        <?php /*<label class="has-success">*/ ?>
        <?php /*<input type="radio" disabled="diasbled" checked="checked" name="" value="">*/ ?>
        <?php /*Team A*/ ?>
        <?php /*</label>*/ ?>
        <?php /*</div>*/ ?>
        <?php /*</div>*/ ?>
        <?php /*<div class="radio-inline">*/ ?>
        <?php /*<label>*/ ?>
        <?php /*<input type="radio" disabled="diasbled" name="" value="">*/ ?>
        <?php /*Team B*/ ?>
        <?php /*</label>*/ ?>
        <?php /*</div>*/ ?>
        <?php /*</section>*/ ?>
        <?php /*<section class="game game-complete">*/ ?>
        <?php /*<h2 class="">Team A vs. Team B</h2>*/ ?>
        <?php /*<div class="has-error">*/ ?>
        <?php /*<div class="radio-inline">*/ ?>
        <?php /*<label class="has-success">*/ ?>
        <?php /*<input type="radio" disabled="diasbled" name="" checked="checked" value="">*/ ?>
        <?php /*Team A*/ ?>
        <?php /*</label>*/ ?>
        <?php /*</div>*/ ?>
        <?php /*</div>*/ ?>
        <?php /*<div class="radio-inline">*/ ?>
        <?php /*<label>*/ ?>
        <?php /*<input type="radio" disabled="diasbled" name="" value="">*/ ?>
        <?php /*Team B*/ ?>
        <?php /*</label>*/ ?>
        <?php /*</div>*/ ?>
        <?php /*</section>*/ ?>

    </div>
    <script>
        jQuery(document).ready(function () {
            $('#week-select').on('change', function () {
                console.log('change');
                var value = $(this).val();
                console.log(value);
                window.location = '<?php echo e(url('/winners/')); ?>/' + value;
            });
        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.main', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>