<table class="table">
    <tr>
        <td style="width: 40%; text-align: center;"><h3 class="cont"><?php echo e($game->teamOne); ?></h3></td>
        <td style="background: #b1f10c; color: red; text-align: center; width: 10%" valign="bottom">VS</td>
        <td style="width: 40%; text-align: center;"><h3 class="cont"><?php echo e($game->teamTwo); ?></h3></td>
    </tr>
</table>
<hr>

<div class="container">
<form action="<?php echo e(route('/ajaxTestimonial')); ?>" method="POST" id="testimonial">
    <input type="hidden" name="id" value="<?php echo e($game->id); ?>">
    <div class="form-group col-md-12">
        <label>SELECT POTENTIAL PREDICTION</label>
        <select name="potential" class="form-control" required>
            <option value="">Select here...</option>
            <option value="Full-Time Recommendation : <?php echo e($game->FTRecommendation); ?>"><b>Full-Time Recommendation</b> : <?php echo e($game->FTRecommendation); ?></option>
            <?php if($game->twoDouble=='Yes'): ?><option value="2 Double : <?php echo e($game->FTRecommendation); ?>"><b>2 Double</b> : <?php echo e($game->FTRecommendation); ?></option> <?php endif; ?>
            <?php if($game->threeTreble=='Yes'): ?><option value="3 Treble : <?php echo e($game->FTRecommendation); ?>"><b>3 Treble</b> : <?php echo e($game->FTRecommendation); ?></option> <?php endif; ?>
            <?php if($game->midWeekJackpot=='Yes'): ?><option value="Mid-Week Jackpot : <?php echo e($game->FTRecommendation); ?>"><b>Mid-Week Jackpot</b> : <?php echo e($game->FTRecommendation); ?></option> <?php endif; ?>
            <?php if($game->megaJackpot=='Yes'): ?> <option value="Mega Jackpot : <?php echo e($game->FTRecommendation); ?>"><b>Mega Jackpot</b> : <?php echo e($game->FTRecommendation); ?></option> <?php endif; ?>
            <?php if($game->sportPesa=='Yes'): ?> <option value="Sportpesa : <?php echo e($game->FTRecommendation); ?>"><b>Sportpesa</b> : <?php echo e($game->FTRecommendation); ?></option> <?php endif; ?>
            <option value="Halftime/Fulltime : <?php echo e($game->HTFT); ?>"><b>Halftime/Fulltime</b> : <?php echo e($game->HTFT); ?></option>
            <option value="Correct Score : <?php echo e($game->correctScore); ?>"><b>Correct Score</b> : <?php echo e($game->correctScore); ?></option>
        </select>
    </div>

    <?php echo csrf_field(); ?>


    <div id="teststatus" class="col-xs-6"></div>
    <div class="form-group col-sm-12">
        <button class="btn btn-md btn-success" name="submit" id="submittest">SAVE/DONE</button>
    </div>
</form>
</div>

<script>
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });

    $(document).ready(function () {
        $('#testimonial').submit(function (e) {
            e.preventDefault();
            var id = "<?php echo e($game->id); ?>";
            $('#submittest').prop('disabled', true).html('SAVING');
            var url = $(this).attr('action');

            var dataString = $(this).serialize();
            console.log(dataString);
            $.ajax({
                type: "POST",
                url: url,
                data: dataString,
                dataType: "JSON",
                success: function(data){
                    if (data.status == 1) {
                        $('#submittest').prop('disabled', false).html('SAVE/DONE');
                        swal(data.encounters, '', 'warning');
                        console.log(data);
                    }
                    else{
                        $('#f'+id).css('color', 'green').html('Marked Testimonial');
                        swal(data.encounters, '', 'success');
                        $('#marktest').modal('hide');
                    }
                }
            });

        });
    });
</script>