<?php 
include ('includes/json_utils.php');
include ('includes/header.php');

$page_name = 'sport_settings';




if (isset($_POST['submit']) && isset($_POST['data'])) {
    foreach ($_POST['data'] as $id => $fields) {
        updateJsonRecordByIdMulty($id, $fields);
    }

    echo "<script>window.location.href='" . $page_name . ".php?status=1'</script>";
}


?>

<div class="col-md-6 mx-auto ctmain-table">
    <div class="card-body">
        <div class="card text-white ctcard">
            <div class="card-header card-header-warning">
                <center>
                    <h2><i class="icon icon-bullhorn"></i> Sport settings</h2>
                </center>
            </div>
            
            <div class="card-body">
                <form method="post">
                    <div class="form-group ctinput">
                      <label class="form-label"> Sport Button Text :</label>
                      <input type="hidden" name="data[28][preffile]" value="RTXRebrand">
                      <input type="hidden" name="data[28][preftype]" value="string">
                      <input type="hidden" name="data[28][prefname]" value="btn_text_sports">
                      <div class="form-group ctinput">
                          <input class="form-control" name="data[28][mods]"  value="<?php echo (getmodsbyid('28'))?>"  placeholder="Eg: Sport guide" type="text"/>
                      </div>
                    </div>

                    <div class="form-group ctinput">
                      <label class="form-label"> Button :</label>
                      <input type="hidden" name="data[29][preffile]" value="RTXRebrand">
                      <input type="hidden" name="data[29][preftype]" value="string">
                      <input type="hidden" name="data[29][prefname]" value="btn_sport_visiblity">
                      <select name="data[29][mods]">
                        <option value="enable" <?php echo (getmodsbyid('29') == 'enable') ? 'selected' : ''; ?>>Enable</option>
                        <option value="disable" <?php echo (getmodsbyid('29') == 'disable') ? 'selected' : ''; ?>>Disable</option>
                      </select>
                    </div>
                    

                    <div class="form-group ctinputform-group">
                        <center>
                            <button class="btn btn-info" name="submit" type="submit">
                                <i class="icon icon-check"></i> Submit
                            </button>
                        </center>
                    </div>
                </form>
            </div>       
        </div>
    </div>
</div>

<?php include ('includes/footer.php');?>
