<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="container-fluid">
        <h4 class="text-danger">PREMIUM VIP TIPS</h4>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group col-md-4 bg-danger" style="padding: 10px;">
                    <div class="row">
                        <div class="col-sm-4">
                            <label>MULTIBET 1</label>
                            <select name="multiBetOne" class="form-control">
                                <option value="Yes" <?php if($game->multiBetOne=='Yes'): ?> selected <?php endif; ?>>Yes</option>
                                <option value="No" <?php if($game->multiBetOne=='No'): ?> selected <?php endif; ?>>No</option>
                            </select>
                        </div>
                        <div class="col-sm-4">
                            <label>TIP</label>
                            <input type="text" name="multiBetOneTip" value="<?php echo e($game->multiBetOneTip); ?>" class="form-control">
                        </div>
                        <div class="col-sm-4">
                            <label>ODD</label>
                            <input type="text" name="multiBetOneOdds" value="<?php echo e($game->multiBetOneOdds); ?>" 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>MULTIBET 2</label>
                            <select name="multiBetTwo" class="form-control">
                                <option value="Yes" <?php if($game->multiBetTwo=='Yes'): ?> selected <?php endif; ?>>Yes</option>
                                <option value="No" <?php if($game->multiBetTwo=='No'): ?> selected <?php endif; ?>>No</option>
                            </select>
                        </div>
                        <div class="col-sm-4">
                            <label>TIP</label>
                            <input type="text" name="multiBetTwoTip" value="<?php echo e($game->multiBetTwoTip); ?>" class="form-control">
                        </div>
                        <div class="col-sm-4">
                            <label>ODD</label>
                            <input type="text" name="multiBetTwoOdds" value="<?php echo e($game->multiBetTwoOdds); ?>" 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>MULTIBET 3</label>
                            <select name="multiBetThree" class="form-control">
                                <option value="Yes" <?php if($game->multiBetThree=='Yes'): ?> selected <?php endif; ?>>Yes</option>
                                <option value="No" <?php if($game->multiBetThree=='No'): ?> selected <?php endif; ?>>No</option>
                            </select>
                        </div>
                        <div class="col-sm-4">
                            <label>TIP</label>
                            <input type="text" name="multiBetThreeTip" value="<?php echo e($game->multiBetThreeTip); ?>" class="form-control">
                        </div>
                        <div class="col-sm-4">
                            <label>ODD</label>
                            <input type="text" name="multiBetThreeOdds" value="<?php echo e($game->multiBetThreeOdds); ?>" class="form-control">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="container-fluid">
        <hr>
        <div class="form-group col-md-6 bg-danger" style="padding: 10px;">
            <div class="row">
                <div class="col-sm-12"><h4>SUPER VIP TIPS</h4></div>
                <div class="col-sm-4">
                    <label>SUPER TIP</label>
                    <select name="super" class="form-control">
                        <option value="Yes" <?php if($game->super=='Yes'): ?> selected <?php endif; ?>>Yes</option>
                        <option value="No" <?php if($game->super=='No'): ?> selected <?php endif; ?>>No</option>
                    </select>
                </div>
                <div class="col-sm-4">
                    <label>PREDICTION</label>
                    <input type="text" name="superTip" value="<?php echo e($game->superTip); ?>" class="form-control">
                </div>
                <div class="col-sm-4">
                    <label>ODD</label>
                    <input type="text" name="superOdds" value="<?php echo e($game->superOdds); ?>" class="form-control">
                </div>
            </div>
        </div>

        <div class="form-group col-md-6 bg-success" style="padding: 10px;">
            <div class="row">
                <div class="col-sm-12"><h4>SUPER VIP TIPS</h4></div>
                <div class="col-sm-6">
                    <label>HT/FT</label>
                    <select name="HTFT" class="form-control">
                        <option value="1/1" <?php if($game->HTFT=='1/1'): ?> selected <?php endif; ?>>1/1</option>
                        <option value="1/X" <?php if($game->HTFT=='1/X'): ?> selected <?php endif; ?>>1/X</option>
                        <option value="1/2" <?php if($game->HTFT=='1/2'): ?> selected <?php endif; ?>>1/2</option>
                        <option value="X/1" <?php if($game->HTFT=='X/1'): ?> selected <?php endif; ?>>X/1</option>
                        <option value="X/2" <?php if($game->HTFT=='X/2'): ?> selected <?php endif; ?>>X/2</option>
                        <option value="X/X" <?php if($game->HTFT=='X/X'): ?> selected <?php endif; ?>>X/X</option>
                        <option value="2/1" <?php if($game->HTFT=='2/1'): ?> selected <?php endif; ?>>2/1</option>
                        <option value="2/2" <?php if($game->HTFT=='2/2'): ?> selected <?php endif; ?>>2/2</option>
                        <option value="2/X" <?php if($game->HTFT=='2/X'): ?> selected <?php endif; ?>>2/X</option>
                        <option value="No" <?php if($game->HTFT=='No'): ?> selected <?php endif; ?>>No</option>
                    </select>
                </div>
                <div class="col-sm-6">
                    <label>ODD</label>
                    <input type="text" name="HTFTOdds" value="<?php echo e($game->HTFTOdds); ?>" class="form-control">
                </div>
            </div>
        </div>

        <div class="form-group col-md-12" style="padding: 10px;">
            <div class="row">
                <div class="col-sm-12">
                    <h4 class="text-danger">JACKPOT VIP TIPS</h4>
                </div>
                <div class="form-group col-md-6 bg-success" style="padding: 10px;">
                    <div class="row">
                        <div class="col-sm-4">
                            <label class="text-primary">MEGA JACKPOT</label>
                            <select name="mega" class="form-control">
                                <option value="Yes" <?php if($game->mega=='Yes'): ?> selected <?php endif; ?>>Yes</option>
                                <option value="No" <?php if($game->mega=='No'): ?> selected <?php endif; ?>>No</option>
                            </select>
                        </div>
                        <div class="col-sm-4">
                            <label>TIP</label>
                            <input type="text" name="megaTip" value="<?php echo e($game->megaTip); ?>" class="form-control">
                        </div>
                        <div class="col-sm-4">
                            <label>ODD</label>
                            <input type="text" name="megaOdds" value="<?php echo e($game->megaOdds); ?>" class="form-control">
                        </div>
                    </div>
                </div>

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

    </div>
    <div class="row">
        <?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>