index.php 6.2 KB

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