<?php
$tdataMy_Calls_Summary=array();
	$tdataMy_Calls_Summary[".NumberOfChars"]=80; 
	$tdataMy_Calls_Summary[".ShortName"]="My_Calls_Summary";
	$tdataMy_Calls_Summary[".OwnerID"]="Executive Name";
	$tdataMy_Calls_Summary[".OriginalTable"]="calls";


	
//	field labels
$fieldLabelsMy_Calls_Summary = array();
if(mlang_getcurrentlang()=="English")
{
	$fieldLabelsMy_Calls_Summary["English"]=array();
	$fieldToolTipsMy_Calls_Summary["English"]=array();
	$fieldLabelsMy_Calls_Summary["English"]["Date"] = "Date";
	$fieldToolTipsMy_Calls_Summary["English"]["Date"] = "";
	$fieldLabelsMy_Calls_Summary["English"]["Executive_Name"] = "Executive Name";
	$fieldToolTipsMy_Calls_Summary["English"]["Executive Name"] = "";
	$fieldLabelsMy_Calls_Summary["English"]["Nos"] = "Nos";
	$fieldToolTipsMy_Calls_Summary["English"]["Nos"] = "";
	$fieldLabelsMy_Calls_Summary["English"]["Comp"] = "Comp";
	$fieldToolTipsMy_Calls_Summary["English"]["Comp"] = "";
	if (count($fieldToolTipsMy_Calls_Summary["English"])){
		$tdataMy_Calls_Summary[".isUseToolTips"]=true;
	}
}


	
	$tdataMy_Calls_Summary[".NCSearch"]=true;

	

$tdataMy_Calls_Summary[".shortTableName"] = "My_Calls_Summary";
$tdataMy_Calls_Summary[".nSecOptions"] = 2;
$tdataMy_Calls_Summary[".recsPerRowList"] = 1;	
$tdataMy_Calls_Summary[".tableGroupBy"] = "1";
$tdataMy_Calls_Summary[".mainTableOwnerID"] = "Executive Name";
$tdataMy_Calls_Summary[".moveNext"] = 1;




$tdataMy_Calls_Summary[".showAddInPopup"] = false;

$tdataMy_Calls_Summary[".showEditInPopup"] = false;

$tdataMy_Calls_Summary[".showViewInPopup"] = false;


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

$tdataMy_Calls_Summary[".listAjax"] = false;

	$tdataMy_Calls_Summary[".audit"] = false;

	$tdataMy_Calls_Summary[".locking"] = false;
	
$tdataMy_Calls_Summary[".listIcons"] = true;




$tdataMy_Calls_Summary[".showSimpleSearchOptions"] = false;

$tdataMy_Calls_Summary[".showSearchPanel"] = true;


$tdataMy_Calls_Summary[".isUseAjaxSuggest"] = true;

$tdataMy_Calls_Summary[".rowHighlite"] = true;


// button handlers file names

$tdataMy_Calls_Summary[".addPageEvents"] = false;

$tdataMy_Calls_Summary[".arrKeyFields"][] = "Executive Name";

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

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

$tdataMy_Calls_Summary[".isUseiBox"] = false;




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

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

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


$tdataMy_Calls_Summary[".googleLikeFields"][] = "Nos";
$tdataMy_Calls_Summary[".googleLikeFields"][] = "Date";
$tdataMy_Calls_Summary[".googleLikeFields"][] = "Executive Name";
$tdataMy_Calls_Summary[".googleLikeFields"][] = "Comp";



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

$tdataMy_Calls_Summary[".isTableType"] = "list";


	

$tdataMy_Calls_Summary[".isDisplayLoading"] = true;

$tdataMy_Calls_Summary[".isResizeColumns"] = false;





$tdataMy_Calls_Summary[".pageSize"] = 6;

$gstrOrderBy = "ORDER BY Date(Date) DESC";
if(strlen($gstrOrderBy) && strtolower(substr($gstrOrderBy,0,8))!="order by")
	$gstrOrderBy = "order by ".$gstrOrderBy;
$tdataMy_Calls_Summary[".strOrderBy"] = $gstrOrderBy;
	
$tdataMy_Calls_Summary[".orderindexes"] = array();
$tdataMy_Calls_Summary[".orderindexes"][] = array(2, (0 ? "ASC" : "DESC"), "Date(Date)");

$tdataMy_Calls_Summary[".sqlHead"] = "SELECT COUNT(idCalls) AS Nos,  Date(Date) AS `Date`,  `Executive Name`,  Date(Now())-Date(Date) AS Comp";
$tdataMy_Calls_Summary[".sqlFrom"] = "FROM calls";
$tdataMy_Calls_Summary[".sqlWhereExpr"] = "(Date(Now())-Date(Date) <30)";
$tdataMy_Calls_Summary[".sqlTail"] = "GROUP BY Date(Date), `Executive Name`";




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

	$tableKeys = array();
	$tableKeys[] = "Executive Name";
	$tdataMy_Calls_Summary[".Keys"] = $tableKeys;

//	Nos
	$fdata = array();
	$fdata["strName"] = "Nos";
	$fdata["ownerTable"] = "";
		
		
		
	$fdata["FieldType"]= 3;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "Nos";
	
		$fdata["FullName"]= "COUNT(idCalls)";
	
		
		
		
		
		
				$fdata["Index"]= 1;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		
		
		
		
		$fdata["bAdvancedSearch"]=true; 
	
		
		
	//Begin validation
	$fdata["validateAs"] = array();
				$fdata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdataMy_Calls_Summary["Nos"]=$fdata;
//	Date
	$fdata = array();
	$fdata["strName"] = "Date";
	$fdata["ownerTable"] = "";
		
		
		
	$fdata["FieldType"]= 135;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Date";
	$fdata["ViewFormat"]= "Short Date";
	
		$fdata["ShowTime"]=true; 
	
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "Date";
	
		$fdata["FullName"]= "Date(Date)";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 2;
		$fdata["DateEditType"] = 11; 
	$fdata["InitialYearFactor"] = 100; 
	$fdata["LastYearFactor"] = 10; 
			
		$fdata["bListPage"]=true; 
	
		
		
		
		
		
		
		
		
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdataMy_Calls_Summary["Date"]=$fdata;
//	Executive Name
	$fdata = array();
	$fdata["strName"] = "Executive Name";
	$fdata["ownerTable"] = "calls";
		
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Lookup wizard";
	$fdata["ViewFormat"]= "";
	
		
		$fdata["LookupType"]=1;
	$fdata["pLookupType"] = 1;
	$fdata["freeInput"] = 0;	
	$fdata["autoCompleteFieldsOnEdit"] = 0;
	$fdata["autoCompleteFields"] = array();
										$fdata["LinkField"]="username";
	$fdata["LinkFieldType"]=200;
	$fdata["DisplayField"]="Full Name";
				$fdata["LookupTable"]="employee_list";
	$fdata["LookupOrderBy"]="";
																			
					
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "Executive_Name";
	
		$fdata["FullName"]= "`Executive Name`";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 3;
				
		
		
		
		
		
		
		
		
		
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				
		
				
		
		
		
			$tdataMy_Calls_Summary["Executive Name"]=$fdata;
//	Comp
	$fdata = array();
	$fdata["strName"] = "Comp";
	$fdata["ownerTable"] = "";
		
		
		
	$fdata["FieldType"]= 5;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "Number";
	
		
		
		
		$fdata["DecimalDigits"] = 2;
	
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "Comp";
	
		$fdata["FullName"]= "Date(Now())-Date(Date)";
	
		
		
		
		
		
				$fdata["Index"]= 4;
				$fdata["EditParams"]="";
			
		
		
		
		
		
		
		
		
		
	//Begin validation
	$fdata["validateAs"] = array();
				$fdata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						
		//End validation
	
				
		
				
		
		
		
			$tdataMy_Calls_Summary["Comp"]=$fdata;

	
$tables_data["My Calls Summary"]=&$tdataMy_Calls_Summary;
$field_labels["My_Calls_Summary"] = &$fieldLabelsMy_Calls_Summary;
$fieldToolTips["My Calls Summary"] = &$fieldToolTipsMy_Calls_Summary;

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

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

$mIndex = 1-1;
			$strOriginalDetailsTable="employee_list";
	$masterTablesData["My Calls Summary"][$mIndex] = array(
		  "mDataSourceTable"=>"My Home"
		, "mOriginalTable" => $strOriginalDetailsTable
		, "mShortTable" => "My_Home"
		, "masterKeys" => array()
		, "detailKeys" => array()
		, "dispChildCount" => "1"
		, "hideChild" => "0"	
		, "dispInfo" => "1"								
		, "previewOnList" => 1
		, "previewOnAdd" => 0
		, "previewOnEdit" => 0
		, "previewOnView" => 1
	);	
		$masterTablesData["My Calls Summary"][$mIndex]["masterKeys"][]="username";
		$masterTablesData["My Calls Summary"][$mIndex]["detailKeys"][]="Executive Name";

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

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










$proto493=array();
$proto493["m_strHead"] = "SELECT";
$proto493["m_strFieldList"] = "COUNT(idCalls) AS Nos,  Date(Date) AS `Date`,  `Executive Name`,  Date(Now())-Date(Date) AS Comp";
$proto493["m_strFrom"] = "FROM calls";
$proto493["m_strWhere"] = "(Date(Now())-Date(Date) <30)";
$proto493["m_strOrderBy"] = "ORDER BY Date(Date) DESC";
$proto493["m_strTail"] = "GROUP BY Date(Date), `Executive Name`";
$proto494=array();
$proto494["m_sql"] = "Date(Now())-Date(Date) <30";
$proto494["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLNonParsed(array(
	"m_sql" => "Date(Now())-Date(Date)"
));

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

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

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

$proto493["m_having"] = $obj;
$proto493["m_fieldlist"] = array();
						$proto498=array();
			$proto499=array();
$proto499["m_functiontype"] = "SQLF_COUNT";
$proto499["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "idCalls",
	"m_strTable" => "calls"
));

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

$proto498["m_expr"]=$obj;
$proto498["m_alias"] = "Nos";
$obj = new SQLFieldListItem($proto498);

$proto493["m_fieldlist"][]=$obj;
						$proto501=array();
			$proto502=array();
$proto502["m_functiontype"] = "SQLF_CUSTOM";
$proto502["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "Date"
));

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

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

$proto493["m_fieldlist"][]=$obj;
						$proto504=array();
			$obj = new SQLField(array(
	"m_strName" => "Executive Name",
	"m_strTable" => "calls"
));

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

$proto493["m_fieldlist"][]=$obj;
						$proto506=array();
			$obj = new SQLNonParsed(array(
	"m_sql" => "Date(Now())-Date(Date)"
));

$proto506["m_expr"]=$obj;
$proto506["m_alias"] = "Comp";
$obj = new SQLFieldListItem($proto506);

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

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

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

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

$proto493["m_fromlist"][]=$obj;
$proto493["m_groupby"] = array();
												$proto512=array();
						$proto513=array();
$proto513["m_functiontype"] = "SQLF_CUSTOM";
$proto513["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "Date"
));

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

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

$proto493["m_groupby"][]=$obj;
												$proto515=array();
						$obj = new SQLField(array(
	"m_strName" => "Executive Name",
	"m_strTable" => "calls"
));

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

$proto493["m_groupby"][]=$obj;
$proto493["m_orderby"] = array();
												$proto517=array();
						$proto518=array();
$proto518["m_functiontype"] = "SQLF_CUSTOM";
$proto518["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "Date"
));

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

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

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

$queryData_My_Calls_Summary = $obj;
$tdataMy_Calls_Summary[".sqlquery"] = $queryData_My_Calls_Summary;

$tableEvents["My Calls Summary"] = new eventsBase;

?>
