<!DOCTYPE html>
<html lang="en" class="no-js">

	<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <head>
    	 <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">

    <!-- Bootstrap core CSS -->
    <link href="https://getbootstrap.com/docs/3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="https://getbootstrap.com/docs/3.3/assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <!-- Custom styles for this template -->
   <!--  <link href="navbar-fixed-top.css" rel="stylesheet"> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">    
    <!--<script src="https://getbootstrap.com/docs/3.3/assets/js/ie-emulation-modes-warning.js"></script>-->
    
    </head>

    <body>
    
        <div class="container-fluid" style="text-align: center;">          
              
                <div class="row" style="margin: 12% 18%;border:1px dotted #118258;padding-top:4%;border-radius: 6px;">
           <div class="col-md-6" style=""><h4 style="color:#118258;">Enter your email address to Unsubscribe</h4></div>
                    <div class="col-md-6">
                    <form class="example" style="color:#fff;border:none;border-radius: 10px">
                    
                              <input type="hidden" id="oid" name="oid" value ="<?php echo $_REQUEST['oid'];?>" />
                
                         <div class="input-group">
                            <span class="input-group-addon" style="border: 1px solid #118258;"><i class="glyphicon glyphicon-user" style="color: #118258"></i></span>
                            <input id="email" type="email" class="form-control" name="email" value="" placeholder="Email Address" required style="color: #118258; border: 1px solid #118258;">                                        
                        </div>
                       
                  </form>
                       <div style="text-align: center"><button style="background-color:#cd6252;color:#fff;border: none;border-radius: 4px;margin-top:16px;font-size: 18px;margin-left: 15px;" VALUE="Unsubscribe" onClick="submt()">Unsubscribe</button></div>
 <div id='reslt2' style='color:red'></div> 
               </div>
                </div>
                
    	</div>
    </body>
    </html>
    
     <style>
     .btn{
padding:8px 14px;
background-color:#118258;
color: #fff;
border-radius: 4px;
margin-top:16px;
font-size: 16px;
margin-left: 15px
     }
         
.example {
    border: 1px solid;
    padding: 10px;
   
}
     </style>
        <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script  type="text/javascript" >


function submt()
{
	
var email = $('#email').val();
var oid= $('#oid').val();
var emailReg = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
if(email =='')
{
$('#reslt2').text('Please enter email!');
}
else if (!emailReg.test(email))
{
$('#reslt2').text('Please insert valid Email');
}
else
{
$.ajax({
type: "POST",
url: "unsubsuccess.php",
data: "mail="+email+"&oid="+oid,
success: function(data)
{
$('#reslt2').html("<b>Unsusbcribed Successfully!!");
}
});
return false;
}

}
</script>
