<?php
$tdataCalls_Performance=array();
	$tdataCalls_Performance[".ShortName"]="Calls_Performance";
	$tdataCalls_Performance[".OwnerID"]="";
	$tdataCalls_Performance[".OriginalTable"]="calls";


	
//	field labels
$fieldLabelsCalls_Performance = array();
if(mlang_getcurrentlang()=="English")
{
	$fieldLabelsCalls_Performance["English"]=array();
	$fieldToolTipsCalls_Performance["English"]=array();
	$fieldLabelsCalls_Performance["English"]["Date"] = "Date";
	$fieldToolTipsCalls_Performance["English"]["Date"] = "";
	$fieldLabelsCalls_Performance["English"]["COUNT"] = "COUNT";
	$fieldToolTipsCalls_Performance["English"]["COUNT"] = "";
	if (count($fieldToolTipsCalls_Performance["English"])){
		$tdataCalls_Performance[".isUseToolTips"]=true;
	}
}


	
	$tdataCalls_Performance[".NCSearch"]=true;

	
	$tdataCalls_Performance[".ChartRefreshTime"] = 0;

$tdataCalls_Performance[".shortTableName"] = "Calls_Performance";
$tdataCalls_Performance[".nSecOptions"] = 0;
$tdataCalls_Performance[".recsPerRowList"] = 1;	
$tdataCalls_Performance[".tableGroupBy"] = "1";
$tdataCalls_Performance[".mainTableOwnerID"] = "";
$tdataCalls_Performance[".moveNext"] = 1;




$tdataCalls_Performance[".showAddInPopup"] = false;

$tdataCalls_Performance[".showEditInPopup"] = false;

$tdataCalls_Performance[".showViewInPopup"] = false;


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

$tdataCalls_Performance[".listAjax"] = false;

	$tdataCalls_Performance[".audit"] = false;

	$tdataCalls_Performance[".locking"] = false;
	
$tdataCalls_Performance[".listIcons"] = true;
$tdataCalls_Performance[".edit"] = true;
$tdataCalls_Performance[".inlineEdit"] = true;
$tdataCalls_Performance[".view"] = true;



$tdataCalls_Performance[".delete"] = true;

$tdataCalls_Performance[".showSimpleSearchOptions"] = false;

$tdataCalls_Performance[".showSearchPanel"] = true;


$tdataCalls_Performance[".isUseAjaxSuggest"] = true;



// button handlers file names

$tdataCalls_Performance[".addPageEvents"] = false;


// use datepicker for search panel
$tdataCalls_Performance[".isUseCalendarForSearch"] = true;

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

$tdataCalls_Performance[".isUseiBox"] = false;



$tdataCalls_Performance[".isUseInlineJs"] = $tdataCalls_Performance[".isUseInlineAdd"] || $tdataCalls_Performance[".isUseInlineEdit"];

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

$tdataCalls_Performance[".globSearchFields"][] = "Date";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("Date", $tdataCalls_Performance[".allSearchFields"]))
{
	$tdataCalls_Performance[".allSearchFields"][] = "Date";	
}


$tdataCalls_Performance[".googleLikeFields"][] = "Date";



$tdataCalls_Performance[".advSearchFields"][] = "Date";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("Date", $tdataCalls_Performance[".allSearchFields"])) 
{
	$tdataCalls_Performance[".allSearchFields"][] = "Date";	
}

$tdataCalls_Performance[".isTableType"] = "chart";


	

$tdataCalls_Performance[".isDisplayLoading"] = true;

$tdataCalls_Performance[".isResizeColumns"] = false;




$gstrOrderBy = "";
if(strlen($gstrOrderBy) && strtolower(substr($gstrOrderBy,0,8))!="order by")
	$gstrOrderBy = "order by ".$gstrOrderBy;
$tdataCalls_Performance[".strOrderBy"] = $gstrOrderBy;
	
$tdataCalls_Performance[".orderindexes"] = array();

$tdataCalls_Performance[".sqlHead"] = "SELECT COUNT(idCalls) AS `COUNT`,  Date(Date) AS `Date`";
$tdataCalls_Performance[".sqlFrom"] = "FROM calls";
$tdataCalls_Performance[".sqlWhereExpr"] = "";
$tdataCalls_Performance[".sqlTail"] = "GROUP BY Date(Date)";




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

	$tableKeys = array();
	$tdataCalls_Performance[".Keys"] = $tableKeys;

//	COUNT
	$fdata = array();
	$fdata["strName"] = "COUNT";
	$fdata["ownerTable"] = "";
		
		
		
	$fdata["FieldType"]= 3;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "COUNT";
	
		$fdata["FullName"]= "COUNT(idCalls)";
	
		
		
		
		
		
				$fdata["Index"]= 1;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
				$fdata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						
		//End validation
	
				
		
		
		
		
		
			$tdataCalls_Performance["COUNT"]=$fdata;
//	Date
	$fdata = array();
	$fdata["strName"] = "Date";
	$fdata["ownerTable"] = "";
		
		
		
	$fdata["FieldType"]= 135;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Date";
	$fdata["ViewFormat"]= "Short Date";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "Date";
	
		$fdata["FullName"]= "Date(Date)";
	
		
		
		
		
		
				$fdata["Index"]= 2;
		$fdata["DateEditType"] = 13; 
	$fdata["InitialYearFactor"] = 100; 
	$fdata["LastYearFactor"] = 10; 
			
		$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; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
		
		
		
		
			$tdataCalls_Performance["Date"]=$fdata;

$tdataCalls_Performance[".chartXml"] = '<chart>
<attr value="tables">
	<attr value="0">Calls Performance</attr>
</attr>
<attr value="chart_type">
	<attr value="type">line</attr>
</attr>

<attr value="parameters">
<attr value="0">
<attr value="name">COUNT</attr>
<attr value="currencyFormat">0</attr>
<attr value="decimalFormat">2</attr>
<attr value="customFormat">0</attr>
<attr value="customFormatStr"></attr>
</attr>
<attr value="1">
<attr value="name">Date</attr>
</attr>
</attr>


<attr value="appearance">
	<attr value="scolor11">FF0000</attr>
	<attr value="scolor12">FF0000</attr>

<attr value="head">'.xmlencode("Chart Title").'</attr>
<attr value="foot">'.xmlencode("Legend Title").'</attr>

<attr value="color51">49563A</attr>
<attr value="color52">49563A</attr>
<attr value="color61">49563A</attr>
<attr value="color62">49563A</attr>
<attr value="color71">C7CDC1</attr>
<attr value="color72">C7CDC1</attr>
<attr value="color81">ECF0E8</attr>
<attr value="color82">ECF0E8</attr>
<attr value="color91">68838B</attr>
<attr value="color92">68838B</attr>
<attr value="color101">48505A</attr>
<attr value="color102">48505A</attr>
<attr value="color111">45595F</attr>
<attr value="color112">45595F</attr>
<attr value="color121"></attr>
<attr value="color122"></attr>
<attr value="color131">000000</attr>
<attr value="color132">000000</attr>
<attr value="color141">000000</attr>
<attr value="color142">000000</attr>

<attr value="slegend">true</attr>
<attr value="sgrid">true</attr>
<attr value="sname">true</attr>
<attr value="sval">true</attr>
<attr value="sanim">true</attr>
<attr value="sstacked">false</attr>
<attr value="saxes">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">5</attr>
<attr value="cscroll">true</attr>
<attr value="maxbarscroll">10</attr>
</attr>

<attr value="fields">
	<attr value="0">
		<attr value="name">COUNT</attr>
		<attr value="label">COUNT</attr>
		<attr value="search"></attr>
	</attr>
	<attr value="1">
		<attr value="name">Date</attr>
		<attr value="label">Date</attr>
		<attr value="search"></attr>
	</attr>
</attr>


<attr value="settings">
<attr value="name">idCalls</attr>
<attr value="short_table_name">Calls_Performance</attr>
</attr>

</chart>';
	
$tables_data["Calls Performance"]=&$tdataCalls_Performance;
$field_labels["Calls_Performance"] = &$fieldLabelsCalls_Performance;
$fieldToolTips["Calls Performance"] = &$fieldToolTipsCalls_Performance;

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

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

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

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










$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "COUNT(idCalls) AS `COUNT`,  Date(Date) AS `Date`";
$proto0["m_strFrom"] = "FROM calls";
$proto0["m_strWhere"] = "";
$proto0["m_strOrderBy"] = "";
$proto0["m_strTail"] = "GROUP BY Date(Date)";
$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();
						$proto5=array();
			$proto6=array();
$proto6["m_functiontype"] = "SQLF_COUNT";
$proto6["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "idCalls",
	"m_strTable" => "calls"
));

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

$proto5["m_expr"]=$obj;
$proto5["m_alias"] = "COUNT";
$obj = new SQLFieldListItem($proto5);

$proto0["m_fieldlist"][]=$obj;
						$proto8=array();
			$proto9=array();
$proto9["m_functiontype"] = "SQLF_CUSTOM";
$proto9["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "Date"
));

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

$proto8["m_expr"]=$obj;
$proto8["m_alias"] = "Date";
$obj = new SQLFieldListItem($proto8);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto11=array();
$proto11["m_link"] = "SQLL_MAIN";
			$proto12=array();
$proto12["m_strName"] = "calls";
$proto12["m_columns"] = array();
$proto12["m_columns"][] = "idCalls";
$proto12["m_columns"][] = "Date";
$proto12["m_columns"][] = "Call Details";
$proto12["m_columns"][] = "Executive Name";
$proto12["m_columns"][] = "Customer Name";
$obj = new SQLTable($proto12);

$proto11["m_table"] = $obj;
$proto11["m_alias"] = "";
$proto13=array();
$proto13["m_sql"] = "";
$proto13["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto0["m_fromlist"][]=$obj;
$proto0["m_groupby"] = array();
												$proto15=array();
						$proto16=array();
$proto16["m_functiontype"] = "SQLF_CUSTOM";
$proto16["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "Date"
));

$proto16["m_arguments"][]=$obj;
$proto16["m_strFunctionName"] = "Date";
$obj = new SQLFunctionCall($proto16);

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

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

$queryData_Calls_Performance = $obj;
$tdataCalls_Performance[".sqlquery"] = $queryData_Calls_Performance;

$tableEvents["Calls Performance"] = new eventsBase;

?>
