HEX
Server: Apache
System: Linux v38079.2is.nl 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: democfellows (10015)
PHP: 8.1.34
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/creativefellows.nl/jhtaxatie.creativefellows.nl/classes/BaseController.php
<?php
	
	/**
	* Description
	*/
	abstract class BaseController 
	{
	
		/*
		 * Get role of user
		 */
		public function getUserRole()
		{
			return $this->user_role;
		}
		
		public function priceHuman($price,$symbol=false)
		{
			return ($symbol === true ? "<span style=\"color:#ccc;\">€</span> " : "" ) . number_format($price,2,',','.');
		}
		
		/*
		 * Get id of user
		 */
		public function getUserId()
		{
			return $this->user_id;
		}
		

		/*
		 * Get routename of current request
		 */
		public function getCurrentRouteName($request)
		{
			$route 		= $request->getAttribute('route');			
			return $route ? $route->getName() : null;
		}	
		
		
		/*
		 * Get a form field based on input type
		 */
		public function getHTMLFields(array $fields_array)
		{
			
			$elements = [];
			foreach($fields_array as $groupName => $fields)
			{	
						
				foreach($fields as $i => $field)
				{				
					$elements[$groupName][$i] = new HtmlElement($field);
				}
				
			}
			
			return $elements;
			
		}
		
		
		public function getSiteUrl()
		{
			return $this->siteUrl;
		}
		
		public function setPageMax($int)
		{
			$this->pageMax = $int;
		}
		
		public function getPageMax()
		{
			return $this->pageMax = 20;
		}
		public function isOdd($number)
		{
   			return $number & 1;
		}
				
	}

?>