<!DOCTYPE html>
<html class="body-full-height" lang="en"><head>        
        <!-- META SECTION -->
        <title>Contractor App</title>            
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        
        <link rel="icon" href="http://estimates.strandwebsites.com/favicon.ico" type="image/x-icon">
        <!-- END META SECTION -->
        
        <!-- CSS INCLUDE -->        
        <link rel="stylesheet" type="text/css" id="theme" href="<?php echo base_url();?>assets/css/theme-default.css">
		   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <link rel="stylesheet" href="<?php echo base_url();?>assets/css/custom.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
        <!-- EOF CSS INCLUDE -->    
        
        <style>
 .log-form .btn-success {
    background: #fff;
    color: #157bff;
    font-weight: bold;
}
</style>                                
</head>
    
    <body cz-shortcut-listen="true" class="min-h100">
        
		
		<div class="d-flex min-h100">
			<div class="log-left">
				<img src="<?php echo base_url();?>assets/images/logo.png"/>
			</div>
			<div class="log-right gred-back">
				<div class="log-form">
                 <form method="post" id="send_mail" action="">
					<h2 class="text-center cw bold">FORGOT PASSWORD</h2>
                    <center><h4><font color="red">
                          <?php echo $this->session->flashdata('response');
						  ?>
						  </font></h4></center>
					<div class="form-group">
					  <input type="text" class="form-control" id="email" name="email" placeholder="Username">
					</div>
					<div class="form-group text-center">
                   <a href=""><input class="btn btn-success btn-style" value="Get Password" type="submit"></a>
					<!--<button class="btn btn-success btn-style">Get Password</button>-->
					</div>
                    </form>
				</div>
			</div>
		</div>
		
<script>
 $("#send_mail").submit(function(e){
   e.preventDefault();
  var email = $("#email").val();
            $.ajax({
                type: "POST",
                url: '<?php echo base_url() ?>index.php/admin/forget_password',
                data: {email:email},
                success:function(data)
                {
					
				    if(data == 1)
					{
						
                    alert('Mail sent successfully');
					 window.location = "<?php echo base_url();?>index.php/admin/subscription";
					}else{
					
					    alert('Email address not exists');
						
					}
                },
                error:function()
                {
                   window.location = "<?php echo base_url();?>index.php/admin/index";
                }
            });
   
   
   
    });
</script>


</body></html>