<?php session_start();
   include("../config/config.php");
   
   $alertType='1';// ADMIN=1 USER =0
   $id	=secureSuperGlobalPOST($_REQUEST[SESS_MASTER.'id']);
   $pass =secureSuperGlobalPOST($_REQUEST[SESS_MASTER.'pass']);
    
       $sql = "SELECT * FROM vendor_master WHERE rowId='$id'";
   	 
      	$myquery=$conn->query($sql);
   	$mydara= $myquery->fetchAll()  ;
   	
   	$rows_found = $myquery->rowCount();
   	 
   	if($rows_found==0){
   		$_SESSION[ADD_TAG.'_unvalidate']=12;
   		$_SESSION[ADD_TAG.'_tologusername']='';
   		unsetme();
   		$pagename='Admin Login ';
   				$parameter='suspicious Login for Admin ';
   				$alertdisplay=' For Email ID '.$email_id  ;
   				
   		
   		header('Location: ../password-reset-for/vendor');
   		}else{
   			 
   			foreach( $mydara as $row ) {
   				$userId		= $row['rowId'];
   				$first_name	= $row['first_name'];
   				$email_id	= $row['emailId'];
   				$mobile_no	= $row['mobile_no'];
   				$password	= $row['otp'];
   		}
   		     
   
   $hash = password_hash($pass,PASSWORD_DEFAULT);
   	  $sqls = "UPDATE vendor_master SET userpass = '$hash' WHERE rowId='$userId'";
   	 
      	$myquerys=$conn->query($sqls);
   			 
   			
   				
   					
   					
   					header('Location: ../login-id/vendor');
   					
   		
               	
   				
   			}
   			
   
   	 
   ?>