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


	
//	field labels
$fieldLabelsCalls_Performace = array();
if(mlang_getcurrentlang()=="English")
{
	$fieldLabelsCalls_Performace["English"]=array();
	$fieldToolTipsCalls_Performace["English"]=array();
	$fieldLabelsCalls_Performace["English"]["Date"] = "Date";
	$fieldToolTipsCalls_Performace["English"]["Date"] = "";
	$fieldLabelsCalls_Performace["English"]["COUNT"] = "COUNT";
	$fieldToolTipsCalls_Performace["English"]["COUNT"] = "";
	if (count($fieldToolTipsCalls_Performace["English"])){
		$tdataCalls_Performace[".isUseToolTips"]=true;
	}
}


	
	$tdataCalls_Performace[".NCSearch"]=true;

	
	$tdataCalls_Performace[".ChartRefreshTime"] = 0;

$tdataCalls_Performace[".shortTableName"] = "Calls_Performace";
$tdataCalls_Performace[".nSecOptions"] = 0;
$tdataCalls_Performace[".recsPerRowList"] = 1;	
$tdataCalls_Performace[".tableGroupBy"] = "1";
$tdataCalls_Performace[".mainTableOwnerID"] = "";
$tdataCalls_Performace[".moveNext"] = 1;




$tdataCalls_Performace[".showAddInPopup"] = false;

$tdataCalls_Performace[".showEditInPopup"] = false;

$tdataCalls_Performace[".showViewInPopup"] = false;


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

$tdataCalls_Performace[".listAjax"] = false;

	$tdataCalls_Performace[".audit"] = false;

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



$tdataCalls_Performace[".delete"] = true;

$tdataCalls_Performace[".showSimpleSearchOptions"] = false;

$tdataCalls_Performace[".showSearchPanel"] = true;


$tdataCalls_Performace[".isUseAjaxSuggest"] = true;



// button handlers file names

$tdataCalls_Performace[".addPageEvents"] = false;


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

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

$tdataCalls_Performace[".isUseiBox"] = false;



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

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

$tdataCalls_Performace[".globSearchFields"][] = "COUNT";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("COUNT", $tdataCalls_Performace[".allSearchFields"]))
{
	$tdataCalls_Performace[".allSearchFields"][] = "COUNT";	
}
$tdataCalls_Performace[".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_Performace[".allSearchFields"]))
{
	$tdataCalls_Performace[".allSearchFields"][] = "Date";	
}


$tdataCalls_Performace[".googleLikeFields"][] = "COUNT";
$tdataCalls_Performace[".googleLikeFields"][] = "Date";



$tdataCalls_Performace[".advSearchFields"][] = "COUNT";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("COUNT", $tdataCalls_Performace[".allSearchFields"])) 
{
	$tdataCalls_Performace[".allSearchFields"][] = "COUNT";	
}
$tdataCalls_Performace[".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_Performace[".allSearchFields"])) 
{
	$tdataCalls_Performace[".allSearchFields"][] = "Date";	
}

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


	

$tdataCalls_Performace[".isDisplayLoading"] = true;

$tdataCalls_Performace[".isResizeColumns"] = false;




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

$tdataCalls_Performace[".sqlHead"] = "SELECT COUNT(calls.idCalls) AS `COUNT`,  Date(Date) AS `Date`";
$tdataCalls_Performace[".sqlFrom"] = "FROM calls  INNER JOIN customer_list ON calls.`Customer Name` = customer_list.`Customer Name`";
$tdataCalls_Performace[".sqlWhereExpr"] = "";
$tdataCalls_Performace[".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_Performace[".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_Performace[".arrGroupsPerPage"] = $arrGPP;

	$tableKeys = array();
	$tdataCalls_Performace[".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(calls.idCalls)";
	
		
		
		
		
		
				$fdata["Index"]= 1;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
				$fdata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
		
		
		
		
			$tdataCalls_Performace["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_Performace["Date"]=$fdata;

$tdataCalls_Performace[".chartXml"] = '<chart>
<attr value="tables">
	<attr value="0">Calls Performace</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">0</attr>
<attr value="customFormat">1</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("Calls Performce").'</attr>
<attr value="foot">'.xmlencode("Calls Performce").'</attr>

<attr value="color51">49563A</attr>
<attr value="color52">49563A</attr>
<attr value="color61">49563A</attr>
<attr value="color62">49563A</attr>
<attr value="color71">FFFFFF</attr>
<attr value="color72">FFFFFF</attr>
<attr value="color81">FEF7DB</attr>
<attr value="color82">FEF7DB</attr>
<attr value="color91">000000</attr>
<attr value="color92">000000</attr>
<attr value="color101">000000</attr>
<attr value="color102">000000</attr>
<attr value="color111">000000</attr>
<attr value="color112">000000</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">true</attr>
<attr value="slog">true</attr>
<attr value="aqua">0</attr>
<attr value="cview">0</attr>
<attr value="is3d">1</attr>
<attr value="isstacked">1</attr>
<attr value="linestyle">1</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_Performace</attr>
</attr>

</chart>';
	
$tables_data["Calls Performace"]=&$tdataCalls_Performace;
$field_labels["Calls_Performace"] = &$fieldLabelsCalls_Performace;
$fieldToolTips["Calls Performace"] = &$fieldToolTipsCalls_Performace;

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

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

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

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










$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "COUNT(calls.idCalls) AS `COUNT`,  Date(Date) AS `Date`";
$proto0["m_strFrom"] = "FROM calls  INNER JOIN customer_list ON calls.`Customer Name` = customer_list.`Customer Name`";
$proto0["m_strWhere"] = "";
$proto0["m_strOrderBy"] = "ORDER BY Date(Date)";
$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;
												$proto15=array();
$proto15["m_link"] = "SQLL_INNERJOIN";
			$proto16=array();
$proto16["m_strName"] = "customer_list";
$proto16["m_columns"] = array();
$proto16["m_columns"][] = "idCL";
$proto16["m_columns"][] = "Created on";
$proto16["m_columns"][] = "Region";
$proto16["m_columns"][] = "Customer Name";
$proto16["m_columns"][] = "Address";
$proto16["m_columns"][] = "City";
$proto16["m_columns"][] = "State";
$proto16["m_columns"][] = "Country";
$proto16["m_columns"][] = "Postal Code";
$proto16["m_columns"][] = "Web address";
$proto16["m_columns"][] = "Area";
$proto16["m_columns"][] = "Customer_Category";
$proto16["m_columns"][] = "Breif About the Company";
$proto16["m_columns"][] = "Existing Setup";
$proto16["m_columns"][] = "Interaction Summary";
$proto16["m_columns"][] = "Commercial Summary";
$proto16["m_columns"][] = "Customer Status";
$proto16["m_columns"][] = "Assigned Executive";
$proto16["m_columns"][] = "Assigned Date";
$proto16["m_columns"][] = "Last Updated on";
$proto16["m_columns"][] = "Aligned Partner";
$obj = new SQLTable($proto16);

$proto15["m_table"] = $obj;
$proto15["m_alias"] = "";
$proto17=array();
$proto17["m_sql"] = "calls.`Customer Name` = customer_list.`Customer Name`";
$proto17["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "Customer Name",
	"m_strTable" => "calls"
));

$proto17["m_column"]=$obj;
$proto17["m_contained"] = array();
$proto17["m_strCase"] = "= customer_list.`Customer Name`";
$proto17["m_havingmode"] = "0";
$proto17["m_inBrackets"] = "0";
$proto17["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto17);

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

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

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

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

$proto0["m_groupby"][]=$obj;
$proto0["m_orderby"] = array();
												$proto22=array();
						$proto23=array();
$proto23["m_functiontype"] = "SQLF_CUSTOM";
$proto23["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "Date"
));

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

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

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

$queryData_Calls_Performace = $obj;
$tdataCalls_Performace[".sqlquery"] = $queryData_Calls_Performace;

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

?>
