<?php
class AutoLoader
{
	public static function adminLoader($class)
	{
		$path = PATH_CONTROLLERS . "admin/{$class}.php" ;
		if (is_readable($path)) require_once $path ;
	}

	public static function baseLoader($class)
	{
		$path = PATH_CONTROLLERS . "base/{$class}.php" ;
		if (is_readable($path)) require_once $path ;
	}
	public static function signinLoader($class)
	{
		$path = PATH_CONTROLLERS . "signin/{$class}.php" ;
		if (is_readable($path)) require_once $path ;
	}
	public static function homeLoader($class)
	{
		$path = PATH_CONTROLLERS . "home/{$class}.php" ;
		if (is_readable($path)) require_once $path ;
	}
	public static function prospectLoader($class)
	{
		$path = PATH_CONTROLLERS . "prospect/{$class}.php";
		if (is_readable($path)) require_once $path;
	}
	public static function customerLoader($class)
	{
		$path = PATH_CONTROLLERS . "customer/{$class}.php";
		if (is_readable($path)) require_once $path;
	}
	public static function destinationLoader($class)
	{
		$path = PATH_CONTROLLERS . "destination/{$class}.php";
		if (is_readable($path)) require_once $path;
	}
	public static function telemarketingLoader($class)
	{
		$path = PATH_CONTROLLERS . "telemarketing/{$class}.php";
		if (is_readable($path)) require_once $path;
	}
	public static function userGroupLoader($class)
	{
		$path = PATH_CONTROLLERS . "admin/usergroup/{$class}.php";
		if (is_readable($path)) require_once $path;
	}

	public static function mobileLoader($class)
	{
		$path = PATH_CONTROLLERS . "mobile/{$class}.php";
		if (is_readable($path)) require_once $path;
	}

	public static function meetingLoader($class)
	{
		$path = PATH_CONTROLLERS . "mobile/meeting/{$class}.php";
		if (is_readable($path)) require_once $path;
	}
	public static function accountLoader($class)
	{
		$path = PATH_CONTROLLERS . "mobile/account/{$class}.php";
		if (is_readable($path)) require_once $path;
	}
	public static function reportLoader($class)
	{
		$path = PATH_CONTROLLERS . "report/{$class}.php";
		if (is_readable($path)) require_once $path;
	}
	public static function corporateGiftLoader($class)
	{
		$path = PATH_CONTROLLERS . "corporate_gift/{$class}.php";
		if (is_readable($path)) require_once $path;
	}
	public static function campaignLoader($class)
	{
		$path = PATH_CONTROLLERS . "campaign/{$class}.php";
		if (is_readable($path)) require_once $path;
	}
}
spl_autoload_register('AutoLoader::adminLoader') ;
spl_autoload_register('AutoLoader::signinLoader') ;
spl_autoload_register('AutoLoader::homeLoader') ;
spl_autoload_register('AutoLoader::baseLoader') ;
spl_autoload_register('AutoLoader::prospectLoader');
spl_autoload_register('AutoLoader::customerLoader');
spl_autoload_register('AutoLoader::destinationLoader');
spl_autoload_register('AutoLoader::telemarketingLoader');
spl_autoload_register('AutoLoader::userGroupLoader');
spl_autoload_register('AutoLoader::mobileLoader');
spl_autoload_register('AutoLoader::meetingLoader');
spl_autoload_register('AutoLoader::accountLoader');
spl_autoload_register('AutoLoader::reportLoader');
spl_autoload_register('AutoLoader::corporateGiftLoader');
spl_autoload_register('AutoLoader::campaignLoader');


require PATH_VENDOR_COMPOSER . 'autoload.php';

//for Google credentials
putenv('GOOGLE_APPLICATION_CREDENTIALS=' . PATH_VENDOR_COMPOSER . 'google/service-account.json');
