<form action="<?php echo e(route('/ajaxVIPGameUpdate')); ?>/<?php echo e($game->id); ?>/<?php echo e($datain); ?>" method="POST" id="updateForm">
    <div class="container-fluid">
        <div class="col-xs-12">
            <div class="col-md-5 col-xs-12" style="background: whitesmoke; padding: 15px;">
                <div class="form-group col-xs-12">
                    <input type="text" name="teamOne" class="form-control" placeholder="TEAM ONE *" value="<?php echo e($game->teamOne); ?>" required>
                    <input type="hidden" value="<?php echo e($game->gameType); ?>" name="gameType" required>
                </div>
                <div class="form-group col-md-6 col-xs-12">
                    <label for="team1odd">FORM</label>
                    <input type="text" name="teamOneForm" placeholder="eg. WWWLD" class="form-control" value="<?php echo e($game->teamOneForm); ?>" maxlength="5">
                </div>
                <div class="form-group col-md-6 col-xs-12">
                    <label for="team1odd">ODDS</label>
                    <input type="text" name="teamOneOdds" placeholder="eg. 1.5" class="form-control" value="<?php echo e($game->teamOneOdds); ?>">
                </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>
                <?php /*<div class="form-group">*/ ?>
                    <?php /*<input class="form-control" name="drawOdd" type="text" value="<?php echo e($game->drawOdd); ?>" placeholder="DRAW ODD">*/ ?>
                <?php /*</div>*/ ?>
                <div class="form-group">
                    <input class="form-control" name="gameDate" id="matchdate" type="text" placeholder="MATCH DATE *" value="<?php echo e($game->gameDate); ?>" required>
                </div>
                <div class="form-group">
                    <input class="form-control" name="gameTime" id="matchtime" type="text" placeholder="MATCH TIME *" value="<?php echo e($game->gameTime); ?>" required>
                </div>
                <div class="form-group">
                    <select name="league" class="form-control select2" required>
                        <?php foreach($allleagues->all() as $leagues): ?>
                            <option value="<?php echo e($leagues->code); ?>" <?php if($game->league==$leagues->code): ?> selected <?php endif; ?>><?php echo e($leagues->code); ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
            </div>

            <div class="col-md-5 col-xs-12" style="background: whitesmoke; padding: 15px;">
                <div class="form-group col-xs-12">
                    <input type="text" name="teamTwo" class="form-control" placeholder="TEAM TWO *" value="<?php echo e($game->teamTwo); ?>" required>
                </div>

                <div class="form-group col-md-6 col-xs-12">
                    <label for="team1odd">FORM</label>
                    <input type="text" name="teamTwoForm" placeholder="eg. WWWLD" class="form-control" value="<?php echo e($game->teamTwoForm); ?>" maxlength="5">
                </div>
                <div class="form-group col-md-6 col-xs-12">
                    <label for="team1odd">ODDS</label>
                    <input type="text" name="teamTwoOdds" placeholder="eg. 1.5" class="form-control" value="<?php echo e($game->teamTwoOdds); ?>">
                </div>
            </div>
        </div>
    </div>
    <hr>
    <div class="col-sm-12"><h4>SILVER PACKAGE TIPS</h4></div>
    <div class="container-fluid">
        <div class="form-group col-md-4 bg-danger" style="padding: 10px;">
            <div class="row">
                <div class="col-sm-4">
                    <label>2 ODDS</label>
                    <select name="sure2Odds" class="form-control">
                        <option value="Yes" <?php if($game->sure2Odds=='Yes'): ?> selected <?php endif; ?>>Yes</option>
                        <option value="No" <?php if($game->sure2Odds=='No'): ?> selected <?php endif; ?>>No</option>
                    </select>
                </div>
                <div class="col-sm-4">
                    <label>PREDICTION</label>
                    <input type="text" name="sure2OddsTip" value="<?php echo e($game->sure2OddsTip); ?>" class="form-control">
                </div>
                <div class="col-sm-4">
                    <label>ODD</label>
                    <input type="text" name="sure2OddsOdds" value="<?php echo e($game->sure2OddsOdds); ?>" class="form-control">
                </div>
            </div>
        </div>

        <div class="form-group col-md-4 bg-success" style="padding: 10px;">
            <div class="row">
                <div class="col-sm-6">
                    <label>OVER 0.5 GOALS HT</label>
                    <select name="over05HT" class="form-control">
                        <option value="">*-*-*-*-*-*-*-*-*-*</option>
                        <option value="Over 0.5" <?php if($game->over05HT=='Over 0.5'): ?> selected <?php endif; ?>>Over 0.5</option>
                        <option value="Under 0.5" <?php if($game->over05HT=='Under 0.5'): ?> selected <?php endif; ?>>Under 0.5</option>
                    </select>
                </div>
                <div class="col-sm-6">
                    <label>ODD</label>
                    <input type="text" name="over05HTOdds" value="<?php echo e($game->over05HTOdds); ?>" class="form-control">
                </div>
            </div>
        </div>

        <div class="form-group col-md-4 bg-danger" style="padding: 10px;">
            <div class="row">
                <div class="col-sm-6">
                    <label>FULLTIME DRAW</label>
                    <select name="fullTimeDraw" class="form-control">
                        <option value="">*-*-*-*-*-*-*-*-*-*</option>
                        <option value="Yes" <?php if($game->fullTimeDraw=='Yes'): ?> selected <?php endif; ?>>Yes</option>
                        <option value="No"  <?php if($game->fullTimeDraw=='No'): ?> selected <?php endif; ?>>No</option>
                    </select>
                </div>
                <div class="col-sm-6">
                    <label>ODD</label>
                    <input type="text" name="fullTimeDrawOdds" value="<?php echo e($game->fullTimeDrawOdds); ?>" class="form-control">
                </div>
            </div>
        </div>

        <div class="form-group col-md-4 bg-success" style="padding: 10px;">
            <div class="row">
                <div class="col-sm-6">
                    <label>HOME/AWAY</label>
                    <select name="homeAwayScore" class="form-control">
                        <option value="">*-*-*-*-*-*-*-*-*-*</option>
                        <option value="Home To Score" <?php if($game->homeAwayScore=='Home To Score'): ?> selected <?php endif; ?>>Home To Score</option>
                        <option value="Away To Score" <?php if($game->homeAwayScore=='Away To Score'): ?> selected <?php endif; ?>>Away To Score</option>
                    </select>
                </div>
                <div class="col-sm-6">
                    <label>ODD</label>
                    <input type="text" name="homeAwayScoreOdds" value="<?php echo e($game->homeAwayScoreOdds); ?>" class="form-control">
                </div>
            </div>
        </div>

    </div>
    <hr>
    <div class="col-sm-12"><h4>GOLD PACKAGE TIPS</h4></div>
    <div class="row">
        <div class="col-sm-12">
            <div class="col-sm-12">
                <div class="form-group col-md-4 bg-primary" style="padding: 10px;">
                    <div class="row">
                        <div class="col-sm-4">
                            <label>3 ODDS</label>
                            <select name="sure3Odds" class="form-control">
                                <option value="Yes" <?php if($game->sure3Odds=='Yes'): ?> selected <?php endif; ?>>Yes</option>
                                <option value="No" <?php if($game->sure3Odds=='No'): ?> selected <?php endif; ?>>No</option>
                            </select>
                        </div>
                        <div class="col-sm-4">
                            <label>PREDICTION</label>
                            <input type="text" name="sure3OddsTip" value="<?php echo e($game->sure3OddsTip); ?>" class="form-control">
                        </div>
                        <div class="col-sm-4">
                            <label>ODD</label>
                            <input type="text" name="sure3OddsOdds" value="<?php echo e($game->sure3OddsOdds); ?>" class="form-control">
                        </div>
                    </div>
                </div>
                <div class="form-group col-md-4 bg-danger" style="padding: 10px;">
                    <div class="row">
                        <div class="col-sm-4">
                            <label>5 ODDS</label>
                            <select name="sure5Odds" class="form-control">
                                <option value="Yes" <?php if($game->sure5Odds=='Yes'): ?> selected <?php endif; ?>>Yes</option>
                                <option value="No" <?php if($game->sure5Odds=='No'): ?> selected <?php endif; ?>>No</option>
                            </select>
                        </div>
                        <div class="col-sm-4">
                            <label>TIP</label>
                            <input type="text" name="sure5OddsTip" value="<?php echo e($game->sure5OddsTip); ?>" class="form-control">
                        </div>
                        <div class="col-sm-4">
                            <label>ODD</label>
                            <input type="text" name="sure5OddsOdds" value="<?php echo e($game->sure5OddsOdds); ?>" class="form-control">
                        </div>
                    </div>
                </div>

                <div class="form-group col-md-4 bg-success" style="padding: 10px;">
                    <div class="row">
                        <div class="col-sm-4">
                            <label>WEEKEND</label>
                            <select name="weekend" class="form-control">
                                <option value="Yes" <?php if($game->weekend=='Yes'): ?> selected <?php endif; ?>>Yes</option>
                                <option value="No" <?php if($game->weekend=='No'): ?> selected <?php endif; ?>>No</option>
                            </select>
                        </div>
                        <div class="col-sm-4">
                            <label>TIP</label>
                            <input type="text" name="weekendTip" value="<?php echo e($game->weekendTip); ?>" class="form-control">
                        </div>
                        <div class="col-sm-4">
                            <label>ODD</label>
                            <input type="text" name="weekendOdds" value="<?php echo e($game->weekendOdds); ?>" class="form-control">
                        </div>
                    </div>
                </div>

                <div class="form-group col-md-4 bg-danger" style="padding: 10px;">
                    <div class="row">
                        <div class="col-sm-6">
                            <label>DRAW NO BET</label>
                            <select name="drawNoBet" class="form-control">
                                <option value="">*-*-*-*-*-*-*-*-*-</option>
                                <option value="1 DNB" <?php if($game->drawNoBet=='1 DNB'): ?> selected <?php endif; ?>>1 DNB</option>
                                <option value="2 DNB" <?php if($game->drawNoBet=='2 DNB'): ?> selected <?php endif; ?>>2 DNB</option>
                            </select>
                        </div>
                        <div class="col-sm-6">
                            <label>ODD</label>
                            <input type="text" name="drawNoBetOdds" value="<?php echo e($game->drawNoBetOdds); ?>" class="form-control">
                        </div>
                    </div>
                </div>

            </div>
        </div>
        <?php echo csrf_field(); ?>


        <div class="col-sm-12">
            <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">UPDATE PREDICTION</button>
            </div>
        </div>

    </div>
</form>

<script>
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
    $(document).ready(function () {
        $('#updateForm').submit(function (e) {
            e.preventDefault();
            $('#submitsetting').prop('disabled', true).html("UPDATING PREDICTION");
            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) {
                        $('#submitsetting').prop('disabled', false).html("UPDATE PREDICTION");
                        swal(data.encounters, '', 'warning');
                    }
                    else{
                        swal(data.encounters, '', 'success');
                        $('#updategame').modal('hide');
                    }
                }
            });

        });
    });
</script>