Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html >
- <script>
- /*
- creates a cookie with a given name, a value, and a number of days that it is active for
- */
- function createCookie(name,value,days){
- if (days)
- {
- var date = new Date();
- date.setTime(date.getTime() + (days * 24 * 60 * 60 *1000));
- var expires = "; expires=" + date.toGMTString();
- }
- else
- {
- var expires = "";
- }
- document.cookie = name + "=" + value + expires + "; path=/";
- }
- function checkAccount()
- {
- var user = document.getElementById("Username_login");
- var pass = document.getElementById("password_login");
- if (user.value == "admin@admin.com" && pass.value == "admin")
- {
- createCookie("admin", "yes", 1);
- console.log("WENT INTO THE IF STATEMENT");
- // window.location.href = '/admin/home/';
- }
- else {
- // window.location.href = '/admin/';
- console.log("WENT INTO THE ELSE STATEMENT");
- }
- }
- </script>
- <head>
- <meta charset="UTF-8">
- <title>Log in / Sign up</title>
- <script src="https://use.fontawesome.com/1335577d55.js"></script>
- <link href="../../static/login.css" rel="stylesheet">
- <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
- <script src="../../static/index.js"></script>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- </head>
- <body>
- {% if account_error %}
- <script type="text/javascript">
- alert('{{account_error}}');
- window.location.replace('login_register');
- </script>
- {% endif %}
- <div class="page-container">
- <div class="title">
- <p class="heading">Group 1's Grocery Store</p>
- </div>
- <div class="container" id="animation-holder"><!-- Nav tabs -->
- <div class="image-container">
- <img src="../../static/img/loginIcon.png">
- </div>
- <div class="container-form">
- <div class="form-item log-in" id="login-form">
- <form method="get" action="/admin/home">
- {% csrf_token %}
- {{ form.as_p }}
- <div class="form-input">
- <input type="text" name="Username" id="Username_login" placeholder="Enter Email">
- </div>
- <div class="form-input password">
- <input type="password" name="Password" id="password_login" placeholder="Enter Password">
- </div>
- <div class="buttons-bottom">
- <input type="submit" name="req_type" onclick="checkAccount()" value="Log-in" class="btn-login btn">
- </div>
- <div class="continue-link">
- <a href="/home/">Go Back To Home Page</a>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- <script src="../../static/jquery.min.js"></script>
- <script src="../../static/index.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement