PageRenderTime 46ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/mgmt/trainee_login/index.php

https://gitlab.com/msdusad/all_ones
PHP | 82 lines | 71 code | 10 blank | 1 comment | 14 complexity | eca560abab5edf8df9ceaf3f273b4f92 MD5 | raw file
  1. <?php
  2. session_start();
  3. include('conn.php');
  4. $select="select * from login_detail where username='".$_POST['username']."' and password='".$_POST['password']."'";
  5. $view=mysql_query($select) or die("Error in Insert plantype Table".mysql_error());
  6. $num=mysql_fetch_array($view);
  7. if($num>0)
  8. {
  9. // print_r($num);
  10. $_SESSION['username'] = $num['trainee_fname'];
  11. $_SESSION['loguser'] = $num['username'];
  12. $_SESSION['pass'] = $num['password'];
  13. header('location:dashboard.php');
  14. }
  15. else
  16. {
  17. echo "incorrect login";
  18. }
  19. ?>
  20. <!DOCTYPE html>
  21. <head>
  22. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  23. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  24. <title>Nex-G</title>
  25. <link rel="stylesheet" href="css/style.default.css" type="text/css" />
  26. <script type="text/javascript" src="/admin/js/jquery-1.8.3.min.js"></script>
  27. </head>
  28. <body class="loginbody">
  29. <div class="loginwrapper">
  30. <div class="loginwrap zindex100 animate2 bounceInDown">
  31. <h1 class="logintitle"><span class="iconfa-lock"></span> Sign In <span class="subtitle">Hello! Sign in to get you started!</span></h1>
  32. <div class="loginwrapperinner">
  33. <form id="loginform" action="" method="post">
  34. <p class="animate4 bounceIn"><input type="text" id="username" name="username" placeholder="Username" /></p>
  35. <p class="animate5 bounceIn"><input type="password" id="password" name="password" placeholder="Password" /></p>
  36. <p class="animate6 bounceIn"><button class="btn btn-default btn-block">Submit</button></p>
  37. <p class="animate7 fadeIn"><a href="#"><span class="icon-question-sign icon-white"></span> Forgot Password?</a></p>
  38. </form>
  39. </div><!--loginwrapperinner-->
  40. </div>
  41. <div class="loginshadow animate3 fadeInUp"></div>
  42. </div><!--loginwrapper-->
  43. <script type="text/javascript">
  44. jQuery.noConflict();
  45. jQuery(document).ready(function(){
  46. var anievent = (jQuery.browser.webkit)? 'webkitAnimationEnd' : 'animationend';
  47. jQuery('.loginwrap').bind(anievent,function(){
  48. jQuery(this).removeClass('animate2 bounceInDown');
  49. });
  50. jQuery('#username,#password').focus(function(){
  51. if(jQuery(this).hasClass('error')) jQuery(this).removeClass('error');
  52. });
  53. jQuery('#loginform button').click(function(){
  54. if(!jQuery.browser.msie) {
  55. if(jQuery('#username').val() == '' || jQuery('#password').val() == '') {
  56. if(jQuery('#username').val() == '') jQuery('#username').addClass('error'); else jQuery('#username').removeClass('error');
  57. if(jQuery('#password').val() == '') jQuery('#password').addClass('error'); else jQuery('#password').removeClass('error');
  58. jQuery('.loginwrap').addClass('animate0 wobble').bind(anievent,function(){
  59. jQuery(this).removeClass('animate0 wobble');
  60. });
  61. } else {
  62. jQuery('.loginwrapper').addClass('animate0 fadeOutUp').bind(anievent,function(){
  63. jQuery('#loginform').submit();
  64. });
  65. }
  66. return false;
  67. }
  68. });
  69. });
  70. </script>
  71. </body>
  72. </html>