| 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
|
|---|
| 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
|---|
| 3 |
|
|---|
| 4 | <!DOCTYPE html>
|
|---|
| 5 | <html lang="en">
|
|---|
| 6 | <head>
|
|---|
| 7 | <meta charset="UTF-8">
|
|---|
| 8 | <title>University Form</title>
|
|---|
| 9 | <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" crossorigin="anonymous">
|
|---|
| 10 | </head>
|
|---|
| 11 | <body>
|
|---|
| 12 |
|
|---|
| 13 | <header>
|
|---|
| 14 | <nav class="navbar navbar-expand-md navbar-dark" style="background-color: tomato;">
|
|---|
| 15 | <div>
|
|---|
| 16 | <a href="${pageContext.request.contextPath}/university/list" class="navbar-brand">University App</a>
|
|---|
| 17 | </div>
|
|---|
| 18 | <ul class="navbar-nav">
|
|---|
| 19 | <li><a href="${pageContext.request.contextPath}/university/list" class="nav-link">University List</a></li>
|
|---|
| 20 | </ul>
|
|---|
| 21 | </nav>
|
|---|
| 22 | </header>
|
|---|
| 23 |
|
|---|
| 24 | <br>
|
|---|
| 25 |
|
|---|
| 26 | <div class="container col-md-5">
|
|---|
| 27 | <div class="card">
|
|---|
| 28 | <div class="card-body">
|
|---|
| 29 | <form action="${pageContext.request.contextPath}/university/${university != null ? 'update' : 'insert'}" method="post">
|
|---|
| 30 | <h2>${university != null ? 'Edit University' : 'Add New University'}</h2>
|
|---|
| 31 | <input type="hidden" name="id" value="${university.id}" />
|
|---|
| 32 |
|
|---|
| 33 | <fieldset class="form-group">
|
|---|
| 34 | <label for="name">University Name</label>
|
|---|
| 35 | <input type="text" id="name" name="name" class="form-control" value="${university != null ? university.name : ''}" required>
|
|---|
| 36 | </fieldset>
|
|---|
| 37 |
|
|---|
| 38 | <fieldset class="form-group">
|
|---|
| 39 | <label for="location">Location</label>
|
|---|
| 40 | <input type="text" id="location" name="location" class="form-control" value="${university != null ? university.location : ''}" required>
|
|---|
| 41 | </fieldset>
|
|---|
| 42 |
|
|---|
| 43 | <fieldset class="form-group">
|
|---|
| 44 | <label for="isPrivate">Is Private</label>
|
|---|
| 45 | <select id="isPrivate" name="isPrivate" class="form-control">
|
|---|
| 46 | <option value="true" ${university != null && university.isPrivate ? 'selected' : ''}>Yes</option>
|
|---|
| 47 | <option value="false" ${university != null && !university.isPrivate ? 'selected' : ''}>No</option>
|
|---|
| 48 | </select>
|
|---|
| 49 | </fieldset>
|
|---|
| 50 |
|
|---|
| 51 | <button type="submit" class="btn btn-success">Save</button>
|
|---|
| 52 | </form>
|
|---|
| 53 | </div>
|
|---|
| 54 | </div>
|
|---|
| 55 | </div>
|
|---|
| 56 |
|
|---|
| 57 | </body>
|
|---|
| 58 | </html>
|
|---|