HEX
Server: Apache
System: Linux darrell.nocdirect.com 4.18.0-513.18.2.el8_9.x86_64 #1 SMP Sat Mar 30 06:10:41 EDT 2024 x86_64
User: joderbya (1358)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /home/joderbya/wlsa.quick-step-ei.com2/include/Top_5_Bairros_settings.php
<?php
require_once(getabspath("classes/cipherer.php"));




$tdataTop_5_Bairros = array();
	$tdataTop_5_Bairros[".ShortName"] = "Top_5_Bairros";
	$tdataTop_5_Bairros[".OwnerID"] = "";
	$tdataTop_5_Bairros[".OriginalTable"] = "reports";

//	field labels
$fieldLabelsTop_5_Bairros = array();
$fieldToolTipsTop_5_Bairros = array();
$pageTitlesTop_5_Bairros = array();
$placeHoldersTop_5_Bairros = array();

if(mlang_getcurrentlang()=="English")
{
	$fieldLabelsTop_5_Bairros["English"] = array();
	$fieldToolTipsTop_5_Bairros["English"] = array();
	$placeHoldersTop_5_Bairros["English"] = array();
	$pageTitlesTop_5_Bairros["English"] = array();
	$fieldLabelsTop_5_Bairros["English"]["Bairro"] = "Bairro";
	$fieldToolTipsTop_5_Bairros["English"]["Bairro"] = "";
	$placeHoldersTop_5_Bairros["English"]["Bairro"] = "";
	$fieldLabelsTop_5_Bairros["English"]["Vitimas"] = "Vitimas";
	$fieldToolTipsTop_5_Bairros["English"]["Vitimas"] = "";
	$placeHoldersTop_5_Bairros["English"]["Vitimas"] = "";
	$fieldLabelsTop_5_Bairros["English"]["Feminino"] = "Feminino";
	$fieldToolTipsTop_5_Bairros["English"]["Feminino"] = "";
	$placeHoldersTop_5_Bairros["English"]["Feminino"] = "";
	$fieldLabelsTop_5_Bairros["English"]["Masculino"] = "Masculino";
	$fieldToolTipsTop_5_Bairros["English"]["Masculino"] = "";
	$placeHoldersTop_5_Bairros["English"]["Masculino"] = "";
	if (count($fieldToolTipsTop_5_Bairros["English"]))
		$tdataTop_5_Bairros[".isUseToolTips"] = true;
}
if(mlang_getcurrentlang()=="")
{
	$fieldLabelsTop_5_Bairros[""] = array();
	$fieldToolTipsTop_5_Bairros[""] = array();
	$placeHoldersTop_5_Bairros[""] = array();
	$pageTitlesTop_5_Bairros[""] = array();
	$fieldLabelsTop_5_Bairros[""]["Bairro"] = "Bairro";
	$fieldToolTipsTop_5_Bairros[""]["Bairro"] = "";
	$placeHoldersTop_5_Bairros[""]["Bairro"] = "";
	$fieldLabelsTop_5_Bairros[""]["Vitimas"] = "Vitimas";
	$fieldToolTipsTop_5_Bairros[""]["Vitimas"] = "";
	$placeHoldersTop_5_Bairros[""]["Vitimas"] = "";
	$fieldLabelsTop_5_Bairros[""]["Feminino"] = "Feminino";
	$fieldToolTipsTop_5_Bairros[""]["Feminino"] = "";
	$placeHoldersTop_5_Bairros[""]["Feminino"] = "";
	$fieldLabelsTop_5_Bairros[""]["Masculino"] = "Masculino";
	$fieldToolTipsTop_5_Bairros[""]["Masculino"] = "";
	$placeHoldersTop_5_Bairros[""]["Masculino"] = "";
	if (count($fieldToolTipsTop_5_Bairros[""]))
		$tdataTop_5_Bairros[".isUseToolTips"] = true;
}


	$tdataTop_5_Bairros[".NCSearch"] = true;

	$tdataTop_5_Bairros[".ChartRefreshTime"] = 0;


$tdataTop_5_Bairros[".shortTableName"] = "Top_5_Bairros";
$tdataTop_5_Bairros[".nSecOptions"] = 0;
$tdataTop_5_Bairros[".recsPerRowPrint"] = 1;
$tdataTop_5_Bairros[".recsLimit"] = 5;
$tdataTop_5_Bairros[".mainTableOwnerID"] = "";
$tdataTop_5_Bairros[".moveNext"] = 1;
$tdataTop_5_Bairros[".entityType"] = 3;

$tdataTop_5_Bairros[".strOriginalTableName"] = "reports";

	



$tdataTop_5_Bairros[".showAddInPopup"] = false;

$tdataTop_5_Bairros[".showEditInPopup"] = false;

$tdataTop_5_Bairros[".showViewInPopup"] = false;

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


$tdataTop_5_Bairros[".fieldsForRegister"] = array();

$tdataTop_5_Bairros[".listAjax"] = false;

	$tdataTop_5_Bairros[".audit"] = false;

	$tdataTop_5_Bairros[".locking"] = false;


$tdataTop_5_Bairros[".add"] = true;
$tdataTop_5_Bairros[".afterAddAction"] = 1;
$tdataTop_5_Bairros[".closePopupAfterAdd"] = 1;
$tdataTop_5_Bairros[".afterAddActionDetTable"] = "";

$tdataTop_5_Bairros[".list"] = true;



$tdataTop_5_Bairros[".reorderRecordsByHeader"] = true;








$tdataTop_5_Bairros[".showSimpleSearchOptions"] = false;

// Allow Show/Hide Fields in GRID
$tdataTop_5_Bairros[".allowShowHideFields"] = false;
//

// Allow Fields Reordering in GRID
$tdataTop_5_Bairros[".allowFieldsReordering"] = false;
//

// search Saving settings
$tdataTop_5_Bairros[".searchSaving"] = false;
//

$tdataTop_5_Bairros[".showSearchPanel"] = true;
		$tdataTop_5_Bairros[".flexibleSearch"] = true;

$tdataTop_5_Bairros[".isUseAjaxSuggest"] = true;






$tdataTop_5_Bairros[".ajaxCodeSnippetAdded"] = false;

$tdataTop_5_Bairros[".buttonsAdded"] = false;

$tdataTop_5_Bairros[".addPageEvents"] = false;

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





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

$tdataTop_5_Bairros[".allSearchFields"][] = "Bairro";
	$tdataTop_5_Bairros[".allSearchFields"][] = "Vitimas";
	$tdataTop_5_Bairros[".allSearchFields"][] = "Feminino";
	$tdataTop_5_Bairros[".allSearchFields"][] = "Masculino";
	

$tdataTop_5_Bairros[".googleLikeFields"] = array();
$tdataTop_5_Bairros[".googleLikeFields"][] = "Bairro";
$tdataTop_5_Bairros[".googleLikeFields"][] = "Vitimas";
$tdataTop_5_Bairros[".googleLikeFields"][] = "Feminino";
$tdataTop_5_Bairros[".googleLikeFields"][] = "Masculino";


$tdataTop_5_Bairros[".advSearchFields"] = array();
$tdataTop_5_Bairros[".advSearchFields"][] = "Bairro";
$tdataTop_5_Bairros[".advSearchFields"][] = "Vitimas";
$tdataTop_5_Bairros[".advSearchFields"][] = "Feminino";
$tdataTop_5_Bairros[".advSearchFields"][] = "Masculino";

$tdataTop_5_Bairros[".tableType"] = "chart";

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

$tdataTop_5_Bairros[".nPrinterSplitRecords"] = 40;

$tdataTop_5_Bairros[".nPrinterPDFSplitRecords"] = 40;



$tdataTop_5_Bairros[".geocodingEnabled"] = false;



// chart settings
$tdataTop_5_Bairros[".chartType"] = "2DBar";
// end of chart settings


$tdataTop_5_Bairros[".listGridLayout"] = 3;





// view page pdf

// print page pdf



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

$tdataTop_5_Bairros[".orderindexes"] = array();
	$tdataTop_5_Bairros[".orderindexes"][] = array(2, (0 ? "ASC" : "DESC"), "COUNT(morada)");


$tdataTop_5_Bairros[".sqlHead"] = "SELECT morada as Bairro,  	COUNT(morada) as Vitimas,  	(SELECT Count(genero) FROM reports WHERE morada=Bairro and genero='F') AS Feminino,  (SELECT Count(genero) FROM reports WHERE morada=Bairro and genero='M') AS Masculino";
$tdataTop_5_Bairros[".sqlFrom"] = "FROM reports";
$tdataTop_5_Bairros[".sqlWhereExpr"] = "";
$tdataTop_5_Bairros[".sqlTail"] = "LIMIT 5";

//fill array of tabs for list page
$arrGridTabs = array();
$arrGridTabs[] = array(
	'tabId' => "",
	'name' => "All data",
	'nameType' => 'Text',
	'where' => "",	
	'showRowCount' => 0,
	'hideEmpty' => 0,	
);				  
$tdataTop_5_Bairros[".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;
$tdataTop_5_Bairros[".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;
$tdataTop_5_Bairros[".arrGroupsPerPage"] = $arrGPP;

$tdataTop_5_Bairros[".highlightSearchResults"] = true;

$tableKeysTop_5_Bairros = array();
$tdataTop_5_Bairros[".Keys"] = $tableKeysTop_5_Bairros;

$tdataTop_5_Bairros[".listFields"] = array();
$tdataTop_5_Bairros[".listFields"][] = "Bairro";
$tdataTop_5_Bairros[".listFields"][] = "Vitimas";
$tdataTop_5_Bairros[".listFields"][] = "Feminino";
$tdataTop_5_Bairros[".listFields"][] = "Masculino";

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


$tdataTop_5_Bairros[".viewFields"] = array();
$tdataTop_5_Bairros[".viewFields"][] = "Bairro";
$tdataTop_5_Bairros[".viewFields"][] = "Vitimas";
$tdataTop_5_Bairros[".viewFields"][] = "Feminino";
$tdataTop_5_Bairros[".viewFields"][] = "Masculino";

$tdataTop_5_Bairros[".addFields"] = array();

$tdataTop_5_Bairros[".masterListFields"] = array();
$tdataTop_5_Bairros[".masterListFields"][] = "Bairro";
$tdataTop_5_Bairros[".masterListFields"][] = "Vitimas";
$tdataTop_5_Bairros[".masterListFields"][] = "Feminino";
$tdataTop_5_Bairros[".masterListFields"][] = "Masculino";

$tdataTop_5_Bairros[".inlineAddFields"] = array();

$tdataTop_5_Bairros[".editFields"] = array();

$tdataTop_5_Bairros[".inlineEditFields"] = array();

$tdataTop_5_Bairros[".updateSelectedFields"] = array();


$tdataTop_5_Bairros[".exportFields"] = array();
$tdataTop_5_Bairros[".exportFields"][] = "Bairro";
$tdataTop_5_Bairros[".exportFields"][] = "Vitimas";
$tdataTop_5_Bairros[".exportFields"][] = "Feminino";
$tdataTop_5_Bairros[".exportFields"][] = "Masculino";

$tdataTop_5_Bairros[".importFields"] = array();
$tdataTop_5_Bairros[".importFields"][] = "Bairro";
$tdataTop_5_Bairros[".importFields"][] = "Vitimas";
$tdataTop_5_Bairros[".importFields"][] = "Feminino";
$tdataTop_5_Bairros[".importFields"][] = "Masculino";

$tdataTop_5_Bairros[".printFields"] = array();
$tdataTop_5_Bairros[".printFields"][] = "Bairro";
$tdataTop_5_Bairros[".printFields"][] = "Vitimas";
$tdataTop_5_Bairros[".printFields"][] = "Feminino";
$tdataTop_5_Bairros[".printFields"][] = "Masculino";


//	Bairro
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 1;
	$fdata["strName"] = "Bairro";
	$fdata["GoodName"] = "Bairro";
	$fdata["ownerTable"] = "reports";
	$fdata["Label"] = GetFieldLabel("Top_5_Bairros","Bairro");
	$fdata["FieldType"] = 200;

	
	
	
			
		$fdata["bListPage"] = true;

	
	
	
	
	

		$fdata["bViewPage"] = true;

		$fdata["bAdvancedSearch"] = true;

		$fdata["bPrinterPage"] = true;

		$fdata["bExportPage"] = true;

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

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

	
	
				$fdata["FieldPermissions"] = true;

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

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

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

	
	
	
	
	
	
	
	
	
	
	
	
		$vdata["NeedEncode"] = true;

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

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

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

	
	
		
	


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

		$edata["maxNumberOfFiles"] = 1;

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

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

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

	
	
	
	
	
	$fdata["EditFormats"]["search"] = $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




	$tdataTop_5_Bairros["Bairro"] = $fdata;
//	Vitimas
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "Vitimas";
	$fdata["GoodName"] = "Vitimas";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("Top_5_Bairros","Vitimas");
	$fdata["FieldType"] = 3;

	
	
	
			
		$fdata["bListPage"] = true;

	
	
	
	
	

		$fdata["bViewPage"] = true;

		$fdata["bAdvancedSearch"] = true;

		$fdata["bPrinterPage"] = true;

		$fdata["bExportPage"] = true;

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

		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "COUNT(morada)";

	
	
				$fdata["FieldPermissions"] = true;

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

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

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

	
	
	
	
	
	
	
	
	
	
	
	
		$vdata["NeedEncode"] = true;

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

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

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

	
	
		
	


		$edata["IsRequired"] = true;

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

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




	$tdataTop_5_Bairros["Vitimas"] = $fdata;
//	Feminino
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "Feminino";
	$fdata["GoodName"] = "Feminino";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("Top_5_Bairros","Feminino");
	$fdata["FieldType"] = 3;

	
	
	
			
		$fdata["bListPage"] = true;

	
	
	
	
	

		$fdata["bViewPage"] = true;

		$fdata["bAdvancedSearch"] = true;

		$fdata["bPrinterPage"] = true;

		$fdata["bExportPage"] = true;

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

		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "(SELECT Count(genero) FROM reports WHERE morada=Bairro and genero='F')";

	
	
				$fdata["FieldPermissions"] = true;

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

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

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

	
	
	
	
	
	
	
	
	
	
	
	
		$vdata["NeedEncode"] = true;

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

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

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

	
	
		
	


		$edata["IsRequired"] = true;

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

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




	$tdataTop_5_Bairros["Feminino"] = $fdata;
//	Masculino
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "Masculino";
	$fdata["GoodName"] = "Masculino";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("Top_5_Bairros","Masculino");
	$fdata["FieldType"] = 3;

	
	
	
			
		$fdata["bListPage"] = true;

	
	
	
	
	

		$fdata["bViewPage"] = true;

		$fdata["bAdvancedSearch"] = true;

		$fdata["bPrinterPage"] = true;

		$fdata["bExportPage"] = true;

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

		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "(SELECT Count(genero) FROM reports WHERE morada=Bairro and genero='M')";

	
	
				$fdata["FieldPermissions"] = true;

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

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

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

	
	
	
	
	
	
	
	
	
	
	
	
		$vdata["NeedEncode"] = true;

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

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

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

	
	
		
	


		$edata["IsRequired"] = true;

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

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




	$tdataTop_5_Bairros["Masculino"] = $fdata;

	$tdataTop_5_Bairros[".chartXml"] = '<chart>
		<attr value="tables">
			<attr value="0">Top 5 Bairros</attr>
		</attr>
		<attr value="chart_type">
			<attr value="type">2d_bar</attr>
		</attr>

		<attr value="parameters">';
	$tdataTop_5_Bairros[".chartXml"] .= '<attr value="0">
			<attr value="name">Vitimas</attr>';
	$tdataTop_5_Bairros[".chartXml"] .= '</attr>';
	$tdataTop_5_Bairros[".chartXml"] .= '<attr value="1">
			<attr value="name">Feminino</attr>';
	$tdataTop_5_Bairros[".chartXml"] .= '</attr>';
	$tdataTop_5_Bairros[".chartXml"] .= '<attr value="2">
			<attr value="name">Masculino</attr>';
	$tdataTop_5_Bairros[".chartXml"] .= '</attr>';
	$tdataTop_5_Bairros[".chartXml"] .= '<attr value="3">
		<attr value="name">Bairro</attr>
	</attr>';
	$tdataTop_5_Bairros[".chartXml"] .= '</attr>
			<attr value="appearance">';


	$tdataTop_5_Bairros[".chartXml"] .= '<attr value="head">'.xmlencode("Top 5 Bairros").'</attr>
<attr value="foot">'.xmlencode("Bairros").'</attr>
<attr value="y_axis_label">'.xmlencode("Nº Vítimas").'</attr>


<attr value="slegend">true</attr>
<attr value="sgrid">false</attr>
<attr value="sname">true</attr>
<attr value="sval">true</attr>
<attr value="sanim">true</attr>
<attr value="sstacked">false</attr>
<attr value="slog">false</attr>
<attr value="aqua">0</attr>
<attr value="cview">0</attr>
<attr value="is3d">0</attr>
<attr value="isstacked">0</attr>
<attr value="linestyle">0</attr>
<attr value="autoupdate">0</attr>
<attr value="autoupmin">60</attr>';
$tdataTop_5_Bairros[".chartXml"] .= '</attr>

<attr value="fields">';
	$tdataTop_5_Bairros[".chartXml"] .= '<attr value="0">
		<attr value="name">Bairro</attr>
		<attr value="label">'.xmlencode(GetFieldLabel("Top_5_Bairros","Bairro")).'</attr>
		<attr value="search"></attr>
	</attr>';
	$tdataTop_5_Bairros[".chartXml"] .= '<attr value="1">
		<attr value="name">Vitimas</attr>
		<attr value="label">'.xmlencode(GetFieldLabel("Top_5_Bairros","Vitimas")).'</attr>
		<attr value="search"></attr>
	</attr>';
	$tdataTop_5_Bairros[".chartXml"] .= '<attr value="2">
		<attr value="name">Feminino</attr>
		<attr value="label">'.xmlencode(GetFieldLabel("Top_5_Bairros","Feminino")).'</attr>
		<attr value="search"></attr>
	</attr>';
	$tdataTop_5_Bairros[".chartXml"] .= '<attr value="3">
		<attr value="name">Masculino</attr>
		<attr value="label">'.xmlencode(GetFieldLabel("Top_5_Bairros","Masculino")).'</attr>
		<attr value="search"></attr>
	</attr>';
$tdataTop_5_Bairros[".chartXml"] .= '</attr>


<attr value="settings">
<attr value="name">Top 5 Bairros</attr>
<attr value="short_table_name">Top_5_Bairros</attr>
</attr>

</chart>';

$tables_data["Top 5 Bairros"]=&$tdataTop_5_Bairros;
$field_labels["Top_5_Bairros"] = &$fieldLabelsTop_5_Bairros;
$fieldToolTips["Top_5_Bairros"] = &$fieldToolTipsTop_5_Bairros;
$placeHolders["Top_5_Bairros"] = &$placeHoldersTop_5_Bairros;
$page_titles["Top_5_Bairros"] = &$pageTitlesTop_5_Bairros;

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

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


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

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










function createSqlQuery_Top_5_Bairros()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "morada as Bairro,  	COUNT(morada) as Vitimas,  	(SELECT Count(genero) FROM reports WHERE morada=Bairro and genero='F') AS Feminino,  (SELECT Count(genero) FROM reports WHERE morada=Bairro and genero='M') AS Masculino";
$proto0["m_strFrom"] = "FROM reports";
$proto0["m_strWhere"] = "";
$proto0["m_strOrderBy"] = "ORDER BY Vitimas DESC";
	
		;
			$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" => "morada",
	"m_strTable" => "reports",
	"m_srcTableName" => "Top 5 Bairros"
));

$proto6["m_sql"] = "morada";
$proto6["m_srcTableName"] = "Top 5 Bairros";
$proto6["m_expr"]=$obj;
$proto6["m_alias"] = "Bairro";
$obj = new SQLFieldListItem($proto6);

$proto0["m_fieldlist"][]=$obj;
						$proto8=array();
			$proto9=array();
$proto9["m_functiontype"] = "SQLF_COUNT";
$proto9["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "morada",
	"m_strTable" => "reports",
	"m_srcTableName" => "Top 5 Bairros"
));

$proto9["m_arguments"][]=$obj;
$proto9["m_strFunctionName"] = "COUNT";
$obj = new SQLFunctionCall($proto9);

$proto8["m_sql"] = "COUNT(morada)";
$proto8["m_srcTableName"] = "Top 5 Bairros";
$proto8["m_expr"]=$obj;
$proto8["m_alias"] = "Vitimas";
$obj = new SQLFieldListItem($proto8);

$proto0["m_fieldlist"][]=$obj;
						$proto11=array();
			$proto12=array();
$proto12["m_strHead"] = "SELECT";
$proto12["m_strFieldList"] = "Count(genero)";
$proto12["m_strFrom"] = "FROM reports";
$proto12["m_strWhere"] = "morada=Bairro and genero='F'";
$proto12["m_strOrderBy"] = "";
	
		;
			$proto12["cipherer"] = null;
$proto14=array();
$proto14["m_sql"] = "morada=Bairro and genero='F'";
$proto14["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "morada=Bairro and genero='F'"
));

$proto14["m_column"]=$obj;
$proto14["m_contained"] = array();
						$proto16=array();
$proto16["m_sql"] = "morada=Bairro";
$proto16["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "morada",
	"m_strTable" => "reports",
	"m_srcTableName" => "Top 5 Bairros"
));

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

			$proto14["m_contained"][]=$obj;
						$proto18=array();
$proto18["m_sql"] = "genero='F'";
$proto18["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "genero",
	"m_strTable" => "reports",
	"m_srcTableName" => "Top 5 Bairros"
));

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

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

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

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

$proto12["m_having"] = $obj;
$proto12["m_fieldlist"] = array();
						$proto22=array();
			$proto23=array();
$proto23["m_functiontype"] = "SQLF_COUNT";
$proto23["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "genero",
	"m_strTable" => "reports",
	"m_srcTableName" => "Top 5 Bairros"
));

$proto23["m_arguments"][]=$obj;
$proto23["m_strFunctionName"] = "Count";
$obj = new SQLFunctionCall($proto23);

$proto22["m_sql"] = "Count(genero)";
$proto22["m_srcTableName"] = "Top 5 Bairros";
$proto22["m_expr"]=$obj;
$proto22["m_alias"] = "";
$obj = new SQLFieldListItem($proto22);

$proto12["m_fieldlist"][]=$obj;
$proto12["m_fromlist"] = array();
												$proto25=array();
$proto25["m_link"] = "SQLL_MAIN";
			$proto26=array();
$proto26["m_strName"] = "reports";
$proto26["m_srcTableName"] = "Top 5 Bairros";
$proto26["m_columns"] = array();
$proto26["m_columns"][] = "id";
$proto26["m_columns"][] = "contacto";
$proto26["m_columns"][] = "genero";
$proto26["m_columns"][] = "idade";
$proto26["m_columns"][] = "morada";
$proto26["m_columns"][] = "quarteirao";
$proto26["m_columns"][] = "tipo_violacao";
$proto26["m_columns"][] = "agressor";
$proto26["m_columns"][] = "descricao";
$proto26["m_columns"][] = "data_agressao";
$proto26["m_columns"][] = "data_registo";
$proto26["m_columns"][] = "Estado";
$obj = new SQLTable($proto26);

$proto25["m_table"] = $obj;
$proto25["m_sql"] = "reports";
$proto25["m_alias"] = "";
$proto25["m_srcTableName"] = "Top 5 Bairros";
$proto27=array();
$proto27["m_sql"] = "";
$proto27["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto12["m_fromlist"][]=$obj;
$proto12["m_groupby"] = array();
$proto12["m_orderby"] = array();
$proto12["m_srcTableName"]="Top 5 Bairros";		
$obj = new SQLQuery($proto12);

$proto11["m_sql"] = "(SELECT Count(genero) FROM reports WHERE morada=Bairro and genero='F')";
$proto11["m_srcTableName"] = "Top 5 Bairros";
$proto11["m_expr"]=$obj;
$proto11["m_alias"] = "Feminino";
$obj = new SQLFieldListItem($proto11);

$proto0["m_fieldlist"][]=$obj;
						$proto29=array();
			$proto30=array();
$proto30["m_strHead"] = "SELECT";
$proto30["m_strFieldList"] = "Count(genero)";
$proto30["m_strFrom"] = "FROM reports";
$proto30["m_strWhere"] = "morada=Bairro and genero='M'";
$proto30["m_strOrderBy"] = "";
	
		;
			$proto30["cipherer"] = null;
$proto32=array();
$proto32["m_sql"] = "morada=Bairro and genero='M'";
$proto32["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "morada=Bairro and genero='M'"
));

$proto32["m_column"]=$obj;
$proto32["m_contained"] = array();
						$proto34=array();
$proto34["m_sql"] = "morada=Bairro";
$proto34["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "morada",
	"m_strTable" => "reports",
	"m_srcTableName" => "Top 5 Bairros"
));

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

			$proto32["m_contained"][]=$obj;
						$proto36=array();
$proto36["m_sql"] = "genero='M'";
$proto36["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "genero",
	"m_strTable" => "reports",
	"m_srcTableName" => "Top 5 Bairros"
));

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

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

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

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

$proto30["m_having"] = $obj;
$proto30["m_fieldlist"] = array();
						$proto40=array();
			$proto41=array();
$proto41["m_functiontype"] = "SQLF_COUNT";
$proto41["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "genero",
	"m_strTable" => "reports",
	"m_srcTableName" => "Top 5 Bairros"
));

$proto41["m_arguments"][]=$obj;
$proto41["m_strFunctionName"] = "Count";
$obj = new SQLFunctionCall($proto41);

$proto40["m_sql"] = "Count(genero)";
$proto40["m_srcTableName"] = "Top 5 Bairros";
$proto40["m_expr"]=$obj;
$proto40["m_alias"] = "";
$obj = new SQLFieldListItem($proto40);

$proto30["m_fieldlist"][]=$obj;
$proto30["m_fromlist"] = array();
												$proto43=array();
$proto43["m_link"] = "SQLL_MAIN";
			$proto44=array();
$proto44["m_strName"] = "reports";
$proto44["m_srcTableName"] = "Top 5 Bairros";
$proto44["m_columns"] = array();
$proto44["m_columns"][] = "id";
$proto44["m_columns"][] = "contacto";
$proto44["m_columns"][] = "genero";
$proto44["m_columns"][] = "idade";
$proto44["m_columns"][] = "morada";
$proto44["m_columns"][] = "quarteirao";
$proto44["m_columns"][] = "tipo_violacao";
$proto44["m_columns"][] = "agressor";
$proto44["m_columns"][] = "descricao";
$proto44["m_columns"][] = "data_agressao";
$proto44["m_columns"][] = "data_registo";
$proto44["m_columns"][] = "Estado";
$obj = new SQLTable($proto44);

$proto43["m_table"] = $obj;
$proto43["m_sql"] = "reports";
$proto43["m_alias"] = "";
$proto43["m_srcTableName"] = "Top 5 Bairros";
$proto45=array();
$proto45["m_sql"] = "";
$proto45["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto30["m_fromlist"][]=$obj;
$proto30["m_groupby"] = array();
$proto30["m_orderby"] = array();
$proto30["m_srcTableName"]="Top 5 Bairros";		
$obj = new SQLQuery($proto30);

$proto29["m_sql"] = "(SELECT Count(genero) FROM reports WHERE morada=Bairro and genero='M')";
$proto29["m_srcTableName"] = "Top 5 Bairros";
$proto29["m_expr"]=$obj;
$proto29["m_alias"] = "Masculino";
$obj = new SQLFieldListItem($proto29);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto47=array();
$proto47["m_link"] = "SQLL_MAIN";
			$proto48=array();
$proto48["m_strName"] = "reports";
$proto48["m_srcTableName"] = "Top 5 Bairros";
$proto48["m_columns"] = array();
$proto48["m_columns"][] = "id";
$proto48["m_columns"][] = "contacto";
$proto48["m_columns"][] = "genero";
$proto48["m_columns"][] = "idade";
$proto48["m_columns"][] = "morada";
$proto48["m_columns"][] = "quarteirao";
$proto48["m_columns"][] = "tipo_violacao";
$proto48["m_columns"][] = "agressor";
$proto48["m_columns"][] = "descricao";
$proto48["m_columns"][] = "data_agressao";
$proto48["m_columns"][] = "data_registo";
$proto48["m_columns"][] = "Estado";
$obj = new SQLTable($proto48);

$proto47["m_table"] = $obj;
$proto47["m_sql"] = "reports";
$proto47["m_alias"] = "";
$proto47["m_srcTableName"] = "Top 5 Bairros";
$proto49=array();
$proto49["m_sql"] = "";
$proto49["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto0["m_fromlist"][]=$obj;
$proto0["m_groupby"] = array();
												$proto51=array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "Bairro"
));

$proto51["m_column"]=$obj;
$obj = new SQLGroupByItem($proto51);

$proto0["m_groupby"][]=$obj;
$proto0["m_orderby"] = array();
												$proto53=array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "Vitimas"
));

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

$proto0["m_orderby"][]=$obj;					
$proto0["m_srcTableName"]="Top 5 Bairros";		
$obj = new SQLQuery($proto0);

	return $obj;
}
$queryData_Top_5_Bairros = createSqlQuery_Top_5_Bairros();


	
		;

				

$tdataTop_5_Bairros[".sqlquery"] = $queryData_Top_5_Bairros;

$tableEvents["Top 5 Bairros"] = new eventsBase;
$tdataTop_5_Bairros[".hasEvents"] = false;

?>