Advertisement
Guest User

adminLoginPage

a guest
Nov 22nd, 2017
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.07 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html >
  3. <script>
  4. /*
  5. creates a cookie with a given name, a value, and a number of days that it is active for
  6. */
  7.   function createCookie(name,value,days){
  8.   if (days)
  9.   {
  10.       var date = new Date();
  11.       date.setTime(date.getTime() + (days * 24 * 60 * 60 *1000));
  12.       var expires = "; expires=" + date.toGMTString();
  13.   }
  14.   else
  15.   {
  16.       var expires = "";
  17.   }
  18.   document.cookie = name + "=" + value + expires + "; path=/";
  19. }
  20.  
  21.  function checkAccount()
  22.  {
  23.    var user = document.getElementById("Username_login");
  24.    var pass = document.getElementById("password_login");
  25.    if (user.value == "admin@admin.com" && pass.value == "admin")
  26.   {
  27.     createCookie("admin", "yes", 1);
  28.      console.log("WENT INTO THE IF STATEMENT");
  29.     //  window.location.href = '/admin/home/';
  30.  
  31.    }
  32.    else {
  33.     //  window.location.href = '/admin/';
  34.      console.log("WENT INTO THE ELSE STATEMENT");
  35.    }
  36.  
  37.  }
  38.  
  39. </script>
  40. <head>
  41.     <meta charset="UTF-8">
  42.     <title>Log in / Sign up</title>
  43.  
  44.     <script src="https://use.fontawesome.com/1335577d55.js"></script>
  45.     <link href="../../static/login.css" rel="stylesheet">
  46.     <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
  47.     <script src="../../static/index.js"></script>
  48.     <meta name="viewport" content="width=device-width, initial-scale=1">
  49. </head>
  50.  
  51. <body>
  52.  
  53.  
  54.  
  55. {% if account_error %}
  56.     <script type="text/javascript">
  57.         alert('{{account_error}}');
  58.         window.location.replace('login_register');
  59.     </script>
  60. {% endif %}
  61.  
  62. <div class="page-container">
  63.      <div class="title">
  64.          <p class="heading">Group 1's Grocery Store</p>
  65.      </div>
  66.      <div class="container" id="animation-holder"><!-- Nav tabs -->
  67.          <div class="image-container">
  68.              <img src="../../static/img/loginIcon.png">
  69.         </div>
  70.         <div class="container-form">
  71.                     <div class="form-item log-in" id="login-form">
  72.                       <form method="get" action="/admin/home">
  73.                           {% csrf_token %}
  74.                           {{ form.as_p }}
  75.                           <div class="form-input">
  76.                               <input type="text" name="Username" id="Username_login" placeholder="Enter Email">
  77.                           </div>
  78.                           <div class="form-input password">
  79.                               <input type="password" name="Password" id="password_login" placeholder="Enter Password">
  80.                           </div>
  81.                           <div class="buttons-bottom">
  82.                               <input type="submit" name="req_type" onclick="checkAccount()" value="Log-in" class="btn-login btn">
  83.                           </div>
  84.                           <div class="continue-link">
  85.                               <a href="/home/">Go Back To Home Page</a>
  86.                           </div>
  87.                       </form>
  88.                   </div>
  89.  
  90.         </div>
  91.     </div>
  92. </div>
  93. <script src="../../static/jquery.min.js"></script>
  94. <script  src="../../static/index.js"></script>
  95.  
  96. </body>
  97. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement