<?php
session_start();
require_once '../../../config.php';
load('middleware', 'user');
if ($_SESSION['user']['level'] !== "Admin") {
    header('location:' . base_url('id'));
}
if (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { ?>
<form method="POST">
<div class="form-group mb-3">
        <label>Nama Lengkap</label>
        <input class="form-control" placeholder="Lynch Store" name="name">
    </div>
<div class="form-group mb-3">
        <label>Username</label>
        <input class="form-control" placeholder="LynchStore" name="username">
    </div>
<div class="form-group mb-3">
        <label>Password</label>
        <input type="text" class="form-control" placeholder="password" name="password">
    </div>
<div class="form-group mb-3">
        <label>Phone</label>
        <input class="form-control" name="phone" placeholder="62813*******">
    </div>
<div class="form-group mb-3">
        <label>Email</label>
        <input class="form-control" name="email" placeholder="cs@lynchstore.xyz">
    </div>
<div class="form-group mb-3">
        <label>Level</label>
        <select class="form-control" name="level">
				<option value="0">- Select Level -</option>
				<option value="Member">Member</option>
				<option value="Reseller">Reseller</option>
				<option value="Vip">Vip</option>
				<option value="Admin">Admin</option>
			</select>
    </div>
    <hr>
    <div class="float-right">
                <button type="button" data-bs-dismiss="modal" aria-label="Close" class="btn btn-block bg-light fw-bold">BACK</button>
                <button type="submit" name="add_user" class="btn btn-block text-white bg-primary fw-bold">ADD</button>
    </div>
</form>
<?php } ?>