<?php
require_once(getabspath("classes/cipherer.php"));
$tdataranking_cliente = array();
	$tdataranking_cliente[".NumberOfChars"] = 80; 
	$tdataranking_cliente[".ShortName"] = "ranking_cliente";
	$tdataranking_cliente[".OwnerID"] = "";
	$tdataranking_cliente[".OriginalTable"] = "venta";

//	field labels
$fieldLabelsranking_cliente = array();
if(mlang_getcurrentlang()=="Spanish")
{
	$fieldLabelsranking_cliente["Spanish"] = array();
	$fieldToolTipsranking_cliente["Spanish"] = array();
	$fieldLabelsranking_cliente["Spanish"]["cliente"] = "Cliente";
	$fieldToolTipsranking_cliente["Spanish"]["cliente"] = "";
	$fieldLabelsranking_cliente["Spanish"]["ranking"] = "Ranking";
	$fieldToolTipsranking_cliente["Spanish"]["ranking"] = "";
	$fieldLabelsranking_cliente["Spanish"]["cantidad_ventas"] = "Cantidad Ventas";
	$fieldToolTipsranking_cliente["Spanish"]["cantidad_ventas"] = "";
	$fieldLabelsranking_cliente["Spanish"]["monto_total"] = "Mont total de Vent.";
	$fieldToolTipsranking_cliente["Spanish"]["monto_total"] = "";
	if (count($fieldToolTipsranking_cliente["Spanish"]))
		$tdataranking_cliente[".isUseToolTips"] = true;
}
	
	
	$tdataranking_cliente[".NCSearch"] = true;



$tdataranking_cliente[".shortTableName"] = "ranking_cliente";
$tdataranking_cliente[".nSecOptions"] = 0;
$tdataranking_cliente[".recsPerRowList"] = 1;
$tdataranking_cliente[".mainTableOwnerID"] = "";
$tdataranking_cliente[".moveNext"] = 1;
$tdataranking_cliente[".nType"] = 2;

$tdataranking_cliente[".strOriginalTableName"] = "venta";




$tdataranking_cliente[".showAddInPopup"] = false;

$tdataranking_cliente[".showEditInPopup"] = false;

$tdataranking_cliente[".showViewInPopup"] = false;

$tdataranking_cliente[".fieldsForRegister"] = array();
	
$tdataranking_cliente[".listAjax"] = false;

	$tdataranking_cliente[".audit"] = false;

	$tdataranking_cliente[".locking"] = false;

$tdataranking_cliente[".listIcons"] = true;
$tdataranking_cliente[".edit"] = true;
$tdataranking_cliente[".inlineEdit"] = true;
$tdataranking_cliente[".inlineAdd"] = true;
$tdataranking_cliente[".view"] = true;

$tdataranking_cliente[".exportTo"] = true;

$tdataranking_cliente[".printFriendly"] = true;

$tdataranking_cliente[".delete"] = true;

$tdataranking_cliente[".showSimpleSearchOptions"] = false;

$tdataranking_cliente[".showSearchPanel"] = true;

if (isMobile())
	$tdataranking_cliente[".isUseAjaxSuggest"] = false;
else 
	$tdataranking_cliente[".isUseAjaxSuggest"] = true;


// button handlers file names

$tdataranking_cliente[".addPageEvents"] = false;

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




$tdataranking_cliente[".allSearchFields"] = array();

$tdataranking_cliente[".allSearchFields"][] = "ranking";
$tdataranking_cliente[".allSearchFields"][] = "cliente";
$tdataranking_cliente[".allSearchFields"][] = "cantidad_ventas";
$tdataranking_cliente[".allSearchFields"][] = "monto_total";

$tdataranking_cliente[".googleLikeFields"][] = "ranking";
$tdataranking_cliente[".googleLikeFields"][] = "cliente";
$tdataranking_cliente[".googleLikeFields"][] = "cantidad_ventas";
$tdataranking_cliente[".googleLikeFields"][] = "monto_total";


$tdataranking_cliente[".advSearchFields"][] = "ranking";
$tdataranking_cliente[".advSearchFields"][] = "cliente";
$tdataranking_cliente[".advSearchFields"][] = "cantidad_ventas";
$tdataranking_cliente[".advSearchFields"][] = "monto_total";

$tdataranking_cliente[".isTableType"] = "report";

	



// Access doesn't support subqueries from the same table as main




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

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

$tdataranking_cliente[".sqlHead"] = " ";
$tdataranking_cliente[".sqlFrom"] = "";
$tdataranking_cliente[".sqlWhereExpr"] = "";
$tdataranking_cliente[".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;
$tdataranking_cliente[".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;
$tdataranking_cliente[".arrGroupsPerPage"] = $arrGPP;

$tableKeysranking_cliente = array();
$tdataranking_cliente[".Keys"] = $tableKeysranking_cliente;

$tdataranking_cliente[".listFields"] = array();
$tdataranking_cliente[".listFields"][] = "ranking";
$tdataranking_cliente[".listFields"][] = "cliente";
$tdataranking_cliente[".listFields"][] = "cantidad_ventas";
$tdataranking_cliente[".listFields"][] = "monto_total";

$tdataranking_cliente[".viewFields"] = array();
$tdataranking_cliente[".viewFields"][] = "ranking";
$tdataranking_cliente[".viewFields"][] = "cliente";
$tdataranking_cliente[".viewFields"][] = "cantidad_ventas";
$tdataranking_cliente[".viewFields"][] = "monto_total";

$tdataranking_cliente[".addFields"] = array();
$tdataranking_cliente[".addFields"][] = "cliente";

$tdataranking_cliente[".inlineAddFields"] = array();
$tdataranking_cliente[".inlineAddFields"][] = "ranking";
$tdataranking_cliente[".inlineAddFields"][] = "cliente";
$tdataranking_cliente[".inlineAddFields"][] = "cantidad_ventas";
$tdataranking_cliente[".inlineAddFields"][] = "monto_total";

$tdataranking_cliente[".editFields"] = array();
$tdataranking_cliente[".editFields"][] = "cliente";

$tdataranking_cliente[".inlineEditFields"] = array();
$tdataranking_cliente[".inlineEditFields"][] = "ranking";
$tdataranking_cliente[".inlineEditFields"][] = "cliente";
$tdataranking_cliente[".inlineEditFields"][] = "cantidad_ventas";
$tdataranking_cliente[".inlineEditFields"][] = "monto_total";

$tdataranking_cliente[".exportFields"] = array();
$tdataranking_cliente[".exportFields"][] = "ranking";
$tdataranking_cliente[".exportFields"][] = "cliente";
$tdataranking_cliente[".exportFields"][] = "cantidad_ventas";
$tdataranking_cliente[".exportFields"][] = "monto_total";

$tdataranking_cliente[".printFields"] = array();
$tdataranking_cliente[".printFields"][] = "ranking";
$tdataranking_cliente[".printFields"][] = "cliente";
$tdataranking_cliente[".printFields"][] = "cantidad_ventas";
$tdataranking_cliente[".printFields"][] = "monto_total";

//	ranking
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 1;
	$fdata["strName"] = "ranking";
	$fdata["GoodName"] = "ranking";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = "Ranking"; 
	$fdata["FieldType"] = 5;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		$fdata["bInlineAdd"] = true; 
	
		
		$fdata["bInlineEdit"] = true; 
	
		$fdata["bViewPage"] = true; 
	
		$fdata["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "ranking"; 
				$fdata["FullName"] = "`venta`.`ranking`";
	
		
		
				$fdata["FieldPermissions"] = true;
	
				$fdata["UploadFolder"] = "files";
		
//  Begin View Formats
	$fdata["ViewFormats"] = array();
	
	$vdata = array("ViewFormat" => "Number");
	
		
		
		
			
		
		$vdata["DecimalDigits"] = 0;
	
		
		
		
		
		$vdata["NeedEncode"] = true;
	
	$fdata["ViewFormats"]["report"] = $vdata;
//  End View Formats

//	Begin Edit Formats 	
	$fdata["EditFormats"] = array();
	
	$edata = array("EditFormat" => "Text field");
	
		
		
	
//	Begin Lookup settings
	//	End Lookup Settings

		
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		$edata["EditParams"] = "";
			
		
//	Begin validation
	$edata["validateAs"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						
			//	End validation
	
		
		
		$fdata["EditFormats"]["search"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdataranking_cliente["ranking"] = $fdata;
//	cliente
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "cliente";
	$fdata["GoodName"] = "cliente";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = "Cliente"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		$fdata["bInlineAdd"] = true; 
	
		$fdata["bEditPage"] = true; 
	
		$fdata["bInlineEdit"] = true; 
	
		$fdata["bViewPage"] = true; 
	
		$fdata["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "cliente"; 
				$fdata["FullName"] = "`venta`.`cliente`";
	
		
		
				$fdata["FieldPermissions"] = true;
	
				$fdata["UploadFolder"] = "files";
		
//  Begin View Formats
	$fdata["ViewFormats"] = array();
	
	$vdata = array("ViewFormat" => "");
	
		
		
		
			
		
		
		
		
		
		
		$vdata["NeedEncode"] = true;
	
	$fdata["ViewFormats"]["report"] = $vdata;
//  End View Formats

//	Begin Edit Formats 	
	$fdata["EditFormats"] = array();
	
	$edata = array("EditFormat" => "Lookup wizard");
	
		
		
	
//	Begin Lookup settings
								$edata["LookupType"] = 2;
	$edata["freeInput"] = 0;
	$edata["autoCompleteFieldsOnEdit"] = 0;
	$edata["autoCompleteFields"] = array();
				
		
			
	$edata["LinkField"] = "idcliente";
	$edata["LinkFieldType"] = 3;
	$edata["DisplayField"] = "denominacion";
	
		
	$edata["LookupTable"] = "cliente";
	$edata["LookupOrderBy"] = "";
	
		
		
		
		
		
				
	
	
	//	End Lookup Settings

		$edata["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		
		
//	Begin validation
	$edata["validateAs"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
	
			//	End validation
	
		
		
		$fdata["EditFormats"]["search"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdataranking_cliente["cliente"] = $fdata;
//	cantidad_ventas
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "cantidad_ventas";
	$fdata["GoodName"] = "cantidad_ventas";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = "Cantidad Ventas"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		$fdata["bInlineAdd"] = true; 
	
		
		$fdata["bInlineEdit"] = true; 
	
		$fdata["bViewPage"] = true; 
	
		$fdata["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "cantidad_ventas"; 
				$fdata["FullName"] = "`venta`.`cantidad_ventas`";
	
		
		
				$fdata["FieldPermissions"] = true;
	
				$fdata["UploadFolder"] = "files";
		
//  Begin View Formats
	$fdata["ViewFormats"] = array();
	
	$vdata = array("ViewFormat" => "");
	
		
		
		
			
		
		
		
		
		
		
		$vdata["NeedEncode"] = true;
	
	$fdata["ViewFormats"]["report"] = $vdata;
//  End View Formats

//	Begin Edit Formats 	
	$fdata["EditFormats"] = array();
	
	$edata = array("EditFormat" => "Text field");
	
		
		
	
//	Begin Lookup settings
	//	End Lookup Settings

		
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		$edata["EditParams"] = "";
			
		
//	Begin validation
	$edata["validateAs"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						
			//	End validation
	
		
		
		$fdata["EditFormats"]["search"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdataranking_cliente["cantidad_ventas"] = $fdata;
//	monto_total
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "monto_total";
	$fdata["GoodName"] = "monto_total";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = "Mont total de Vent."; 
	$fdata["FieldType"] = 14;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		$fdata["bInlineAdd"] = true; 
	
		
		$fdata["bInlineEdit"] = true; 
	
		$fdata["bViewPage"] = true; 
	
		$fdata["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "monto_total"; 
				$fdata["FullName"] = "`venta`.`monto_total`";
	
		
		
				$fdata["FieldPermissions"] = true;
	
				$fdata["UploadFolder"] = "files";
		
//  Begin View Formats
	$fdata["ViewFormats"] = array();
	
	$vdata = array("ViewFormat" => "Number");
	
		
		
		
			
		
		$vdata["DecimalDigits"] = 2;
	
		
		
		
		
		$vdata["NeedEncode"] = true;
	
	$fdata["ViewFormats"]["report"] = $vdata;
//  End View Formats

//	Begin Edit Formats 	
	$fdata["EditFormats"] = array();
	
	$edata = array("EditFormat" => "Text field");
	
		
		
	
//	Begin Lookup settings
	//	End Lookup Settings

		
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		$edata["EditParams"] = "";
			
		
//	Begin validation
	$edata["validateAs"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						
			//	End validation
	
		
		
		$fdata["EditFormats"]["search"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdataranking_cliente["monto_total"] = $fdata;

	
$tables_data["ranking_cliente"]=&$tdataranking_cliente;
$field_labels["ranking_cliente"] = &$fieldLabelsranking_cliente;
$fieldToolTips["ranking_cliente"] = &$fieldToolTipsranking_cliente;

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

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

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










function createSqlQuery_ranking_cliente()
{
$proto0=array();
$proto0["m_strHead"] = "";
$proto0["m_strFieldList"] = "";
$proto0["m_strFrom"] = "";
$proto0["m_strWhere"] = "";
$proto0["m_strOrderBy"] = "";
$proto0["m_strTail"] = "";
$proto0["cipherer"] = null;
$proto1=array();
$proto1["m_sql"] = "";
$proto1["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

$proto0["m_where"] = $obj;
$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"] = "0";
$proto3["m_inBrackets"] = "0";
$proto3["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto3);

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

	return $obj;
}
$queryData_ranking_cliente = createSqlQuery_ranking_cliente();
				$tdataranking_cliente[".sqlquery"] = $queryData_ranking_cliente;
	
if(isset($tdataranking_cliente["field2"])){
	$tdataranking_cliente["field2"]["LookupTable"] = "carscars_view";
	$tdataranking_cliente["field2"]["LookupOrderBy"] = "name";
	$tdataranking_cliente["field2"]["LookupType"] = 4;
	$tdataranking_cliente["field2"]["LinkField"] = "email";
	$tdataranking_cliente["field2"]["DisplayField"] = "name";
	$tdataranking_cliente[".hasCustomViewField"] = true;
}

$tableEvents["ranking_cliente"] = new eventsBase;
$tdataranking_cliente[".hasEvents"] = false;

$cipherer = new RunnerCipherer("ranking_cliente");

?>