<?php



$tdatatb_consultas = array();
$tdatatb_consultas[".searchableFields"] = array();
$tdatatb_consultas[".ShortName"] = "tb_consultas";
$tdatatb_consultas[".OwnerID"] = "";
$tdatatb_consultas[".OriginalTable"] = "tb_consultas";


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

//	field labels
$fieldLabelstb_consultas = array();
$fieldToolTipstb_consultas = array();
$pageTitlestb_consultas = array();
$placeHolderstb_consultas = array();

if(mlang_getcurrentlang()=="English")
{
	$fieldLabelstb_consultas["English"] = array();
	$fieldToolTipstb_consultas["English"] = array();
	$placeHolderstb_consultas["English"] = array();
	$pageTitlestb_consultas["English"] = array();
	$fieldLabelstb_consultas["English"]["consultaiD"] = "ID";
	$fieldToolTipstb_consultas["English"]["consultaiD"] = "";
	$placeHolderstb_consultas["English"]["consultaiD"] = "";
	$fieldLabelstb_consultas["English"]["especialidade"] = "Especialidade:";
	$fieldToolTipstb_consultas["English"]["especialidade"] = "";
	$placeHolderstb_consultas["English"]["especialidade"] = "";
	$fieldLabelstb_consultas["English"]["local"] = "Local";
	$fieldToolTipstb_consultas["English"]["local"] = "";
	$placeHolderstb_consultas["English"]["local"] = "";
	$fieldLabelstb_consultas["English"]["medico"] = "Médico:";
	$fieldToolTipstb_consultas["English"]["medico"] = "";
	$placeHolderstb_consultas["English"]["medico"] = "";
	$fieldLabelstb_consultas["English"]["tipo_consulta"] = "Tipo Consulta";
	$fieldToolTipstb_consultas["English"]["tipo_consulta"] = "";
	$placeHolderstb_consultas["English"]["tipo_consulta"] = "";
	$fieldLabelstb_consultas["English"]["data"] = "Data";
	$fieldToolTipstb_consultas["English"]["data"] = "";
	$placeHolderstb_consultas["English"]["data"] = "";
	$fieldLabelstb_consultas["English"]["horario"] = "Horário:";
	$fieldToolTipstb_consultas["English"]["horario"] = "";
	$placeHolderstb_consultas["English"]["horario"] = "";
	$fieldLabelstb_consultas["English"]["valor"] = "Valor";
	$fieldToolTipstb_consultas["English"]["valor"] = "";
	$placeHolderstb_consultas["English"]["valor"] = "";
	$fieldLabelstb_consultas["English"]["status"] = "Status";
	$fieldToolTipstb_consultas["English"]["status"] = "";
	$placeHolderstb_consultas["English"]["status"] = "";
	$fieldLabelstb_consultas["English"]["Observacao"] = "Observações:";
	$fieldToolTipstb_consultas["English"]["Observacao"] = "";
	$placeHolderstb_consultas["English"]["Observacao"] = "";
	$fieldLabelstb_consultas["English"]["pacID"] = "Pac ID";
	$fieldToolTipstb_consultas["English"]["pacID"] = "";
	$placeHolderstb_consultas["English"]["pacID"] = "";
	if (count($fieldToolTipstb_consultas["English"]))
		$tdatatb_consultas[".isUseToolTips"] = true;
}


	$tdatatb_consultas[".NCSearch"] = true;



$tdatatb_consultas[".shortTableName"] = "tb_consultas";
$tdatatb_consultas[".nSecOptions"] = 0;

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

$tdatatb_consultas[".strOriginalTableName"] = "tb_consultas";

	



$tdatatb_consultas[".showAddInPopup"] = false;

$tdatatb_consultas[".showEditInPopup"] = false;

$tdatatb_consultas[".showViewInPopup"] = false;

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


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

	$tdatatb_consultas[".audit"] = false;

	$tdatatb_consultas[".locking"] = false;


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

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

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

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



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




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

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

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

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



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

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

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

$tdatatb_consultas[".isUseAjaxSuggest"] = true;

$tdatatb_consultas[".rowHighlite"] = true;





$tdatatb_consultas[".ajaxCodeSnippetAdded"] = false;

$tdatatb_consultas[".buttonsAdded"] = false;

$tdatatb_consultas[".addPageEvents"] = false;

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


$tdatatb_consultas[".badgeColor"] = "008b8b";


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

$tdatatb_consultas[".googleLikeFields"] = array();
$tdatatb_consultas[".googleLikeFields"][] = "consultaiD";
$tdatatb_consultas[".googleLikeFields"][] = "especialidade";
$tdatatb_consultas[".googleLikeFields"][] = "local";
$tdatatb_consultas[".googleLikeFields"][] = "medico";
$tdatatb_consultas[".googleLikeFields"][] = "tipo_consulta";
$tdatatb_consultas[".googleLikeFields"][] = "data";
$tdatatb_consultas[".googleLikeFields"][] = "horario";
$tdatatb_consultas[".googleLikeFields"][] = "valor";
$tdatatb_consultas[".googleLikeFields"][] = "status";
$tdatatb_consultas[".googleLikeFields"][] = "Observacao";
$tdatatb_consultas[".googleLikeFields"][] = "pacID";



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

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

$tdatatb_consultas[".nPrinterSplitRecords"] = 40;

$tdatatb_consultas[".geocodingEnabled"] = false;










$tdatatb_consultas[".pageSize"] = 20;

$tdatatb_consultas[".warnLeavingPages"] = true;



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

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

$tdatatb_consultas[".sqlHead"] = "SELECT consultaiD,  	especialidade,  	`local`,  	medico,  	tipo_consulta,  	`data`,  	horario,  	valor,  	status,  	Observacao,  	pacID";
$tdatatb_consultas[".sqlFrom"] = "FROM tb_consultas";
$tdatatb_consultas[".sqlWhereExpr"] = "";
$tdatatb_consultas[".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;
$tdatatb_consultas[".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;
$tdatatb_consultas[".arrGroupsPerPage"] = $arrGPP;

$tdatatb_consultas[".highlightSearchResults"] = true;

$tableKeystb_consultas = array();
$tableKeystb_consultas[] = "consultaiD";
$tdatatb_consultas[".Keys"] = $tableKeystb_consultas;


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




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

	
		$fdata["AutoInc"] = true;

	
			

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

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

	
	
				$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


	$tdatatb_consultas["consultaiD"] = $fdata;
		$tdatatb_consultas[".searchableFields"][] = "consultaiD";
//	especialidade
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "especialidade";
	$fdata["GoodName"] = "especialidade";
	$fdata["ownerTable"] = "tb_consultas";
	$fdata["Label"] = GetFieldLabel("tb_consultas","especialidade");
	$fdata["FieldType"] = 3;

	
	
	
			

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

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

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

	
		
	$edata["LinkField"] = "especialidadeID";
	$edata["LinkFieldType"] = 0;
	$edata["DisplayField"] = "especialidade";

	

	
	$edata["LookupOrderBy"] = "";

	
	
		$edata["AllowToAdd"] = true;
			$edata["addPageId"] = "add";

	
				//dependent dropdowns @deprecated data ?
	$edata["DependentLookups"] = array();
	$edata["DependentLookups"][] = "medico";

	
	
		$edata["SelectSize"] = 1;

// End Lookup Settings


		$edata["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

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


	$tdatatb_consultas["especialidade"] = $fdata;
		$tdatatb_consultas[".searchableFields"][] = "especialidade";
//	local
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "local";
	$fdata["GoodName"] = "local";
	$fdata["ownerTable"] = "tb_consultas";
	$fdata["Label"] = GetFieldLabel("tb_consultas","local");
	$fdata["FieldType"] = 200;

	
	
	
			

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

		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "`local`";

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

	
		
	$edata["LinkField"] = "cclinicoID";
	$edata["LinkFieldType"] = 0;
	$edata["DisplayField"] = "nome";

	

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

	
	
		$edata["AllowToAdd"] = true;
			$edata["addPageId"] = "add";

	

	
	
		$edata["SelectSize"] = 1;

// End Lookup Settings


		$edata["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

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


	$tdatatb_consultas["local"] = $fdata;
		$tdatatb_consultas[".searchableFields"][] = "local";
//	medico
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "medico";
	$fdata["GoodName"] = "medico";
	$fdata["ownerTable"] = "tb_consultas";
	$fdata["Label"] = GetFieldLabel("tb_consultas","medico");
	$fdata["FieldType"] = 200;

	
	
	
			

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

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

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

	
		
	$edata["LinkField"] = "medicoID";
	$edata["LinkFieldType"] = 0;
	$edata["DisplayField"] = "Nome_medico";

	

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

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

	
	

	
	
		$edata["SelectSize"] = 1;

// End Lookup Settings


		$edata["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

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


	$tdatatb_consultas["medico"] = $fdata;
		$tdatatb_consultas[".searchableFields"][] = "medico";
//	tipo_consulta
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 5;
	$fdata["strName"] = "tipo_consulta";
	$fdata["GoodName"] = "tipo_consulta";
	$fdata["ownerTable"] = "tb_consultas";
	$fdata["Label"] = GetFieldLabel("tb_consultas","tipo_consulta");
	$fdata["FieldType"] = 200;

	
	
	
			

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

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

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

	
	
		$edata["LookupValues"] = array();
	$edata["LookupValues"][] = "Mensal";
	$edata["LookupValues"][] = "Trimestral";
	$edata["LookupValues"][] = "Semestral";
	$edata["LookupValues"][] = "Avaliação ";
	$edata["LookupValues"][] = "Re-Consulta";
	$edata["LookupValues"][] = "Urgência ";
	$edata["LookupValues"][] = "Check-Up";

	
		$edata["SelectSize"] = 1;

// End Lookup Settings


		$edata["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

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


	$tdatatb_consultas["tipo_consulta"] = $fdata;
		$tdatatb_consultas[".searchableFields"][] = "tipo_consulta";
//	data
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 6;
	$fdata["strName"] = "data";
	$fdata["GoodName"] = "data";
	$fdata["ownerTable"] = "tb_consultas";
	$fdata["Label"] = GetFieldLabel("tb_consultas","data");
	$fdata["FieldType"] = 7;

	
	
	
			

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

		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "`data`";

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

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

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

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

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


	
	



		$edata["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

	
	
		$edata["DateEditType"] = 2;
	$edata["InitialYearFactor"] = 10;
	$edata["LastYearFactor"] = 10;

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

			// the default search options list
				$fdata["searchOptionsList"] = array("Equals", "More than", "Less than", "Between", EMPTY_SEARCH, 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


	$tdatatb_consultas["data"] = $fdata;
		$tdatatb_consultas[".searchableFields"][] = "data";
//	horario
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 7;
	$fdata["strName"] = "horario";
	$fdata["GoodName"] = "horario";
	$fdata["ownerTable"] = "tb_consultas";
	$fdata["Label"] = GetFieldLabel("tb_consultas","horario");
	$fdata["FieldType"] = 134;

	
	
	
			

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

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

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

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

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

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

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


	
	



		$edata["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

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

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

	
			
				$hours = 24;
	$edata["FormatTimeAttrs"] = array("useTimePicker" => 0,
									  "hours" => $hours,
									  "minutes" => 1,
									  "showSeconds" => 0);

	
	
	$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("Equals", "More than", "Less than", "Between", EMPTY_SEARCH, 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


	$tdatatb_consultas["horario"] = $fdata;
		$tdatatb_consultas[".searchableFields"][] = "horario";
//	valor
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 8;
	$fdata["strName"] = "valor";
	$fdata["GoodName"] = "valor";
	$fdata["ownerTable"] = "tb_consultas";
	$fdata["Label"] = GetFieldLabel("tb_consultas","valor");
	$fdata["FieldType"] = 200;

	
	
	
			

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

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

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


	$tdatatb_consultas["valor"] = $fdata;
		$tdatatb_consultas[".searchableFields"][] = "valor";
//	status
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 9;
	$fdata["strName"] = "status";
	$fdata["GoodName"] = "status";
	$fdata["ownerTable"] = "tb_consultas";
	$fdata["Label"] = GetFieldLabel("tb_consultas","status");
	$fdata["FieldType"] = 200;

	
	
	
			

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

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

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

	
	
		$edata["LookupValues"] = array();
	$edata["LookupValues"][] = "Por Agendar";
	$edata["LookupValues"][] = "Agendada";
	$edata["LookupValues"][] = "Realizada";
	$edata["LookupValues"][] = "Confirmar";
	$edata["LookupValues"][] = "Aguarda Vaga";
	$edata["LookupValues"][] = "Cancelada";
	$edata["LookupValues"][] = "Transferida";

	
		$edata["SelectSize"] = 1;

// End Lookup Settings


		$edata["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

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


	$tdatatb_consultas["status"] = $fdata;
		$tdatatb_consultas[".searchableFields"][] = "status";
//	Observacao
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 10;
	$fdata["strName"] = "Observacao";
	$fdata["GoodName"] = "Observacao";
	$fdata["ownerTable"] = "tb_consultas";
	$fdata["Label"] = GetFieldLabel("tb_consultas","Observacao");
	$fdata["FieldType"] = 200;

	
	
	
			

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

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

	
	
				$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 area");

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


	
	



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

		$edata["maxNumberOfFiles"] = 1;

	
	
	
				$edata["nRows"] = 100;
			$edata["nCols"] = 200;

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


	$tdatatb_consultas["Observacao"] = $fdata;
		$tdatatb_consultas[".searchableFields"][] = "Observacao";
//	pacID
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 11;
	$fdata["strName"] = "pacID";
	$fdata["GoodName"] = "pacID";
	$fdata["ownerTable"] = "tb_consultas";
	$fdata["Label"] = GetFieldLabel("tb_consultas","pacID");
	$fdata["FieldType"] = 3;

	
	
	
			

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

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

	
	
				$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["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");
							
	
	//	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


	$tdatatb_consultas["pacID"] = $fdata;
		$tdatatb_consultas[".searchableFields"][] = "pacID";


$tables_data["tb_consultas"]=&$tdatatb_consultas;
$field_labels["tb_consultas"] = &$fieldLabelstb_consultas;
$fieldToolTips["tb_consultas"] = &$fieldToolTipstb_consultas;
$placeHolders["tb_consultas"] = &$placeHolderstb_consultas;
$page_titles["tb_consultas"] = &$pageTitlestb_consultas;

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

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



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


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

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

	$detailsTablesData["tb_consultas"][$dIndex]["masterKeys"][]="consultaiD";

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

	$detailsTablesData["tb_consultas"][$dIndex]["detailKeys"][]="consultaID";
//	tb_receitas
	
	

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



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


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

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

	$detailsTablesData["tb_consultas"][$dIndex]["masterKeys"][]="consultaiD";

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

	$detailsTablesData["tb_consultas"][$dIndex]["detailKeys"][]="consulta ID";

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



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

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


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










function createSqlQuery_tb_consultas()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "consultaiD,  	especialidade,  	`local`,  	medico,  	tipo_consulta,  	`data`,  	horario,  	valor,  	status,  	Observacao,  	pacID";
$proto0["m_strFrom"] = "FROM tb_consultas";
$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" => "consultaiD",
	"m_strTable" => "tb_consultas",
	"m_srcTableName" => "tb_consultas"
));

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

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

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

$proto0["m_fieldlist"][]=$obj;
						$proto10=array();
			$obj = new SQLField(array(
	"m_strName" => "local",
	"m_strTable" => "tb_consultas",
	"m_srcTableName" => "tb_consultas"
));

$proto10["m_sql"] = "`local`";
$proto10["m_srcTableName"] = "tb_consultas";
$proto10["m_expr"]=$obj;
$proto10["m_alias"] = "";
$obj = new SQLFieldListItem($proto10);

$proto0["m_fieldlist"][]=$obj;
						$proto12=array();
			$obj = new SQLField(array(
	"m_strName" => "medico",
	"m_strTable" => "tb_consultas",
	"m_srcTableName" => "tb_consultas"
));

$proto12["m_sql"] = "medico";
$proto12["m_srcTableName"] = "tb_consultas";
$proto12["m_expr"]=$obj;
$proto12["m_alias"] = "";
$obj = new SQLFieldListItem($proto12);

$proto0["m_fieldlist"][]=$obj;
						$proto14=array();
			$obj = new SQLField(array(
	"m_strName" => "tipo_consulta",
	"m_strTable" => "tb_consultas",
	"m_srcTableName" => "tb_consultas"
));

$proto14["m_sql"] = "tipo_consulta";
$proto14["m_srcTableName"] = "tb_consultas";
$proto14["m_expr"]=$obj;
$proto14["m_alias"] = "";
$obj = new SQLFieldListItem($proto14);

$proto0["m_fieldlist"][]=$obj;
						$proto16=array();
			$obj = new SQLField(array(
	"m_strName" => "data",
	"m_strTable" => "tb_consultas",
	"m_srcTableName" => "tb_consultas"
));

$proto16["m_sql"] = "`data`";
$proto16["m_srcTableName"] = "tb_consultas";
$proto16["m_expr"]=$obj;
$proto16["m_alias"] = "";
$obj = new SQLFieldListItem($proto16);

$proto0["m_fieldlist"][]=$obj;
						$proto18=array();
			$obj = new SQLField(array(
	"m_strName" => "horario",
	"m_strTable" => "tb_consultas",
	"m_srcTableName" => "tb_consultas"
));

$proto18["m_sql"] = "horario";
$proto18["m_srcTableName"] = "tb_consultas";
$proto18["m_expr"]=$obj;
$proto18["m_alias"] = "";
$obj = new SQLFieldListItem($proto18);

$proto0["m_fieldlist"][]=$obj;
						$proto20=array();
			$obj = new SQLField(array(
	"m_strName" => "valor",
	"m_strTable" => "tb_consultas",
	"m_srcTableName" => "tb_consultas"
));

$proto20["m_sql"] = "valor";
$proto20["m_srcTableName"] = "tb_consultas";
$proto20["m_expr"]=$obj;
$proto20["m_alias"] = "";
$obj = new SQLFieldListItem($proto20);

$proto0["m_fieldlist"][]=$obj;
						$proto22=array();
			$obj = new SQLField(array(
	"m_strName" => "status",
	"m_strTable" => "tb_consultas",
	"m_srcTableName" => "tb_consultas"
));

$proto22["m_sql"] = "status";
$proto22["m_srcTableName"] = "tb_consultas";
$proto22["m_expr"]=$obj;
$proto22["m_alias"] = "";
$obj = new SQLFieldListItem($proto22);

$proto0["m_fieldlist"][]=$obj;
						$proto24=array();
			$obj = new SQLField(array(
	"m_strName" => "Observacao",
	"m_strTable" => "tb_consultas",
	"m_srcTableName" => "tb_consultas"
));

$proto24["m_sql"] = "Observacao";
$proto24["m_srcTableName"] = "tb_consultas";
$proto24["m_expr"]=$obj;
$proto24["m_alias"] = "";
$obj = new SQLFieldListItem($proto24);

$proto0["m_fieldlist"][]=$obj;
						$proto26=array();
			$obj = new SQLField(array(
	"m_strName" => "pacID",
	"m_strTable" => "tb_consultas",
	"m_srcTableName" => "tb_consultas"
));

$proto26["m_sql"] = "pacID";
$proto26["m_srcTableName"] = "tb_consultas";
$proto26["m_expr"]=$obj;
$proto26["m_alias"] = "";
$obj = new SQLFieldListItem($proto26);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto28=array();
$proto28["m_link"] = "SQLL_MAIN";
			$proto29=array();
$proto29["m_strName"] = "tb_consultas";
$proto29["m_srcTableName"] = "tb_consultas";
$proto29["m_columns"] = array();
$proto29["m_columns"][] = "consultaiD";
$proto29["m_columns"][] = "especialidade";
$proto29["m_columns"][] = "local";
$proto29["m_columns"][] = "medico";
$proto29["m_columns"][] = "tipo_consulta";
$proto29["m_columns"][] = "data";
$proto29["m_columns"][] = "horario";
$proto29["m_columns"][] = "valor";
$proto29["m_columns"][] = "status";
$proto29["m_columns"][] = "Observacao";
$proto29["m_columns"][] = "pacID";
$obj = new SQLTable($proto29);

$proto28["m_table"] = $obj;
$proto28["m_sql"] = "tb_consultas";
$proto28["m_alias"] = "";
$proto28["m_srcTableName"] = "tb_consultas";
$proto30=array();
$proto30["m_sql"] = "";
$proto30["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

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

	return $obj;
}
$queryData_tb_consultas = createSqlQuery_tb_consultas();


	
		;

											

$tdatatb_consultas[".sqlquery"] = $queryData_tb_consultas;

$tableEvents["tb_consultas"] = new eventsBase;
$tdatatb_consultas[".hasEvents"] = false;

?>