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

$bSubqueriesSupported=true;

$tables_data=array();
$field_labels=array();
$fieldToolTips=array();

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

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_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_DATABASE_VIDEO", "Database video");

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_DP",11);
define("EDIT_DATE_DD",12);
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("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("ADD_SIMPLE",0);
define("ADD_INLINE",1);
define("ADD_ONTHEFLY",2);
define("ADD_MASTER",3);
define("ADD_POPUP",4);

define("EDIT_SIMPLE",0);
define("EDIT_INLINE",1);
define("EDIT_ONTHEFLY",2);
define("EDIT_POPUP",3);

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

// 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("DP_POPUP",0);
define("DP_INLINE",1);
define("DP_NONE",2);

define("SEARCH_SIMPLE",0);
define("SEARCH_LOAD_CONTROL",1);

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

define("LT_LISTOFVALUES",0);
define("LT_LOOKUPTABLE",1);

$globalSettings = array();
$globalSettings["nLoginMethod"] = 1;
$globalSettings["dbType"] = 0;
$globalSettings["createLoginPage"] = true;

$wr_is_standalone=false;


$strLeftWrapper="`";
$strRightWrapper="`";

$cLoginTable				= "employee_list";
$cUserNameField			= "username";
$cPasswordField			= "password";
$cUserGroupField			= "Userlevel";
$cEmailField			= "E-Mail Address";

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

$nDBType=0;

$useAJAX = true;
$suggestAllContent = true;

$strLastSQL="";

$includes_js=array();
$includes_jsreq=array();
$includes_css=array();

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

// table captions
$tableCaptions = array();
$tableCaptions["English"]=array();
$tableCaptions["English"]["List_Management"] = "List Management";
$tableCaptions["English"]["Pending_Customers"] = "Pending Customers";
$tableCaptions["English"]["Review_List"] = "Review List";
$tableCaptions["English"]["Contact_Details"] = "Contact Details";
$tableCaptions["English"]["cust_list_contact_person"] = "Cust List Contact Person";
$tableCaptions["English"]["calls"] = "Calls";
$tableCaptions["English"]["Inactive_customer_list"] = "Inactive Customer List";
$tableCaptions["English"]["RO___Calls_Summary"] = "RO - Calls Summary";
$tableCaptions["English"]["Short_Listed_Customers"] = "Short-Listed Customers";
$tableCaptions["English"]["Active_Customers"] = "Active Customers";
$tableCaptions["English"]["Call_Details"] = "Call-Details";
$tableCaptions["English"]["Visit_Details"] = "Visit-Details";
$tableCaptions["English"]["visit_register"] = "Visit Register";
$tableCaptions["English"]["RO___Visit_Report"] = "RO - Visit Report";
$tableCaptions["English"]["Lead_Details"] = "Lead Details";
$tableCaptions["English"]["RO___Calls_Report"] = "RO - Calls Report";
$tableCaptions["English"]["employee_list"] = "Employee List";
$tableCaptions["English"]["department"] = "Department";
$tableCaptions["English"]["Area_Details"] = "Area Details";
$tableCaptions["English"]["area"] = "Area";
$tableCaptions["English"]["Region_Details"] = "Region Details";
$tableCaptions["English"]["region"] = "Region";
$tableCaptions["English"]["Visit_Update"] = "Visit Update";
$tableCaptions["English"]["My_Home"] = "My Home";
$tableCaptions["English"]["My_Planned_Visits"] = "My Planned Visits";
$tableCaptions["English"]["My_Leads"] = "My Leads";
$tableCaptions["English"]["My_Calls_Summary"] = "My Calls Summary";
$tableCaptions["English"]["My_Visit_Summary"] = "My Visit Summary";
$tableCaptions["English"]["Open_Leads_Report"] = "Open Leads Report";
$tableCaptions["English"]["HO___Calls_Report"] = "HO - Calls Report";
$tableCaptions["English"]["HO___Calls_Summary"] = "HO - Calls Summary";
$tableCaptions["English"]["HO___Visit_Report"] = "HO - Visit Report";
$tableCaptions["English"]["Customer_List_Summary___RO"] = "Customer List Summary - RO";
$tableCaptions["English"]["RO_Customer_List_Summary"] = "RO-Customer List Summary";
$tableCaptions["English"]["Potential_Customer_List"] = "Potential Customer List";
$tableCaptions["English"]["attendance_table"] = "Attendance Table";
$tableCaptions["English"]["Visit_Performance"] = "Visit Performance";
$tableCaptions["English"]["Vendor_Details"] = "Vendor Details";
$tableCaptions["English"]["vendor_list"] = "Vendor List";
$tableCaptions["English"]["lead_table"] = "Lead Table";
$tableCaptions["English"]["Leads_Management"] = "Leads-Management";
$tableCaptions["English"]["qtr_name"] = "Qtr Name";
$tableCaptions["English"]["Open_Leads"] = "Open Leads";
$tableCaptions["English"]["Calls_Performance"] = "Calls Performance";
$tableCaptions["English"]["material_category"] = "Material Category";
$tableCaptions["English"]["Materials_Master"] = "Materials Master";
$tableCaptions["English"]["material_master"] = "Material Master";
$tableCaptions["English"]["Lead_BOM"] = "Lead-BOM";
$tableCaptions["English"]["lead_bom"] = "Lead Bom";
$tableCaptions["English"]["Quote"] = "Quote";
$tableCaptions["English"]["SPC_Req"] = "SPC Req";
$tableCaptions["English"]["SPC__Quote"] = "SPC  Quote";
$tableCaptions["English"]["SPC_Pending"] = "SPC-Pending";
$tableCaptions["English"]["SPC_Approval"] = "SPC Approval";

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

$mlang_defaultlang="English";


$conn=db_connect();

//	old  menu support
//	deprecated
//	remove after version 5.2
$menuTablesArr = array();
$menuTablesArr[] = array("shortTName"=>"My_Home","dataSourceTName"=>"My Home","nType"=>1);
$menuTablesArr[] = array("shortTName"=>"Inactive_customer_list","dataSourceTName"=>"Inactive customer_list","nType"=>1);
$menuTablesArr[] = array("shortTName"=>"Pending_Customers","dataSourceTName"=>"Pending Customers","nType"=>1);
$menuTablesArr[] = array("shortTName"=>"Review_List","dataSourceTName"=>"Review List","nType"=>1);
$menuTablesArr[] = array("shortTName"=>"Short_Listed_Customers","dataSourceTName"=>"Short-Listed Customers","nType"=>1);
$menuTablesArr[] = array("shortTName"=>"Active_Customers","dataSourceTName"=>"Active Customers","nType"=>1);
$menuTablesArr[] = array("shortTName"=>"Visit_Update","dataSourceTName"=>"Visit Update","nType"=>1);
$menuTablesArr[] = array("shortTName"=>"employee_list","dataSourceTName"=>"employee_list","nType"=>0);
$menuTablesArr[] = array("shortTName"=>"Area_Details","dataSourceTName"=>"Area_Details","nType"=>1);
$menuTablesArr[] = array("shortTName"=>"Region_Details","dataSourceTName"=>"Region_Details","nType"=>1);
$menuTablesArr[] = array("shortTName"=>"RO___Calls_Summary","dataSourceTName"=>"RO - Calls Summary","nType"=>2);
$menuTablesArr[] = array("shortTName"=>"RO___Calls_Report","dataSourceTName"=>"RO - Calls Report","nType"=>2);
$menuTablesArr[] = array("shortTName"=>"RO___Visit_Report","dataSourceTName"=>"RO - Visit Report","nType"=>2);
$menuTablesArr[] = array("shortTName"=>"Customer_List_Summary___RO","dataSourceTName"=>"Customer List Summary - RO","nType"=>3);
$menuTablesArr[] = array("shortTName"=>"HO___Calls_Report","dataSourceTName"=>"HO - Calls Report","nType"=>2);
$menuTablesArr[] = array("shortTName"=>"HO___Calls_Summary","dataSourceTName"=>"HO - Calls Summary","nType"=>2);
$menuTablesArr[] = array("shortTName"=>"HO___Visit_Report","dataSourceTName"=>"HO - Visit Report","nType"=>2);
$menuTablesArr[] = array("shortTName"=>"Open_Leads_Report","dataSourceTName"=>"Open Leads Report","nType"=>2);
$menuTablesArr[] = array("shortTName"=>"Potential_Customer_List","dataSourceTName"=>"Potential Customer List","nType"=>1);
$menuTablesArr[] = array("shortTName"=>"Calls_Performance","dataSourceTName"=>"Calls Performance","nType"=>3);
$menuTablesArr[] = array("shortTName"=>"Visit_Performance","dataSourceTName"=>"Visit Performance","nType"=>3);
$menuTablesArr[] = array("shortTName"=>"Vendor_Details","dataSourceTName"=>"Vendor Details","nType"=>1);
$menuTablesArr[] = array("shortTName"=>"Leads_Management","dataSourceTName"=>"Leads-Management","nType"=>1);
$menuTablesArr[] = array("shortTName"=>"SPC_Pending","dataSourceTName"=>"SPC-Pending","nType"=>1);
$menuTablesArr[] = array("shortTName"=>"material_category","dataSourceTName"=>"material category","nType"=>0);


$isGroupSecurity = true;

?>
