<?php
$tdataregion = array();
$tdataregion[".searchableFields"] = array();
$tdataregion[".ShortName"] = "region";
$tdataregion[".OwnerID"] = "";
$tdataregion[".OriginalTable"] = "region";


$tdataregion[".pagesByType"] = my_json_decode( "{\"add\":[\"add\"],\"edit\":[\"edit\"],\"export\":[\"export\"],\"import\":[\"import\"],\"list\":[\"list\"],\"print\":[\"print\"],\"search\":[\"search\"]}" );
$tdataregion[".originalPagesByType"] = $tdataregion[".pagesByType"];
$tdataregion[".pages"] = types2pages( my_json_decode( "{\"add\":[\"add\"],\"edit\":[\"edit\"],\"export\":[\"export\"],\"import\":[\"import\"],\"list\":[\"list\"],\"print\":[\"print\"],\"search\":[\"search\"]}" ) );
$tdataregion[".originalPages"] = $tdataregion[".pages"];
$tdataregion[".defaultPages"] = my_json_decode( "{\"add\":\"add\",\"edit\":\"edit\",\"export\":\"export\",\"import\":\"import\",\"list\":\"list\",\"print\":\"print\",\"search\":\"search\"}" );
$tdataregion[".originalDefaultPages"] = $tdataregion[".defaultPages"];

//	field labels
$fieldLabelsregion = array();
$fieldToolTipsregion = array();
$pageTitlesregion = array();
$placeHoldersregion = array();

if(mlang_getcurrentlang()=="English")
{
	$fieldLabelsregion["English"] = array();
	$fieldToolTipsregion["English"] = array();
	$placeHoldersregion["English"] = array();
	$pageTitlesregion["English"] = array();
	$fieldLabelsregion["English"]["id"] = "رقم";
	$fieldToolTipsregion["English"]["id"] = "";
	$placeHoldersregion["English"]["id"] = "";
	$fieldLabelsregion["English"]["name"] = "أسم المنطقة";
	$fieldToolTipsregion["English"]["name"] = "";
	$placeHoldersregion["English"]["name"] = "";
	if (count($fieldToolTipsregion["English"]))
		$tdataregion[".isUseToolTips"] = true;
}
if(mlang_getcurrentlang()=="Arabic")
{
	$fieldLabelsregion["Arabic"] = array();
	$fieldToolTipsregion["Arabic"] = array();
	$placeHoldersregion["Arabic"] = array();
	$pageTitlesregion["Arabic"] = array();
	$fieldLabelsregion["Arabic"]["id"] = "رقم";
	$fieldToolTipsregion["Arabic"]["id"] = "";
	$placeHoldersregion["Arabic"]["id"] = "";
	$fieldLabelsregion["Arabic"]["name"] = "أسم المنطقة";
	$fieldToolTipsregion["Arabic"]["name"] = "";
	$placeHoldersregion["Arabic"]["name"] = "";
	if (count($fieldToolTipsregion["Arabic"]))
		$tdataregion[".isUseToolTips"] = true;
}


	$tdataregion[".NCSearch"] = true;



$tdataregion[".shortTableName"] = "region";
$tdataregion[".nSecOptions"] = 0;

$tdataregion[".mainTableOwnerID"] = "";
$tdataregion[".entityType"] = 0;
$tdataregion[".connId"] = "electiondb_at_ssl_localhost";


$tdataregion[".strOriginalTableName"] = "region";

	



$tdataregion[".showAddInPopup"] = false;

$tdataregion[".showEditInPopup"] = false;

$tdataregion[".showViewInPopup"] = false;

//page's base css files names
$popupPagesLayoutNames = array();
$tdataregion[".popupPagesLayoutNames"] = $popupPagesLayoutNames;


$tdataregion[".listAjax"] = false;
//	temporary
$tdataregion[".listAjax"] = false;

	$tdataregion[".audit"] = false;

	$tdataregion[".locking"] = false;


$pages = $tdataregion[".defaultPages"];

if( $pages[PAGE_EDIT] ) {
	$tdataregion[".edit"] = true;
	$tdataregion[".afterEditAction"] = 1;
	$tdataregion[".closePopupAfterEdit"] = 1;
	$tdataregion[".afterEditActionDetTable"] = "";
}

if( $pages[PAGE_ADD] ) {
$tdataregion[".add"] = true;
$tdataregion[".afterAddAction"] = 1;
$tdataregion[".closePopupAfterAdd"] = 1;
$tdataregion[".afterAddActionDetTable"] = "";
}

if( $pages[PAGE_LIST] ) {
	$tdataregion[".list"] = true;
}



$tdataregion[".strSortControlSettingsJSON"] = "";




if( $pages[PAGE_VIEW] ) {
$tdataregion[".view"] = true;
}

if( $pages[PAGE_IMPORT] ) {
$tdataregion[".import"] = true;
}

if( $pages[PAGE_EXPORT] ) {
$tdataregion[".exportTo"] = true;
}

if( $pages[PAGE_PRINT] ) {
$tdataregion[".printFriendly"] = true;
}



$tdataregion[".showSimpleSearchOptions"] = true; // temp fix #13449

// Allow Show/Hide Fields in GRID
$tdataregion[".allowShowHideFields"] = true; // temp fix #13449
//

// Allow Fields Reordering in GRID
$tdataregion[".allowFieldsReordering"] = true; // temp fix #13449
//

$tdataregion[".isUseAjaxSuggest"] = true;

$tdataregion[".rowHighlite"] = true;





$tdataregion[".ajaxCodeSnippetAdded"] = false;

$tdataregion[".buttonsAdded"] = false;

$tdataregion[".addPageEvents"] = false;

// use timepicker for search panel
$tdataregion[".isUseTimeForSearch"] = false;


$tdataregion[".badgeColor"] = "4169E1";


$tdataregion[".allSearchFields"] = array();
$tdataregion[".filterFields"] = array();
$tdataregion[".requiredSearchFields"] = array();

$tdataregion[".googleLikeFields"] = array();
$tdataregion[".googleLikeFields"][] = "id";
$tdataregion[".googleLikeFields"][] = "name";



$tdataregion[".tableType"] = "list";

$tdataregion[".printerPageOrientation"] = 0;
$tdataregion[".nPrinterPageScale"] = 100;

$tdataregion[".nPrinterSplitRecords"] = 40;

$tdataregion[".geocodingEnabled"] = false;










$tdataregion[".pageSize"] = 20;

$tdataregion[".warnLeavingPages"] = true;



$tstrOrderBy = "";
if(strlen($tstrOrderBy) && strtolower(substr($tstrOrderBy,0,8))!="order by")
	$tstrOrderBy = "order by ".$tstrOrderBy;
$tdataregion[".strOrderBy"] = $tstrOrderBy;

$tdataregion[".orderindexes"] = array();


$tdataregion[".sqlHead"] = "SELECT id,  	name";
$tdataregion[".sqlFrom"] = "FROM region";
$tdataregion[".sqlWhereExpr"] = "";
$tdataregion[".sqlTail"] = "";










//fill array of records per page for list and report without group fields
$arrRPP = array();
$arrRPP[] = 10;
$arrRPP[] = 20;
$arrRPP[] = 30;
$arrRPP[] = 50;
$arrRPP[] = 100;
$arrRPP[] = 500;
$arrRPP[] = -1;
$tdataregion[".arrRecsPerPage"] = $arrRPP;

//fill array of groups per page for report with group fields
$arrGPP = array();
$arrGPP[] = 1;
$arrGPP[] = 3;
$arrGPP[] = 5;
$arrGPP[] = 10;
$arrGPP[] = 50;
$arrGPP[] = 100;
$arrGPP[] = -1;
$tdataregion[".arrGroupsPerPage"] = $arrGPP;

$tdataregion[".highlightSearchResults"] = true;

$tableKeysregion = array();
$tableKeysregion[] = "id";
$tdataregion[".Keys"] = $tableKeysregion;


$tdataregion[".hideMobileList"] = array();




//	id
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 1;
	$fdata["strName"] = "id";
	$fdata["GoodName"] = "id";
	$fdata["ownerTable"] = "region";
	$fdata["Label"] = GetFieldLabel("region","id");
	$fdata["FieldType"] = 3;

	
		$fdata["AutoInc"] = true;

	
			

		$fdata["strField"] = "id";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "id";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "");

	
	
	
	
	
	
	
	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats
	$fdata["EditFormats"] = array();

	$edata = array("EditFormat" => "Text field");

	
		$edata["weekdayMessage"] = array("message" => "", "messageType" => "Text");
	$edata["weekdays"] = "[]";


	
	



		$edata["IsRequired"] = true;

	
	
	
			$edata["acceptFileTypes"] = ".+$";
		$edata["acceptFileTypesHtml"] = "";

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
			$edata["HTML5InuptType"] = "text";

		$edata["EditParams"] = "";
		
		$edata["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
		
	
	//	End validation

	
			
	
	
	
	$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats


	$fdata["isSeparate"] = false;




// the field's search options settings
		$fdata["defaultSearchOption"] = "Contains";

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdataregion["id"] = $fdata;
		$tdataregion[".searchableFields"][] = "id";
//	name
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "name";
	$fdata["GoodName"] = "name";
	$fdata["ownerTable"] = "region";
	$fdata["Label"] = GetFieldLabel("region","name");
	$fdata["FieldType"] = 200;

	
	
	
			

		$fdata["strField"] = "name";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "name";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "");

	
	
	
	
	
	
	
	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats
	$fdata["EditFormats"] = array();

	$edata = array("EditFormat" => "Text field");

	
		$edata["weekdayMessage"] = array("message" => "", "messageType" => "Text");
	$edata["weekdays"] = "[]";


	
	



		$edata["IsRequired"] = true;

	
	
	
			$edata["acceptFileTypes"] = ".+$";
		$edata["acceptFileTypesHtml"] = "";

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
			$edata["HTML5InuptType"] = "text";

		$edata["EditParams"] = "";
			$edata["EditParams"].= " maxlength=100";

		$edata["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
		
	
	//	End validation

	
			
	
	
	
	$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats


	$fdata["isSeparate"] = false;




// the field's search options settings
		$fdata["defaultSearchOption"] = "Contains";

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdataregion["name"] = $fdata;
		$tdataregion[".searchableFields"][] = "name";


$tables_data["region"]=&$tdataregion;
$field_labels["region"] = &$fieldLabelsregion;
$fieldToolTips["region"] = &$fieldToolTipsregion;
$placeHolders["region"] = &$placeHoldersregion;
$page_titles["region"] = &$pageTitlesregion;

// -----------------start  prepare master-details data arrays ------------------------------//
// tables which are detail tables for current table (master)
$detailsTablesData["region"] = array();

// tables which are master tables for current table (detail)
$masterTablesData["region"] = array();



// -----------------end  prepare master-details data arrays ------------------------------//



require_once(getabspath("classes/sql.php"));











function createSqlQuery_region()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "id,  	name";
$proto0["m_strFrom"] = "FROM region";
$proto0["m_strWhere"] = "";
$proto0["m_strOrderBy"] = "";
	
		;
			$proto0["cipherer"] = null;
$proto2=array();
$proto2["m_sql"] = "";
$proto2["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto2["m_column"]=$obj;
$proto2["m_contained"] = array();
$proto2["m_strCase"] = "";
$proto2["m_havingmode"] = false;
$proto2["m_inBrackets"] = false;
$proto2["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto2);

$proto0["m_where"] = $obj;
$proto4=array();
$proto4["m_sql"] = "";
$proto4["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto4["m_column"]=$obj;
$proto4["m_contained"] = array();
$proto4["m_strCase"] = "";
$proto4["m_havingmode"] = false;
$proto4["m_inBrackets"] = false;
$proto4["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto4);

$proto0["m_having"] = $obj;
$proto0["m_fieldlist"] = array();
						$proto6=array();
			$obj = new SQLField(array(
	"m_strName" => "id",
	"m_strTable" => "region",
	"m_srcTableName" => "region"
));

$proto6["m_sql"] = "id";
$proto6["m_srcTableName"] = "region";
$proto6["m_expr"]=$obj;
$proto6["m_alias"] = "";
$obj = new SQLFieldListItem($proto6);

$proto0["m_fieldlist"][]=$obj;
						$proto8=array();
			$obj = new SQLField(array(
	"m_strName" => "name",
	"m_strTable" => "region",
	"m_srcTableName" => "region"
));

$proto8["m_sql"] = "name";
$proto8["m_srcTableName"] = "region";
$proto8["m_expr"]=$obj;
$proto8["m_alias"] = "";
$obj = new SQLFieldListItem($proto8);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto10=array();
$proto10["m_link"] = "SQLL_MAIN";
			$proto11=array();
$proto11["m_strName"] = "region";
$proto11["m_srcTableName"] = "region";
$proto11["m_columns"] = array();
$proto11["m_columns"][] = "id";
$proto11["m_columns"][] = "name";
$obj = new SQLTable($proto11);

$proto10["m_table"] = $obj;
$proto10["m_sql"] = "region";
$proto10["m_alias"] = "";
$proto10["m_srcTableName"] = "region";
$proto12=array();
$proto12["m_sql"] = "";
$proto12["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto12["m_column"]=$obj;
$proto12["m_contained"] = array();
$proto12["m_strCase"] = "";
$proto12["m_havingmode"] = false;
$proto12["m_inBrackets"] = false;
$proto12["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto12);

$proto10["m_joinon"] = $obj;
$obj = new SQLFromListItem($proto10);

$proto0["m_fromlist"][]=$obj;
$proto0["m_groupby"] = array();
$proto0["m_orderby"] = array();
$proto0["m_srcTableName"]="region";		
$obj = new SQLQuery($proto0);

	return $obj;
}
$queryData_region = createSqlQuery_region();


	
		;

		

$tdataregion[".sqlquery"] = $queryData_region;



$tableEvents["region"] = new eventsBase;
$tdataregion[".hasEvents"] = false;

?>