Advertisement
Guest User

Untitled

a guest
Mar 9th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.68 KB | None | 0 0
  1. ABÖYT
  2. <!DOCTYPE html>
  3. <!--
  4. To change this license header, choose License Headers in Project Properties.
  5. To change this template file, choose Tools | Templates
  6. and open the template in the editor.
  7. -->
  8. <html>
  9. <head>
  10.  
  11. <meta charset="UTF-8">
  12. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  13. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  14. <link rel="stylesheet" type="text/css" href="css/css.css">
  15. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  16. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  17. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  18.  
  19. <script>
  20. // Checking the cookie
  21. $(document).ready(function () {
  22. <%
  23. boolean valid = true;
  24. String userName = null;
  25. Cookie[] cookies = request.getCookies();
  26. if (cookies != null) {
  27. for (Cookie cookie : cookies) {
  28. if (cookie.getName().equals("user")) {
  29. userName = cookie.getValue();
  30. }
  31. }
  32. }
  33. if (userName == null) {
  34. valid = false;
  35. }
  36. %>
  37. // If you are logged in, you will see the buttons to navigate the page
  38. var show = <%= valid%>;
  39. if (show) {
  40. document.getElementById("edit").style.display = "block";
  41. document.getElementById("user").style.display = "block";
  42. document.getElementById("logout").style.display = "block";
  43. document.getElementById("landing").style.display = "none";
  44. console.log(show);
  45. } else {
  46. document.getElementById("edit").style.display = "none";
  47. document.getElementById("user").style.display = "none";
  48. document.getElementById("logout").style.display = "none";
  49. document.getElementById("landing").style.display = "block";
  50. console.log(show);
  51. }
  52. });
  53.  
  54. </script>
  55.  
  56. <title>NotMalware</title>
  57. </head>
  58.  
  59. <body>
  60. <div id="header">
  61. <img src="css/img/logo.png" alt="Masterful design" id="logo">
  62. <form action="LogoutServlet" method="post">
  63. <input type="submit" role="button" value="Logout" id="logout" class="form-control btn btn-info note-input">
  64. </form>
  65. <a href="EditProfile.jsp" id="edit" role="button" class="form-control btn btn-info note-input" >Edit profile</a>
  66. <a href="AboutUs.jsp" id="about" role="button" type="button" class="form-control btn btn-info note-input" >About us</a>
  67. <a href="User.jsp" id="user" role="button" class="form-control btn btn-info note-input" >User</a>
  68. <a href="Landing.jsp" id="landing" role="button" class="form-control btn btn-info note-input" >Home</a>
  69. <br style="clear: both;" />
  70. </div>
  71.  
  72.  
  73. <div id="mainaboutus">
  74. <h2>Welcome to The Factory!</h2>
  75. <p id="abouttext1">
  76. This is the official page for Freddie&rsquo;s Fish Nugget Factory. We have been the leading fish nugget supplier for Sodexo restaurants since our foundation in 1966. Our factory works day and night to provide you with top quality nuggets. Bon appétit!
  77. </p>
  78. <p id="abouttext2">
  79. <br><br><q>Best nuggets I have ever eaten!</q><br>-Made up person
  80. </div>
  81. <div id="footer">
  82. <p>Copyrights © NotMalware</p>
  83. </div>
  84. </body>
  85. </html>
  86. ----------------------------------------------------------
  87. LÄNDING
  88. <!DOCTYPE html>
  89. <!--
  90. To change this license header, choose License Headers in Project Properties.
  91. To change this template file, choose Tools | Templates
  92. and open the template in the editor.
  93. -->
  94.  
  95. <!DOCTYPE html>
  96. <html>
  97. <head>
  98.  
  99. <meta charset="UTF-8">
  100. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  101. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  102. <link rel="stylesheet" type="text/css" href="css/css.css">
  103. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" crossorigin="anonymous">
  104. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  105. <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
  106. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  107. <script>
  108. function validate() {
  109. var user = document.getElementById("fuser").value;
  110. var pass = document.getElementById("fpass").value;
  111. if (user.length <= 0 || pass.length <= 0) {
  112. alert("Fill up the form");
  113. return false;
  114. }
  115.  
  116. return true;
  117. }
  118.  
  119. </script>
  120. <script>
  121. $(document).ready(function () {
  122. // Get the modal
  123. var modal = document.getElementById('loginmodal');
  124.  
  125. // Get the <span> element that closes the modal
  126. var span = document.getElementsByClassName("close")[0];
  127.  
  128. // When the user clicks on <span> (x), close the modal
  129. span.onclick = function () {
  130. modal.style.display = "none";
  131. };
  132.  
  133. // When the user clicks anywhere outside of the modal, close it
  134. window.onclick = function (event) {
  135. if (event.target === modal) {
  136. modal.style.display = "none";
  137. }
  138. };
  139.  
  140. $("button[name='openloginmodal']").click(function () {
  141. modal.style.display = "block";
  142. });
  143. });
  144. </script>
  145.  
  146. <title>NotMalware</title>
  147. </head>
  148. <body>
  149. <div id="header">
  150. <img src="css/img/logo.png" alt="Masterful design" id="logo">
  151. <img src="css/img/NuggetLogo.png" id="logofreddies">
  152. <a href="AboutUs.jsp" id="about" role="button" type="button" class="form-control btn btn-info note-input" >About us</a>
  153. <br style="clear: both;" />
  154. </div>
  155.  
  156. <div id="mascotdiv">
  157. <img src="css/img/mascotfish.png" alt="Masterful mascot" id="mascot">
  158. </div>
  159.  
  160. <div style="text-align: center; margin-left:40%; margin-top: 5%; position: fixed">
  161. <button name="openloginmodal" class="form-control btn btn-info" style="width:160px;">Log in</button>
  162.  
  163. <div id="loginmodal" class="modal">
  164. <div class="modal-content">
  165. <span class="close">&times;</span>
  166. <form role="form" method="post" class="login-form" action="LoginServlet" onsubmit="return validate()">
  167. <div class="form-group">
  168. <label class="sr-only" for="username">Username</label>
  169. <input type="text" name="username" placeholder="Username..." class="form-username" id="fuser">
  170. </div>
  171. <div class="form-group">
  172. <label class="sr-only" for="password">Password</label>
  173. <input type="password" name="password" placeholder="Password..." class="form-password" id="fpass">
  174. </div>
  175. <button type="submit" value="Login" class="form-control btn btn-info note-input" style="width:160px;">Log in</button>
  176. </form>
  177. </div>
  178. </div>
  179. <form action="/NotMalware/SignIn.jsp" style="margin-top: 10px">
  180. <button type="submit" class="form-control btn btn-info" style="width:160px;">Sign up</button>
  181. </form>
  182. </div>
  183. <div id="footer">
  184. <p>Copyrights © NotMalware</p>
  185. </div>
  186. </body>
  187. </html>
  188. ---------------------------------------------------------------
  189. CSS
  190. #mascot {
  191. margin-top: 5px;
  192. height: 70px;
  193. opacity: 0.35;
  194. }
  195.  
  196. #mascotdiv {
  197. margin-top: 15%;
  198. width: 32%;
  199. margin-left: 40%;
  200. padding-top: 20px;
  201. }
  202.  
  203. #logofreddies {
  204. margin-top: 5px;
  205. margin-left: 30%;
  206. width:220px;
  207. height:70px;
  208. opacity: 0.5;
  209. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement