<?php

define('APP_ROOT', '/survey/');	

// echo '<pre>';
// print_r($_SERVER);
// echo '</pre>';

define('PAGE_THIS', $_SERVER['PHP_SELF']);

$URLsuf=strrchr($_SERVER['SERVER_PROTOCOL'],'/');
$SERVERprotocol=strtolower(str_replace($URLsuf,'',$_SERVER['SERVER_PROTOCOL']));
define('DOC_BASE', $SERVERprotocol.'://'.$_SERVER['HTTP_HOST']);
define ('THIS',  $SERVERprotocol.'://'.$_SERVER['HTTP_HOST'].PAGE_THIS);
define ('DOC_URI',  $SERVERprotocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);


if(  ($_SERVER['SYSTEMROOT']??'') == 'C:\WINDOWS'){
    $LOC_PARAMS = array('localhost', 'sp_surveys', 'SPr00t', 'iyienu');
}else{
    $LOC_PARAMS = array('localhost', 'swiftp11_sp_surveys', 'swiftp11_spr00t', 'swiftp11_iyienu');
}

define('REQTIMESTAMP', time());
define('QUERY_STRING', (isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : ''));
define('PAGE_REFERER', (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''));
define('REMOTE_ADDR', (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : 0));
define('REQDATETIME', date('Y-m-d H:i:s', REQTIMESTAMP));
define('REQDATE', date('Y-m-d', REQTIMESTAMP));
define('REQDATE_INT', str_replace('-','',REQDATE));
define('REQDATETIME_INT', date('YmdHis', REQTIMESTAMP));
define('REQTIME', date('H:i:s', REQTIMESTAMP));

const SESSION_DURATION = 60;
const DEFAULT_FILE_EXTENSIONS = 'jpg,jpeg,gif,tiff,png,pdf,avi,mp4,mkv,wmv,doc,docx,xls,xlsx,ppt,pptx';
const DEFAULT_IMAGE_EXTENSIONS = 'jpg,jpeg,gif,tiff,png';
const DEFAULT_VIDEO_EXTENSIONS = 'avi,mp4,mkv,wmv';
const DEFAULT_MEDIA_EXTENSIONS = 'jpg,jpeg,gif,tiff,png,avi,mp4,mkv,wmv';

