generate.jsp 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <%@ taglib prefix="tag" tagdir="/WEB-INF/tags" %>
  4. <%@ taglib prefix="s" uri="/struts-tags"%>
  5. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  6. <!DOCTYPE html>
  7. <html>
  8. <head>
  9. <tag:head title="QR Code" />
  10. <style>
  11. img {
  12. margin-left: auto;
  13. margin-right: auto;
  14. }
  15. </style>
  16. </head>
  17. <body class="grey lighten-3">
  18. <!-- Header -->
  19. <header class="navbar-fixed">
  20. <nav class="red">
  21. <div class="nav-wrapper">
  22. <a href="<c:url value="/" />" class="brand-logo center mtop-half hide-on-med-and-down"><img src="../img/logo.png"
  23. title="Logo Microfolie" class="responsive-img" style="max-width: 128px;" /></a>
  24. <a href="<c:url value="/" />" class="brand-logo center hide-on-large-only">Microfolie Lens</a>
  25. <div class="left mleft-2 hide-on-med-and-down">
  26. <span>
  27. <h5>Microfolie Lens</h5>
  28. </span>
  29. </div>
  30. </div>
  31. </nav>
  32. </header>
  33. <div class="mtop-5 hide-on-med-and-down"></div>
  34. <!-- Main -->
  35. <main class="container">
  36. <div class="row mtop-2">
  37. <div class="col s12">
  38. <a onclick="window.history.back()" class="waves-effect waves-light btn" >
  39. <i class="material-icons left">arrow_back</i>Retour
  40. </a>
  41. </div>
  42. </div>
  43. <div class="white z-depth-1">
  44. <div class="row">
  45. <div class="col s12 center-align">
  46. <h3>Code : <span id="code"></span></h3>
  47. </div>
  48. </div>
  49. <div class="row">
  50. <div class="col s12">
  51. <div id="qrcode"></div>
  52. </div>
  53. </div>
  54. <div class="row">
  55. <div class="col s12 center-align" style="padding-bottom: 1em">
  56. <a href="#"
  57. onclick="this.href = $('#qrcode img:first').attr('src');"
  58. class="waves-effect waves-light btn-large" download="qrcode.png">
  59. <i class="material-icons left">keyboard_arrow_down</i>T&eacute;l&eacute;charger
  60. </a>
  61. </div>
  62. </div>
  63. </div>
  64. </main>
  65. <!-- Footer -->
  66. <tag:footer />
  67. <!-- Script -->
  68. <tag:script />
  69. <script type="text/javascript" src="<c:url value="/js/qrcode.min.js" />"></script>
  70. <script type="text/javascript">
  71. $(document).ready(() => {
  72. const params = new URLSearchParams(window.location.search);
  73. if (!params.has("code")) {
  74. window.location.href = '../';
  75. }
  76. $("#code").html(params.get("code"));
  77. new QRCode("qrcode", params.get("code"));
  78. });
  79. </script>
  80. </body>
  81. </html>