<?php
$life_time = 70000 ;
// server should keep session data for AT LEAST 1 hour
ini_set('session.gc_maxlifetime', $life_time) ;
// each client should remember their session id for EXACTLY 1 hour
session_set_cookie_params($life_time) ;
session_start() ;

// request database
$databaseName 	= 'localhost' ; // Server
$userName 		= 'worknovaco_system' ; // Username
$password 		= '6Vt%U3&gXfFn' ; // Password
$database 		= 'worknovaco_system' ; // Database name
$prefix 		= 'system_' ; // Table prefix name
$mysqli 		= new mysqli($databaseName, $userName, $password, $database) ; // Connect to database
$mysqli->set_charset("utf8") ;
date_default_timezone_set('Asia/Singapore') ;

// Check connection //
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\n", mysqli_connect_error()) ;
    exit ;
}

// default variable
if ( !isset($_SERVER['HTTPS']) && !$boolean_ssl_lock ) {
	header('Location: https://' . $_SERVER["SERVER_NAME"] . '/' . $current_page) ;
	exit ;
}
$prefix_url = 'https://' ;
define('PATH', 				 $prefix_url.$_SERVER['SERVER_NAME'].'/') ;
define('COMPANY', 			 'IPS Software Sdn. Bhd.') ;
define('COMPANYSHORT', 		 'IPS') ;
define('ADDRESS', 			 '') ;
define('COMPANYLOCATION', 	 '{"lat":"2.058902","lon":"102.560469"}') ;
define('COUNTRY', 			 'Malaysia') ;
define('WEBSITE', 			 'https://ips.com.my') ;
define('SYSTEM', 			 'System') ;
define('MAPKEY', 			 '') ;
define('PUSHTOKEN',     	 'AAAAeH4NE-M:APA91bF3mRs11LWVgUgZeOHW2PVArCLrGzXkyC2UZajIs9mdZQK0khPVw59rsCAxZ47o2za3l5pFa3NLE3-yBEu2VlKz7hWjvGreeurudhY64FsqYZF4oUW-wVxJcDvjwU5UDW4Swmnq') ;
define('SECRETKEY', 		 'A91bLWVZaj0khPVwFa3N') ;
define('APIKEY', 	    	 '1egZU2jm#ya+E9E3K&DbivDh') ;
define('IMAGELOCATION', 	 'ips') ;
define('CONTACTHR', 	     '016 977 5111') ;

define('SUPPORTNAME', 		 'Mr. Jimmy') ;
define('SUPPORTMOBILE', 	 '+60 16-977 7280') ;

// setdefault setting
define('ALLOWSIGN', 		 '0') ;
define('LIMIT', 		     '20') ;
define('TODAYDAY', 		     date('Y-m-d', time())) ;
define('TODAYDATE',          date('Y-m-d H:i:s', time())) ;

// set config
define('DEFAULTPUNCH', 		 'NO') ;
define('ATTENDANCEFORMULA',  '2') ;
define('LIMITDIGITNO', 		 '4') ;
define('ATTENDANCEABSENT',   'yes') ; // yes or no

// set module config
define('MENUMARKETING', 	 'no') ;
define('MENUJOB', 			 'no') ;
define('MENUACCOUNT', 		 'no') ;
define('MENUCUSTOMER', 		 'no') ;
define('MENUPRODUCT', 		 'no') ;
define('MENUPRODUCTIONS', 	 'no') ;
define('MENUHR', 			 'yes') ;

// 1 = table view only, 2 = qrcode only, 3 = table and qrcode only
define('QRCODEVIEW',         '2') ; 

// to punch card system
define('PUNCHURL', 			 'http://machine.ips.com.my') ;
define('PUNCHCOMPANYID', 	 '2') ;
define('PUNCHSHOWBRANCHID',  'no') ;

// mail setting
$EMAILCC 					 = [ 'info@ips.com.my' ] ;
$EMAILCRON					 = [ 'info@ips.com.my' ] ; 
define('EMAIL', 		     'info@ips.com.my') ;
define('EMAILSYSTEM', 	     'info@ips.com.my') ;
define('EMAILNOREPLY', 		 'noreply@ips.com.my') ;
DEFINE('MAILSMTP',           'yes') ;
DEFINE('MAILHOST',           'mail.ips.com.my') ;
DEFINE('MAILUSERNAME',       'noreply@ips.com.my') ;
DEFINE('MAILPASSWORD',       '0a=RoEvz6G#c') ;
DEFINE('MAILPORT',           '587') ;

// sms
define('SMSENDPOINT', 	     'https://sms.ips.com.my/api/sms.php') ;
define('SMSID', 			 '1') ;
define('SMSTOKEN', 			 'e282bc52197813943c744e61eb6b65c6') ;
define('SMSSECRET', 		 '2316efc8559cec0a7c7b5f43b913feeb') ;
define('SMSCOMPANY', 		 'IPS') ;

// rms pay
define('RMSLOCATION', 		 'IPS') ;
define('RMSAPIURL', 		 'https://api.molreloads.com/terminal/v1/') ;
define('RMSAPITERMINAL', 	 'IPSSOF0001') ;
define('RMSAPIKEY', 		 '8668989810297014') ;

// point for nomination
define('NOMINATIONPOINT', 	 60) ;

$LANGS  					 = [ 'en' => 'EN', 'my' => 'MY', 'cn' => 'CN' ] ;
$STAFFDETAILS 				 = 'show' ;
$CRONJOBS  					 = [
	'generate_attendance' 			        => 'yes',
	'push_notification' 			        => 'yes',
	'rms_pay_bill' 					        => 'yes',
	'rms_prepaid_check_status' 				=> 'yes',
	'punchs/user' 					        => 'yes',
	'generate_leave_day' 			        => 'yes',
	'push_task_notification' 		        => 'yes',
	'push_holiday' 					        => 'yes',
	'push_passport_permit_leave_advance'    => 'yes',
	'push_application_form_reminder' 		=> 'yes',
	'push_staff_resignation' 				=> 'yes',
	'generate_payment_slip'         		=> 'yes',
	'generate_attendance_to_text'         	=> 'no',
	'generate_staff_achievement' 	        => 'yes',
	'generate_monthly_attendance_point'     => 'yes',
	'generate_monthly_performance_point'    => 'yes',
	'generate_seasonly_improvement_point'   => 'yes',
	'generate_seasonly_summary_point'       => 'yes'
] ;

// set array binding config
$CHECKLEAVEPOSITION         = [ '2' ] ;
define('LEAVESETTING', 	   'month') ;

?>