<?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"));










$proto139=array();
$proto139["m_strHead"] = "SELECT";
$proto139["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";
$proto139["m_strFrom"] = "FROM visit_register";
$proto139["m_strWhere"] = "(Date(Now())-Date(visit_register.`Date Of Visit`) <30)";
$proto139["m_strOrderBy"] = "ORDER BY Date(visit_register.`Date Of Visit`) DESC";
$proto139["m_strTail"] = "GROUP BY `Employee Name`, Date(visit_register.`Date Of Visit`)";
$proto140=array();
$proto140["m_sql"] = "Date(Now())-Date(visit_register.`Date Of Visit`) <30";
$proto140["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLNonParsed(array(
	"m_sql" => "Date(Now())-Date(visit_register.`Date Of Visit`)"
));

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

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

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

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

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

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

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

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

$proto139["m_fieldlist"][]=$obj;
						$proto149=array();
			$proto150=array();
$proto150["m_functiontype"] = "SQLF_COUNT";
$proto150["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "idvisit_register",
	"m_strTable" => "visit_register"
));

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

?>
