<?php
$dDebug = false;
$dSQL = "";

$tables_data = array();
$page_layouts = array();
$page_options = array();
$pd_pages = array();
$all_pd_layouts = array();
$field_labels = array();
$fieldToolTips = array();
$page_titles = array();
$placeHolders = array();
$all_page_layouts = array();
$all_page_types = null;
$all_pages = null;
$detailsTablesData = array();
$masterTablesData = array();

// .NET convertor needs this
$tdataGLOBAL = array();
$pages = array();
$defaultPages = array();

/**
 * Breadcrumb label templates

 *	Label without master table
 *	$breadcrumb_titles[<language>][<table>][<page>]["."] = "..."

 *	Label with master active
 *	$breadcrumb_titles[<language>][<table>][<page>][<master>] = "..."

 *	Label for the page with no table
 *	$breadcrumb_titles[<language>]["."][<page>]["."] = "..."
 */
$breadcrumb_labels = array();


$lookupTableLinks = array();

$_gmdays = array(0=>31,1=>31,2=>28,3=>31,4=>30,5=>31,6=>30,7=>31,8=>31,9=>30,10=>31,11=>30,12=>31);

include(getabspath('classes/layout.php'));
include(getabspath('classes/pdlayout.php'));


//	custom labels
$custom_labels = array();
$custom_labels["English"] = array();

define('GLOBAL_PAGES_SHORT', ".global");
define('GLOBAL_PAGES', "<global>");

/**
 *  Define constants of page name
 */
define('PAGE_LIST',"list");
define('PAGE_MASTER_INFO_LIST',"masterlist");
define('PAGE_ADD',"add");
define('PAGE_EDIT',"edit");
define('PAGE_VIEW',"view");
define('PAGE_MENU',"menu");
define('PAGE_LOGIN',"login");
define('PAGE_REGISTER',"register");
define('PAGE_REMIND',"remind");
define('PAGE_CHANGEPASS',"changepwd");
define('PAGE_SEARCH',"search");
define('PAGE_REPORT',"report");
define('PAGE_MASTER_INFO_REPORT',"masterreport");
define('PAGE_CHART',"chart");
define('PAGE_PRINT',"print");
define('PAGE_MASTER_INFO_PRINT',"masterprint");
define('PAGE_RPRINT',"rprint");
define('PAGE_MASTER_INFO_RPRINT',"masterrprint");
define('PAGE_EXPORT',"export");
define('PAGE_IMPORT',"import");
define('PAGE_INLINEADD',"inlineadd");
define('PAGE_INLINEEDIT',"inlineedit");
define('PAGE_DASHBOARD',"dashboard");
define('PAGE_DASHMAP', "map");
define('PAGE_ADMIN_RIGHTS', "admin_rights_list");
define('PAGE_ADMIN_MEMBERS', "admin_members_list");
define('PAGE_ADMIN_ADMEMBERS', "admin_admembers_list");

define('ADMIN_USERS',"admin_users");


define('FORMAT_VIEW',"ViewFormats");
define('FORMAT_EDIT',"EditFormats");
/**
 *  Define constants of view format
 */
define("FORMAT_NONE","");
define("FORMAT_DATE_SHORT","Short Date");
define("FORMAT_DATE_LONG","Long Date");
define("FORMAT_DATE_TIME","Datetime");
define("FORMAT_TIME","Time");
define("FORMAT_CURRENCY","Currency");
define("FORMAT_PERCENT","Percent");
define("FORMAT_HYPERLINK","Hyperlink");
define("FORMAT_EMAILHYPERLINK","Email Hyperlink");
define("FORMAT_FILE_IMAGE","File-based Image");
define("FORMAT_FILE_IMAGE_OLD","Old file-based Image");
define("FORMAT_DATABASE_IMAGE","Database Image");
define("FORMAT_DATABASE_FILE","Database File");
define("FORMAT_FILE","Document Download");
define("FORMAT_LOOKUP_WIZARD","Lookup wizard");
define("FORMAT_PHONE_NUMBER","Phone Number");
define("FORMAT_NUMBER","Number");
define("FORMAT_HTML","HTML");
define("FORMAT_CHECKBOX","Checkbox");
define("FORMAT_MAP","Map");
define("FORMAT_CUSTOM","Custom");
define("FORMAT_AUDIO", "Audio file");
define("FORMAT_DATABASE_AUDIO", "Database audio");
define("FORMAT_VIDEO", "Video file");
define("FORMAT_VIDEO_HTML5", "Video file HTML5");
define("FORMAT_DATABASE_VIDEO", "Database video");
/**
 *  Define constants of edit format
 */
define("EDIT_FORMAT_NONE","");
define("EDIT_FORMAT_TEXT_FIELD","Text field");
define("EDIT_FORMAT_TEXT_AREA","Text area");
define("EDIT_FORMAT_PASSWORD","Password");
define("EDIT_FORMAT_DATE","Date");
define("EDIT_FORMAT_TIME","Time");
define("EDIT_FORMAT_RADIO","Radio button");
define("EDIT_FORMAT_CHECKBOX","Checkbox");
define("EDIT_FORMAT_DATABASE_IMAGE","Database image");
define("EDIT_FORMAT_DATABASE_FILE","Database file");
define("EDIT_FORMAT_FILE","Document upload");
define("EDIT_FORMAT_LOOKUP_WIZARD","Lookup wizard");
define("EDIT_FORMAT_HIDDEN","Hidden field");
define("EDIT_FORMAT_READONLY","Readonly");

define("EDIT_DATE_SIMPLE",0);
define("EDIT_DATE_SIMPLE_INLINE",2);
define("EDIT_DATE_SIMPLE_DP",11);
define("EDIT_DATE_DD",12);
define("EDIT_DATE_DD_INLINE",5);
define("EDIT_DATE_DD_DP",13);

define("MODE_ADD",0);
define("MODE_EDIT",1);
define("MODE_SEARCH",2);
define("MODE_LIST",3);
define("MODE_PRINT",4);
define("MODE_VIEW",5);
define("MODE_INLINE_ADD",6);
define("MODE_INLINE_EDIT",7);
define("MODE_EXPORT",8);

define("LOGIN_HARDCODED",0);
define("LOGIN_TABLE",1);

define("SECURITY_NONE",-1);
define("SECURITY_HARDCODED", 0);
define("SECURITY_TABLE", 1);
define("SECURITY_AD", 2);

define("ADVSECURITY_ALL",0);
define("ADVSECURITY_VIEW_OWN",1);
define("ADVSECURITY_EDIT_OWN",2);
define("ADVSECURITY_NONE",3);

define("ACCESS_LEVEL_ADMIN","Admin");
define("ACCESS_LEVEL_ADMINGROUP","AdminGroup");
define("ACCESS_LEVEL_USER","User");
define("ACCESS_LEVEL_GUEST","Guest");

define("nDATABASE_MySQL",0);
define("nDATABASE_Oracle",1);
define("nDATABASE_MSSQLServer",2);
define("nDATABASE_Access",3);
define("nDATABASE_PostgreSQL",4);
define("nDATABASE_Informix",5);
define("nDATABASE_SQLite3",6);
define("nDATABASE_DB2",7);
define("nDATABASE_Interbase", 16);

define("ADD_SIMPLE",0);
define("ADD_INLINE",1);
define("ADD_ONTHEFLY",2);
define("ADD_MASTER",3);
define("ADD_POPUP",4);
define("ADD_DASHBOARD",5);
define("ADD_MASTER_POPUP",6);
define("ADD_MASTER_DASH",7);

//	Edit page modes
define("EDIT_SIMPLE",0); 	//	standalone Edit page
define("EDIT_INLINE",1);	//	inlineEdit
define("EDIT_POPUP",3);		//	edit page in popup
define("EDIT_DASHBOARD",4);	//	edit page in dashboard
define("EDIT_SELECTED_SIMPLE",5);
define("EDIT_SELECTED_POPUP",6);


//	View page modes
define("VIEW_SIMPLE",0); 	//	standalone View page
define("VIEW_POPUP",1); 	//	View page in popup
define("VIEW_DASHBOARD",2); 	//	View page in dashboard
define("VIEW_PDFJSON",3); 	//	prepare json for PDF

define("LOGIN_SIMPLE", 0);
define("LOGIN_POPUP", 1);
define("LOGIN_EMBEDED", 2);

define("REGISTER_SIMPLE", 0);
define("REGISTER_POPUP", 1);

define("REMIND_SIMPLE", 0);
define("REMIND_POPUP", 1);

define("EXPORT_SIMPLE", 0);
define("EXPORT_POPUP", 1);

define("EXPORT_RAW", 0);
define("EXPORT_FORMATTED", 1);
define("EXPORT_BOTH", 2);


define("titTABLE",0);
define("titVIEW",1);
define("titREPORT",2);
define("titCHART",3);
define("titDASHBOARD",4);

define("TAB_TYPE_TAB", 0);
define("TAB_TYPE_SECTION", 1);
define("TAB_TYPE_STEP", 2);

// for report lib
define("REPORT_STEPPED", 0);
define("REPORT_BLOCK", 1);
define("REPORT_OUTLINE", 2);
define("REPORT_ALIGN", 3);
define("REPORT_TABULAR", 6);

define("TOTAL_NONE", -1);
define("TOTAL_MAX", 0);
define("TOTAL_AVG", 1);
define("TOTAL_SUM", 3);
define("TOTAL_MIN", 4);

define("LIST_SIMPLE",0);
define("LIST_LOOKUP",1);
define("LIST_DETAILS",3);
define("LIST_AJAX",4);
define("RIGHTS_PAGE", 5);
define("MEMBERS_PAGE", 6);
define("LIST_DASHBOARD", 7);
define("LIST_DASHDETAILS", 8);
define("MAP_DASHBOARD", 9);
define("LIST_MASTER",10);
define("PRINT_MASTER",11);
define("LIST_POPUPDETAILS",12);
define("PRINT_SIMPLE",13);
define("PRINT_PDFJSON",14); 	//	prepare json for PDF
define("LIST_PDFJSON",15); 	//	prepare details table json for PDF



define("REPORT_SIMPLE", 0);
define("REPORT_POPUPDETAILS", 1);
define("REPORT_DASHBOARD", 2);
define("REPORT_DETAILS", 3);
define("REPORT_DASHDETAILS", 4);

define("CHART_SIMPLE", 0);
define("CHART_POPUPDETAILS", 1);
define("CHART_DASHBOARD", 2);
define("CHART_DETAILS", 3);
define("CHART_DASHDETAILS", 4);

define("DP_POPUP",0);
define("DP_INLINE",1);
define("DP_NONE",2);

define("DL_SINGLE",0);
define("DL_INDIVIDUAL",1);
define("DL_NONE",2);

define("SEARCH_SIMPLE", 0);
define("SEARCH_LOAD_CONTROL", 1);
define("SEARCH_DASHBOARD", 2);
define("SEARCH_POPUP", 3);

define("LCT_DROPDOWN",0);
define("LCT_AJAX",1);
define("LCT_LIST",2);
define("LCT_CBLIST",3);
define("LCT_RADIO",4);

define("LT_LISTOFVALUES",0);
// lookup table is not added to the project
define("LT_LOOKUPTABLE",1);
define("LT_QUERY", 2);

define("ENCRYPTION_NONE", 0);
define("ENCRYPTION_DB", 1);
define("ENCRYPTION_PHP", 2);
define("ENCRYPTION_ALG_DES", 1);
define("ENCRYPTION_ALG_AES", 128);
define("ENCRYPTION_ALG_AES_256", 256);

define("SETTING_TYPE_GLOBAL", "global");
define("SETTING_TYPE_VIEW", "view");
define("SETTING_TYPE_EDIT", "edit");

define('otNone',0);
define('otUseMobile',1);
define('otUseDesktop',2);


define("CONTAINS", "Contains");
define("EQUALS", "Equals");
define("STARTS_WITH", "Starts with");
define("MORE_THAN", "More than");
define("LESS_THAN", "Less than");
define("BETWEEN", "Between");
define("EMPTY_SEARCH", "Empty");
define("NOT_CONTAINS", "NOT Contains");
define("NOT_EQUALS", "NOT Equals");
define("NOT_STARTS_WITH", "NOT Starts with");
define("NOT_MORE_THAN", "NOT More than");
define("NOT_LESS_THAN", "NOT Less than");
define("NOT_BETWEEN", "NOT Between");
define("NOT_EMPTY", "NOT Empty");

define("SEARCHID_SIMPLE", 1);
define("SEARCHID_PANEL", 10);
define("SEARCHID_ALL", 10000);


/* Define constants for the filters settings */
//fiter totals
define("FT_NONE", 0);
define("FT_COUNT", 1);
define("FT_MIN", 2);
define("FT_MAX", 3);
//filter multiselect
define("FM_NONE", 0);
define("FM_ON_DEMAND", 1);
define("FM_ALWAYS", 2);
//filter format
define("FF_VALUE_LIST", "Values list");
define("FF_BOOLEAN", "Options list");
define("FF_INTERVAL_LIST", "Interval list");
define("FF_INTERVAL_SLIDER", "Interval slider");
//define filter interval limits' constants
define("FIL_NONE", 0);
define("FIL_MORE_THAN", 1);
define("FIL_LESS_THAN", 1);
define("FIL_LESS_THAN_OR_EQUAL", 2);
define("FIL_MORE_THAN_OR_EQUAL", 2);
define("FIL_REMAINDER", 3);
//define slider filter constants
define("FS_BOTH", 0);
define("FS_MIN_ONLY", 1);
define("FS_MAX_ONLY", 2);
//define slider step types
define("FSST_SECONDS", 0);
define("FSST_MINUTES", 1);
define("FSST_HOURS", 2);
define("FSST_DAYS", 3);
define("FSST_MONTHS", 4);
define("FSST_YEARS", 5);
//sorting constants
define('SORT_BY_DISP_VALUE', 0);
define('SORT_BY_DB_VALUE', 1);
define('SORT_BY_GR_VALUE', 2);
/**/


define("gltHORIZONTAL", 0);
define("gltVERTICAL", 1);
define("gltCOLUMNS", 2);
define("gltFLEXIBLE", 3);

/* Define comstamts for hidden columns devices*/
define("DESKTOP", 1);
define("TABLET_10_IN", 2);
define("TABLET_7_IN", 3);
define("SMARTPHONE_LANDSCAPE", 4);
define("SMARTPHONE_PORTRAIT", 5);
/**/

/* Dashboard types */
define("DASHBOARD_LIST", 0);
define("DASHBOARD_CHART", 1);
define("DASHBOARD_REPORT", 2);
define("DASHBOARD_RECORD", 3);
define("DASHBOARD_SEARCH", 4);
define("DASHBOARD_DETAILS", 5);
define("DASHBOARD_MAP", 6);
define("DASHBOARD_SNIPPET", 7);
/**/

/* Define message type constants */
define("MESSAGE_INFO", 1);
define("MESSAGE_ERROR", 2);

/* Define ML String type constants */
define("ML_TEXT", 0);
define("ML_CUSTOM_LABEL", 1);
define("ML_MESSAGE", 2);


/* Define print page and pdf page constants */
define("PRINT_PAGE_WIDTH", 700);
define("PRINT_PAGE_HEIGHT", 900);
define("PDF_PAGE_WIDTH", 750);
define("PDF_PAGE_HEIGHT", 1060);

/* Defined maps type */
define("GOOGLE_MAPS", 0);
define("OPEN_STREET_MAPS", 1);
define("BING_MAPS", 2);

/* Defined captcha type */
define("FLASH_CAPTCHA", 0);
define("RE_CAPTCHA", 1);

/* Define 'after record added/edited actions' constants*/
define("AA_TO_LIST", 0);
define("AA_TO_ADD", 1);
define("AA_TO_VIEW", 2);
define("AA_TO_EDIT", 3);
define("AA_TO_DETAIL_ADD", 4);
define("AA_TO_DETAIL_LIST", 5);

define("AE_TO_LIST", 0);
define("AE_TO_EDIT", 1);
define("AE_TO_VIEW", 2);
define("AE_TO_NEXT_EDIT", 3);
define("AE_TO_PREV_EDIT", 4);
define("AE_TO_DETAIL_LIST", 5);
/**/

define('BOOTSTRAP_LAYOUT', 3);
define('PD_BS_LAYOUT', 4); // temp

define('ICON_NONE', 0);
define('ICON_FILE', 1);
define('ICON_BOOTSTRAP_GLYPH', 2);



define('WELCOME_MENU', "welcome_page");

define('MENU_VERTICAL', "v");
define('MENU_HORIZONTAL', "h");
define('MENU_QUICKJUMP', "q");

// paramsLogger types
define('SSEARCH_PARAMS_TYPE', 1);
define('CRESIZE_PARAMS_TYPE', 2);
define('SHFIELDS_PARAMS_TYPE', 3);
define('FORDER_PARAMS_TYPE', 4);

// remind password method
define('RPM_SEND', 'SEND');
define('RPM_RESET', 'RESET');

define('CONTEXT_GLOBAL', 0);	//	global context
define('CONTEXT_PAGE', 1);		//	page where pageObject is available
define('CONTEXT_BUTTON', 2);	// 	button or other AJAX event
define('CONTEXT_LOOKUP', 3);	//	dependent lookup
define('CONTEXT_ROW', 4);		// 	processing grid row on multiple-records page (list)

define('BOTH_RECORDS', 0);
define('NEXT_RECORD', 1);
define('PREV_RECORD', 2);

// login form types
define('LOGIN_SEPARATE', 0);
//define('LOGIN_POPUP', 1);
//define('LOGIN_EMBEDED', 2);
define('NO_LOGIN', 3);

define('MEDIA_DESKTOP', 0);
define('MEDIA_MOBILE', 1);
define('MEDIA_MOBILE_EXPANDED', 2);

define('WEBREPORTS_TABLE', "{04AFFBE6-86C0-47b0-ADD3-BA7FA19CA6FC}" );


$globalSettings = array();
$g_defaultOptionValues = array();
$g_settingsType = array();

$globalSettings["nLoginMethod"] = -1;

$twilioSID = "";
$twilioAuth = "";
$twilioNumber = "";
$globalSettings["bTwoFactorAuth"] = false;





$globalSettings["popupPagesLayoutNames"] = array();

//mail settings
$globalSettings["useBuiltInMailer"] = false;

$globalSettings["useCustomSMTPSettings"] = true;

$globalSettings["strSMTPUser"] = "scholarships@gersonsolulu.org.pg";
$globalSettings["strSMTPServer"] = "mail14.qnetau.com";
$globalSettings["strSMTPPort"] = "25";
$globalSettings["strSMTPPassword"] = "Vavines17!";
$globalSettings["strFromEmail"] = "scholarships@gersonsolulu.org.pg";

//


$ajaxSearchStartsWith = true;




$globalSettings["LandingPageType"] = 0;
$globalSettings["LandingTable"] = "";
$globalSettings["LandingPage"] = "login";
$globalSettings["LandingURL"] = "login.php";
$globalSettings["LandingPageId"] = "";

$globalSettings["ProjectLogo"] = array();
$globalSettings["ProjectLogo"]["English"] = "Scholarships Menu:";

$globalSettings["CookieBanner"] = array();

$globalSettings["useCookieBanner"] = 1 != 0;



$globalSettings["isSection508"] = true;

$globalSettings["apiGoogleMapsCode"] = "";




/**
 * If true then detail table name will be printed before detail table on the view page
 * @var {bool}
 */
$globalSettings["printDetailTableName"] = true;

/**
 * Alias for custom expression in display field in ListPage_Lookup
 * @var {string}
 */
$globalSettings["dispFieldAlias"] = "rrdf1";

/**
 * If true then search suggest result will be handled in Lookup control
 * @var {bool}
 */
$globalSettings["handleSearchSuggestInLookup"] = true;

/**
 * Maximum size of search suggest result string
 * @var {int}
 */
$globalSettings["suggestStringSize"] = 40;

/**
 * The number of seach suggests displayed
 */
$globalSettings["searchSuggestsNumber"] = 10;

$globalSettings["override"] = array();

	$globalSettings["override"]["remind.htm"] = 2;
	$globalSettings["override"]["changepwd.htm"] = 2;
	$globalSettings["override"]["remind_success.htm"] = 2;
	$globalSettings["override"]["Financials_add.htm"] = 2;
	$globalSettings["override"]["GraduatesAll_report.htm"] = 2;
	$globalSettings["override"]["Scholarship_Officers_view.htm"] = 2;
	$globalSettings["override"]["Schools_Panel_list.htm"] = 2;
	$globalSettings["override"]["Schools_Panel_print.htm"] = 2;
	$globalSettings["override"]["Schools_Panel_export.htm"] = 2;
	$globalSettings["override"]["Schools_Panel_import.htm"] = 2;
	$globalSettings["override"]["Schools_Panel_search.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_edit_Referee21.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_edit_Commissioner_Of_Oaths1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_add_Personal_Details1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_add_Father_Details1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_add.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_add_Education_Details1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_add_Referees1.htm"] = 2;
	$globalSettings["override"]["Scholarship_Module_edit.htm"] = 2;
	$globalSettings["override"]["Scholarship_Module_add.htm"] = 2;
	$globalSettings["override"]["Scholarship_Module_view.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_edit.htm"] = 2;
	$globalSettings["override"]["Judges_Module_add_Education_Details1.htm"] = 2;
	$globalSettings["override"]["Judges_Module_add_Personal_Details1.htm"] = 2;
	$globalSettings["override"]["Judges_Module_add_Parents_Details1.htm"] = 2;
	$globalSettings["override"]["Judges_Module_add_Documents1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_add_Documents1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_add_Mothers_Details1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_add_Comments1.htm"] = 2;
	$globalSettings["override"]["LiveUploadApplication_add.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_edit_Personal_Details1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_edit_Mothers_Details1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_edit_Parents_Details1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_edit_Comments1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_edit_Education_Details1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_edit_Referee11.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_view_Personal_Details1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_view_Parents_Details1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_view_Mothers_Details1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_view_Academic_Details1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_view_Documents1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_view_Referees1.htm"] = 2;
	$globalSettings["override"]["Live_Application_Form_view_Comments1.htm"] = 2;
	$globalSettings["override"]["LiveUploadApplication_add_Referees1.htm"] = 2;
	$globalSettings["override"]["LiveUploadApplication_add_Documents1.htm"] = 2;
	$globalSettings["override"]["LiveUploadApplication_add_Mothers_Details1.htm"] = 2;
	$globalSettings["override"]["LiveUploadApplication_add_Father_Details1.htm"] = 2;
	$globalSettings["override"]["LiveUploadApplication_add_Education_Details1.htm"] = 2;
	$globalSettings["override"]["LiveUploadApplication_add_Personal_Details1.htm"] = 2;

$styleOverrides = array();


$globalSettings["mapProvider"]=0;

$globalSettings["CaptchaSettings"] = array();
$globalSettings["CaptchaSettings"]["type"] = 1;
$globalSettings["CaptchaSettings"]["siteKey"] = "6LfOQg4TAAAAAGi_z4jPAuldsmYBxLFnydZpioLL";
$globalSettings["CaptchaSettings"]["secretKey"] = "6LfOQg4TAAAAAK_zwHWswfjZauQigH8cYDWGvq8i";
$globalSettings["CaptchaSettings"]["captchaPassesCount"] = "5";


$bsProjectTheme = "spacelab";
$bsProjectSize = "normal";

$wr_pagestylepath = "RoundedSalsaOrangeOrangeSalsaGreenButtn";
$wr_is_standalone = false;
$WRAdminPagePassword = "";

$cLoginTable = "mpgusers";
$cDisplayNameField = "fullname";
$cUserNameField	= "username";
$cPasswordField	= "password";
$cUserGroupField = "groupid";
$cEmailField = "email";
$globalSettings["usersTableInProject"] = false;

$globalSettings["jwtSecret"] = "s2dgfsg-43f";

if( $cDisplayNameField == '' )
	$cDisplayNameField = $cUserNameField;

$cDisplayNameFieldType	= 200;
$cUserNameFieldType	= 200;
$cPasswordFieldType	= 200;
$cEmailFieldType = 200;

$arrCustomPages = array();
$arrCustomPages["Judges_Selection_Committee_Panel_list.htm"] = true;
$arrCustomPages["Judges_New_Applicants_list.htm"] = true;
$arrCustomPages["ReportGraduatesByDistrictView_list.htm"] = true;
$arrCustomPages["ChartGraduatesVsYears_chart.htm"] = true;
$arrCustomPages["Application_Form_list.htm"] = true;
$arrCustomPages["Application_Form_add.htm"] = true;
$arrCustomPages["applicform1_add.htm"] = true;
$arrCustomPages["Reporting_Panel_add.htm"] = true;
$arrCustomPages["Judges_Panel_edit.htm"] = true;
$arrCustomPages["Judges_Panel_add.htm"] = true;
$arrCustomPages["Judges_Panel_edit_Judges_Approval1.htm"] = true;
$arrCustomPages["Scholarship_Officers_edit_Second_Year1.htm"] = true;
$arrCustomPages["Scholarship_Officers_edit_Third_Year1.htm"] = true;
$arrCustomPages["Scholarship_Officers_edit_Fourth_Year1.htm"] = true;
$arrCustomPages["Scholarship_Officers_edit_Fifth_Year1.htm"] = true;
$arrCustomPages["Scholarships_Sample_report.htm"] = true;
$arrCustomPages["Scholarship_Officers_edit_First_Year1.htm"] = true;
$arrCustomPages["Reference_Module1_list.htm"] = true;
$arrCustomPages["Scholarship_Module_view.htm"] = true;
$arrCustomPages["Scholarship_Module_view_Personal_Details1.htm"] = true;
$arrCustomPages["Scholarship_Module_view_Education_Details1.htm"] = true;
$arrCustomPages["Scholarship_Module_view_Fathers_Details1.htm"] = true;
$arrCustomPages["GeneralDataSearch_search.htm"] = true;
$arrCustomPages["Scholarship_Module_add_Personal_Detals1.htm"] = true;
$arrCustomPages["Scholarship_Module_add_Documents1.htm"] = true;
$arrCustomPages["Scholarship_Module_add_Education_Details1.htm"] = true;
$arrCustomPages["Scholarship_Module_add_Fathers_Details1.htm"] = true;
$arrCustomPages["Scholarship_Module_add_First_Year1.htm"] = true;
$arrCustomPages["Scholarship_Module_add_Second_Academic_Details1.htm"] = true;
$arrCustomPages["Scholarship_Module_add_Third_Year_Academic_Details1.htm"] = true;
$arrCustomPages["Scholarship_Module_add_Fourth_Year_Academic_Details11.htm"] = true;
$arrCustomPages["Scholarship_Module_add_Fifth_Year_Academic_Details1.htm"] = true;
$arrCustomPages["Scholarship_Module_add_Referees_Witnesses1.htm"] = true;
$arrCustomPages["Scholarship_Module_view_First_Year1.htm"] = true;
$arrCustomPages["Scholarship_Module_view_Second_Year1.htm"] = true;
$arrCustomPages["Scholarship_Module_view_Third_Year1.htm"] = true;
$arrCustomPages["Scholarship_Module_view_Fourth1.htm"] = true;
$arrCustomPages["Scholarship_Module_view_Fifth_Year1.htm"] = true;
$arrCustomPages["Scholarship_Module_edit.htm"] = true;
$arrCustomPages["Scholarship_Module_add_Mothers_Details1.htm"] = true;
$arrCustomPages["mpgssofficer_add.htm"] = true;
$arrCustomPages["mpgssofficer_edit.htm"] = true;
$arrCustomPages["mpgsadminnew_add.htm"] = true;
$arrCustomPages["mpgsadminnew_view.htm"] = true;
$arrCustomPages["adminprovinces_list.htm"] = true;
$arrCustomPages["adminundetails_list.htm"] = true;
$arrCustomPages["instupdateunibals_list.htm"] = true;
$arrCustomPages[""] = true;
$arrCustomPages["Online_Application_Update_edit.htm"] = true;
$arrCustomPages["Online_Application_Update_add.htm"] = true;
$arrCustomPages["OnlineApplicationForm2018SBS_view.htm"] = true;

												$cUserNameFieldType	= 200;
												$cPasswordFieldType	= 200;
												$cEmailFieldType = 200;
																																																																								

$useAJAX = true;
$suggestAllContent = true;

$strLastSQL = "";
$showCustomMarkerOnPrint = false;

$projectBuildKey = "2108_1748498379";
$wizardBuildKey = "33876";
$projectBuildNumber = "2108";

$mlang_messages = array();
$mlang_charsets = array();


$projectMenus = array();
$projectMenus[] = "main";
$projectMenus[] = "Application";
$projectMenus[] = "Judges";
$projectMenus[] = "Referees";
$projectMenus[] = "Report";
$projectMenus[] = "Scholarships";
$projectMenus[] = "welcome_page";


$menuTreelikeFlags = array();
$menuTreelikeFlags["main"] = 0;


$menuTreelikeFlags["Application"] = 0;
$menuTreelikeFlags["Judges"] = 0;
$menuTreelikeFlags["Referees"] = 0;
$menuTreelikeFlags["Report"] = 0;
$menuTreelikeFlags["Scholarships"] = 0;
$menuTreelikeFlags["welcome_page"] = 0;



// table captions
$tableCaptions = array();
$tableCaptions["English"] = array();
$tableCaptions["English"]["GraduatesAll"] = "Graduates All";
$tableCaptions["English"]["GraduatesByDistrict"] = "Graduates By District";
$tableCaptions["English"]["Judges_Module"] = "Judges Module";
$tableCaptions["English"]["Schools_Module"] = "Schools Module";
$tableCaptions["English"]["ChartGraduatesByYears"] = "Chart Graduates By Years";
$tableCaptions["English"]["ChartGraduatesByDistrict"] = "Chart Graduates By District";
$tableCaptions["English"]["Reporting_Module"] = "Reporting Module";
$tableCaptions["English"]["Live_Application_Form"] = "Live Application Form";
$tableCaptions["English"]["AllNewApplicants"] = "All New Applicants";
$tableCaptions["English"][""] = "";
$tableCaptions["English"]["YearlyFinancials"] = "Yearly Financials";
$tableCaptions["English"]["YearlyFinancialsbyNonGraduates"] = "Yearly Financialsby Non Graduates";
$tableCaptions["English"]["YearlyFinancialsbyDistrict"] = "Yearly Financialsby District";
$tableCaptions["English"]["YearlyFinancialsByInstitution"] = "Yearly Financials By Institution";
$tableCaptions["English"]["YearlyFinancialsbyGraduated"] = "Yearly Financialsby Graduated";
$tableCaptions["English"]["GraduatesYears"] = "Graduates Years";
$tableCaptions["English"]["JudgesApprovd"] = "Judges Approvd";
$tableCaptions["English"]["JudgesNotApproved"] = "Judges Not Approved";
$tableCaptions["English"]["FinancialsByYear_Institution"] = "Financials By Year&Institution";
$tableCaptions["English"]["UnsortedNoInstitution"] = "Unsorted No Institution";
$tableCaptions["English"]["GraduatesByYears"] = "Graduates By Years";
$tableCaptions["English"]["User_Management"] = "User Management";
$tableCaptions["English"]["Upload_Module"] = "Upload Module";
$tableCaptions["English"]["DataSearch"] = "Data Search";
$tableCaptions["English"]["ChartGraduatesByDistrictCostings"] = "Chart Graduates By District Costings";
$tableCaptions["English"]["LiveUploadApplication"] = "Live Upload Application";
$tableCaptions["English"]["Judges_Module___Continuing"] = "Judges Module - Continuing";
$tableCaptions["English"]["JudgesApprovd2017"] = "Judges Approvd2017";
$tableCaptions["English"]["mpgssdatasearch"] = "Mpgssdatasearch";
$tableCaptions["English"]["NewApplicationsList2017"] = "New Applications List2017";
$tableCaptions["English"]["Judges___New_Applications_2017"] = "Judges - New Applications 2017";
$tableCaptions["English"]["Scholarship_Officer"] = "Scholarship Officer";
$tableCaptions["English"]["mpgsstemplate"] = "Mpgsstemplate";
$tableCaptions["English"]["feecomponentcont2017"] = "Feecomponentcont2017";
$tableCaptions["English"]["mpgssadmin"] = "Mpgssadmin";
$tableCaptions["English"]["mpgsssearchnupload"] = "Mpgsssearchnupload";
$tableCaptions["English"]["admintesas"] = "Admintesas";
$tableCaptions["English"]["adminjudgcont2017"] = "Adminjudgcont2017";
$tableCaptions["English"]["judgescont2017"] = "Judgescont2017";
$tableCaptions["English"]["feecomponentsnewapplic2017"] = "Feecomponentsnewapplic2017";
$tableCaptions["English"]["judgescont2017all"] = "Judgescont2017all";
$tableCaptions["English"]["NewApplic2017trans"] = "New Applic2017trans";
$tableCaptions["English"]["NewApplic2017notrans"] = "New Applic2017notrans";
$tableCaptions["English"]["ApprovdContinuingAll2017byDistrict"] = "Approvd Continuing All2017by District";
$tableCaptions["English"]["NewApprovd2017byDistrict"] = "New Approvd2017by District";
$tableCaptions["English"]["NewApprovd2017NoDistrict"] = "New Approvd2017No District";
$tableCaptions["English"]["Sholarhips_Data_Entry_Template"] = "Sholarhips Data Entry Template";
$tableCaptions["English"]["LiveApplicationTemplate"] = "Live Application Template";
$tableCaptions["English"]["LiveApplicationNew"] = "Live Application New";
$tableCaptions["English"]["SholarhipsAdmin"] = "Sholarhips Admin";
$tableCaptions["English"]["GPAGENERAL"] = "GPAGENERAL";
$tableCaptions["English"]["GPABALOB"] = "GPABALOB";
$tableCaptions["English"]["LiveApplication2018"] = "Live Application2018";
$tableCaptions["English"]["OnlineApplicationFrm2018Update"] = "Online Application Frm2018Update";
$tableCaptions["English"]["OnlineApplicationForm2018"] = "Online Application Form2018";
$tableCaptions["English"]["NewApplicationsList2018"] = "New Applications List2018";
$tableCaptions["English"]["adminjudgcont2018"] = "Adminjudgcont2018";
$tableCaptions["English"]["Judges___New_Applications_2018"] = "Judges - New Applications 2018";
$tableCaptions["English"]["OnlineApplicationFormSBS"] = "Online Application Form SBS";
$tableCaptions["English"]["Graduates_Instant_Report"] = "Graduates Instant Report";
$tableCaptions["English"]["mpgusers"] = "Mpgusers";


$globalEvents = new class_GlobalEvents;
$tableEvents = array();
$dalTables = array();
$tableinfo_cache = array();

require_once( getabspath('classes/labels.php') );
require_once( getabspath('classes/security.php') );
require_once( getabspath("connections/dbfunctions_legacy.php") );
require_once( getabspath("connections/ConnectionManager.php") );
include(getabspath('classes/searchclause.php'));
include(getabspath('classes/projectsettings.php'));
include_once(getabspath('classes/runnerpage.php'));
include_once(getabspath("classes/controls/ViewControl.php"));
require_once( getabspath('classes/db.php') );
require_once( getabspath('classes/context.php') );
require_once(getabspath("classes/cipherer.php"));
require_once( getabspath('classes/wheretabs.php') );

$contextStack = new RunnerContext;

$cman = new ConnectionManager();

$currentConnection = null;

$mlang_defaultlang = getDefaultLanguage();

include(getabspath("include/languages.php"));

$mediaType = $_COOKIE["mediaType"];
$mediaType = $mediaType ? $mediaType : 0;



$page_titles[".global"] = array();
if(mlang_getcurrentlang()=="English")
{
}

$globalSettings["showDetailedError"] = true;


// SearchClause::getSearchObject
$_cachedSeachClauses = array();

$auditMaxFieldLength = 300;



// default connection link #9875
$conn = $cman->getDefault()->conn;



$isGroupSecurity = false;

$isUseRTEBasic = true;

$isUseRTECK = false;

$isUseRTEInnova = false;

$caseInsensitiveUsername = 1;


$menuNodesIndex=0;

/**
 *	Sundry data the page classes want pass to their JS counterparts
 * 	TODO: Move proxy here
 *
 *	$pagesData[<pageid>] = array( 	<key> => <value>
 *									<key> => <value> ... )
 *					)
 */
$pagesData = array();

$pageInConstruction = null;

?>