<?php
$versionPHP = explode('.', phpversion());//5.3.29 ==> $versionPHP[0]==5, $versionPHP[1]==3, $versionPHP[2]==29
$fivePointFourPlus = (($versionPHP[0]>=5)&&($versionPHP[1]>=4));
define('BOOTSTRAP_VERSION', 	'bootstrap_3.3.7/');
define('SABLE_VERSION', '1.0.009');
/*** Site Working Directories ***/
define('SABLE_PROTOCOL', 		'https');
define('SABLE_SUB_DOMAIN', 		'cleaning');
define('SABLE_DOMAIN', 			'webapps');
define('SABLE_SLD_TLD', 		'co.za');
define('SABLE_SITE_URL', 		SABLE_PROTOCOL.'://'.SABLE_SUB_DOMAIN.'.'.SABLE_DOMAIN.'.'.SABLE_SLD_TLD); //was $currentSite	
define('SABLE_ROOT_FOLDER', 	'/'); //if site is in a folder e.g. http://www.jona.co.za/sable/ --> root folder would then be "/sable/"
define('SABLE_DOMAIN_ROOT', 	SABLE_SITE_URL.'/');
define('SABLE_URL_ROOT', 		SABLE_SITE_URL.SABLE_ROOT_FOLDER); //points to the root URL for the SITE. E.g. http://www.jona.co.za/
define('SABLE_WORKING_PATH',	'/home/webapooc/cleaning.webapps.co.za/'); //physical path to the website on the server. E.g. /public_html/www/
define('SABLE_INCLUDES_PATH', 	SABLE_WORKING_PATH.'includes/');
define('SABLE_CLASS_PATH', 		SABLE_WORKING_PATH.'classes/');
define('SABLE_SCRIPTS_PATH', 	SABLE_URL_ROOT.'scripts/');
define('SABLE_MEDIA_PATH', 		SABLE_URL_ROOT.'media/');
define('SABLE_IMAGES_PATH', 	SABLE_MEDIA_PATH.'images/');
define('SABLE_AUDIO_PATH', 		SABLE_MEDIA_PATH.'audio/');
define('SABLE_VIDEOS_PATH', 	SABLE_MEDIA_PATH.'videos/');
define('SABLE_FONTS_PATH', 		SABLE_MEDIA_PATH.'fonts/');
define('SABLE_DOWNLOADS_PATH', 	SABLE_MEDIA_PATH.'downloads/');
define('SABLE_UPLOADS_PATH', 	SABLE_MEDIA_PATH.'uploads/');
define('SABLE_LIB_PATH', 		SABLE_WORKING_PATH.'lib/');
define('SABLE_CRON_PATH', 		SABLE_WORKING_PATH.'cron/');

/*** General Site Settings ***/
define('SABLE_UNDER_MAINTENANCE',	0); //0 = none, 1 = maintenance logged in, 2 = maintenance not logged in, 3 = maintenance both.
define('SABLE_ENABLE_ENCRYPTION',	false);  //if false, links and values returned from sableDecode/sableEncode will not be encoded (for testing)
define('SABLE_SITE_DEBUGGING',		true);  //if true will enable the use of the debug and debugout functions in /includes/debug.php
define('SABLE_DEMO_SYSTEM', 		true);  //defines if this site is a demo/test site. Emails will only be sent to SABLE_DEMO_RECIPIENTS
define('SABLE_ENABLE_ERRORS',		true); //if true then ini_set('display_errors', 1) is configured in includes/sysinit.php
define('SABLE_UPLOAD_PROGRESS',	$fivePointFourPlus&&true); //if true then ini_set('session.upload_progress.enabled', 1) is set. Only for PHP 5.4+

/*--- System JS files ---*/
$sablejs = [];
$sablejs[] = array('cond' => 0, 'tag' => 'script', 'cont' => array('src' => SABLE_URL_ROOT.'scripts/jquery-2.1.4.min.js'));
$sablejs[] = array('cond' => 0, 'tag' => 'script', 'cont' => array('src' => SABLE_URL_ROOT.'scripts/ajax.js?v='.SABLE_VERSION));
$sablejs[] = array('cond' => 0, 'tag' => 'script', 'cont' => array('src' => SABLE_URL_ROOT.'scripts/sable.js?v='.SABLE_VERSION));
$sablejs[] = array('cond' => 2, 'tag' => 'script', 'cont' => array('src' => SABLE_URL_ROOT.'scripts/sable_tabs.js'));
$sablejs[] = array('cond' => 3, 'tag' => 'script', 'cont' => array('src' => SABLE_URL_ROOT.'scripts/debug.js'));
$sablejs[] = array('cond' => 0, 'tag' => 'script', 'cont' => array('src' => SABLE_URL_ROOT.'scripts/md5.min.js'));
$sablejs[] = array('cond' => 0, 'tag' => 'script', 'cont' => array('src' => SABLE_URL_ROOT.'scripts/jquery-ui.min.js'));

define('SABLE_JS', serialize($sablejs));

/*--- CSS files ---*/
$sablecss = [];
$sablecss[] =	array('cond' => 0, 'tag' => 'link', 
				'cont' => 
					array('href' => SABLE_URL_ROOT.'style/'.BOOTSTRAP_VERSION.'bootstrap.min.css',	'rel' => 'stylesheet', 'media' => 'all'));
$sablecss[] =	array('cond' => 0, 'tag' => 'link', 
				'cont' => 
					array('href' => SABLE_URL_ROOT.'style/all.min.css',			'rel' => 'stylesheet', 'media'	=> 'all'));						
define('SABLE_CSS',	serialize($sablecss));
							
/*** Database Settings ***/
define('SABLE_DATABASE_HOST', 		'localhost');
define('SABLE_DATABASE_USER', 		'webapooc');
define('SABLE_DATABASE_PASSWORD',	'UhEu)(bCpptc');
define('SABLE_DATABASE_NAME', 		'webapooc_cleaning');
define('SABLE_EMAIL_LOGO', 			SABLE_IMAGES_PATH.'email_logo.png'); //logo that will be displayed in outgoing emails.

/*** Email Settings ***/	
/*
	When working in a Demo Environment (i.e. SABLE_DEMO_SYSTEM === True) then the emails will always be sent to
	the recipients defined by SABLE_DEMO_RECIPIENTS. This is a safety tool to prevent unwanted emails being sent
	out while in a Development Phase.
*/
define('SABLE_DEMO_RECIPIENTS', 	'Michael Palmer <michael@jonasolutions.co.uk>');

define('SABLE_DEMO_EMAIL_PREFIX',	'[** TEST SYSTEM **]');	//Will be the prefix of email subjects ONLY in the Demo environment
define('SABLE_SENDER_NAME', 		'Champooches Pet Services'); //Email display name
define('SABLE_SENDER_PREFIX', 		'no-reply'); //Email reply from address prefix
define('SABLE_SENDER_DOMAIN', 		SABLE_DOMAIN.'.'.SABLE_SLD_TLD); //Email domain
define('SABLE_SENDER_EMAIL', 		SABLE_SENDER_PREFIX.'@'.SABLE_SENDER_DOMAIN); //Email reply address	

/*** Selected Theme Settings ***/
define('SABLE_THEME_NAME',			'sable');
define('SABLE_THEME_PATH',			'themes/');
define('SABLE_THEME_LOCATION', 		SABLE_WORKING_PATH.SABLE_THEME_PATH);
define('SABLE_THEME_INDEX_FILE',	'index.php');
define('SABLE_THEME_WORKING_PATH', 	SABLE_THEME_LOCATION.SABLE_THEME_NAME.'/');
define('SABLE_THEME_ROOT',			SABLE_URL_ROOT.SABLE_THEME_PATH.SABLE_THEME_NAME.'/');
define('SABLE_INSTALLED_THEME', 	SABLE_THEME_NAME.'/'.SABLE_THEME_INDEX_FILE);
define('SABLE_THEME_MENU', 			SABLE_THEME_WORKING_PATH.'menu/index.php');

define('SABLE_UNKNOWN_IMAGE', 		SABLE_IMAGES_PATH.'unknown_image.png');
define('SABLE_SEO_ENABLED', 		false && (!SABLE_ENABLE_ENCRYPTION)); //SEO can't work with encrypted URL's
define('SABLE_PUSH_ENABLED', 		true);
define('SABLE_PWA',					true);
define('SABLE_INDEXED_DB_ENABLED',	SABLE_PWA && false);
define('GOOGLE_TRANSLATE_ENABLED',	false);

/** Datalist FontAwesome Icons **/
define('SABLE_DATALIST_ROWS',		50);
define('SABLE_DATALIST_CLEAR',		'fa-redo');
define('SABLE_DATALIST_HOME',		'fa-home');
define('SABLE_DATALIST_BACK',		'fa-arrow-left');
define('SABLE_DATALIST_ADD',		'fa-plus-circle');
define('SABLE_DATALIST_EDIT',		'fa-edit');
define('SABLE_DATALIST_VIEW',		'fa-eye');
define('SABLE_DATALIST_DELETE',		'fa-trash-alt');
define('SABLE_DATALIST_COPY',		'fa-copy');
define('SABLE_DATALIST_SELECT',		'fa-check-circle');
define('SABLE_DATALIST_SEARCH',		'fa-search');
define('SABLE_DATALIST_SORT_UP',	'fa-sort-up');
define('SABLE_DATALIST_SORT_DOWN',	'fa-sort-down');
define('SABLE_DATALIST_DOWNLOAD',	'fa-download');
define('SABLE_DATALIST_LOGOFF',		'fa-sign-out-alt');
define('SABLE_DATALIST_PRINT',		'fa-print');

/** 
	5-DEC-2020 - J. Jardim:
	See sable_system.php - checkSession(). Exceptions are not validated.
**/
$pageExceptions = [];
$pageExceptions[] = array('uri' => '/enableGPS', 			'path' => '/themes/sable/noGPS.php');
$pageExceptions[] = array('uri' => '/netcash-accept',	'path' => '/netcash/accept.php');
$pageExceptions[] = array('uri' => '/netcash-decline',	'path' => '/netcash/decline.php');
$pageExceptions[] = array('uri' => '/netcash-notify',	'path' => '/netcash/notify.php');
$pageExceptions[] = array('uri' => '/netcash-redirect',	'path' => '/netcash/redirect.php');

define('SABLE_SESSION_EXCEPTIONS',	serialize($pageExceptions));

//Panacea Mobile:
define('PANACEA_USERNAME', 'jorge_jardim');
define('PANACEA_PASSWORD', 'ECRx5rhYC6qHGjp');

require(SABLE_THEME_LOCATION.SABLE_THEME_NAME.'/config.php'); //defines theme specific parameters