<?php

include 'connections/customPDO.php';





Class Authentication{

private	$mysql;

private $apikey;

private $username;

private $password;

private $providerid;

private $inscompany;



function Authentication($connection){

$this->mysql=$connection;

}



	function get_api_authentication($apikey, $username, $password, $providerid)

	{

		# code...

        $this->apikey=$this->mysql->quote($apikey);

        $this->username=$this->mysql->quote($username);

        $this->password=$this->mysql->quote($password);

        $this->providerid=$this->mysql->quote($providerid);







        $result=$this->mysql->selectData("select * from provider_api where apikey=".$this->apikey."and username=".$this->username." and password=".$this->password." and provider_id=".$this->providerid);

        if ($result==false) {

        	# code...

        	return 0;

        }else{

        	return 1;

        }



        

	}





	function get_api_inscompany_activation($inscompany,$providerid)

	{

		# code...

		$this->inscompany=$this->mysql->quote($inscompany);

		$this->providerid=$this->mysql->quote($providerid);



		$result = $this->mysql->selectData("SELECT * FROM insurance_company a inner join activation b on a.company_code=b.ins_company where a.status='Active' and a.company_code=".$this->inscompany." and b.provider_id=".$this->providerid);

  

		if ($result==false) {

        	# code...

        	 return 0;

        }else{

        	 return 1;

        }

		

	



	}





	



	

}

?>