<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="#" 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="Draw Odd : <?php echo e($game->drawodd); ?>"><b>Draw Odd</b> : <?php echo e($game->drawodd); ?></option>
            <option value="Full-Time Recommendation : <?php echo e($game->ft_recommendation); ?>"><b>Full-Time Recommendation</b> : <?php echo e($game->ft_recommendation); ?></option>
            <option value="1st Half Goals : <?php echo e($game->firsthalf_goals); ?>"><b>1st Half Goals</b> : <?php echo e($game->firsthalf_goals); ?></option>
            <option value="1st Half Result : <?php echo e($game->firsthalf_result); ?>"><b>1st Half Result</b> : <?php echo e($game->firsthalf_result); ?></option>
            <option value="Double Chance : <?php echo e($game->double_chance); ?>"><b>Double Chance</b> : <?php echo e($game->double_chance); ?></option>
            <option value="1.5 Goals : <?php echo e($game->onefive_goals); ?>"><b>1.5 Goals</b> : <?php echo e($game->onefive_goals); ?></option>
            <option value="2.5 Goals : <?php echo e($game->twofive_goals); ?>"><b>2.5 Goals</b> : <?php echo e($game->twofive_goals); ?></option>
            <option value="3.5 Goals : <?php echo e($game->threefive_goals); ?>"><b>3.5 Goals</b> : <?php echo e($game->threefive_goals); ?></option>
            <option value="Both Team To Score : <?php echo e($game->both_team_score); ?>"><b>Both Team To Score</b> : <?php echo e($game->both_team_score); ?></option>
            <option value="1st Half Result : <?php echo e($game->firsthalf_result); ?>"><b>1st Half Result</b> : <?php echo e($game->firsthalf_result); ?></option>
            <option value="Win Either Half : <?php echo e($game->win_either_half); ?>"><b>Win Either Half</b> : <?php echo e($game->win_either_half); ?></option>
            <option value="Win Both Halves : <?php echo e($game->win_both_half); ?>"><b>Win Both Half</b> : <?php echo e($game->win_both_half); ?></option>
            <option value="Score Both Halves : <?php echo e($game->score_both_half); ?>"><b>Score Both Half</b> : <?php echo e($game->score_both_half); ?></option>
            <option value="1st 15Mins Draw : <?php echo e($game->first15mins_draw); ?>"><b>1st 15Mins Draw</b> : <?php echo e($game->first15mins_draw); ?></option>
            <option value="Value Stake : <?php echo e($game->value_stakes); ?>"><b>Value Stake</b> : <?php echo e($game->value_stakes); ?></option>
            <option value="Draw : <?php echo e($game->draw_option); ?>"><b>Draw</b> : <?php echo e($game->draw_option); ?></option>
            <option value="Highest Scoring Half : <?php echo e($game->highest_scoring_half); ?>"><b>Highest Scoring Half</b> : <?php echo e($game->highest_scoring_half); ?></option>
            <option value="Double Chance/BTTS : <?php echo e($game->double_chance_btts); ?>"><b>Double Chance/BTTS</b> : <?php echo e($game->double_chance_btts); ?></option>
            <option value="Handicap (0:1, 1:0) : <?php echo e($game->handicap_one); ?>"><b>Handicap (0:1, 1:0)</b> : <?php echo e($game->handicap_one); ?></option>
            <option value="Handicap (0:2, 2:0) : <?php echo e($game->handicap_two); ?>"><b>Handicap (0:2, 2:0)</b> : <?php echo e($game->handicap_two); ?></option>
            <option value="1X2/BTTS : <?php echo e($game->x2btts); ?>"><b>1X2/BTTS</b> : <?php echo e($game->x2btts); ?></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); ?>";
            $('#teststatus').html('Updating... Please wait');
            $('#submittest').prop('disabled', true);

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

        });
    });
</script>