<?php
$tdataMy_Visit_Summary=array();
	$tdataMy_Visit_Summary[".NumberOfChars"]=80; 
	$tdataMy_Visit_Summary[".ShortName"]="My_Visit_Summary";
	$tdataMy_Visit_Summary[".OwnerID"]="Employee Name";
	$tdataMy_Visit_Summary[".OriginalTable"]="visit_register";


	
//	field labels
$fieldLabelsMy_Visit_Summary = array();
if(mlang_getcurrentlang()=="English")
{
	$fieldLabelsMy_Visit_Summary["English"]=array();
	$fieldToolTipsMy_Visit_Summary["English"]=array();
	$fieldLabelsMy_Visit_Summary["English"]["Employee_Name"] = "Employee Name";
	$fieldToolTipsMy_Visit_Summary["English"]["Employee Name"] = "";
	$fieldLabelsMy_Visit_Summary["English"]["Nos"] = "Nos";
	$fieldToolTipsMy_Visit_Summary["English"]["Nos"] = "";
	$fieldLabelsMy_Visit_Summary["English"]["Date"] = "Date";
	$fieldToolTipsMy_Visit_Summary["English"]["Date"] = "";
	$fieldLabelsMy_Visit_Summary["English"]["comp"] = "Comp";
	$fieldToolTipsMy_Visit_Summary["English"]["comp"] = "";
	if (count($fieldToolTipsMy_Visit_Summary["English"])){
		$tdataMy_Visit_Summary[".isUseToolTips"]=true;
	}
}


	
	$tdataMy_Visit_Summary[".NCSearch"]=true;

	

$tdataMy_Visit_Summary[".shortTableName"] = "My_Visit_Summary";
$tdataMy_Visit_Summary[".nSecOptions"] = 1;
$tdataMy_Visit_Summary[".recsPerRowList"] = 1;	
$tdataMy_Visit_Summary[".tableGroupBy"] = "1";
$tdataMy_Visit_Summary[".mainTableOwnerID"] = "Employee Name";
$tdataMy_Visit_Summary[".moveNext"] = 1;




$tdataMy_Visit_Summary[".showAddInPopup"] = false;

$tdataMy_Visit_Summary[".showEditInPopup"] = false;

$tdataMy_Visit_Summary[".showViewInPopup"] = false;


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

$tdataMy_Visit_Summary[".listAjax"] = false;

	$tdataMy_Visit_Summary[".audit"] = false;

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




$tdataMy_Visit_Summary[".showSimpleSearchOptions"] = false;

$tdataMy_Visit_Summary[".showSearchPanel"] = true;


$tdataMy_Visit_Summary[".isUseAjaxSuggest"] = true;

$tdataMy_Visit_Summary[".rowHighlite"] = true;


// button handlers file names

$tdataMy_Visit_Summary[".addPageEvents"] = false;

$tdataMy_Visit_Summary[".arrKeyFields"][] = "Employee Name";

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

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

$tdataMy_Visit_Summary[".isUseiBox"] = false;




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

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

$tdataMy_Visit_Summary[".globSearchFields"][] = "Employee 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("Employee Name", $tdataMy_Visit_Summary[".allSearchFields"]))
{
	$tdataMy_Visit_Summary[".allSearchFields"][] = "Employee Name";	
}
$tdataMy_Visit_Summary[".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", $tdataMy_Visit_Summary[".allSearchFields"]))
{
	$tdataMy_Visit_Summary[".allSearchFields"][] = "Date";	
}
$tdataMy_Visit_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_Visit_Summary[".allSearchFields"]))
{
	$tdataMy_Visit_Summary[".allSearchFields"][] = "Nos";	
}


$tdataMy_Visit_Summary[".googleLikeFields"][] = "comp";
$tdataMy_Visit_Summary[".googleLikeFields"][] = "Employee Name";
$tdataMy_Visit_Summary[".googleLikeFields"][] = "Date";
$tdataMy_Visit_Summary[".googleLikeFields"][] = "Nos";



$tdataMy_Visit_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_Visit_Summary[".allSearchFields"])) 
{
	$tdataMy_Visit_Summary[".allSearchFields"][] = "comp";	
}
$tdataMy_Visit_Summary[".advSearchFields"][] = "Employee 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("Employee Name", $tdataMy_Visit_Summary[".allSearchFields"])) 
{
	$tdataMy_Visit_Summary[".allSearchFields"][] = "Employee Name";	
}
$tdataMy_Visit_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_Visit_Summary[".allSearchFields"])) 
{
	$tdataMy_Visit_Summary[".allSearchFields"][] = "Date";	
}
$tdataMy_Visit_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_Visit_Summary[".allSearchFields"])) 
{
	$tdataMy_Visit_Summary[".allSearchFields"][] = "Nos";	
}

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


	

$tdataMy_Visit_Summary[".isDisplayLoading"] = true;

$tdataMy_Visit_Summary[".isResizeColumns"] = false;





$tdataMy_Visit_Summary[".pageSize"] = 6;

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

$tdataMy_Visit_Summary[".sqlHead"] = "SELECT `Employee Name`,  Date(visit_register.`Date Of Visit`) AS `Date`,  COUNT(idvisit_register) AS Nos,  Date(Now())-Date(visit_register.`Date Of Visit`) AS comp";
$tdataMy_Visit_Summary[".sqlFrom"] = "FROM visit_register";
$tdataMy_Visit_Summary[".sqlWhereExpr"] = "(Date(Now())-Date(visit_register.`Date Of Visit`) <30)";
$tdataMy_Visit_Summary[".sqlTail"] = "GROUP BY `Employee Name`, Date(visit_register.`Date Of Visit`)";




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

	$tableKeys = array();
	$tableKeys[] = "Employee Name";
	$tdataMy_Visit_Summary[".Keys"] = $tableKeys;

//	Employee Name
	$fdata = array();
	$fdata["strName"] = "Employee Name";
	$fdata["ownerTable"] = "visit_register";
		
		
		
	$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"]= "Employee_Name";
	
		$fdata["FullName"]= "`Employee Name`";
	
		
		
		
		
		
				$fdata["Index"]= 1;
				
		
		
		
		
		
		
		$fdata["bAdvancedSearch"]=true; 
	
		
		
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				
		
				
		
		
		
			$tdataMy_Visit_Summary["Employee Name"]=$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(visit_register.`Date Of Visit`)";
	
		
		
		
		
		
				$fdata["Index"]= 2;
		$fdata["DateEditType"] = 13; 
	$fdata["InitialYearFactor"] = 100; 
	$fdata["LastYearFactor"] = 10; 
			
		$fdata["bListPage"]=true; 
	
		
		
		
		
		
		$fdata["bAdvancedSearch"]=true; 
	
		
		
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdataMy_Visit_Summary["Date"]=$fdata;
//	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(idvisit_register)";
	
		
		
		
		
		
				$fdata["Index"]= 3;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		
		
		
		
		$fdata["bAdvancedSearch"]=true; 
	
		
		
	//Begin validation
	$fdata["validateAs"] = array();
				$fdata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdataMy_Visit_Summary["Nos"]=$fdata;
//	comp
	$fdata = array();
	$fdata["strName"] = "comp";
	$fdata["ownerTable"] = "";
		$fdata["Label"]="Comp"; 
	
		
		
	$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(visit_register.`Date Of Visit`)";
	
		
		
		
		
		
				$fdata["Index"]= 4;
				$fdata["EditParams"]="";
			
		
		
		
		
		
		
		
		
		
	//Begin validation
	$fdata["validateAs"] = array();
				$fdata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						
		//End validation
	
				
		
				
		
		
		
			$tdataMy_Visit_Summary["comp"]=$fdata;

	
$tables_data["My Visit Summary"]=&$tdataMy_Visit_Summary;
$field_labels["My_Visit_Summary"] = &$fieldLabelsMy_Visit_Summary;
$fieldToolTips["My Visit Summary"] = &$fieldToolTipsMy_Visit_Summary;

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

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

$mIndex = 1-1;
			$strOriginalDetailsTable="employee_list";
	$masterTablesData["My Visit 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 Visit Summary"][$mIndex]["masterKeys"][]="username";
		$masterTablesData["My Visit Summary"][$mIndex]["detailKeys"][]="Employee Name";

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

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










$proto448=array();
$proto448["m_strHead"] = "SELECT";
$proto448["m_strFieldList"] = "`Employee Name`,  Date(visit_register.`Date Of Visit`) AS `Date`,  COUNT(idvisit_register) AS Nos,  Date(Now())-Date(visit_register.`Date Of Visit`) AS comp";
$proto448["m_strFrom"] = "FROM visit_register";
$proto448["m_strWhere"] = "(Date(Now())-Date(visit_register.`Date Of Visit`) <30)";
$proto448["m_strOrderBy"] = "ORDER BY Date(visit_register.`Date Of Visit`) DESC";
$proto448["m_strTail"] = "GROUP BY `Employee Name`, Date(visit_register.`Date Of Visit`)";
$proto449=array();
$proto449["m_sql"] = "Date(Now())-Date(visit_register.`Date Of Visit`) <30";
$proto449["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLNonParsed(array(
	"m_sql" => "Date(Now())-Date(visit_register.`Date Of Visit`)"
));

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

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

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

$proto448["m_having"] = $obj;
$proto448["m_fieldlist"] = array();
						$proto453=array();
			$obj = new SQLField(array(
	"m_strName" => "Employee Name",
	"m_strTable" => "visit_register"
));

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

$proto448["m_fieldlist"][]=$obj;
						$proto455=array();
			$proto456=array();
$proto456["m_functiontype"] = "SQLF_CUSTOM";
$proto456["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "visit_register.`Date Of Visit`"
));

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

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

$proto448["m_fieldlist"][]=$obj;
						$proto458=array();
			$proto459=array();
$proto459["m_functiontype"] = "SQLF_COUNT";
$proto459["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "idvisit_register",
	"m_strTable" => "visit_register"
));

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

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

$proto448["m_fieldlist"][]=$obj;
						$proto461=array();
			$obj = new SQLNonParsed(array(
	"m_sql" => "Date(Now())-Date(visit_register.`Date Of Visit`)"
));

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

$proto448["m_fieldlist"][]=$obj;
$proto448["m_fromlist"] = array();
												$proto463=array();
$proto463["m_link"] = "SQLL_MAIN";
			$proto464=array();
$proto464["m_strName"] = "visit_register";
$proto464["m_columns"] = array();
$proto464["m_columns"][] = "idvisit_register";
$proto464["m_columns"][] = "Lead_ID";
$proto464["m_columns"][] = "Recorded Date";
$proto464["m_columns"][] = "Employee Name";
$proto464["m_columns"][] = "Customer Name";
$proto464["m_columns"][] = "Contact Person";
$proto464["m_columns"][] = "Purpose Of Visit";
$proto464["m_columns"][] = "MOM Summary";
$proto464["m_columns"][] = "Voucher Status";
$proto464["m_columns"][] = "Date Of Visit";
$proto464["m_columns"][] = "Mode Of Travel";
$proto464["m_columns"][] = "Travel Expense";
$proto464["m_columns"][] = "Expense Remarks";
$proto464["m_columns"][] = "Visit Status";
$proto464["m_columns"][] = "Reporting Manager";
$proto464["m_columns"][] = "Approved Expense";
$proto464["m_columns"][] = "Approved Date";
$proto464["m_columns"][] = "Voucher Processed Date";
$proto464["m_columns"][] = "Expense Claim Date";
$obj = new SQLTable($proto464);

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

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

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

$proto448["m_fromlist"][]=$obj;
$proto448["m_groupby"] = array();
												$proto467=array();
						$obj = new SQLField(array(
	"m_strName" => "Employee Name",
	"m_strTable" => "visit_register"
));

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

$proto448["m_groupby"][]=$obj;
												$proto469=array();
						$proto470=array();
$proto470["m_functiontype"] = "SQLF_CUSTOM";
$proto470["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "visit_register.`Date Of Visit`"
));

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

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

$proto448["m_groupby"][]=$obj;
$proto448["m_orderby"] = array();
												$proto472=array();
						$proto473=array();
$proto473["m_functiontype"] = "SQLF_CUSTOM";
$proto473["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "visit_register.`Date Of Visit`"
));

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

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

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

$queryData_My_Visit_Summary = $obj;
$tdataMy_Visit_Summary[".sqlquery"] = $queryData_My_Visit_Summary;

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

?>
