<div class="row mb-4">
	<div class="col-lg-12 col-md-12 mb-md-0">
		<div class="card">
			<div class="card-header pb-0">
				<div class="row">
					<div class="col-lg-6 col-7">
						<h6>Add IBO User for DNS - <?php echo $dnsInfo['portal']; ?></h6>
					</div>
				</div>
			</div>
			<div class="card-body px-0 pb-2">
				<div class="container">
					<div class="row">
						<div class="col-xl-12 col-lg-12 col-md-12 d-flex flex-column ms-auto me-auto ms-lg-auto me-lg-12">
							<div class="card card-plain">
								<div class="card-body">
									<form action="action.php" method="post" role="form">
										<input name="dns_id" type="hidden" value="<?php echo $_GET['id'] ?>" />
										<div class="input-group input-group-outline mb-3">
											<label class="form-label">MAC</label>
											<input name="mac_address" id="mac_address" type="text" class="form-control" maxlength="17" value="">
										</div>
										<div class="input-group input-group-outline mb-3">
											<label class="form-label">Username</label>
											<input name="username" type="text" class="form-control" value="">
										</div>
										<div class="input-group input-group-outline mb-3">
											<label class="form-label">Password</label>
											<input name="password" type="text" class="form-control" value="">
										</div>
										<input name="ekleyen_kullanici" type="hidden" value="<?php echo $_SESSION[$authVar] ?>" />
										<div class="text-center">
											<button name="addibouser" type="submit" class="btn btn-lg bg-gradient-secondary btn-lg w-100 mt-4 mb-0">Add</button>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<script>
function formatMACAddress(input) {
  var value = input.value.replace(/[^0-9a-f]/gi, '').toUpperCase(); // Harfleri 
  var formatted = '';

  for (var i = 0; i < value.length; i += 2) {
    formatted += value.substring(i, i + 2);
    if (formatted.length < 17 && i < value.length - 2) {
      formatted += ':';
    }
  }
  input.value = formatted;
}

document.getElementById('mac_address').addEventListener('keyup', function() {
  formatMACAddress(this);
});
</script>