
<form action="<?php echo e(route('/addResult')); ?>" method="POST" id="addresultform">
    <div class="container-fluid">
        <div class="col-xs-12">
            <input type="hidden" name="id" value="<?php echo e($game->id); ?>">
            <div class="col-md-5 col-xs-12" style="background: whitesmoke; padding: 15px;">
                <h1 class="text-center"><?php echo e($game->teamOne); ?></h1><hr>

                <div class="form-group col-md-12 col-xs-12">
                    <label for="score1">SCORE/GOAL(S)</label>
                    <input type="text" name="score1" class="form-control" required value="<?php echo e($game->teamOneScore); ?>">
                </div>

            </div>

            <div class="col-md-2 col-xs-12" style="margin: 10px 0px; background: grey; border-radius: 0px 0px 8px 8px;"><center><span style="padding: 5px 10px; background: grey; color: white; border-radius: 100px; margin-top: -30px;">VS</span></center>
                <br>
                <div class="form-group">
                    <input class="form-control" name="matchdate" id="matchdate" type="text" placeholder="MATCH DATE" required value="<?php echo e($game->gameDate); ?>" disabled>
                </div>
                <div class="form-group">
                    <input class="form-control" name="matchtime" id="matchtime" type="text" placeholder="MATCH TIME" required value="<?php echo e($game->gameTime); ?>" disabled>
                </div>
            </div>

            <div class="col-md-5 col-xs-12" style="background: whitesmoke; padding: 15px;">
                <h1 class="text-center"><?php echo e($game->teamTwo); ?></h1><hr>

                <div class="form-group col-md-12 col-xs-12">
                    <label for="score2">SCORE/GOAL(S)</label>
                    <input type="text" name="score2" class="form-control" value="<?php echo e($game->teamTwoScore); ?>">
                </div>

            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="col-sm-12">
                    <span class="text-danger">If the match is postponed, just type "<strong>pstp</strong>" in the home-team result box!</span>
                </div>
            </div>
        </div>
    </div>
    <hr>
    <div class="col-sm-12">
        <div class="form-group col-sm-6">
            <label>SELECT POTENTIAL PREDICTION</label>
            <select name="potential" class="form-control">
                <option value="">Select here...</option>
                <?php if($game->gameType=='1'): ?>
                    <?php if($game->sure2Odds!='No'): ?><option value="<?php echo e($game->sure2OddsTip); ?>"  <?php if($game->testimonialValue==$game->sure2OddsTip): ?> selected <?php endif; ?>><b>Sure 2 Odds</b> : <?php echo e($game->sure2OddsTip); ?></option> <?php endif; ?>
                    <?php if($game->sure3Odds!='No'): ?><option value="<?php echo e($game->sure3OddsTip); ?>"  <?php if($game->testimonialValue==$game->sure3OddsTip): ?> selected <?php endif; ?>><b>Sure 3 Odds</b> : <?php echo e($game->sure3OddsTip); ?></option> <?php endif; ?>
                    <?php if($game->sure5Odds!='No'): ?><option value="<?php echo e($game->sure5OddsTip); ?>"  <?php if($game->testimonialValue==$game->sure5OddsTip): ?> selected <?php endif; ?>><b>Sure 5 Odds</b> : <?php echo e($game->sure5OddsTip); ?></option> <?php endif; ?>

                    <?php if($game->forteSingle!='No'): ?><option value="<?php echo e($game->forteSingleTip); ?>"  <?php if($game->testimonialValue==$game->forteSingleTip): ?> selected <?php endif; ?>><b>Forte Single</b> : <?php echo e($game->forteSingleTip); ?></option> <?php endif; ?>
                    <?php if($game->forteDouble!='No'): ?><option value="<?php echo e($game->forteDoubleTip); ?>"  <?php if($game->testimonialValue==$game->forteDoubleTip): ?> selected <?php endif; ?>><b>Forte Double</b> : <?php echo e($game->forteDoubleTip); ?></option> <?php endif; ?>

                    <?php if($game->BTTS!=''): ?><option value="BTTS/GG"  <?php if($game->testimonialValue=='BTTS/GG'): ?> selected <?php endif; ?>><b>BTTS/GG</b> : Yes</option> <?php endif; ?>
                    <?php if($game->HTFT!='No'): ?><option value="<?php echo e($game->HTFT); ?>"  <?php if($game->testimonialValue==$game->HTFT): ?> selected <?php endif; ?>><b>HT/FT</b> : <?php echo e($game->HTFT); ?></option> <?php endif; ?>
                    <?php if($game->over35Goals!=''): ?><option value="<?php echo e($game->over35Goals); ?>"  <?php if($game->testimonialValue==$game->over35Goals): ?> selected <?php endif; ?>><b>Over 3.5</b> : <?php echo e($game->over35Goals); ?></option> <?php endif; ?>

                    <?php if($game->weekend=='Yes'): ?><option value="<?php echo e($game->weekendTip); ?>"   <?php if($game->testimonialValue==$game->weekendTip): ?> selected <?php endif; ?>><b>Weekend Tips</b> : <?php echo e($game->weekendTip); ?></option> <?php endif; ?>

                <?php else: ?>
                    <option value="<?php echo e($game->FTRecommendation); ?>" <?php if($game->testimonialValue==$game->FTRecommendation): ?> selected <?php endif; ?>><b>Full-Time Recommendation</b> : <?php echo e($game->FTRecommendation); ?></option>
                    <option value="<?php echo e($game->doubleChance); ?>" <?php if($game->testimonialValue==$game->doubleChance): ?> selected <?php endif; ?>><b>Double Chance</b> : <?php echo e($game->doubleChance); ?></option>
                    <option value="<?php echo e($game->X12); ?>" <?php if($game->testimonialValue==$game->X12): ?> selected <?php endif; ?>><b>1X2</b> : <?php echo e($game->X12); ?></option>
                    <option value="<?php echo e($game->oneFiveGoals); ?>"   <?php if($game->testimonialValue==$game->oneFiveGoals): ?> selected <?php endif; ?>><b>Over 1.5</b> : <?php echo e($game->oneFiveGoals); ?></option>
                    <option value="<?php echo e($game->twoFiveGoals); ?>" <?php if($game->testimonialValue==$game->twoFiveGoals): ?> selected <?php endif; ?>><b>2.5 Goals</b> : <?php echo e($game->twoFiveGoals); ?></option>
                    <option value="<?php echo e($game->over05HT); ?>" <?php if($game->testimonialValue==$game->over05HT): ?> selected <?php endif; ?>><b>Over 0.5 HT</b> : <?php echo e($game->over05HT); ?></option>
                    <option value="<?php echo e($game->DNB); ?>" <?php if($game->testimonialValue==$game->DNB): ?> selected <?php endif; ?>><b>Draw No Bet</b> : <?php echo e($game->DNB); ?></option>
                <?php endif; ?>
            </select>
        </div>
    </div>
    <div class="container-fluid">
        <?php echo csrf_field(); ?>


        <div id="settingstatus" class="col-xs-6"></div>
        <div class="form-group col-sm-12">
            <button class="btn btn-md btn-success" name="submit" id="submitsetting">SAVE & CLOSE</button>
        </div>

    </div>
</form>

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

    $(document).ready(function () {
        $('#addresultform').submit(function (e) {
            e.preventDefault();
            $('#submitsetting').prop('disabled', true).html('SAVING RESULT');
            var url = $(this).attr('action');
            var dataString = $(this).serialize();
            $.ajax({
                type: "POST",
                url: url,
                data: dataString,
                dataType: "JSON",
                success: function(data){
                    if (data.status == 1) {
                        $('#submitsetting').prop('disabled', false).html('SAVE RESULT');
                        swal(data.encounters, '', 'warning');
                    }
                    else{
                        swal(data.encounters, '', 'success');
                        $('#pred<?php echo e($game->id); ?>').css({'background':'lightgreen', 'color':'darkgreen'});
                        $('#addresult').modal('hide');
                    }
                }
            });

        });
    });
</script>