Advertisement
Guest User

index

a guest
Sep 6th, 2015
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.25 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Joel Male - Dashboard</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="icon" href="./images/favicons/favicon.png">
  8.  
  9. <link href="plugins/bootstrap/bootstrap.css" rel="stylesheet">
  10. <link href="plugins/jquery-ui/jquery-ui.min.css" rel="stylesheet">
  11. <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
  12. <link href='http://fonts.googleapis.com/css?family=Righteous' rel='stylesheet' type='text/css'>
  13. <link href="plugins/fancybox/jquery.fancybox.css" rel="stylesheet">
  14. <link href="plugins/fullcalendar/fullcalendar.css" rel="stylesheet">
  15. <link href="plugins/xcharts/xcharts.min.css" rel="stylesheet">
  16. <link href="plugins/select2/select2.css" rel="stylesheet">
  17. <link href="plugins/justified-gallery/justifiedGallery.css" rel="stylesheet">
  18. <link href="css/dashboard.css" rel="stylesheet">
  19. <link href="plugins/chartist/chartist.min.css" rel="stylesheet">
  20. <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  21. <!--[if lt IE 9]>
  22. <script src="http://getbootstrap.com/docs-assets/js/html5shiv.js"></script>
  23. <script src="http://getbootstrap.com/docs-assets/js/respond.min.js"></script>
  24. <![endif]-->
  25.  
  26. <style>
  27. @font-face {
  28. font-family: 'Iconfont'; /*a name to be used later*/
  29. src: url('fonts/iconfont.ttf'); /*URL to font*/
  30. }
  31.  
  32. html {
  33. background-color: gray;
  34. }
  35.  
  36. * {
  37. font-family: 'Iconfont', sans-serif;
  38. font-size: 15px;
  39. }
  40.  
  41. .center {
  42. width: 985px;
  43. margin: 0 auto;
  44. text-align: center;
  45. }
  46.  
  47. @import url(http://fonts.googleapis.com/css?family=Exo:100,200,400);
  48. @import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:700,400,300);
  49.  
  50. body{
  51. margin: 0;
  52. padding: 0;
  53. font-family: Arial;
  54. font-size: 12px;
  55. }
  56.  
  57. .body{
  58. position: absolute;
  59. top: -20px;
  60. left: -20px;
  61. right: -40px;
  62. bottom: -40px;
  63. width: auto;
  64. height: auto;
  65. background-image: url(images/loginbg.jpg);
  66. background-size: cover;
  67. -webkit-filter: blur(5px);
  68. z-index: 0;
  69. }
  70.  
  71. .grad{
  72. position: absolute;
  73. top: -20px;
  74. left: -20px;
  75. right: -40px;
  76. bottom: -40px;
  77. width: auto;
  78. height: auto;
  79. 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+ */
  80. z-index: 1;
  81. opacity: 0.7;
  82. }
  83.  
  84. .header{
  85. position: absolute;
  86. top: calc(50% - 35px);
  87. left: calc(50% - 255px);
  88. z-index: 2;
  89. }
  90.  
  91. .header div{
  92. float: left;
  93. font-family: 'Exo', sans-serif;
  94. font-size: 40px;
  95. font-weight: bold;
  96. }
  97.  
  98. .header div span{
  99. color: #ffb366 !important;
  100. }
  101.  
  102. .pleaselogin p {
  103. font-size: 18px;
  104. color: white;
  105. float: right;
  106. margin: 0 0 0 20px;
  107. }
  108.  
  109. .login{
  110. position: absolute;
  111. top: calc(50% - 75px);
  112. left: calc(50% - 50px);
  113. height: 150px;
  114. width: 350px;
  115. padding: 10px;
  116. z-index: 2;
  117. }
  118.  
  119. .login input[type=text]{
  120. width: 250px;
  121. height: 30px;
  122. background: transparent;
  123. border: 1px solid rgba(255,255,255,0.6);
  124. border-radius: 2px;
  125. color: #fff;
  126. font-family: 'Exo', sans-serif;
  127. font-size: 16px;
  128. font-weight: 400;
  129. padding: 4px;
  130. }
  131.  
  132. .login input[type=password]{
  133. width: 250px;
  134. height: 30px;
  135. background: transparent;
  136. border: 1px solid rgba(255,255,255,0.6);
  137. border-radius: 2px;
  138. color: #fff;
  139. font-family: 'Exo', sans-serif;
  140. font-size: 16px;
  141. font-weight: 400;
  142. padding: 4px;
  143. margin-top: 10px;
  144. }
  145.  
  146. .login input[type=submit]{
  147. width: 260px;
  148. height: 35px;
  149. background: #fff;
  150. border: 1px solid #fff;
  151. cursor: pointer;
  152. border-radius: 2px;
  153. color: #a18d6c;
  154. font-family: 'Exo', sans-serif;
  155. font-size: 16px;
  156. font-weight: 400;
  157. padding: 6px;
  158. margin-top: 10px;
  159. }
  160.  
  161. ::-webkit-input-placeholder { /* WebKit, Blink, Edge */
  162. padding-left: 5px;
  163.  
  164. }
  165. :-moz-placeholder { /* Mozilla Firefox 4 to 18 */
  166. padding-left: 5px;
  167. }
  168. ::-moz-placeholder { /* Mozilla Firefox 19+ */
  169. padding-left: 5px;
  170. }
  171. :-ms-input-placeholder { /* Internet Explorer 10-11 */
  172. padding-left: 5px;
  173. }
  174.  
  175. .login input[type=submit]:hover{
  176. opacity: 0.8;
  177. }
  178.  
  179. .login input[type=submit]:active{
  180. opacity: 0.6;
  181. }
  182.  
  183. .login input[type=text]:focus{
  184. outline: none;
  185. border: 1px solid rgba(255,255,255,0.9);
  186. }
  187.  
  188. .login input[type=password]:focus{
  189. outline: none;
  190. border: 1px solid rgba(255,255,255,0.9);
  191. }
  192.  
  193. .login input[type=submit]:focus{
  194. outline: none;
  195. }
  196.  
  197. ::-webkit-input-placeholder{
  198. color: rgba(255,255,255,0.6);
  199. }
  200.  
  201. ::-moz-input-placeholder{
  202. color: rgba(255,255,255,0.6);
  203. }
  204.  
  205. .textHeader {
  206. width: 985px;
  207. margin: 0 auto;
  208. text-align: center;
  209. }
  210.  
  211. .textHeader a {
  212. font-size: 20px;
  213. text-decoration: none;
  214. }
  215.  
  216. .displayEmails {
  217. margin-left: auto;
  218. margin-right: auto;
  219. width: 40%;
  220. }
  221.  
  222. @media screen and (max-width: 410px) {
  223. .header {
  224. margin-top: 40%;
  225. position: relative;
  226. text-align: center;
  227. top: 0;
  228. left: 0;
  229. }
  230.  
  231. .header div {
  232. float: none;
  233. }
  234.  
  235. .pleaselogin p {
  236. float: none;
  237. margin: -15px 0 0 -10px;
  238. }
  239.  
  240. .login {
  241. position: relative;
  242. text-align: center;
  243. left: 0;
  244. }
  245. }
  246.  
  247. </style>
  248. <?php
  249.  
  250. session_start();
  251. if (isset($_SESSION["username_login"])) {
  252. $username = $_SESSION["username_login"];
  253. $loggedIn = true;
  254. }
  255.  
  256. // User login
  257. if (isset($_POST["username_login"]) && isset($_POST["password_login"])) {
  258. $username_login = preg_replace('#[^A-Za-z0-9]#i', '', $_POST["username_login"]); // Filter everything but numbers and letters
  259. $password_login = preg_replace('#[^A-Za-z0-9]#i', '', $_POST["password_login"]);
  260.  
  261. $db = mysqli_connect() or die("Could not connect to database!");
  262. $login_query = mysqli_query($db, "SELECT user_id, username FROM users WHERE username='$username_login' AND password='$password_login' LIMIT 1");
  263.  
  264. // Check to see if the user exists
  265. $userCount = mysqli_num_rows($login_query);
  266.  
  267. if ($userCount == 1) {
  268. while($row = mysqli_fetch_array($login_query)) {
  269. $user_id = $row['id'];
  270. $username = $row['username'];
  271. }
  272. $_SESSION["username_login"] = $username_login;
  273. header("Location: dashboard.php");
  274. exit();
  275. } else {
  276. 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>";
  277. exit();
  278. }
  279. }
  280. ?>
  281. <script src="js/prefixfree.min.js"></script>
  282. </head>
  283. <body>
  284.  
  285. <!-- NOT LOGGED IN - SO DISPLAY THE FORM -->
  286. <div class="body"></div>
  287. <div class="grad"></div>
  288. <div class="header">
  289. <div>Email<span>History</span></div><br/>
  290. <div class="pleaselogin"><p>Please login</p></div>
  291. </div>
  292. <br>
  293. <div class="login">
  294. <form action="dashboard.php" method="POST">
  295. <input type="text" placeholder="username" name="username_login"><br>
  296. <input type="password" placeholder="password" name="password_login"><br>
  297. <input type="submit" name="login" value="Login">
  298. </form>
  299. </div>
  300.  
  301. <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
  302. <!-- END OF NOT LOGGED IN - SO DISPLAY THE FORM -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement