index.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <?php
  2. session_start();
  3. ?>
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <meta name="viewport" content="width=device-width, initial-scale=1">
  8. <title> Forward Station Server Login</title>
  9. <link rel = "icon" href = "img/Autoleum Logo.jpg" type = "image/x-icon">
  10. <style>
  11. body {
  12. font-family: Arial, Helvetica, sans-serif;
  13. margin-top: 50px;
  14. }
  15. form {border: 3px solid #f1f1f1;}
  16. input[type=text], input[type=password] {
  17. width: 80%;
  18. padding: 12px 20px;
  19. margin: 8px 0;
  20. display: inline-block;
  21. border: 1px solid #ccc;
  22. box-sizing: border-box;
  23. }
  24. .imgcontainer {
  25. text-align: center;
  26. margin: 24px 0 12px 0;
  27. background:#5eeae7;
  28. height:200px;
  29. margin-top:0px;
  30. }
  31. img.avatar {
  32. width: 40%;
  33. border-radius: 50%;
  34. margin-top: 32px;
  35. width:80px;
  36. height:80px;
  37. margin-top:-57px;
  38. }
  39. .main {
  40. padding: 16px;
  41. background-color:#d4e0e6
  42. }
  43. .form-control.texthight {
  44. font-size: 15px;
  45. color:#028790;
  46. border-radius: 1rem;
  47. }
  48. input[type=text],input[type=password]{
  49. border: 2px solid #5eeae7;
  50. }
  51. .forgot:hover { color: #3b3b3b }
  52. input[type="submit"] {
  53. width:240px;
  54. height:35px;
  55. display:block;
  56. font-family:Arial, "Helvetica", sans-serif;
  57. font-size:16px;
  58. font-weight:bold;
  59. color:#fff;
  60. text-decoration:none;
  61. text-transform:uppercase;
  62. text-align:center;
  63. text-shadow:1px 1px 0px #37a69b;
  64. padding-top:6px;
  65. margin: 29px 0 0 29px;
  66. position:relative;
  67. cursor:pointer;
  68. border: none;
  69. background-color: #37a69b;
  70. background-image: linear-gradient(top,#3db0a6,#3111);
  71. border-top-left-radius: 5px;
  72. border-top-right-radius: 5px;
  73. border-bottom-right-radius: 5px;
  74. border-bottom-left-radius:5px;
  75. box-shadow: inset 0px 1px 0px #2ab7ec, 0px 5px 0px 0px #497a78, 0px 10px 5px #999;
  76. }
  77. input[type="submit"]:active {
  78. top:3px;
  79. box-shadow: inset 0px 1px 0px #2ab7ec, 0px 2px 0px 0px #31524d, 0px 5px 3px #999;
  80. }
  81. .divider{
  82. width:400px;
  83. height:350px;
  84. background:#dde3e4;
  85. position:absolute;
  86. margin-left:50px;
  87. margin-top:-100px;
  88. box-shadow: inset 0px 1px 0px #ffff, 0px 2px 0px 0px #ffff, 0px 5px 3px #999;
  89. }
  90. .login{
  91. width:500px;
  92. height:600px;
  93. align:center;
  94. background:white;
  95. box-shadow: inset 0px 1px 0px #ffff, 0px 2px 0px 0px #ffff, 0px 5px 3px #999;
  96. }
  97. @import url("//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css");
  98. .form-group {
  99. position: relative;
  100. color: #aaa;
  101. font-size: 16px;
  102. }
  103. .form-group input { text-indent: 32px;}
  104. .form-group .fa-user {
  105. position: absolute;
  106. top: 20px;
  107. left: 45px;
  108. color:#0fb7a2;
  109. }
  110. .form-group input { text-indent: 32px;}
  111. .form-group .fa-key {
  112. position: absolute;
  113. top: 33px;
  114. left: 45px;
  115. color:#0fb7a2;
  116. }
  117. .form-group input { text-indent: 32px;}
  118. .form-group .fa-eye {
  119. position: absolute;
  120. top: 35px;
  121. right: 50px;
  122. color:#0fb7a2;
  123. }
  124. .form-errors p{
  125. color:red;
  126. }
  127. </style>
  128. <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
  129. </head>
  130. <body>
  131. <center>
  132. <form action="login.php" class="login" method="post">
  133. <div class="imgcontainer">
  134. </div>
  135. <div style="" class="divider">
  136. <div class="main">
  137. <img src="dist/img/profile.jpg" alt="Avatar" class="avatar">
  138. <?php if (isset($_SESSION['errors'])): ?>
  139. <div class="form-errors">
  140. <?php foreach($_SESSION['errors'] as $error): ?>
  141. <p><?php echo $error ?></p>
  142. <?php endforeach;
  143. session_destroy();?>
  144. </div>
  145. <?php endif; ?>
  146. <div class="form-group" style="margin-top:40px;" id="floatContainer">
  147. <label for="floatField"></label>
  148. <i class="far fa-user icon" ></i>
  149. <input type="text" id="floatField" placeholder="Enter Username" id="name" name="uname" class="form-control texthight" required >
  150. </div>
  151. <div class="form-group ">
  152. <i class="fa fa-key icon" ></i>
  153. <input type="password" class="form-control texthight" name="password" id="password-field" placeholder="Enter your password" style="margin-top:20px;">
  154. <i id="pass-status" class="fa fa-eye" aria-hidden="true" onClick="viewPassword()"></i>
  155. </div>
  156. <input type="submit" value="Login">
  157. </div>
  158. </div>
  159. </form>
  160. </center>
  161. <script type="text/javascript">
  162. function viewPassword()
  163. {
  164. var passwordInput = document.getElementById('password-field');
  165. var passStatus = document.getElementById('pass-status');
  166. if (passwordInput.type == 'password'){
  167. passwordInput.type='text';
  168. passStatus.className='fa fa-eye-slash';
  169. }
  170. else{
  171. passwordInput.type='password';
  172. passStatus.className='fa fa-eye';
  173. }
  174. }
  175. const floatField = document.getElementById('floatField');
  176. const floatContainer = document.getElementById('floatContainer');
  177. floatField.addEventListener('focus', () => {
  178. floatContainer.classList.add('active');
  179. });
  180. floatField.addEventListener('blur', () => {
  181. floatContainer.classList.remove('active');
  182. });
  183. </script>
  184. </body>
  185. </html>