Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Joel Male - Dashboard</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="icon" href="./images/favicons/favicon.png">
- <link href="plugins/bootstrap/bootstrap.css" rel="stylesheet">
- <link href="plugins/jquery-ui/jquery-ui.min.css" rel="stylesheet">
- <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
- <link href='http://fonts.googleapis.com/css?family=Righteous' rel='stylesheet' type='text/css'>
- <link href="plugins/fancybox/jquery.fancybox.css" rel="stylesheet">
- <link href="plugins/fullcalendar/fullcalendar.css" rel="stylesheet">
- <link href="plugins/xcharts/xcharts.min.css" rel="stylesheet">
- <link href="plugins/select2/select2.css" rel="stylesheet">
- <link href="plugins/justified-gallery/justifiedGallery.css" rel="stylesheet">
- <link href="css/dashboard.css" rel="stylesheet">
- <link href="plugins/chartist/chartist.min.css" rel="stylesheet">
- <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
- <!--[if lt IE 9]>
- <script src="http://getbootstrap.com/docs-assets/js/html5shiv.js"></script>
- <script src="http://getbootstrap.com/docs-assets/js/respond.min.js"></script>
- <![endif]-->
- <style>
- @font-face {
- font-family: 'Iconfont'; /*a name to be used later*/
- src: url('fonts/iconfont.ttf'); /*URL to font*/
- }
- html {
- background-color: gray;
- }
- * {
- font-family: 'Iconfont', sans-serif;
- font-size: 15px;
- }
- .center {
- width: 985px;
- margin: 0 auto;
- text-align: center;
- }
- @import url(http://fonts.googleapis.com/css?family=Exo:100,200,400);
- @import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:700,400,300);
- body{
- margin: 0;
- padding: 0;
- font-family: Arial;
- font-size: 12px;
- }
- .body{
- position: absolute;
- top: -20px;
- left: -20px;
- right: -40px;
- bottom: -40px;
- width: auto;
- height: auto;
- background-image: url(images/loginbg.jpg);
- background-size: cover;
- -webkit-filter: blur(5px);
- z-index: 0;
- }
- .grad{
- position: absolute;
- top: -20px;
- left: -20px;
- right: -40px;
- bottom: -40px;
- width: auto;
- height: auto;
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,0.65))); /* Chrome,Safari4+ */
- z-index: 1;
- opacity: 0.7;
- }
- .header{
- position: absolute;
- top: calc(50% - 35px);
- left: calc(50% - 255px);
- z-index: 2;
- }
- .header div{
- float: left;
- font-family: 'Exo', sans-serif;
- font-size: 40px;
- font-weight: bold;
- }
- .header div span{
- color: #ffb366 !important;
- }
- .pleaselogin p {
- font-size: 18px;
- color: white;
- float: right;
- margin: 0 0 0 20px;
- }
- .login{
- position: absolute;
- top: calc(50% - 75px);
- left: calc(50% - 50px);
- height: 150px;
- width: 350px;
- padding: 10px;
- z-index: 2;
- }
- .login input[type=text]{
- width: 250px;
- height: 30px;
- background: transparent;
- border: 1px solid rgba(255,255,255,0.6);
- border-radius: 2px;
- color: #fff;
- font-family: 'Exo', sans-serif;
- font-size: 16px;
- font-weight: 400;
- padding: 4px;
- }
- .login input[type=password]{
- width: 250px;
- height: 30px;
- background: transparent;
- border: 1px solid rgba(255,255,255,0.6);
- border-radius: 2px;
- color: #fff;
- font-family: 'Exo', sans-serif;
- font-size: 16px;
- font-weight: 400;
- padding: 4px;
- margin-top: 10px;
- }
- .login input[type=submit]{
- width: 260px;
- height: 35px;
- background: #fff;
- border: 1px solid #fff;
- cursor: pointer;
- border-radius: 2px;
- color: #a18d6c;
- font-family: 'Exo', sans-serif;
- font-size: 16px;
- font-weight: 400;
- padding: 6px;
- margin-top: 10px;
- }
- ::-webkit-input-placeholder { /* WebKit, Blink, Edge */
- padding-left: 5px;
- }
- :-moz-placeholder { /* Mozilla Firefox 4 to 18 */
- padding-left: 5px;
- }
- ::-moz-placeholder { /* Mozilla Firefox 19+ */
- padding-left: 5px;
- }
- :-ms-input-placeholder { /* Internet Explorer 10-11 */
- padding-left: 5px;
- }
- .login input[type=submit]:hover{
- opacity: 0.8;
- }
- .login input[type=submit]:active{
- opacity: 0.6;
- }
- .login input[type=text]:focus{
- outline: none;
- border: 1px solid rgba(255,255,255,0.9);
- }
- .login input[type=password]:focus{
- outline: none;
- border: 1px solid rgba(255,255,255,0.9);
- }
- .login input[type=submit]:focus{
- outline: none;
- }
- ::-webkit-input-placeholder{
- color: rgba(255,255,255,0.6);
- }
- ::-moz-input-placeholder{
- color: rgba(255,255,255,0.6);
- }
- .textHeader {
- width: 985px;
- margin: 0 auto;
- text-align: center;
- }
- .textHeader a {
- font-size: 20px;
- text-decoration: none;
- }
- .displayEmails {
- margin-left: auto;
- margin-right: auto;
- width: 40%;
- }
- @media screen and (max-width: 410px) {
- .header {
- margin-top: 40%;
- position: relative;
- text-align: center;
- top: 0;
- left: 0;
- }
- .header div {
- float: none;
- }
- .pleaselogin p {
- float: none;
- margin: -15px 0 0 -10px;
- }
- .login {
- position: relative;
- text-align: center;
- left: 0;
- }
- }
- </style>
- <?php
- session_start();
- if (isset($_SESSION["username_login"])) {
- $username = $_SESSION["username_login"];
- $loggedIn = true;
- }
- // User login
- if (isset($_POST["username_login"]) && isset($_POST["password_login"])) {
- $username_login = preg_replace('#[^A-Za-z0-9]#i', '', $_POST["username_login"]); // Filter everything but numbers and letters
- $password_login = preg_replace('#[^A-Za-z0-9]#i', '', $_POST["password_login"]);
- $db = mysqli_connect() or die("Could not connect to database!");
- $login_query = mysqli_query($db, "SELECT user_id, username FROM users WHERE username='$username_login' AND password='$password_login' LIMIT 1");
- // Check to see if the user exists
- $userCount = mysqli_num_rows($login_query);
- if ($userCount == 1) {
- while($row = mysqli_fetch_array($login_query)) {
- $user_id = $row['id'];
- $username = $row['username'];
- }
- $_SESSION["username_login"] = $username_login;
- header("Location: dashboard.php");
- exit();
- } else {
- echo "<p style='text-align: center; font-size: 16px; margin: 30px 0px -5px 0px;'>That information is incorrect, please try again.</p><br/><a href='index.php' style='text-align: center; text-decoration: none; font-size: 16px;'><p style='text-align: center;'>OK</p></a>";
- exit();
- }
- }
- ?>
- <script src="js/prefixfree.min.js"></script>
- </head>
- <body>
- <!-- NOT LOGGED IN - SO DISPLAY THE FORM -->
- <div class="body"></div>
- <div class="grad"></div>
- <div class="header">
- <div>Email<span>History</span></div><br/>
- <div class="pleaselogin"><p>Please login</p></div>
- </div>
- <br>
- <div class="login">
- <form action="dashboard.php" method="POST">
- <input type="text" placeholder="username" name="username_login"><br>
- <input type="password" placeholder="password" name="password_login"><br>
- <input type="submit" name="login" value="Login">
- </form>
- </div>
- <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
- <!-- END OF NOT LOGGED IN - SO DISPLAY THE FORM -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement