ok
Direktori : /home2/selectio/www/caliberembedded.com/new/admin/ |
Current File : //home2/selectio/www/caliberembedded.com/new/admin/index.php |
<?php ob_start(); session_start(); $error_message=''; include"config/config.php"; if(isset($_POST['login'])) { if(empty($_POST['username']) || empty($_POST['password'])) { $error_message = 'Username or Password can not be empty'; } else { $username = strip_tags($_POST['username']); $password = strip_tags($_POST['password']); $statement = $pdo->prepare("SELECT * FROM tbl_admin WHERE username=? AND password=?"); $statement->execute(array($username,$password)); $total = $statement->rowCount(); $result = $statement->fetchAll(PDO::FETCH_ASSOC); if($total==0) { $error_message = 'Username does not match'; }else { $_SESSION['admin'] = $result[0]; header("location: dashboard.php"); } } } ?> <!DOCTYPE html> <style> .login-page-green{ background: transparent; } .login-box-bodys{ background: #4e36367a; padding: 20px; border-top: 0; border-radius: 20px; color: white; font-weight: bold; } </style> <html> <head> <meta charset="UTF-8"> <title>Login | RVM </title> <link rel="shortcut icon" href="assets/images/icon.png"/> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=yes" name="viewport"> <link href="assets/dist/css/styles.css" rel="stylesheet" type="text/css" /> </head> <body class="login-page rtl rtl-inv" style="background-image: url('../assets/images/slider/slider-2.jpg');background-repeat: no-repeat;background-attachment: fixed; background-size: cover;"> <div class="login-box"> <div class="login-logo"> <!--<a href="login.php"><img src="img/admin-profile.jpg" width="150px" height="150px" alt="Allchettiyarmarriage" /></a>--> <a class="logo" style="color: #063a08;font-weight: 900;">Agastya</a> </div> <div class="login-box-bodys"> <p class="login-box-msg">Please login to your account.</p> <form action="" method="post" accept-charset="utf-8"> <div class="form-group has-feedback"> <input type="text" name="username" value="" class="form-control" placeholder="Username" /> <span class="glyphicon glyphicon-envelope form-control-feedback"></span> </div> <div class="form-group has-feedback"> <input type="password" name="password" value="" class="form-control" placeholder="Password" /> <span class="glyphicon glyphicon-lock form-control-feedback"></span> </div> <?php if( (isset($error_message)) && ($error_message!='') ): echo '<div class="error" style="color:red;">'.$error_message.'</div>'; endif; ?> <div class="checkbox pull-left" style="margin-top: 0;"> <div class="custom-checkbox"> <input type="checkbox" name="remember" value="1" checked="checked" id="remember" /> <label for="remember" style="padding-left:5px;">Remember me</label> </div> </div> <button type="submit" name="login" class="btn btn-primary btn-block btn-flat"><i class="glyphicon glyphicon-log-in"></i> Sign in</button> </form> <!--<div class=""> <p> </p> <p><span class="text-danger">Forgot your password?</span><br> Don't worry! <a href="#" class="text-danger" data-toggle="modal" data-target="#myModal">click here</a> To Reset </p> </div>--> </div> </div> <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <form action="" method="post" accept-charset="utf-8"> <input type="hidden" name="spos_token" value="979cb0ee8c0288cd1c35a24d683ad9e1" /> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</i></button> <h4 class="modal-title">Forgot Password?</h4> </div> <div class="modal-body"> <p>Enter your e-mail address below to reset your password.</p> <input type="email" name="forgot_email" placeholder="Email" autocomplete="off" class="form-control placeholder-no-fix"> </div> <div class="modal-footer"> <button data-dismiss="modal" class="btn btn-default pull-left" type="button">Close</button> <button class="btn btn-primary" type="submit" name="login">Submit</button> </div> </form> </div> </div> </div> <script src="assets/plugins/jQuery/jQuery-2.1.4.min.js"></script> <script src="assets/bootstrap/js/bootstrap.min.js" type="text/javascript"></script> <script src="assets/plugins/iCheck/icheck.min.js" type="text/javascript"></script> <script> $(function () { if ($('#identity').val()) $('#password').focus(); else $('#identity').focus(); $('input').iCheck({ checkboxClass: 'icheckbox_square-blue', radioClass: 'iradio_square-blue', increaseArea: '20%' }); }); </script> </body> </html>