<!DOCTYPE HTML>
<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>Netbutterfly Classifed Services</title>
<link href="<?php echo ROOTPATH;?>/view/css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="<?php echo ROOTPATH;?>/view/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="<?php echo ROOTPATH;?>/view/css/bootstrap-theme.css" rel="stylesheet" type="text/css">
<link href="<?php echo ROOTPATH;?>/view/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css">
<link href="<?php echo ROOTPATH;?>/view/css/style.css" rel="stylesheet" type="text/css">
<link href="<?php echo ROOTPATH;?>/view/fonts/font.css" rel="stylesheet" type="text/css">


<script src="<?php echo ROOTPATH;?>/jquery/jquery-1.11.1.min.js"></script>
<script src="<?php echo ROOTPATH;?>/jquery/jquery.validate.js"></script> 
<script src="<?php echo ROOTPATH;?>/view/js/jquery-ui.js"></script>      
<script src="<?php echo ROOTPATH;?>/view/js/select2.js"></script>       
<!--<link rel="stylesheet" href="//code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">-->
<link rel="stylesheet" href="<?php echo ROOTPATH;?>/view/css/select2.min.css">


<!--<link rel="stylesheet" href="<?php echo ROOTPATH;?>/view/css/foundation.min.css">    -->
<link rel="stylesheet" href="<?php echo ROOTPATH;?>/view/css/foundation-datepicker.min.css">   
<link rel="stylesheet" href="<?php echo ROOTPATH;?>/view/css/checkbox-styles.css">   
<script src="<?php echo ROOTPATH;?>/view/js/foundation-datepicker.js"></script>
<script src="<?php echo ROOTPATH;?>/view/js/foundation-datepicker.vi.js"></script>  
<script src="<?php echo ROOTPATH;?>/view/js/foundation.min.js"></script>

<script src="<?php echo ROOTPATH;?>/view/js/tab/city-loading.js"></script>  
<script src="<?php echo ROOTPATH;?>/view/js/tab/category-loading.js"></script>   
<link rel="shortcut icon" type="image/png" href="<?php echo ROOTPATH;?>/view/images/fevicon.png?v=2"/>
<!--[if lt IE 9]>
<script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
<![endif]-->
<!--[if lt IE 9]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
 <![endif]-->

<style>

/* The message box is shown when the user clicks on the password field */

#message span{
  padding: 10px 10px;
  font-size: 12px;
}

/* Add a green text color and a checkmark when the requirements are right */
.correct {
  color: green;
}

.correct:before {
  position: relative;
  left: -10px;
  content: "✔";
}

/* Add a red text color and an "x" when the requirements are wrong */
.invalid {
  color: red;
}

.invalid:before {
  position: relative;
  left: -10px;
  content: "✖";
}
</style> 

<script>
URL = "<?php echo ROOTPATH;?>";    
login_url_val = "<?php echo $login_url_val;?>";  
site_custom_id = "<?php echo $_COOKIE['site_custom_id'];?>"; 
 
function clear_error_msg()
{
    $("label.error").hide();
    $(".error").removeClass("error");
    $("#login_msg").html("");
}

function setCookie(cvalue,exdays) 
{ 	
	cname = "loginCookies";
	var d = new Date();
	d.setTime(d.getTime() + (exdays*24*60*60*1000));
	var expires = "expires=" + d.toGMTString();
	document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";	
	location.reload();
} 

function getCookie() 
{
  cname = "loginCookies";
  var name = cname + "=";
  var decodedCookie = decodeURIComponent(document.cookie);
  var ca = decodedCookie.split(';');        
  var ca1 = ca.toString();      
  var ca2 = ca1.split(',');       
  var set = 0;   
  for(var i = 0; i < ca2.length; i++) 
  { 
	  str = (ca2[i].trim());
	  ca3 = str.split('=');          
	  if(ca3[0]=="loginCookies") 
	  {
		  return ca3[1]; 
	  }    
  }  
} 

function removeCookie()
{
	$.ajax({	
	type: "POST",
	url: URL+"/login_logout.php", 
	data: {unset_login_cookies:1},
	beforeSend: function(){ 
	},
	success: function(data)
	{ 
		 						   
	}
  });
}
  
 
$(document).ready(function()
{  
	 user = getCookie();      
	 if(user==1)
	 { 
		$('#login').modal('show');  
		removeCookie();
	 }else  if(user==2)
	 { 
		$('#registration').modal('show');  
		removeCookie();
	 }else  if(user==3)
	 { 
		$('#forgot_password').modal('show');  
		removeCookie();
	 }
		
	 $(".Login_box").click( function()
	 {
		clear_error_msg();				
		$('#login').modal('show');
		$('#registration').modal('hide');
	 });
	 
	 $(".Register_box").click( function()
	 {
		clear_error_msg();
		//$("#reg_some_div").hide();
		//$("#resend_reg_otp").hide();			
		$('#registration').modal('show');
		$('#login').modal('hide');
	 });  
			
		if(login_url_val==1)
		{ 
			$("#login").modal({
			show: 'true',
			backdrop: 'static',
			keyboard:true
			});  
		}
		
		$("#login_modal").click( function()
		{ 
			user=1;
			setCookie(user,30);	    
		});
		
		$("#registration_modal").click( function()
		{
			user=2;
			setCookie(user,30);	    
		});
		
		$("#forgot_password_modal").click( function()
		{
			user=3;
			setCookie(user,30);	    
		});  
	});  
	
	function myFunction1() 
	{	   
	   $("#registrationform").validate().resetForm();
	   //$("#loginform").validate().resetForm();
	   $("#registrationform").closest('form').find("input[type=text], textarea,input[type=password]").val("");
       $("#loginform").closest('form').find("input[type=text], textarea, input[type=password]").val(""); 
       
	   
		var myInput = document.getElementById("registered_password");
		var letter = document.getElementById("letter");
		var capital = document.getElementById("capital");
		var number = document.getElementById("number");
		var length = document.getElementById("length");
		var special_character=document.getElementById("special_character");

		letter.classList.add("invalid");
		capital.classList.add("invalid");
		number.classList.add("invalid");
		length.classList.add("invalid");
		special_character.classList.add("invalid");
	   
	   clear_error_msg();
	   
	   $.ajax({	
		type: "POST",
		url: URL+"/all-ajax/general-ajax.php", 
		data: {unset_data:1},
		beforeSend: function(){ 
		},
		success: function(data)
		{   
		    			
		}
	  });
	}



</script>
</head>
<body>
<header>
  
<!-- Modal -->
<div class="modal fade" id="login" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog loginPop" role="document">
    <div class="modal-content loginBox">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		<div class="loginLogo">
		<img src="<?php echo ROOTPATH;?>/view/images/wt-logo.png" alt="logo">
		</div>
		<div class="loginRight">
		<h2 id="login_here">Login Here</h2>
		<h2 id="forgot_password_heading">Forgot Password</h2>
			<form class="login_form1" action="" method="post" id="loginform" autocomplete="off"><!--<?php echo ROOTPATH;?>/login_logout.php -->
			<input class="loginInput" type="text" placeholder="Mobile No / Email Address" name="login_id"  id="login_id" />	
			<input class="loginInput" type="password" placeholder="Password" name="password"  id="password"  />
			<center><a href="javascript:void(0);" id="show_pwd">Show Password</a></center>	
			<input class="checkBox" type="checkbox" name="login_terms" value="1" id="login_terms"/> 
            <span class="terms_condn" id="login_terms_condn"><a data-toggle="modal" data-target="#terms_condn">I am agree with the terms and conditions</a></span>			
			<input class="loginButton" type="submit"   name="submitlogin"  value="Login"  id="submit_login" />
            <!--<input class="loginInput" type="text" placeholder="Mobile No / Email Address" name="forgot_pass"  id="forgot_pass" />		
            <input class="loginButtonBtn" type="button" name="submit_reset"  value="Reset Password"  id="submit_reset" />	-->		
			<input class="loginButton" type="button" name="submit_login_otp"  value="Login with OTP"  id="submit_login_otp" /> 
			<input class="loginInput" type="text" placeholder="" name="entered_opt"  id="entered_opt"  />
			<span id="some_div"></span>
            <center><a href="javascript:void(0);" id="resend_otp">Resend OTP</a></center><br>
			<input type="button" class="loginButton" name="submit_otp"  value="Submit"  id="submit_otp" />	
			<span id="login_msg" style="color:red;"></span>
        </form>
	  <p class="text-center" id="social_heading">
		<span></span>
		<br>
	  Login with social media account</p>
	  <ul>
	  <form class="socialform"  method="post" id="socialform" action="<?php //echo ROOTPATH;?>/login_logout.php">
		<li><!--<a href="javascript:void(0);">--><a href="<?php echo $loginURL;?>"><img src="<?php echo ROOTPATH;?>/view/images/facebook.png" alt="logo"></a>
		</li>
		<!--<li><a id="gmail_login" href=""><img src="<?php echo ROOTPATH;?>/view/images/google.png" alt="logo" name="gmail_email"></a></li>-->
        <li><a id="gmail_login" href="<?php echo $authUrl;?>"><img src="<?php echo ROOTPATH;?>/view/images/google.png" alt="logo"></a>
		<!--<input type="hidden" value="<?php echo $email;?>" name="gmail_email"/>-->  
		</li><!-- name="gmail_email"-->		
	  </ul>
	 </form>
	
	 
	  <p><!-- class="text-center"-->
	  New user <a href="javascript:void(0);" class="Register_box">Register Here</a>&nbsp;&nbsp;
	  <a href="javascript:void(0);" id="forgot_password_modal"><!-- id="submit_pwd"-->Forgot Password?</a>
	  </p>
	  </div>  
    </div>
  </div>
</div>
<!-- Latest compiled and minified CSS -->

<!-- Modal -->
<div class="modal fade" id="forgot_password" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog loginPop" role="document">
    <div class="modal-content loginBox">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		<div class="loginLogo">
		<img src="<?php echo ROOTPATH;?>/view/images/wt-logo.png" alt="logo">
		</div>
		<div class="loginRight">
		<h2 id="forgot_password_heading">Forgot Password</h2>
			<form class="login_form1" action="" method="post" id="forgot_password_form" autocomplete="off">
            <input class="loginInput" type="text" placeholder="Mobile No / Email Address" name="forgot_pass"  id="forgot_pass" />
			<input class="loginInput" type="text" placeholder="" name="entered_forgot_opt"  id="entered_forgot_opt"  />
			<span id="forgot_password_div"></span>
            <center><a href="javascript:void(0);" id="resend_forgot_otp">Resend OTP</a></center><br>
			<input type="button" class="loginButton" name="submit_forgot_otp"  value="Submit"  id="submit_forgot_otp" />	
			<span id="forgot_password_msg" style="color:red;"></span>
        </form>
	  </div>  
    </div>
  </div>
</div>
<!-- Latest compiled and minified CSS -->



<!-- Modal -->
<div class="modal fade" id="registration" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog loginPop" role="document">
    <div class="modal-content loginBox">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		<div class="loginLogo">
		<img src="<?php echo ROOTPATH;?>/view/images/wt-logo.png" alt="logo">
		</div>
		<div class="loginRight">
		<span id="regi"><h2>Register Here</h2></span>
		 <form  method="post"  id="registrationform" autocomplete="off" >
		<input class="loginInput" type="text" placeholder="Name" name="registered_name"  id="registered_name"  />	
		<input class="loginInput" type="text" placeholder="Mobile No" name="registered_mob"  id="registered_mob"  />	
		<input class="loginInput" type="text" placeholder="Email" name="registered_email"  id="registered_email"  />	
		<!--<input class="loginInput" type="password" placeholder="Password" name="registered_password"  id="registered_password"  onchange="check_password(this.value)"/>
        <span id="password_msg" style="color:red;"></span>-->
		<input type="password" class="loginInput" placeholder="Password" name="registered_password"  id="registered_password">
		<!--<span id="regi_message" style="color:red;">Password must contain, at least one upper case letter,one lower case letter, one number,one special character, minimum 6 and maximum 20 characters</span>-->
		<span id="message">
			<h5>Password must contain the following:</h5>
			<span id="letter" class="invalid">A <b>lowercase</b> letter</span>
			<span id="capital" class="invalid">A <b>uppercase</b> letter</span>
			<span id="number" class="invalid">A <b>number</b></span>
			<span id="length" class="invalid">Minimum <b>6 characters</b></span><br>
			<span id="special_character" class="invalid">A <b>special character</b></span>
			<!--<span id="max_length" class="invalid">Maximum <b>20 characters</b></span>-->
		</span><br>
		
		<center><a href="javascript:void(0);" id="show_regipwd">Show Password</a></center>
		<input class="checkBox" type="checkbox" name="reg_terms" value="1" id="reg_terms"/> <span class="iam" id="iam">I am agree with the terms and conditions</span>
		<input class="loginButton" type="submit"   name="submit_reg"  value="Create Account"  id="submit_reg" />
		<input class="loginInput" type="text" placeholder="Enter OTP" name="entered_OTP"  id="entered_OTP"  />
		<span id="reg_some_div"></span>
        <center><a href="javascript:void(0);" id="resend_reg_otp">Resend OTP</a></center><br>	
		<input type="button" class="loginButton" name="submit_OTP"  value="Submit"  id="submit_OTP" />
     </form>	
	  <p class="text-center" id="log">
	  Already registered <a href="javascript:void(0);" class="Login_box" id="Login_box">Login Here</a>
	  </p>
		</div>  
    </div>
  </div>
</div>
</div>
<!-- Latest compiled and minified CSS -->

<!-- Latest compiled and minified CSS -->
<!-- Modal -->
<div class="modal fade" id="terms_condn" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog loginPop" role="document">
    <div class="modal-content loginBox">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		<div class="loginLogo">
		<img src="<?php echo ROOTPATH;?>/view/images/wt-logo.png" alt="logo">
		</div>
		<div class="loginRight">
		<span id="regi"><h2>Terms & Condition</h2></span>
		 <form  method="post"  id="termsform" autocomplete="off" >
				<p class="text-center" id="log">
			  There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
			  </p>
        </form>	
	  
		</div>  
    </div>
  </div>
</div>
</div>
<!-- Latest compiled and minified CSS -->


<div id="myNavTop">
<div class="col-md-12 topPadNone">
<div class="wrapper">
<div class="logoCenter"><a href="<?php echo ROOTPATH;?>/"><img src="<?php echo ROOTPATH;?>/view/images/logo-mangal-parinay.png" alt="logo"></a></div>
<?php 
	if(isset($_COOKIE['site_custom_id']))
	{
?> 
<div class="rightDrop">
<div class="dropdown">
  <a id="dLabel" data-toggle="dropdown" class="dropTop" aria-haspopup="true" aria-expanded="false">
    Welcome   <?php $login_details->email;?>
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu" aria-labelledby="dLabel">
    <li><?php if($login_details->otp==0) echo $login_details->ph; else echo $login_details->email;?></li> 
	<li><a href="<?php echo ROOTPATH;?>/MyDetails/" id="master_logout" >My Profile</a></li> 
	<li><a href="<?php echo ROOTPATH;?>/login_logout.php?the_logout=logout" id="master_logout" >Logout</a></li> 
  </ul>
</div>
</div>   
<?php } else {  ?>   
<div  class="logoRight">
<a href="javascript:void(0);" id="login_modal">Login</a>&nbsp;|&nbsp; <!-- data-toggle="modal" data-target="#login"  onclick="myFunction1();"-->
<a href="javascript:void(0);" id="registration_modal">Registration</a>
</div>  
<?php  } ?>
<div class="clear"></div>
  </div>
  </div>
</div>


<script>
var myInput = document.getElementById("registered_password");
var letter = document.getElementById("letter");
var capital = document.getElementById("capital");
var number = document.getElementById("number");
var length = document.getElementById("length");
var special_character=document.getElementById("special_character");

document.getElementById("message").style.display = "none";

// When the user clicks on the password field, show the message box
myInput.onfocus = function() {
  document.getElementById("message").style.display = "block";
}

// When the user clicks outside of the password field, hide the message box
myInput.onblur = function() {
  document.getElementById("message").style.display = "none";
}

// When the user starts to type something inside the password field
myInput.onkeyup = function() {
			
	
  // Validate lowercase letters
  var lowerCaseLetters = /[a-z]/g;
  if(myInput.value.match(lowerCaseLetters)) {  
    letter.classList.remove("invalid");
    letter.classList.add("correct");
  } else {
    letter.classList.remove("correct");
    letter.classList.add("invalid");
  }
  
  // Validate capital letters
  var upperCaseLetters = /[A-Z]/g;
  if(myInput.value.match(upperCaseLetters)) {  
    capital.classList.remove("invalid");
    capital.classList.add("correct");
  } else {
    capital.classList.remove("correct");
    capital.classList.add("invalid");
  }

  // Validate numbers
  var numbers = /[0-9]/g;
  if(myInput.value.match(numbers)) {  
    number.classList.remove("invalid");
    number.classList.add("correct");
  } else {
    number.classList.remove("correct");
    number.classList.add("invalid");
  }
  
  // Validate length
  if(myInput.value.length >= 6) {
    length.classList.remove("invalid");
    length.classList.add("correct");
  } else {
    length.classList.remove("correct");
    length.classList.add("invalid");
  }
  
  // Validate special character
   var Spaecialcharacters = /[!@#\$%\^\&*]/g;
  if(myInput.value.match(Spaecialcharacters)) {  
    special_character.classList.remove("invalid");
    special_character.classList.add("correct");
  } else {
    special_character.classList.remove("correct");
    special_character.classList.add("invalid");
  }
}    
</script>