
<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="number" name="score1" class="form-control" required maxlength="5" min="0" 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="number" name="score2" class="form-control" required maxlength="5" min="0" value="<?php echo e($game->teamTwoScore); ?>">
                </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=='Yes'): ?><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->over05HT!=''): ?><option value="<?php echo e($game->over05HT); ?>"  <?php if($game->testimonialValue==$game->over05HT): ?> selected <?php endif; ?>><b>Over 0.5HT</b> : <?php echo e($game->over05HT); ?></option> <?php endif; ?>
                    <?php if($game->fullTimeDraw!=''): ?><option value="<?php echo e($game->fullTimeDraw); ?>"  <?php if($game->testimonialValue==$game->fullTimeDraw): ?> selected <?php endif; ?>><b>Fulltime Draw</b> : <?php echo e($game->over05HT); ?></option> <?php endif; ?>
                    <?php if($game->homeAwayScore!=''): ?><option value="<?php echo e($game->homeAwayScore); ?>"  <?php if($game->testimonialValue==$game->homeAwayScore): ?> selected <?php endif; ?>><b>Home/Away</b> : <?php echo e($game->over05HT); ?></option> <?php endif; ?>

                    <?php if($game->sure3Odds=='Yes'): ?><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=='Yes'): ?><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->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 if($game->drawNoBet!=''): ?><option value="<?php echo e($game->drawNoBet); ?>"   <?php if($game->testimonialValue==$game->drawNoBet): ?> selected <?php endif; ?>><b>DNB</b> : <?php echo e($game->drawNoBet); ?></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->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>
                    <?php /*<option value="<?php echo e($game->overZeroFiveHT); ?>" <?php if($game->testimonialValue==$game->overZeroFiveHT): ?> selected <?php endif; ?>><b>Over 0.5 HT</b> : <?php echo e($game->overZeroFiveHT); ?></option>*/ ?>
                    <option value="<?php echo e($game->BTTS); ?>" <?php if($game->testimonialValue==$game->BTTS): ?> selected <?php endif; ?>><b>BTTS/GG</b> : <?php echo e($game->BTTS); ?></option>
                    <?php /*<option value="<?php echo e($game->draws); ?>" <?php if($game->testimonialValue==$game->draws): ?> selected <?php endif; ?>><b>Draws</b> : <?php echo e($game->draws); ?></option>*/ ?>
                    <?php /*<option value="<?php echo e($game->handicap); ?>" <?php if($game->testimonialValue==$game->handicap): ?> selected <?php endif; ?>><b>Handicap</b> : <?php echo e($game->handicap); ?></option>*/ ?>
                    <?php /*<option value="<?php echo e($game->drawNoBet); ?>" <?php if($game->testimonialValue==$game->drawNoBet): ?> selected <?php endif; ?>><b>Draw No Bet</b> : <?php echo e($game->drawNoBet); ?></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>