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


	
//	field labels
$fieldLabelsVisit_Details = array();
if(mlang_getcurrentlang()=="English")
{
	$fieldLabelsVisit_Details["English"]=array();
	$fieldToolTipsVisit_Details["English"]=array();
	$fieldLabelsVisit_Details["English"]["idvisit_register"] = "Idvisit Register";
	$fieldToolTipsVisit_Details["English"]["idvisit_register"] = "";
	$fieldLabelsVisit_Details["English"]["Employee_Name"] = "Employee Name";
	$fieldToolTipsVisit_Details["English"]["Employee Name"] = "";
	$fieldLabelsVisit_Details["English"]["Customer_Name"] = "Customer Name";
	$fieldToolTipsVisit_Details["English"]["Customer Name"] = "";
	$fieldLabelsVisit_Details["English"]["Contact_Person"] = "Contact Person";
	$fieldToolTipsVisit_Details["English"]["Contact Person"] = "";
	$fieldLabelsVisit_Details["English"]["Purpose_Of_Visit"] = "Purpose Of Visit";
	$fieldToolTipsVisit_Details["English"]["Purpose Of Visit"] = "";
	$fieldLabelsVisit_Details["English"]["MOM_Summary"] = "MOM Summary";
	$fieldToolTipsVisit_Details["English"]["MOM Summary"] = "";
	$fieldLabelsVisit_Details["English"]["Date_Of_Visit"] = "Date Of Visit";
	$fieldToolTipsVisit_Details["English"]["Date Of Visit"] = "";
	$fieldLabelsVisit_Details["English"]["Visit_Status"] = "Visit Status";
	$fieldToolTipsVisit_Details["English"]["Visit Status"] = "";
	if (count($fieldToolTipsVisit_Details["English"])){
		$tdataVisit_Details[".isUseToolTips"]=true;
	}
}


	
	$tdataVisit_Details[".NCSearch"]=true;

	

$tdataVisit_Details[".shortTableName"] = "Visit_Details";
$tdataVisit_Details[".nSecOptions"] = 2;
$tdataVisit_Details[".recsPerRowList"] = 1;	
$tdataVisit_Details[".tableGroupBy"] = "0";
$tdataVisit_Details[".mainTableOwnerID"] = "Employee Name";
$tdataVisit_Details[".moveNext"] = 1;




$tdataVisit_Details[".showAddInPopup"] = false;

$tdataVisit_Details[".showEditInPopup"] = false;

$tdataVisit_Details[".showViewInPopup"] = false;


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

$tdataVisit_Details[".listAjax"] = false;

	$tdataVisit_Details[".audit"] = false;

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




$tdataVisit_Details[".showSimpleSearchOptions"] = false;

$tdataVisit_Details[".showSearchPanel"] = true;


$tdataVisit_Details[".isUseAjaxSuggest"] = true;

$tdataVisit_Details[".rowHighlite"] = true;


// button handlers file names

$tdataVisit_Details[".addPageEvents"] = false;

$tdataVisit_Details[".arrKeyFields"][] = "idvisit_register";

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

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

$tdataVisit_Details[".isUseiBox"] = false;



$tdataVisit_Details[".isUseInlineAdd"] = true;

$tdataVisit_Details[".isUseInlineEdit"] = true;
$tdataVisit_Details[".isUseInlineJs"] = $tdataVisit_Details[".isUseInlineAdd"] || $tdataVisit_Details[".isUseInlineEdit"];

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



$tdataVisit_Details[".googleLikeFields"][] = "idvisit_register";
$tdataVisit_Details[".googleLikeFields"][] = "Employee Name";
$tdataVisit_Details[".googleLikeFields"][] = "Contact Person";
$tdataVisit_Details[".googleLikeFields"][] = "Purpose Of Visit";
$tdataVisit_Details[".googleLikeFields"][] = "MOM Summary";
$tdataVisit_Details[".googleLikeFields"][] = "Date Of Visit";
$tdataVisit_Details[".googleLikeFields"][] = "Visit Status";
$tdataVisit_Details[".googleLikeFields"][] = "Customer Name";



$tdataVisit_Details[".advSearchFields"][] = "idvisit_register";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("idvisit_register", $tdataVisit_Details[".allSearchFields"])) 
{
	$tdataVisit_Details[".allSearchFields"][] = "idvisit_register";	
}
$tdataVisit_Details[".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", $tdataVisit_Details[".allSearchFields"])) 
{
	$tdataVisit_Details[".allSearchFields"][] = "Employee Name";	
}
$tdataVisit_Details[".advSearchFields"][] = "Contact Person";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("Contact Person", $tdataVisit_Details[".allSearchFields"])) 
{
	$tdataVisit_Details[".allSearchFields"][] = "Contact Person";	
}
$tdataVisit_Details[".advSearchFields"][] = "Purpose Of Visit";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("Purpose Of Visit", $tdataVisit_Details[".allSearchFields"])) 
{
	$tdataVisit_Details[".allSearchFields"][] = "Purpose Of Visit";	
}
$tdataVisit_Details[".advSearchFields"][] = "MOM Summary";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("MOM Summary", $tdataVisit_Details[".allSearchFields"])) 
{
	$tdataVisit_Details[".allSearchFields"][] = "MOM Summary";	
}
$tdataVisit_Details[".advSearchFields"][] = "Date Of Visit";
// 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 Of Visit", $tdataVisit_Details[".allSearchFields"])) 
{
	$tdataVisit_Details[".allSearchFields"][] = "Date Of Visit";	
}
$tdataVisit_Details[".advSearchFields"][] = "Visit Status";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("Visit Status", $tdataVisit_Details[".allSearchFields"])) 
{
	$tdataVisit_Details[".allSearchFields"][] = "Visit Status";	
}
$tdataVisit_Details[".advSearchFields"][] = "Customer 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("Customer Name", $tdataVisit_Details[".allSearchFields"])) 
{
	$tdataVisit_Details[".allSearchFields"][] = "Customer Name";	
}

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


	

$tdataVisit_Details[".isDisplayLoading"] = true;

$tdataVisit_Details[".isResizeColumns"] = false;





$tdataVisit_Details[".pageSize"] = 5;

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

$tdataVisit_Details[".sqlHead"] = "SELECT idvisit_register,  `Employee Name`,  `Contact Person`,  `Purpose Of Visit`,  `MOM Summary`,  `Date Of Visit`,  `Visit Status`,  `Customer Name`";
$tdataVisit_Details[".sqlFrom"] = "FROM visit_register";
$tdataVisit_Details[".sqlWhereExpr"] = "";
$tdataVisit_Details[".sqlTail"] = "";




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

	$tableKeys = array();
	$tableKeys[] = "idvisit_register";
	$tdataVisit_Details[".Keys"] = $tableKeys;

//	idvisit_register
	$fdata = array();
	$fdata["strName"] = "idvisit_register";
	$fdata["ownerTable"] = "visit_register";
		$fdata["Label"]="Idvisit Register"; 
	
		
		
	$fdata["FieldType"]= 3;
	
		$fdata["AutoInc"]=true;
	
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "idvisit_register";
	
		$fdata["FullName"]= "idvisit_register";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 1;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		
		
		
		$fdata["bViewPage"]=true; 
	
		
		
		
	//Begin validation
	$fdata["validateAs"] = array();
				$fdata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdataVisit_Details["idvisit_register"]=$fdata;
//	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["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 2;
				
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		
		
		
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdataVisit_Details["Employee Name"]=$fdata;
//	Contact Person
	$fdata = array();
	$fdata["strName"] = "Contact Person";
	$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"]="Name";
	$fdata["LinkFieldType"]=200;
	$fdata["DisplayField"]="Name";
				$fdata["LookupTable"]="cust_list_contact_person";
	$fdata["LookupOrderBy"]="";
										$fdata["UseCategory"]=true; 
	$fdata["CategoryControl"]="Customer Name"; 
	$fdata["CategoryFilter"]="Company Name"; 
										$fdata["SimpleAdd"]=true;
	
					
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "Contact_Person";
	
		$fdata["FullName"]= "`Contact Person`";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 3;
				
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		
		
		
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdataVisit_Details["Contact Person"]=$fdata;
//	Purpose Of Visit
	$fdata = array();
	$fdata["strName"] = "Purpose Of Visit";
	$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"]="Purpose Of Visit";
	$fdata["LinkFieldType"]=200;
	$fdata["DisplayField"]="Purpose Of Visit";
				$fdata["LookupTable"]="purpose_of_visit";
	$fdata["LookupOrderBy"]="";
																			$fdata["SimpleAdd"]=true;
	
					
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "Purpose_Of_Visit";
	
		$fdata["FullName"]= "`Purpose Of Visit`";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 4;
				
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		
		
		
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdataVisit_Details["Purpose Of Visit"]=$fdata;
//	MOM Summary
	$fdata = array();
	$fdata["strName"] = "MOM Summary";
	$fdata["ownerTable"] = "visit_register";
		
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text area";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "MOM_Summary";
	
		$fdata["FullName"]= "`MOM Summary`";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 5;
			$fdata["EditParams"] = "";
			$fdata["EditParams"].= " rows=100";
		$fdata["nRows"] = 100;
			$fdata["EditParams"].= " cols=200";
		$fdata["nCols"] = 200;
		
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		
		
		
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdataVisit_Details["MOM Summary"]=$fdata;
//	Date Of Visit
	$fdata = array();
	$fdata["strName"] = "Date Of Visit";
	$fdata["ownerTable"] = "visit_register";
		
		
		
	$fdata["FieldType"]= 135;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Date";
	$fdata["ViewFormat"]= "Short Date";
	
		$fdata["ShowTime"]=true; 
	
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "Date_Of_Visit";
	
		$fdata["FullName"]= "`Date Of Visit`";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 6;
		$fdata["DateEditType"] = 11; 
	$fdata["InitialYearFactor"] = 100; 
	$fdata["LastYearFactor"] = 10; 
			
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		
		
		
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdataVisit_Details["Date Of Visit"]=$fdata;
//	Visit Status
	$fdata = array();
	$fdata["strName"] = "Visit Status";
	$fdata["ownerTable"] = "visit_register";
		
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Lookup wizard";
	$fdata["ViewFormat"]= "";
	
		
		$fdata["LookupType"]=0;
	$fdata["pLookupType"] = 0;
	$fdata["freeInput"] = 0;	
	$fdata["autoCompleteFieldsOnEdit"] = 0;
	$fdata["autoCompleteFields"] = array();
									$fdata["LookupValues"]=array();
	$fdata["LookupValues"][]="Planned";
	$fdata["LookupValues"][]="Completed";
	$fdata["LookupValues"][]="Cancelled";
			
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "Visit_Status";
	
		$fdata["FullName"]= "`Visit Status`";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 7;
				
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		
		
		
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdataVisit_Details["Visit Status"]=$fdata;
//	Customer Name
	$fdata = array();
	$fdata["strName"] = "Customer 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["LCType"]= 1;
								$fdata["LinkField"]="Customer Name";
	$fdata["LinkFieldType"]=200;
	$fdata["DisplayField"]="Customer Name";
				$fdata["LookupTable"]="customer_list";
	$fdata["LookupOrderBy"]="";
													$fdata["FastType"]=true; 
							$fdata["SimpleAdd"]=true;
	
				//	dependent dropdowns	
	$fdata["DependentLookups"]=array();
	$fdata["DependentLookups"][]="Contact Person";
					
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "Customer_Name";
	
		$fdata["FullName"]= "`Customer Name`";
	
		
		
		
		
		
				$fdata["Index"]= 8;
				
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		
		
		
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdataVisit_Details["Customer Name"]=$fdata;

	
$tables_data["Visit-Details"]=&$tdataVisit_Details;
$field_labels["Visit_Details"] = &$fieldLabelsVisit_Details;
$fieldToolTips["Visit-Details"] = &$fieldToolTipsVisit_Details;

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

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

$mIndex = 1-1;
			$strOriginalDetailsTable="customer_list";
	$masterTablesData["Visit-Details"][$mIndex] = array(
		  "mDataSourceTable"=>"Active Customers"
		, "mOriginalTable" => $strOriginalDetailsTable
		, "mShortTable" => "Active_Customers"
		, "masterKeys" => array()
		, "detailKeys" => array()
		, "dispChildCount" => "1"
		, "hideChild" => "0"	
		, "dispInfo" => "1"								
		, "previewOnList" => 2
		, "previewOnAdd" => 0
		, "previewOnEdit" => 1
		, "previewOnView" => 1
	);	
		$masterTablesData["Visit-Details"][$mIndex]["masterKeys"][]="Customer Name";
		$masterTablesData["Visit-Details"][$mIndex]["detailKeys"][]="Customer Name";

$mIndex = 2-1;
			$strOriginalDetailsTable="customer_list";
	$masterTablesData["Visit-Details"][$mIndex] = array(
		  "mDataSourceTable"=>"Short-Listed Customers"
		, "mOriginalTable" => $strOriginalDetailsTable
		, "mShortTable" => "Short_Listed_Customers"
		, "masterKeys" => array()
		, "detailKeys" => array()
		, "dispChildCount" => "1"
		, "hideChild" => "0"	
		, "dispInfo" => "1"								
		, "previewOnList" => 1
		, "previewOnAdd" => 0
		, "previewOnEdit" => 1
		, "previewOnView" => 1
	);	
		$masterTablesData["Visit-Details"][$mIndex]["masterKeys"][]="Customer Name";
		$masterTablesData["Visit-Details"][$mIndex]["detailKeys"][]="Customer Name";

$mIndex = 3-1;
			$strOriginalDetailsTable="customer_list";
	$masterTablesData["Visit-Details"][$mIndex] = array(
		  "mDataSourceTable"=>"Potential Customer List"
		, "mOriginalTable" => $strOriginalDetailsTable
		, "mShortTable" => "Potential_Customer_List"
		, "masterKeys" => array()
		, "detailKeys" => array()
		, "dispChildCount" => "1"
		, "hideChild" => "0"	
		, "dispInfo" => "1"								
		, "previewOnList" => 1
		, "previewOnAdd" => 0
		, "previewOnEdit" => 0
		, "previewOnView" => 1
	);	
		$masterTablesData["Visit-Details"][$mIndex]["masterKeys"][]="Customer Name";
		$masterTablesData["Visit-Details"][$mIndex]["detailKeys"][]="Customer Name";

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

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










$proto328=array();
$proto328["m_strHead"] = "SELECT";
$proto328["m_strFieldList"] = "idvisit_register,  `Employee Name`,  `Contact Person`,  `Purpose Of Visit`,  `MOM Summary`,  `Date Of Visit`,  `Visit Status`,  `Customer Name`";
$proto328["m_strFrom"] = "FROM visit_register";
$proto328["m_strWhere"] = "";
$proto328["m_strOrderBy"] = "ORDER BY idvisit_register DESC";
$proto328["m_strTail"] = "";
$proto329=array();
$proto329["m_sql"] = "";
$proto329["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

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

$proto328["m_having"] = $obj;
$proto328["m_fieldlist"] = array();
						$proto333=array();
			$obj = new SQLField(array(
	"m_strName" => "idvisit_register",
	"m_strTable" => "visit_register"
));

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

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

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

$proto328["m_fieldlist"][]=$obj;
						$proto337=array();
			$obj = new SQLField(array(
	"m_strName" => "Contact Person",
	"m_strTable" => "visit_register"
));

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

$proto328["m_fieldlist"][]=$obj;
						$proto339=array();
			$obj = new SQLField(array(
	"m_strName" => "Purpose Of Visit",
	"m_strTable" => "visit_register"
));

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

$proto328["m_fieldlist"][]=$obj;
						$proto341=array();
			$obj = new SQLField(array(
	"m_strName" => "MOM Summary",
	"m_strTable" => "visit_register"
));

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

$proto328["m_fieldlist"][]=$obj;
						$proto343=array();
			$obj = new SQLField(array(
	"m_strName" => "Date Of Visit",
	"m_strTable" => "visit_register"
));

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

$proto328["m_fieldlist"][]=$obj;
						$proto345=array();
			$obj = new SQLField(array(
	"m_strName" => "Visit Status",
	"m_strTable" => "visit_register"
));

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

$proto328["m_fieldlist"][]=$obj;
						$proto347=array();
			$obj = new SQLField(array(
	"m_strName" => "Customer Name",
	"m_strTable" => "visit_register"
));

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

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

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

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

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

$proto328["m_fromlist"][]=$obj;
$proto328["m_groupby"] = array();
$proto328["m_orderby"] = array();
												$proto353=array();
						$obj = new SQLField(array(
	"m_strName" => "idvisit_register",
	"m_strTable" => "visit_register"
));

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

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

$queryData_Visit_Details = $obj;
$tdataVisit_Details[".sqlquery"] = $queryData_Visit_Details;

$tableEvents["Visit-Details"] = new eventsBase;

?>
