
<!DOCTYPE html>

<?php 

?>
<html>
  <head>
    <meta charset="utf-8">
    <title>Login-CI Login Registration</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" media="screen" title="no title">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  <link rel="stylesheet" href="<?= base_url() ?>assets/admin/css/login.css">
  </head>
  <body>

    <div class="container">
    <div class="row">
        <div class="col-md-4 col-md-offset-4">
            <div class="login-panel panel panel-success">
                <div class="panel-heading">
                    <h3 class="panel-title">Login</h3>
                </div>
                <?php
              $success_msg= $this->session->flashdata('success_msg');
              $error_msg= $this->session->flashdata('error_msg');

                  if($success_msg){
                    ?>
                    <div class="alert alert-success">
                      <?php echo $success_msg; ?>
                    </div>
                  <?php
                  }
                  if($error_msg){
                    ?>
                    <div class="alert alert-danger">
                      <?php echo $error_msg; ?>
                    </div>
                    <?php
                  }
                  ?>

                <div class="panel-body">
                    <form role="form" method="post" action="<?php echo base_url('index.php/welcome/dashboard'); ?>">
                        <fieldset>
                            <div class="form-group"  >
                                <input class="form-control useremail" placeholder="E-mail" name="user_email" type="email" autofocus>
                            </div>
                            <div class="form-group">
                                <input class="form-control" placeholder="Password" name="user_password" type="password" value="">
                            </div>


                                <input class="btn btn-lg btn-success btn-block" type="submit" value="login" name="login" >

                        </fieldset>
                    </form>
                   <!-- <div class="row">
                <div class="reg-sec col-xs-12 col-sm-6 col-md-6">
                <a class="btn ac" data-toggle="modal" data-target="#myModal" >Don't Have an Account?</a>
              </div> 
              <div class="reg-forget col-xs-12 col-sm-6 col-md-6">
                <a class="btn ac" data-toggle="modal" data-target="#forgotModal" onclick="forgot()" >Lost your password?</a>
              </div>
            </div>-->
              <!--for centered text-->

                </div>
            </div>
        </div>
    </div>

    <!-- <div class="modal fade" id="myModal" role="dialog">
                      <div class="modal-dialog">
                       
                        <div class="modal-content">
                          <div class="modal-header">
                            <button type="button" class="close" id="closemodal" data-dismiss="modal">&times;</button>
                            <h4 class="modal-title">Registration</h4>
                          </div>
                          <div class="modal-body">
                            <form method="post" id="form" action="<?php //echo site_url('user/register_user');?>">
                              <div class="form-group bank">
                      <label for="pwd">First Name:</label>
                      <input type="text" class="form-control " name= "fname">
                      
                    </div>
                             <div class="form-group bank">
                      <label for="pwd">Last Name:</label>
                      <input type="text" class="form-control " name="laname" >
                      
                    </div>
                             <div class="form-group bank">
                      <label for="pwd">Email:</label>
                      <input type="email" class="form-control " name= "email">
                      
                    </div>
                             <div class="form-group bank">
                      <label for="pwd">Password:</label>
                      <input type="password" class="form-control " name="user_password" >
                      
                    </div>
                             <div class="form-group bank">
                      <label for="pwd">Buisness_name:</label>
                      <input type="text" class="form-control " name="buisness_type" >
                      
                    </div>
                             <input type="submit" class="btn btn-success" value="submit">
                              </form></div>
                              <div class="modal-footer">

                  <button type="button"  class="btn btn-danger" data-dismiss="modal">Close</button>
                </div>
                              </div></div></div>
                              
                              <div class="modal fade" id="forgotModal" role="dialog">
                      <div class="modal-dialog">
                     
                        <div class="modal-content">
                          <div class="modal-header">
                            <button type="button" class="close" id="closemodal" data-dismiss="modal">&times;</button>
                            <h4 class="modal-title">Forgot password</h4>
                          </div>
                          <div class="modal-body">
                            <form method="post" id="form" action="<?php //echo site_url('user/forgot');?>">
                            <div class="form-group bank">
                      <label for="pwd">Email:</label>
                      <input type="email" class="form-control forgotemail " placeholder="Enter your email address" name= "forgotemail">
                      
                    </div>
                             <div class="form-group bank">
                      <label for="pwd">Password:</label>
                      <input type="text" class="form-control " placeholder="new-pass" name="forgotpass" >
                      
                    </div>
                           <div class="form-group bank">
                      <label for="pwd">code:</label>
                      <input type="text" class="form-control " placeholder="email-code" name="code" >
                      
                    </div>
                            <input class="btn btn-lg btn-success btn-block" type="submit" value="submit"  >
                             <div class="modal-footer">

                  <button type="button"  class="btn btn-danger" data-dismiss="modal">Close</button>
                </div>
                              </form> </div></div></div></div>--></div>
                              <script>
                                  function forgot(){
                                        var email= $('.useremail').val();
                                      $('.forgotemail').val(email);
                                         $.ajax({
            url: "<?php echo base_url()?>user/forgotpass", 
            type: "POST",
            data    : {'email':email},
                dataType: 'json',
            success: function(data){
                  
            }
        });
                                  }
      </script>

<style type="text/css">
  .login-panel.panel.panel-success {
 margin-top: 50%;
}
</style>
    </body>
</html>
