<?php



$tdataClientes = array();
$tdataClientes[".searchableFields"] = array();
$tdataClientes[".ShortName"] = "Clientes";
$tdataClientes[".OwnerID"] = "";
$tdataClientes[".OriginalTable"] = "Clientes";


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

//	field labels
$fieldLabelsClientes = array();
$fieldToolTipsClientes = array();
$pageTitlesClientes = array();
$placeHoldersClientes = array();

if(mlang_getcurrentlang()=="Portuguese(Standard)")
{
	$fieldLabelsClientes["Portuguese(Standard)"] = array();
	$fieldToolTipsClientes["Portuguese(Standard)"] = array();
	$placeHoldersClientes["Portuguese(Standard)"] = array();
	$pageTitlesClientes["Portuguese(Standard)"] = array();
	$fieldLabelsClientes["Portuguese(Standard)"]["CodCliente"] = "Cod Cliente";
	$fieldToolTipsClientes["Portuguese(Standard)"]["CodCliente"] = "";
	$placeHoldersClientes["Portuguese(Standard)"]["CodCliente"] = "";
	$fieldLabelsClientes["Portuguese(Standard)"]["Nome"] = "Nome";
	$fieldToolTipsClientes["Portuguese(Standard)"]["Nome"] = "";
	$placeHoldersClientes["Portuguese(Standard)"]["Nome"] = "";
	$fieldLabelsClientes["Portuguese(Standard)"]["Dados"] = "Dados";
	$fieldToolTipsClientes["Portuguese(Standard)"]["Dados"] = "";
	$placeHoldersClientes["Portuguese(Standard)"]["Dados"] = "";
	$fieldLabelsClientes["Portuguese(Standard)"]["CodPHC"] = "Cod PHC";
	$fieldToolTipsClientes["Portuguese(Standard)"]["CodPHC"] = "";
	$placeHoldersClientes["Portuguese(Standard)"]["CodPHC"] = "";
	$fieldLabelsClientes["Portuguese(Standard)"]["Escolha"] = "Escolha";
	$fieldToolTipsClientes["Portuguese(Standard)"]["Escolha"] = "";
	$placeHoldersClientes["Portuguese(Standard)"]["Escolha"] = "";
	$fieldLabelsClientes["Portuguese(Standard)"]["CodRegiao"] = "Cod Regiao";
	$fieldToolTipsClientes["Portuguese(Standard)"]["CodRegiao"] = "";
	$placeHoldersClientes["Portuguese(Standard)"]["CodRegiao"] = "";
	if (count($fieldToolTipsClientes["Portuguese(Standard)"]))
		$tdataClientes[".isUseToolTips"] = true;
}


	$tdataClientes[".NCSearch"] = true;


	$tdataClientes[".scrollGridBody"] = true;

$tdataClientes[".shortTableName"] = "Clientes";
$tdataClientes[".nSecOptions"] = 0;

$tdataClientes[".mainTableOwnerID"] = "";
$tdataClientes[".entityType"] = 0;

$tdataClientes[".strOriginalTableName"] = "Clientes";

	



$tdataClientes[".showAddInPopup"] = true;

$tdataClientes[".showEditInPopup"] = false;

$tdataClientes[".showViewInPopup"] = false;

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


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

	$tdataClientes[".audit"] = true;

	$tdataClientes[".locking"] = true;


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

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

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

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



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




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

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

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

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



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

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

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

$tdataClientes[".isUseAjaxSuggest"] = true;

$tdataClientes[".rowHighlite"] = true;



			

$tdataClientes[".ajaxCodeSnippetAdded"] = false;

$tdataClientes[".buttonsAdded"] = false;

$tdataClientes[".addPageEvents"] = false;

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




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

$tdataClientes[".googleLikeFields"] = array();
$tdataClientes[".googleLikeFields"][] = "CodCliente";
$tdataClientes[".googleLikeFields"][] = "Nome";
$tdataClientes[".googleLikeFields"][] = "Dados";
$tdataClientes[".googleLikeFields"][] = "CodPHC";
$tdataClientes[".googleLikeFields"][] = "Escolha";
$tdataClientes[".googleLikeFields"][] = "CodRegiao";



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

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

$tdataClientes[".nPrinterSplitRecords"] = 40;

$tdataClientes[".geocodingEnabled"] = false;










$tdataClientes[".pageSize"] = 999;

$tdataClientes[".warnLeavingPages"] = true;



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

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

$tdataClientes[".sqlHead"] = "SELECT CodCliente,  Nome,  Dados,  CodPHC,  Escolha,  CodRegiao";
$tdataClientes[".sqlFrom"] = "FROM Clientes";
$tdataClientes[".sqlWhereExpr"] = "";
$tdataClientes[".sqlTail"] = "";

//fill array of tabs for list page
$arrGridTabs = array();
$arrGridTabs[] = array(
	'tabId' => "",
	'name' => "All data",
	'nameType' => 'Text',
	'where' => "",
	'showRowCount' => 0,
	'hideEmpty' => 0,
);
$tdataClientes[".arrGridTabs"] = $arrGridTabs;









//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;
$tdataClientes[".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;
$tdataClientes[".arrGroupsPerPage"] = $arrGPP;

$tdataClientes[".highlightSearchResults"] = true;

$tableKeysClientes = array();
$tableKeysClientes[] = "CodCliente";
$tdataClientes[".Keys"] = $tableKeysClientes;


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




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

	
		$fdata["AutoInc"] = true;

	
			

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

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

	
		$fdata["CompatibilityMode"] = true;

				$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"] = 143;

//	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"] = "Equals";

	// the end of search options settings


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

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

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdataClientes["CodCliente"] = $fdata;
		$tdataClientes[".searchableFields"][] = "CodCliente";
//	Nome
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "Nome";
	$fdata["GoodName"] = "Nome";
	$fdata["ownerTable"] = "Clientes";
	$fdata["Label"] = GetFieldLabel("Clientes","Nome");
	$fdata["FieldType"] = 200;

	
	
	
			

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

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

	
		$fdata["CompatibilityMode"] = true;

				$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" => "Lookup wizard");

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


	
	

// Begin Lookup settings
				$edata["LookupType"] = 2;
	$edata["LookupTable"] = "ClientesVinha";
			$edata["freeInput"] = true;
	$edata["autoCompleteFieldsOnEdit"] = 0;
	$edata["autoCompleteFields"] = array();
		$edata["LCType"] = 1;

	
		
	$edata["LinkField"] = "Nome";
	$edata["LinkFieldType"] = 0;
	$edata["DisplayField"] = "Nome";

	

	
	$edata["LookupOrderBy"] = "Nome";

	
		$edata["UseCategory"] = true;
	$edata["categoryFields"] = array();
	$edata["categoryFields"][] = array( "main" => "Escolha", "lookup" => "CodCliente" );

	
	

	
	
	
// End Lookup Settings


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

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
	
	
		$edata["controlWidth"] = 143;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
								$edata["validateAs"]["basicValidate"][] = "DenyDuplicated";
	$edata["validateAs"]["customMessages"]["DenyDuplicated"] = array("message" => "O nome %value% já existe!!!", "messageType" => "Text");

	
	//	End validation

	
			
	
		$edata["denyDuplicates"] = true;

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


	$fdata["isSeparate"] = false;




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

	// the end of search options settings


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

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

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdataClientes["Nome"] = $fdata;
		$tdataClientes[".searchableFields"][] = "Nome";
//	Dados
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "Dados";
	$fdata["GoodName"] = "Dados";
	$fdata["ownerTable"] = "Clientes";
	$fdata["Label"] = GetFieldLabel("Clientes","Dados");
	$fdata["FieldType"] = 200;

	
	
	
			

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

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

	
		$fdata["CompatibilityMode"] = true;

				$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" => "Lookup wizard");

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


	
	

// Begin Lookup settings
				$edata["LookupType"] = 2;
	$edata["LookupTable"] = "ClientesVinha";
			$edata["autoCompleteFieldsOnEdit"] = 0;
	$edata["autoCompleteFields"] = array();
		$edata["LCType"] = 0;

	
		
	$edata["LinkField"] = "Morada";
	$edata["LinkFieldType"] = 0;
	$edata["DisplayField"] = "Morada";

	

	
	$edata["LookupOrderBy"] = "";

	
		$edata["UseCategory"] = true;
	$edata["categoryFields"] = array();
	$edata["categoryFields"][] = array( "main" => "Escolha", "lookup" => "CodCliente" );

	
	

	
	
		$edata["SelectSize"] = 1;

// End Lookup Settings


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

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
	
	
		$edata["controlWidth"] = 143;

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

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


	$fdata["isSeparate"] = false;




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

	// the end of search options settings


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

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

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdataClientes["Dados"] = $fdata;
		$tdataClientes[".searchableFields"][] = "Dados";
//	CodPHC
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "CodPHC";
	$fdata["GoodName"] = "CodPHC";
	$fdata["ownerTable"] = "Clientes";
	$fdata["Label"] = GetFieldLabel("Clientes","CodPHC");
	$fdata["FieldType"] = 200;

	
	
	
			

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

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

	
	
				$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" => "Lookup wizard");

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


	
	

// Begin Lookup settings
				$edata["LookupType"] = 2;
	$edata["LookupTable"] = "ClientesVinha";
			$edata["autoCompleteFieldsOnEdit"] = 0;
	$edata["autoCompleteFields"] = array();
		$edata["LCType"] = 0;

	
		
	$edata["LinkField"] = "CodPHC";
	$edata["LinkFieldType"] = 0;
	$edata["DisplayField"] = "CodPHC";

	

	
	$edata["LookupOrderBy"] = "";

	
		$edata["UseCategory"] = true;
	$edata["categoryFields"] = array();
	$edata["categoryFields"][] = array( "main" => "Escolha", "lookup" => "CodCliente" );

	
	

	
	
		$edata["SelectSize"] = 1;

// End Lookup Settings


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

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
	
	
		$edata["controlWidth"] = 200;

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

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


	$fdata["isSeparate"] = false;




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

			// 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


	$tdataClientes["CodPHC"] = $fdata;
		$tdataClientes[".searchableFields"][] = "CodPHC";
//	Escolha
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 5;
	$fdata["strName"] = "Escolha";
	$fdata["GoodName"] = "Escolha";
	$fdata["ownerTable"] = "Clientes";
	$fdata["Label"] = GetFieldLabel("Clientes","Escolha");
	$fdata["FieldType"] = 3;

	
	
	
			

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

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

	
	
				$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" => "Lookup wizard");

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


	
	

// Begin Lookup settings
				$edata["LookupType"] = 2;
	$edata["LookupTable"] = "ClientesVinha";
			$edata["autoCompleteFieldsOnEdit"] = 1;
	$edata["autoCompleteFields"] = array();
		$edata["LCType"] = 0;

	
		
	$edata["LinkField"] = "CodCliente";
	$edata["LinkFieldType"] = 0;
	$edata["DisplayField"] = "Nome";

	

	
	$edata["LookupOrderBy"] = "Nome";

	
	
	
	
				//dependent dropdowns @deprecated data ?
	$edata["DependentLookups"] = array();
	$edata["DependentLookups"][] = "Nome";
				//dependent dropdowns @deprecated data ?
	$edata["DependentLookups"] = array();
	$edata["DependentLookups"][] = "Dados";
				//dependent dropdowns @deprecated data ?
	$edata["DependentLookups"] = array();
	$edata["DependentLookups"][] = "CodPHC";
				//dependent dropdowns @deprecated data ?
	$edata["DependentLookups"] = array();
	$edata["DependentLookups"][] = "CodRegiao";

	
	
		$edata["SelectSize"] = 1;

// End Lookup Settings


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

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
	
	
		$edata["controlWidth"] = 200;

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

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


	$fdata["isSeparate"] = false;




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

			// 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


	$tdataClientes["Escolha"] = $fdata;
		$tdataClientes[".searchableFields"][] = "Escolha";
//	CodRegiao
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 6;
	$fdata["strName"] = "CodRegiao";
	$fdata["GoodName"] = "CodRegiao";
	$fdata["ownerTable"] = "Clientes";
	$fdata["Label"] = GetFieldLabel("Clientes","CodRegiao");
	$fdata["FieldType"] = 3;

	
	
	
			

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

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

	
	
				$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" => "Lookup wizard");

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


	
	

// Begin Lookup settings
				$edata["LookupType"] = 2;
	$edata["LookupTable"] = "ClientesVinha";
			$edata["autoCompleteFieldsOnEdit"] = 0;
	$edata["autoCompleteFields"] = array();
		$edata["LCType"] = 0;

	
		
	$edata["LinkField"] = "Localidade";
	$edata["LinkFieldType"] = 3;
	$edata["DisplayField"] = "Localidade";

	

	
	$edata["LookupOrderBy"] = "";

	
		$edata["UseCategory"] = true;
	$edata["categoryFields"] = array();
	$edata["categoryFields"][] = array( "main" => "Escolha", "lookup" => "CodCliente" );

		$edata["AllowToAdd"] = true;
		
	

	
	
		$edata["SelectSize"] = 1;

// End Lookup Settings


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

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
	
	
		$edata["controlWidth"] = 143;

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

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


	$fdata["isSeparate"] = false;




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

			// 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"] = 1;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

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

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdataClientes["CodRegiao"] = $fdata;
		$tdataClientes[".searchableFields"][] = "CodRegiao";


$tables_data["Clientes"]=&$tdataClientes;
$field_labels["Clientes"] = &$fieldLabelsClientes;
$fieldToolTips["Clientes"] = &$fieldToolTipsClientes;
$placeHolders["Clientes"] = &$placeHoldersClientes;
$page_titles["Clientes"] = &$pageTitlesClientes;

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

		$dIndex = 0;
	$detailsParam = array();
	$detailsParam["dDataSourceTable"]="Vendas";
		$detailsParam["dOriginalTable"] = "Vendas";



				$detailsParam["dType"]=PAGE_LIST;
	$detailsParam["dShortTable"] = "Vendas";
	$detailsParam["dCaptionTable"] = GetTableCaption("Vendas");
	$detailsParam["masterKeys"] =array();
	$detailsParam["detailKeys"] =array();


		
	$detailsTablesData["Clientes"][$dIndex] = $detailsParam;

	
		$detailsTablesData["Clientes"][$dIndex]["masterKeys"] = array();

	$detailsTablesData["Clientes"][$dIndex]["masterKeys"][]="CodCliente";

				$detailsTablesData["Clientes"][$dIndex]["detailKeys"] = array();

	$detailsTablesData["Clientes"][$dIndex]["detailKeys"][]="CodCliente";
//	Vinha
	
	

		$dIndex = 1;
	$detailsParam = array();
	$detailsParam["dDataSourceTable"]="Vinha";
		$detailsParam["dOriginalTable"] = "Vinha";



				$detailsParam["dType"]=PAGE_LIST;
	$detailsParam["dShortTable"] = "Vinha";
	$detailsParam["dCaptionTable"] = GetTableCaption("Vinha");
	$detailsParam["masterKeys"] =array();
	$detailsParam["detailKeys"] =array();


		
	$detailsTablesData["Clientes"][$dIndex] = $detailsParam;

	
		$detailsTablesData["Clientes"][$dIndex]["masterKeys"] = array();

	$detailsTablesData["Clientes"][$dIndex]["masterKeys"][]="CodCliente";

				$detailsTablesData["Clientes"][$dIndex]["detailKeys"] = array();

	$detailsTablesData["Clientes"][$dIndex]["detailKeys"][]="CodCliente";

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



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


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










function createSqlQuery_Clientes()
{
$proto1=array();
$proto1["m_strHead"] = "SELECT";
$proto1["m_strFieldList"] = "CodCliente,  Nome,  Dados,  CodPHC,  Escolha,  CodRegiao";
$proto1["m_strFrom"] = "FROM Clientes";
$proto1["m_strWhere"] = "";
$proto1["m_strOrderBy"] = "";
	
		;
			$proto1["cipherer"] = null;
$proto3=array();
$proto3["m_sql"] = "";
$proto3["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

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

$proto1["m_having"] = $obj;
$proto1["m_fieldlist"] = array();
						$proto7=array();
			$obj = new SQLField(array(
	"m_strName" => "CodCliente",
	"m_strTable" => "Clientes",
	"m_srcTableName" => "Clientes"
));

$proto7["m_sql"] = "CodCliente";
$proto7["m_srcTableName"] = "Clientes";
$proto7["m_expr"]=$obj;
$proto7["m_alias"] = "";
$obj = new SQLFieldListItem($proto7);

$proto1["m_fieldlist"][]=$obj;
						$proto9=array();
			$obj = new SQLField(array(
	"m_strName" => "Nome",
	"m_strTable" => "Clientes",
	"m_srcTableName" => "Clientes"
));

$proto9["m_sql"] = "Nome";
$proto9["m_srcTableName"] = "Clientes";
$proto9["m_expr"]=$obj;
$proto9["m_alias"] = "";
$obj = new SQLFieldListItem($proto9);

$proto1["m_fieldlist"][]=$obj;
						$proto11=array();
			$obj = new SQLField(array(
	"m_strName" => "Dados",
	"m_strTable" => "Clientes",
	"m_srcTableName" => "Clientes"
));

$proto11["m_sql"] = "Dados";
$proto11["m_srcTableName"] = "Clientes";
$proto11["m_expr"]=$obj;
$proto11["m_alias"] = "";
$obj = new SQLFieldListItem($proto11);

$proto1["m_fieldlist"][]=$obj;
						$proto13=array();
			$obj = new SQLField(array(
	"m_strName" => "CodPHC",
	"m_strTable" => "Clientes",
	"m_srcTableName" => "Clientes"
));

$proto13["m_sql"] = "CodPHC";
$proto13["m_srcTableName"] = "Clientes";
$proto13["m_expr"]=$obj;
$proto13["m_alias"] = "";
$obj = new SQLFieldListItem($proto13);

$proto1["m_fieldlist"][]=$obj;
						$proto15=array();
			$obj = new SQLField(array(
	"m_strName" => "Escolha",
	"m_strTable" => "Clientes",
	"m_srcTableName" => "Clientes"
));

$proto15["m_sql"] = "Escolha";
$proto15["m_srcTableName"] = "Clientes";
$proto15["m_expr"]=$obj;
$proto15["m_alias"] = "";
$obj = new SQLFieldListItem($proto15);

$proto1["m_fieldlist"][]=$obj;
						$proto17=array();
			$obj = new SQLField(array(
	"m_strName" => "CodRegiao",
	"m_strTable" => "Clientes",
	"m_srcTableName" => "Clientes"
));

$proto17["m_sql"] = "CodRegiao";
$proto17["m_srcTableName"] = "Clientes";
$proto17["m_expr"]=$obj;
$proto17["m_alias"] = "";
$obj = new SQLFieldListItem($proto17);

$proto1["m_fieldlist"][]=$obj;
$proto1["m_fromlist"] = array();
												$proto19=array();
$proto19["m_link"] = "SQLL_MAIN";
			$proto20=array();
$proto20["m_strName"] = "Clientes";
$proto20["m_srcTableName"] = "Clientes";
$proto20["m_columns"] = array();
$proto20["m_columns"][] = "CodCliente";
$proto20["m_columns"][] = "Nome";
$proto20["m_columns"][] = "Dados";
$proto20["m_columns"][] = "CodRegiao";
$proto20["m_columns"][] = "CodPHC";
$proto20["m_columns"][] = "Escolha";
$obj = new SQLTable($proto20);

$proto19["m_table"] = $obj;
$proto19["m_sql"] = "Clientes";
$proto19["m_alias"] = "";
$proto19["m_srcTableName"] = "Clientes";
$proto21=array();
$proto21["m_sql"] = "";
$proto21["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

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

	return $obj;
}
$queryData_Clientes = createSqlQuery_Clientes();


	
		;

						

$tdataClientes[".sqlquery"] = $queryData_Clientes;

$tableEvents["Clientes"] = new eventsBase;
$tdataClientes[".hasEvents"] = false;

?>