inscription.jsp 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <%@ taglib prefix="s" uri="/struts-tags"%>
  4. <%@ taglib prefix="tag" tagdir="/WEB-INF/tags" %>
  5. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  6. <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
  7. <c:set var="req" value="${pageContext.request}" />
  8. <c:set var="url">${req.requestURL}</c:set>
  9. <c:set var="base" value="${fn:substring(url, 0, fn:length(url) - fn:length(req.requestURI))}${req.contextPath}/" />
  10. <!DOCTYPE html>
  11. <html>
  12. <head>
  13. <tag:head title="Inscription" />
  14. <s:head />
  15. </head>
  16. <body class="grey lighten-3">
  17. <!-- Header -->
  18. <tag:header active="inscription" />
  19. <!-- Main -->
  20. <main class="container">
  21. <div class="row">
  22. <div class="col s12 center-align">
  23. <h3>Inscription</h3>
  24. </div>
  25. </div>
  26. <div class="row">
  27. <!--s:debug /-->
  28. <s:form action="inscription" validate="true" class="col s12" autocomplete="off">
  29. <div class="row">
  30. <div class="input-field col m6 s12">
  31. <i class="material-icons prefix">person</i>
  32. <s:textfield id="pnom" name="prenom" class="validate" required="required" />
  33. <label for="pnom">Pr&eacute;nom*</label>
  34. <span class="helper-text"></span>
  35. <s:fielderror fieldName="prenom" class="field-error hide" />
  36. </div>
  37. <div class="input-field col m6 s12">
  38. <i class="material-icons prefix">account_circle</i>
  39. <s:textfield id="nom" name="nom" class="validate" required="required" />
  40. <label for="nom">Nom*</label>
  41. <span class="helper-text"></span>
  42. <s:fielderror fieldName="nom" class="field-error hide" />
  43. </div>
  44. </div>
  45. <div class="row">
  46. <div class="input-field col m6 s12">
  47. <i class="material-icons prefix">wc</i>
  48. <s:select id="genre" name="genre" list="getGenres()" headerKey="" headerValue="Selectionnez une valeur" required="required" />
  49. <label for="genre">Genre*</label>
  50. <s:fielderror fieldName="genre" class="red-text" style="padding-left: 3em" />
  51. </div>
  52. <div class="input-field col m6 s12">
  53. <i class="material-icons prefix">cake</i>
  54. <s:textfield id="naissance" name="naissance" class="validate datepicker" required="required" />
  55. <label for="naissance">Date de naissance*</label>
  56. <span class="helper-text"></span>
  57. <s:fielderror fieldName="naissance" class="field-error hide" />
  58. </div>
  59. </div>
  60. <div class="row">
  61. <div class="input-field col m6 s12">
  62. <i class="material-icons prefix">location_city</i>
  63. <s:textfield id="ville" name="ville" class="validate autocomplete-ville" required="required" />
  64. <label for="ville">Ville*</label>
  65. <span class="helper-text"></span>
  66. <s:fielderror fieldName="ville" class="field-error hide" />
  67. </div>
  68. <div class="input-field col m6 s12">
  69. <i class="material-icons prefix">work</i>
  70. <s:textfield id="situation" name="situation" class="validate autocomplete-ecole" required="required" />
  71. <label for="situation">&Eacute;cole*</label>
  72. <span class="helper-text"></span>
  73. <s:fielderror fieldName="situation" class="field-error hide" />
  74. </div>
  75. </div>
  76. <div class="row">
  77. <div class="input-field col m6 s12">
  78. <i class="material-icons prefix">email</i>
  79. <s:textfield id="email" name="email" class="validate" required="required" />
  80. <label for="email">Email*</label>
  81. <span class="helper-text"></span>
  82. <s:fielderror fieldName="email" class="field-error hide" />
  83. </div>
  84. <div class="input-field col m6 s12">
  85. <i class="material-icons prefix">local_phone</i>
  86. <s:textfield id="telephone" name="telephone" class="validate" required="required" />
  87. <label for="telephone">T&eacute;l&eacute;phone*</label>
  88. <span class="helper-text"></span>
  89. <s:fielderror fieldName="telephone" class="field-error hide" />
  90. </div>
  91. </div>
  92. <div class="row">
  93. <div class="input-field col m6 s12">
  94. <i class="material-icons prefix">healing</i>
  95. <s:textfield id="urgence" name="urgence" class="validate" required="required" />
  96. <label for="urgence">Contact d'urgence*</label>
  97. <span class="helper-text"></span>
  98. <s:fielderror fieldName="urgence" class="field-error hide" />
  99. </div>
  100. <div class="file-field input-field col m6 s12">
  101. <div class="waves-effect waves-light btn red">
  102. <i class="material-icons">cloud_upload</i>
  103. <input id="pj" type="file">
  104. </div>
  105. <div class="file-path-wrapper">
  106. <input class="file-path validate" type="text" placeholder="Pi&egrave;ce jointe">
  107. </div>
  108. </div>
  109. </div>
  110. <div class="row">
  111. <div class="col s12 center-align">
  112. <s:submit id="btn-valid" class="btn waves-effect waves-light btn red" value="Valider" />
  113. </div>
  114. </div>
  115. </s:form>
  116. </div>
  117. </main>
  118. <!-- Loader -->
  119. <tag:loader name="loader"/>
  120. <!-- Footer -->
  121. <tag:footer />
  122. <!-- Script -->
  123. <tag:script />
  124. <script type="text/javascript">
  125. function loadAutocomplete(source, callback = null) {
  126. $.ajax({
  127. type: "GET",
  128. url: "${base}api/" + source + "/list/all/autocomplete",
  129. error: () => {
  130. console.error("Impossible de charger l'autocomplete");
  131. if (callback != null) {
  132. callback();
  133. }
  134. },
  135. success: (result) => {
  136. $('input.autocomplete-' + source).autocomplete({
  137. data: result.data,
  138. limit: 5
  139. });
  140. if (callback != null) {
  141. callback();
  142. }
  143. },
  144. });
  145. };
  146. $(document).ready(() => {
  147. const loader = M.Modal.getInstance($('#loader'));
  148. // Chargement autcomplete
  149. loader.open();
  150. loadAutocomplete('ville', () => {
  151. loadAutocomplete('ecole', () => {
  152. loader.close();
  153. })
  154. });
  155. });
  156. </script>
  157. </body>
  158. </html>