<?php



$tdataPlantas = array();
$tdataPlantas[".searchableFields"] = array();
$tdataPlantas[".ShortName"] = "Plantas";
$tdataPlantas[".OwnerID"] = "";
$tdataPlantas[".OriginalTable"] = "Plantas";


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

//	field labels
$fieldLabelsPlantas = array();
$fieldToolTipsPlantas = array();
$pageTitlesPlantas = array();
$placeHoldersPlantas = array();

if(mlang_getcurrentlang()=="Portuguese(Standard)")
{
	$fieldLabelsPlantas["Portuguese(Standard)"] = array();
	$fieldToolTipsPlantas["Portuguese(Standard)"] = array();
	$placeHoldersPlantas["Portuguese(Standard)"] = array();
	$pageTitlesPlantas["Portuguese(Standard)"] = array();
	$fieldLabelsPlantas["Portuguese(Standard)"]["CodPlanta"] = "Cod Planta";
	$fieldToolTipsPlantas["Portuguese(Standard)"]["CodPlanta"] = "";
	$placeHoldersPlantas["Portuguese(Standard)"]["CodPlanta"] = "";
	$fieldLabelsPlantas["Portuguese(Standard)"]["Nome"] = "Nome";
	$fieldToolTipsPlantas["Portuguese(Standard)"]["Nome"] = "";
	$placeHoldersPlantas["Portuguese(Standard)"]["Nome"] = "";
	$fieldLabelsPlantas["Portuguese(Standard)"]["CodPHC"] = "Cod PHC";
	$fieldToolTipsPlantas["Portuguese(Standard)"]["CodPHC"] = "";
	$placeHoldersPlantas["Portuguese(Standard)"]["CodPHC"] = "";
	$fieldLabelsPlantas["Portuguese(Standard)"]["TipoPlanta"] = "Tipo Planta";
	$fieldToolTipsPlantas["Portuguese(Standard)"]["TipoPlanta"] = "";
	$placeHoldersPlantas["Portuguese(Standard)"]["TipoPlanta"] = "";
	if (count($fieldToolTipsPlantas["Portuguese(Standard)"]))
		$tdataPlantas[".isUseToolTips"] = true;
}


	$tdataPlantas[".NCSearch"] = true;


	$tdataPlantas[".scrollGridBody"] = true;

$tdataPlantas[".shortTableName"] = "Plantas";
$tdataPlantas[".nSecOptions"] = 0;

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

$tdataPlantas[".strOriginalTableName"] = "Plantas";

	



$tdataPlantas[".showAddInPopup"] = true;

$tdataPlantas[".showEditInPopup"] = false;

$tdataPlantas[".showViewInPopup"] = false;

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


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

	$tdataPlantas[".audit"] = true;

	$tdataPlantas[".locking"] = true;


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

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

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

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



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




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

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

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

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



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

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

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

$tdataPlantas[".isUseAjaxSuggest"] = true;

$tdataPlantas[".rowHighlite"] = true;



						

$tdataPlantas[".ajaxCodeSnippetAdded"] = false;

$tdataPlantas[".buttonsAdded"] = false;

$tdataPlantas[".addPageEvents"] = false;

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




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

$tdataPlantas[".googleLikeFields"] = array();
$tdataPlantas[".googleLikeFields"][] = "CodPlanta";
$tdataPlantas[".googleLikeFields"][] = "Nome";
$tdataPlantas[".googleLikeFields"][] = "CodPHC";
$tdataPlantas[".googleLikeFields"][] = "TipoPlanta";



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

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

$tdataPlantas[".nPrinterSplitRecords"] = 40;

$tdataPlantas[".geocodingEnabled"] = false;










$tdataPlantas[".pageSize"] = 999;

$tdataPlantas[".warnLeavingPages"] = true;



$tstrOrderBy = "ORDER BY TipoPlanta, Nome";
if(strlen($tstrOrderBy) && strtolower(substr($tstrOrderBy,0,8))!="order by")
	$tstrOrderBy = "order by ".$tstrOrderBy;
$tdataPlantas[".strOrderBy"] = $tstrOrderBy;

$tdataPlantas[".orderindexes"] = array();
	$tdataPlantas[".orderindexes"][] = array(4, (1 ? "ASC" : "DESC"), "TipoPlanta");

	$tdataPlantas[".orderindexes"][] = array(2, (1 ? "ASC" : "DESC"), "Nome");


$tdataPlantas[".sqlHead"] = "SELECT CodPlanta,  Nome,  CodPHC,  TipoPlanta";
$tdataPlantas[".sqlFrom"] = "FROM Plantas";
$tdataPlantas[".sqlWhereExpr"] = "";
$tdataPlantas[".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;
$tdataPlantas[".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;
$tdataPlantas[".arrGroupsPerPage"] = $arrGPP;

$tdataPlantas[".highlightSearchResults"] = true;

$tableKeysPlantas = array();
$tableKeysPlantas[] = "CodPlanta";
$tdataPlantas[".Keys"] = $tableKeysPlantas;


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




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

	
		$fdata["AutoInc"] = true;

	
			

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

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

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

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

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdataPlantas["CodPlanta"] = $fdata;
		$tdataPlantas[".searchableFields"][] = "CodPlanta";
//	Nome
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "Nome";
	$fdata["GoodName"] = "Nome";
	$fdata["ownerTable"] = "Plantas";
	$fdata["Label"] = GetFieldLabel("Plantas","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" => "Text field");

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


	
	



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

		$edata["maxNumberOfFiles"] = 1;

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

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

		$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


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

	
	
	
			

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

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

	
		$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["acceptFileTypes"] = ".+$";
		$edata["acceptFileTypesHtml"] = "";

		$edata["maxNumberOfFiles"] = 1;

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

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

		$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


	$tdataPlantas["CodPHC"] = $fdata;
		$tdataPlantas[".searchableFields"][] = "CodPHC";
//	TipoPlanta
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "TipoPlanta";
	$fdata["GoodName"] = "TipoPlanta";
	$fdata["ownerTable"] = "Plantas";
	$fdata["Label"] = GetFieldLabel("Plantas","TipoPlanta");
	$fdata["FieldType"] = 3;

	
	
	
			

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

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

	
		$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"] = "TiposPlantas";
			$edata["autoCompleteFieldsOnEdit"] = 0;
	$edata["autoCompleteFields"] = array();
		$edata["LCType"] = 0;

	
		
	$edata["LinkField"] = "CodTipo";
	$edata["LinkFieldType"] = 3;
	$edata["DisplayField"] = "Nome";

	

	
	$edata["LookupOrderBy"] = "";

	
	
	
	

	
	
		$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


	$tdataPlantas["TipoPlanta"] = $fdata;
		$tdataPlantas[".searchableFields"][] = "TipoPlanta";


$tables_data["Plantas"]=&$tdataPlantas;
$field_labels["Plantas"] = &$fieldLabelsPlantas;
$fieldToolTips["Plantas"] = &$fieldToolTipsPlantas;
$placeHolders["Plantas"] = &$placeHoldersPlantas;
$page_titles["Plantas"] = &$pageTitlesPlantas;

// -----------------start  prepare master-details data arrays ------------------------------//
// tables which are detail tables for current table (master)
$detailsTablesData["Plantas"] = 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["Plantas"][$dIndex] = $detailsParam;

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

	$detailsTablesData["Plantas"][$dIndex]["masterKeys"][]="CodPlanta";

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

	$detailsTablesData["Plantas"][$dIndex]["detailKeys"][]="CodPlanta";

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



	
				$strOriginalDetailsTable="TiposPlantas";
	$masterParams = array();
	$masterParams["mDataSourceTable"]="TiposPlantas";
	$masterParams["mOriginalTable"]= $strOriginalDetailsTable;
	$masterParams["mShortTable"]= "TiposPlantas";
	$masterParams["masterKeys"]= array();
	$masterParams["detailKeys"]= array();

	$masterParams["type"] = PAGE_LIST;
					$masterTablesData["Plantas"][0] = $masterParams;
				$masterTablesData["Plantas"][0]["masterKeys"] = array();
	$masterTablesData["Plantas"][0]["masterKeys"][]="CodTipo";
				$masterTablesData["Plantas"][0]["detailKeys"] = array();
	$masterTablesData["Plantas"][0]["detailKeys"][]="TipoPlanta";
		
// -----------------end  prepare master-details data arrays ------------------------------//


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










function createSqlQuery_Plantas()
{
$proto1=array();
$proto1["m_strHead"] = "SELECT";
$proto1["m_strFieldList"] = "CodPlanta,  Nome,  CodPHC,  TipoPlanta";
$proto1["m_strFrom"] = "FROM Plantas";
$proto1["m_strWhere"] = "";
$proto1["m_strOrderBy"] = "ORDER BY TipoPlanta, Nome";
	
		;
			$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" => "CodPlanta",
	"m_strTable" => "Plantas",
	"m_srcTableName" => "Plantas"
));

$proto7["m_sql"] = "CodPlanta";
$proto7["m_srcTableName"] = "Plantas";
$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" => "Plantas",
	"m_srcTableName" => "Plantas"
));

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

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

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

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

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

$proto1["m_fieldlist"][]=$obj;
$proto1["m_fromlist"] = array();
												$proto15=array();
$proto15["m_link"] = "SQLL_MAIN";
			$proto16=array();
$proto16["m_strName"] = "Plantas";
$proto16["m_srcTableName"] = "Plantas";
$proto16["m_columns"] = array();
$proto16["m_columns"][] = "CodPlanta";
$proto16["m_columns"][] = "Nome";
$proto16["m_columns"][] = "CodPHC";
$proto16["m_columns"][] = "TipoPlanta";
$proto16["m_columns"][] = "Stock";
$obj = new SQLTable($proto16);

$proto15["m_table"] = $obj;
$proto15["m_sql"] = "Plantas";
$proto15["m_alias"] = "";
$proto15["m_srcTableName"] = "Plantas";
$proto17=array();
$proto17["m_sql"] = "";
$proto17["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto1["m_fromlist"][]=$obj;
$proto1["m_groupby"] = array();
$proto1["m_orderby"] = array();
												$proto19=array();
						$obj = new SQLField(array(
	"m_strName" => "TipoPlanta",
	"m_strTable" => "Plantas",
	"m_srcTableName" => "Plantas"
));

$proto19["m_column"]=$obj;
$proto19["m_bAsc"] = 1;
$proto19["m_nColumn"] = 0;
$obj = new SQLOrderByItem($proto19);

$proto1["m_orderby"][]=$obj;					
												$proto21=array();
						$obj = new SQLField(array(
	"m_strName" => "Nome",
	"m_strTable" => "Plantas",
	"m_srcTableName" => "Plantas"
));

$proto21["m_column"]=$obj;
$proto21["m_bAsc"] = 1;
$proto21["m_nColumn"] = 0;
$obj = new SQLOrderByItem($proto21);

$proto1["m_orderby"][]=$obj;					
$proto1["m_srcTableName"]="Plantas";		
$obj = new SQLQuery($proto1);

	return $obj;
}
$queryData_Plantas = createSqlQuery_Plantas();


	
		;

				

$tdataPlantas[".sqlquery"] = $queryData_Plantas;

$tableEvents["Plantas"] = new eventsBase;
$tdataPlantas[".hasEvents"] = false;

?>