<?php
	if($_SERVER['REQUEST_METHOD'] == "POST"){
    	$FollowerID = safeString($_POST["FollowerID"]);
    	$OldFollowerID = safeString($_POST["OldFollowerID"]);
    
    	if($stmt = $mysqli -> prepare("UPDATE Twitter SET FollowerID = ? WHERE FollowerID = ?")){
        	$stmt ->bind_param("ss", $FollowerID, $OldFollowerID);
        	$stmt ->execute();
        	$stmt ->close();
        }
	}else{
	    $FollowerID = $_GET['FollowerID'];
	}
?>

<div class="col-lg-12">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>Alarm wijzigen</h5>
            <div class="ibox-tools">
                <a class="collapse-link">
                    <i class="fa fa-chevron-up"></i>
                </a>
            </div>
        </div>
        <div class="ibox-content">
            <form method="POST" class="form-horizontal">
				<div class="form-group">
					<label class="col-sm-2 control-label">Follower</label>
					<div class="col-sm-10">
						<input type="hidden" value="<?php echo $FollowerID ?>" required class="form-control" name = "OldFollowerID" maxlength="16">
						<input type="text" value="<?php echo $FollowerID ?>" required class="form-control" name = "FollowerID" maxlength="16">
					</div>
				</div>
		        <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-2">
                        <button class="btn btn-primary" type="submit">Follower opslaan</button>
                        <button class="btn btn-primary" type="reset">Reset</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
