<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Update Credentials</title>
<meta name='description' content='Authentication app'>
<meta name='keywords' content='rkvac, smart-card authentication'>
<meta name='author' content='Bronislav Strava'>
<meta name='robots' content='all'>
<link href='/img/favicon2.png' rel='shortcut icon' type='image/png'>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
	href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
	integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
	crossorigin="anonymous">
<link rel="stylesheet"
	href="https://use.fontawesome.com/releases/v5.4.1/css/all.css"
	integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz"
	crossorigin="anonymous">
</head>
<body>
	<div class="container my-5">
	<h3> Update Credentials</h3>
		<div class="card">
			<div class="card-body">
				<div class="col-md-8">
					<form action="#"
						th:action="@{/admin/update/{id}(id=${student.id})}"
						th:object="${student}" method="post">
						<div class="row">
							<div class="form-group col-md-6">
								<label for="name" class="col-form-label">Name</label> <input
									type="text" th:field="*{name}" class="form-control" id="name"
									placeholder="Name"> <span
									th:if="${#fields.hasErrors('name')}" th:errors="*{name}"
									class="text-danger"></span>
							</div>
							<div class="form-group col-md-8">
								<label for="attributeCount" class="col-form-label">Number of Attributes</label>
								<select class="form-control" name="attributeCount" id="attributeCount" th:field="*{attributeCount}">
									<span
											th:if="${#fields.hasErrors('attributeCount')}" th:errors="*{attributeCount}"
											class="text-danger"></span>
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
									<option value="6">6</option>
									<option value="7">7</option>
									<option value="8">8</option>
									<option value="9">9</option>
								</select>

							</div>
							<div class="form-group col-md-8" id="1">
								<label for="att1" class="col-form-label">Attribute 1</label> <input
									type="text" th:field="*{att1}" class="form-control" id="att1"
									placeholder=""> <span
									th:if="${#fields.hasErrors('att1')}" th:errors="*{att1}"
									class="text-danger"></span>
							</div>
							<div class="form-group col-md-8" id="2">
								<label for="att2" class="col-form-label">Attribute 2</label> <input
									type="text" th:field="*{att2}" class="form-control" id="att2"
									placeholder=""> <span
									th:if="${#fields.hasErrors('att2')}" th:errors="*{att2}"
									class="text-danger"></span>
							</div>
							<div class="form-group col-md-8" id="3">
								<label for="att3" class="col-form-label">Attribute 3</label> <input
									type="text" th:field="*{att3}" class="form-control" id="att3"
									placeholder=""> <span
									th:if="${#fields.hasErrors('att3')}" th:errors="*{att3}"
									class="text-danger"></span>
							</div>
							<div class="form-group col-md-8" id="4">
								<label for="att4" class="col-form-label">Attribute 4</label> <input
									type="text" th:field="*{att4}" class="form-control" id="att4"
									placeholder=""> <span
									th:if="${#fields.hasErrors('att4')}" th:errors="*{att4}"
									class="text-danger"></span>
							</div>
							<div class="form-group col-md-8" id="5">
								<label for="att5" class="col-form-label">Attribute 5</label> <input
									type="text" th:field="*{att5}" class="form-control" id="att5"
									placeholder=""> <span
									th:if="${#fields.hasErrors('att5')}" th:errors="*{att5}"
									class="text-danger"></span>
							</div>
							<div class="form-group col-md-8" id="6">
								<label for="att6" class="col-form-label">Attribute 6</label> <input
									type="text" th:field="*{att6}" class="form-control" id="att6"
									placeholder=""> <span
									th:if="${#fields.hasErrors('att6')}" th:errors="*{att6}"
									class="text-danger"></span>
							</div>
							<div class="form-group col-md-8" id="7">
								<label for="att7" class="col-form-label">Attribute 7</label> <input
									type="text" th:field="*{att7}" class="form-control" id="att7"
									placeholder=""> <span
									th:if="${#fields.hasErrors('att7')}" th:errors="*{att7}"
									class="text-danger"></span>
							</div>
							<div class="form-group col-md-8" id="8">
								<label for="att8" class="col-form-label">Attribute 8</label> <input
									type="text" th:field="*{att8}" class="form-control" id="att8"
									placeholder=""> <span
									th:if="${#fields.hasErrors('att8')}" th:errors="*{att8}"
									class="text-danger"></span>
							</div>
							<div class="form-group col-md-8" id="9">
								<label for="att9" class="col-form-label">Attribute 9</label> <input
									type="text" th:field="*{att9}" class="form-control" id="att9"
									placeholder=""> <span
									th:if="${#fields.hasErrors('att9')}" th:errors="*{att9}"
									class="text-danger"></span>
							</div>
							<div class="form-group col-md-8" >
								<label for="activePositions" class="col-form-label">Active Positions</label> <input
									type="text" th:field="*{activePositions}" class="form-control" id="activePositions"
									placeholder="1,2,3..."> <span
									th:if="${#fields.hasErrors('activePositions')}" th:errors="*{activePositions}"
									class="text-danger"></span>
							</div>
							<div class="form-group col-md-8">
								<input type="submit" class="btn btn-primary"
									value="Update Credentials">
								<a href="/admin/index" class="btn btn-secondary"><i>List</i></a>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<script src="/js/script.js"></script>
</body>
</html>