<?php
$tdataVisit_Performance=array();
	$tdataVisit_Performance[".ShortName"]="Visit_Performance";
	$tdataVisit_Performance[".OwnerID"]="";
	$tdataVisit_Performance[".OriginalTable"]="visit_register";


	
//	field labels
$fieldLabelsVisit_Performance = array();
if(mlang_getcurrentlang()=="English")
{
	$fieldLabelsVisit_Performance["English"]=array();
	$fieldToolTipsVisit_Performance["English"]=array();
	$fieldLabelsVisit_Performance["English"]["Visit_Status"] = "Visit Status";
	$fieldToolTipsVisit_Performance["English"]["Visit Status"] = "";
	$fieldLabelsVisit_Performance["English"]["Nos"] = "Nos";
	$fieldToolTipsVisit_Performance["English"]["Nos"] = "";
	$fieldLabelsVisit_Performance["English"]["Date"] = "Date";
	$fieldToolTipsVisit_Performance["English"]["Date"] = "";
	if (count($fieldToolTipsVisit_Performance["English"])){
		$tdataVisit_Performance[".isUseToolTips"]=true;
	}
}


	
	$tdataVisit_Performance[".NCSearch"]=true;

	
	$tdataVisit_Performance[".ChartRefreshTime"] = 0;

$tdataVisit_Performance[".shortTableName"] = "Visit_Performance";
$tdataVisit_Performance[".nSecOptions"] = 0;
$tdataVisit_Performance[".recsPerRowList"] = 1;	
$tdataVisit_Performance[".tableGroupBy"] = "1";
$tdataVisit_Performance[".mainTableOwnerID"] = "";
$tdataVisit_Performance[".moveNext"] = 1;




$tdataVisit_Performance[".showAddInPopup"] = false;

$tdataVisit_Performance[".showEditInPopup"] = false;

$tdataVisit_Performance[".showViewInPopup"] = false;


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

$tdataVisit_Performance[".listAjax"] = false;

	$tdataVisit_Performance[".audit"] = false;

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



$tdataVisit_Performance[".delete"] = true;

$tdataVisit_Performance[".showSimpleSearchOptions"] = false;

$tdataVisit_Performance[".showSearchPanel"] = true;


$tdataVisit_Performance[".isUseAjaxSuggest"] = true;



// button handlers file names

$tdataVisit_Performance[".addPageEvents"] = false;


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

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

$tdataVisit_Performance[".isUseiBox"] = false;



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

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

$tdataVisit_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", $tdataVisit_Performance[".allSearchFields"]))
{
	$tdataVisit_Performance[".allSearchFields"][] = "Date";	
}


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



$tdataVisit_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", $tdataVisit_Performance[".allSearchFields"])) 
{
	$tdataVisit_Performance[".allSearchFields"][] = "Date";	
}

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


	

$tdataVisit_Performance[".isDisplayLoading"] = true;

$tdataVisit_Performance[".isResizeColumns"] = false;




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

$tdataVisit_Performance[".sqlHead"] = "SELECT COUNT(visit_register.idvisit_register) AS Nos,  Date(visit_register.`Date Of Visit`) AS `Date`,  visit_register.`Visit Status`";
$tdataVisit_Performance[".sqlFrom"] = "FROM visit_register  INNER JOIN customer_list ON visit_register.`Customer Name` = customer_list.`Customer Name`";
$tdataVisit_Performance[".sqlWhereExpr"] = "(visit_register.`Visit Status` ='completed')";
$tdataVisit_Performance[".sqlTail"] = "GROUP BY Date(visit_register.`Date Of Visit`), visit_register.`Visit Status`";




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

	$tableKeys = array();
	$tdataVisit_Performance[".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(visit_register.idvisit_register)";
	
		
		
		
		
		
				$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
	
				
		
		
		
		
		
			$tdataVisit_Performance["Nos"]=$fdata;
//	Date
	$fdata = array();
	$fdata["strName"] = "Date";
	$fdata["ownerTable"] = "";
		
		
		
	$fdata["FieldType"]= 7;
	
		
			$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["bInlineAdd"]=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;
	
		
		
		
		
		
			$tdataVisit_Performance["Date"]=$fdata;
//	Visit Status
	$fdata = array();
	$fdata["strName"] = "Visit Status";
	$fdata["ownerTable"] = "visit_register";
		
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "Visit_Status";
	
		$fdata["FullName"]= "visit_register.`Visit Status`";
	
		
		
		
		
		
				$fdata["Index"]= 3;
				$fdata["EditParams"]="";
			$fdata["EditParams"].= " maxlength=45";
		
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				
		
		
		
		
		
			$tdataVisit_Performance["Visit Status"]=$fdata;

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

<attr value="parameters">
<attr value="0">
<attr value="name">Nos</attr>
<attr value="currencyFormat">0</attr>
<attr value="decimalFormat">0</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("Visit Performance").'</attr>
<attr value="foot">'.xmlencode("Visit Performance").'</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">false</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">Nos</attr>
		<attr value="label">Nos</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 value="2">
		<attr value="name">Visit Status</attr>
		<attr value="label">Visit Status</attr>
		<attr value="search"></attr>
	</attr>
</attr>


<attr value="settings">
<attr value="name">Visit Status</attr>
<attr value="short_table_name">Visit_Performance</attr>
</attr>

</chart>';
	
$tables_data["Visit Performance"]=&$tdataVisit_Performance;
$field_labels["Visit_Performance"] = &$fieldLabelsVisit_Performance;
$fieldToolTips["Visit Performance"] = &$fieldToolTipsVisit_Performance;

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

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

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

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










$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "COUNT(visit_register.idvisit_register) AS Nos,  Date(visit_register.`Date Of Visit`) AS `Date`,  visit_register.`Visit Status`";
$proto0["m_strFrom"] = "FROM visit_register  INNER JOIN customer_list ON visit_register.`Customer Name` = customer_list.`Customer Name`";
$proto0["m_strWhere"] = "(visit_register.`Visit Status` ='completed')";
$proto0["m_strOrderBy"] = "ORDER BY Date(visit_register.`Date Of Visit`)";
$proto0["m_strTail"] = "GROUP BY Date(visit_register.`Date Of Visit`), visit_register.`Visit Status`";
$proto1=array();
$proto1["m_sql"] = "visit_register.`Visit Status` ='completed'";
$proto1["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "Visit Status",
	"m_strTable" => "visit_register"
));

$proto1["m_column"]=$obj;
$proto1["m_contained"] = array();
$proto1["m_strCase"] = "='completed'";
$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" => "idvisit_register",
	"m_strTable" => "visit_register"
));

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

$proto5["m_expr"]=$obj;
$proto5["m_alias"] = "Nos";
$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" => "visit_register.`Date Of Visit`"
));

$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;
						$proto11=array();
			$obj = new SQLField(array(
	"m_strName" => "Visit Status",
	"m_strTable" => "visit_register"
));

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

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

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

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

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

$proto0["m_fromlist"][]=$obj;
												$proto17=array();
$proto17["m_link"] = "SQLL_INNERJOIN";
			$proto18=array();
$proto18["m_strName"] = "customer_list";
$proto18["m_columns"] = array();
$proto18["m_columns"][] = "idCL";
$proto18["m_columns"][] = "Created on";
$proto18["m_columns"][] = "Region";
$proto18["m_columns"][] = "Customer Name";
$proto18["m_columns"][] = "Address";
$proto18["m_columns"][] = "City";
$proto18["m_columns"][] = "State";
$proto18["m_columns"][] = "Country";
$proto18["m_columns"][] = "Postal Code";
$proto18["m_columns"][] = "Web address";
$proto18["m_columns"][] = "Area";
$proto18["m_columns"][] = "Customer_Category";
$proto18["m_columns"][] = "Breif About the Company";
$proto18["m_columns"][] = "Existing Setup";
$proto18["m_columns"][] = "Interaction Summary";
$proto18["m_columns"][] = "Commercial Summary";
$proto18["m_columns"][] = "Customer Status";
$proto18["m_columns"][] = "Assigned Executive";
$proto18["m_columns"][] = "Assigned Date";
$proto18["m_columns"][] = "Last Updated on";
$proto18["m_columns"][] = "Aligned Partner";
$obj = new SQLTable($proto18);

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

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

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

$proto0["m_fromlist"][]=$obj;
$proto0["m_groupby"] = array();
												$proto21=array();
						$proto22=array();
$proto22["m_functiontype"] = "SQLF_CUSTOM";
$proto22["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "visit_register.`Date Of Visit`"
));

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

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

$proto0["m_groupby"][]=$obj;
												$proto24=array();
						$obj = new SQLField(array(
	"m_strName" => "Visit Status",
	"m_strTable" => "visit_register"
));

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

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

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

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

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

$queryData_Visit_Performance = $obj;
$tdataVisit_Performance[".sqlquery"] = $queryData_Visit_Performance;

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

?>
