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

$page_name = 'force_app_settings';

$record = getJsonRecordById('2');
$mods_value = $record['mods'];

if(isset($_POST['submit'])){
	unset($_POST['submit']);
	$updateData = $_POST;
    updateJsonRecordById('2', $updateData);
	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> Force App Settings</h2>
                </center>
            </div>
            
            <div class="card-body">
                <form method="post">
                    <div class="form-group ctinput">
                        <label class="form-label"> Settings :</label>
                        <input  id="preffile" name="preffile" value="RTXRebrand" type="hidden"/>
                        <input  id="preftype" name="preftype" value="string" type="hidden"/>
                        <input  id="prefname" name="prefname" value="force_settings" type="hidden"/>
                        <select id="mods" name="mods">
                            <option value="one_time" <?php echo ($mods_value == 'one_time') ? 'selected' : ''; ?>>Only on first launch</option>
                            <option value="enable" <?php echo ($mods_value == 'enable') ? 'selected' : ''; ?>>At every launch</option>
                            <option value="disable" <?php echo ($mods_value == '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');?>
