/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
- <?php
- session_start();
- include('conn.php');
- $select="select * from login_detail where username='".$_POST['username']."' and password='".$_POST['password']."'";
- $view=mysql_query($select) or die("Error in Insert plantype Table".mysql_error());
- $num=mysql_fetch_array($view);
- if($num>0)
- {
- // print_r($num);
- $_SESSION['username'] = $num['trainee_fname'];
- $_SESSION['loguser'] = $num['username'];
- $_SESSION['pass'] = $num['password'];
- header('location:dashboard.php');
- }
- else
- {
- echo "incorrect login";
- }
- ?>
- <!DOCTYPE html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Nex-G</title>
- <link rel="stylesheet" href="css/style.default.css" type="text/css" />
- <script type="text/javascript" src="/admin/js/jquery-1.8.3.min.js"></script>
- </head>
- <body class="loginbody">
- <div class="loginwrapper">
- <div class="loginwrap zindex100 animate2 bounceInDown">
- <h1 class="logintitle"><span class="iconfa-lock"></span> Sign In <span class="subtitle">Hello! Sign in to get you started!</span></h1>
- <div class="loginwrapperinner">
- <form id="loginform" action="" method="post">
- <p class="animate4 bounceIn"><input type="text" id="username" name="username" placeholder="Username" /></p>
- <p class="animate5 bounceIn"><input type="password" id="password" name="password" placeholder="Password" /></p>
- <p class="animate6 bounceIn"><button class="btn btn-default btn-block">Submit</button></p>
- <p class="animate7 fadeIn"><a href="#"><span class="icon-question-sign icon-white"></span> Forgot Password?</a></p>
- </form>
- </div><!--loginwrapperinner-->
- </div>
- <div class="loginshadow animate3 fadeInUp"></div>
- </div><!--loginwrapper-->
- <script type="text/javascript">
- jQuery.noConflict();
- jQuery(document).ready(function(){
-
- var anievent = (jQuery.browser.webkit)? 'webkitAnimationEnd' : 'animationend';
- jQuery('.loginwrap').bind(anievent,function(){
- jQuery(this).removeClass('animate2 bounceInDown');
- });
-
- jQuery('#username,#password').focus(function(){
- if(jQuery(this).hasClass('error')) jQuery(this).removeClass('error');
- });
-
- jQuery('#loginform button').click(function(){
- if(!jQuery.browser.msie) {
- if(jQuery('#username').val() == '' || jQuery('#password').val() == '') {
- if(jQuery('#username').val() == '') jQuery('#username').addClass('error'); else jQuery('#username').removeClass('error');
- if(jQuery('#password').val() == '') jQuery('#password').addClass('error'); else jQuery('#password').removeClass('error');
- jQuery('.loginwrap').addClass('animate0 wobble').bind(anievent,function(){
- jQuery(this).removeClass('animate0 wobble');
- });
- } else {
- jQuery('.loginwrapper').addClass('animate0 fadeOutUp').bind(anievent,function(){
- jQuery('#loginform').submit();
- });
- }
- return false;
- }
- });
- });
- </script>
- </body>
- </html>