<?php
$tdataallocation_ = array();
$tdataallocation_[".searchableFields"] = array();
$tdataallocation_[".ShortName"] = "allocation_";
$tdataallocation_[".OwnerID"] = "md";
$tdataallocation_[".OriginalTable"] = "allocation";


$tdataallocation_[".pagesByType"] = my_json_decode( "{\"add\":[\"add\"],\"list\":[\"list\"],\"masterlist\":[\"masterlist\"],\"masterprint\":[\"masterprint\"],\"print\":[\"print\"],\"search\":[\"search\"],\"view\":[\"view\"]}" );
$tdataallocation_[".originalPagesByType"] = $tdataallocation_[".pagesByType"];
$tdataallocation_[".pages"] = types2pages( my_json_decode( "{\"add\":[\"add\"],\"list\":[\"list\"],\"masterlist\":[\"masterlist\"],\"masterprint\":[\"masterprint\"],\"print\":[\"print\"],\"search\":[\"search\"],\"view\":[\"view\"]}" ) );
$tdataallocation_[".originalPages"] = $tdataallocation_[".pages"];
$tdataallocation_[".defaultPages"] = my_json_decode( "{\"add\":\"add\",\"list\":\"list\",\"masterlist\":\"masterlist\",\"masterprint\":\"masterprint\",\"print\":\"print\",\"search\":\"search\",\"view\":\"view\"}" );
$tdataallocation_[".originalDefaultPages"] = $tdataallocation_[".defaultPages"];

//	field labels
$fieldLabelsallocation_ = array();
$fieldToolTipsallocation_ = array();
$pageTitlesallocation_ = array();
$placeHoldersallocation_ = array();

if(mlang_getcurrentlang()=="English")
{
	$fieldLabelsallocation_["English"] = array();
	$fieldToolTipsallocation_["English"] = array();
	$placeHoldersallocation_["English"] = array();
	$pageTitlesallocation_["English"] = array();
	$fieldLabelsallocation_["English"]["date"] = "Date";
	$fieldToolTipsallocation_["English"]["date"] = "";
	$placeHoldersallocation_["English"]["date"] = "";
	if (count($fieldToolTipsallocation_["English"]))
		$tdataallocation_[".isUseToolTips"] = true;
}
if(mlang_getcurrentlang()=="sinhala")
{
	$fieldLabelsallocation_["sinhala"] = array();
	$fieldToolTipsallocation_["sinhala"] = array();
	$placeHoldersallocation_["sinhala"] = array();
	$pageTitlesallocation_["sinhala"] = array();
	$fieldLabelsallocation_["sinhala"]["date"] = "දිනය";
	$fieldToolTipsallocation_["sinhala"]["date"] = "";
	$placeHoldersallocation_["sinhala"]["date"] = "";
	if (count($fieldToolTipsallocation_["sinhala"]))
		$tdataallocation_[".isUseToolTips"] = true;
}


	$tdataallocation_[".NCSearch"] = true;



$tdataallocation_[".shortTableName"] = "allocation_";
$tdataallocation_[".nSecOptions"] = 0;

$tdataallocation_[".mainTableOwnerID"] = "md";
$tdataallocation_[".entityType"] = 1;
$tdataallocation_[".connId"] = "allo_at_localhost";


$tdataallocation_[".strOriginalTableName"] = "allocation";

	



$tdataallocation_[".showAddInPopup"] = false;

$tdataallocation_[".showEditInPopup"] = false;

$tdataallocation_[".showViewInPopup"] = false;

//page's base css files names
$popupPagesLayoutNames = array();
$tdataallocation_[".popupPagesLayoutNames"] = $popupPagesLayoutNames;


	$tdataallocation_[".listAjax"] = true;
//	temporary
$tdataallocation_[".listAjax"] = false;

	$tdataallocation_[".audit"] = true;

	$tdataallocation_[".locking"] = true;


$pages = $tdataallocation_[".defaultPages"];

if( $pages[PAGE_EDIT] ) {
	$tdataallocation_[".edit"] = true;
	$tdataallocation_[".afterEditAction"] = 1;
	$tdataallocation_[".closePopupAfterEdit"] = 1;
	$tdataallocation_[".afterEditActionDetTable"] = "";
}

if( $pages[PAGE_ADD] ) {
$tdataallocation_[".add"] = true;
$tdataallocation_[".afterAddAction"] = 1;
$tdataallocation_[".closePopupAfterAdd"] = 1;
$tdataallocation_[".afterAddActionDetTable"] = "";
}

if( $pages[PAGE_LIST] ) {
	$tdataallocation_[".list"] = true;
}



$tdataallocation_[".strSortControlSettingsJSON"] = "[{\"fields\":[{\"desc\":true,\"field\":\"date\"}],\"label\":\"\"}]";




if( $pages[PAGE_VIEW] ) {
$tdataallocation_[".view"] = true;
}

if( $pages[PAGE_IMPORT] ) {
$tdataallocation_[".import"] = true;
}

if( $pages[PAGE_EXPORT] ) {
$tdataallocation_[".exportTo"] = true;
}

if( $pages[PAGE_PRINT] ) {
$tdataallocation_[".printFriendly"] = true;
}



$tdataallocation_[".showSimpleSearchOptions"] = true; // temp fix #13449

// Allow Show/Hide Fields in GRID
$tdataallocation_[".allowShowHideFields"] = true; // temp fix #13449
//

// Allow Fields Reordering in GRID
$tdataallocation_[".allowFieldsReordering"] = true; // temp fix #13449
//

$tdataallocation_[".isUseAjaxSuggest"] = true;

$tdataallocation_[".rowHighlite"] = true;



																								

$tdataallocation_[".ajaxCodeSnippetAdded"] = false;

$tdataallocation_[".buttonsAdded"] = false;

$tdataallocation_[".addPageEvents"] = true;

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


$tdataallocation_[".badgeColor"] = "5F9EA0";


$tdataallocation_[".allSearchFields"] = array();
$tdataallocation_[".filterFields"] = array();
$tdataallocation_[".requiredSearchFields"] = array();

$tdataallocation_[".googleLikeFields"] = array();
$tdataallocation_[".googleLikeFields"][] = "date";



$tdataallocation_[".tableType"] = "list";

$tdataallocation_[".printerPageOrientation"] = 0;
$tdataallocation_[".nPrinterPageScale"] = 100;

$tdataallocation_[".nPrinterSplitRecords"] = 40;

$tdataallocation_[".geocodingEnabled"] = false;










$tdataallocation_[".pageSize"] = 20;

$tdataallocation_[".warnLeavingPages"] = true;



$tstrOrderBy = "";
if(strlen($tstrOrderBy) && strtolower(substr($tstrOrderBy,0,8))!="order by")
	$tstrOrderBy = "order by ".$tstrOrderBy;
$tdataallocation_[".strOrderBy"] = $tstrOrderBy;

$tdataallocation_[".orderindexes"] = array();


$tdataallocation_[".sqlHead"] = "SELECT `date`";
$tdataallocation_[".sqlFrom"] = "FROM `allocation_detail`";
$tdataallocation_[".sqlWhereExpr"] = "(c_acc = \"2\")";
$tdataallocation_[".sqlTail"] = "";

//fill array of tabs for list page
$arrGridTabs = array();
$arrGridTabs[] = array(
	'tabId' => "b",
	'name' => "ALL",
	'nameType' => 'Text',
	'where' => "",
	'showRowCount' => 1,
	'hideEmpty' => 1,
);
$tdataallocation_[".arrGridTabs"] = $arrGridTabs;









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

$tdataallocation_[".highlightSearchResults"] = true;

$tableKeysallocation_ = array();
$tableKeysallocation_[] = "date";
$tdataallocation_[".Keys"] = $tableKeysallocation_;


$tdataallocation_[".hideMobileList"] = array();




//	date
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 1;
	$fdata["strName"] = "date";
	$fdata["GoodName"] = "date";
	$fdata["ownerTable"] = "allocation_detail";
	$fdata["Label"] = GetFieldLabel("allocation_","date");
	$fdata["FieldType"] = 7;

	
	
	
			

		$fdata["strField"] = "date";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "`date`";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "Short Date");

	
	
	
	
	
	
	
	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats
	$fdata["EditFormats"] = array();

	$edata = array("EditFormat" => "Date");

	
		$edata["weekdayMessage"] = array("message" => "Invalid week day", "messageType" => "Text");
	$edata["weekdays"] = "[]";


	
	



		$edata["IsRequired"] = true;

	
	
	
			$edata["acceptFileTypes"] = ".+$";
		$edata["acceptFileTypesHtml"] = "";

		$edata["maxNumberOfFiles"] = 1;

	
	
		$edata["DateEditType"] = 2;
	$edata["InitialYearFactor"] = 100;
	$edata["LastYearFactor"] = 10;

	
	
	
		$edata["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
		
	
	//	End validation

	
			
	
	
	
	$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats


	$fdata["isSeparate"] = false;




// the field's search options settings
		$fdata["defaultSearchOption"] = "Between";

			// the default search options list
				$fdata["searchOptionsList"] = array("Equals", "More than", "Less than", "Between", EMPTY_SEARCH, NOT_EMPTY );
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdataallocation_["date"] = $fdata;
		$tdataallocation_[".searchableFields"][] = "date";


$tables_data["allocation."]=&$tdataallocation_;
$field_labels["allocation_"] = &$fieldLabelsallocation_;
$fieldToolTips["allocation_"] = &$fieldToolTipsallocation_;
$placeHolders["allocation_"] = &$placeHoldersallocation_;
$page_titles["allocation_"] = &$pageTitlesallocation_;

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

		$dIndex = 0;
	$detailsParam = array();
	$detailsParam["dDataSourceTable"]="Details";
		$detailsParam["dOriginalTable"] = "allocation_detail";



		$detailsParam["dType"]=PAGE_REPORT;
	
		$detailsParam["dShortTable"] = "details";
	$detailsParam["dCaptionTable"] = GetTableCaption("Details");
	$detailsParam["masterKeys"] =array();
	$detailsParam["detailKeys"] =array();


		
	$detailsTablesData["allocation."][$dIndex] = $detailsParam;

	
		$detailsTablesData["allocation."][$dIndex]["masterKeys"] = array();

	$detailsTablesData["allocation."][$dIndex]["masterKeys"][]="date";

				$detailsTablesData["allocation."][$dIndex]["detailKeys"] = array();

	$detailsTablesData["allocation."][$dIndex]["detailKeys"][]="date";

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



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



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











function createSqlQuery_allocation_()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "`date`";
$proto0["m_strFrom"] = "FROM `allocation_detail`";
$proto0["m_strWhere"] = "(c_acc = \"2\")";
$proto0["m_strOrderBy"] = "";
	
		;
			$proto0["cipherer"] = null;
$proto2=array();
$proto2["m_sql"] = "c_acc = \"2\"";
$proto2["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "c_acc",
	"m_strTable" => "allocation_detail",
	"m_srcTableName" => "allocation."
));

$proto2["m_column"]=$obj;
$proto2["m_contained"] = array();
$proto2["m_strCase"] = "= \"2\"";
$proto2["m_havingmode"] = false;
$proto2["m_inBrackets"] = false;
$proto2["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto2);

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

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

$proto0["m_having"] = $obj;
$proto0["m_fieldlist"] = array();
						$proto6=array();
			$obj = new SQLField(array(
	"m_strName" => "date",
	"m_strTable" => "allocation_detail",
	"m_srcTableName" => "allocation."
));

$proto6["m_sql"] = "`date`";
$proto6["m_srcTableName"] = "allocation.";
$proto6["m_expr"]=$obj;
$proto6["m_alias"] = "";
$obj = new SQLFieldListItem($proto6);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto8=array();
$proto8["m_link"] = "SQLL_MAIN";
			$proto9=array();
$proto9["m_strName"] = "allocation_detail";
$proto9["m_srcTableName"] = "allocation.";
$proto9["m_columns"] = array();
$proto9["m_columns"][] = "id";
$proto9["m_columns"][] = "sub_office_code";
$proto9["m_columns"][] = "sub_office";
$proto9["m_columns"][] = "expenditure_code";
$proto9["m_columns"][] = "department";
$proto9["m_columns"][] = "amount";
$proto9["m_columns"][] = "date";
$proto9["m_columns"][] = "user";
$proto9["m_columns"][] = "on_time";
$proto9["m_columns"][] = "fk";
$proto9["m_columns"][] = "action";
$proto9["m_columns"][] = "ud";
$proto9["m_columns"][] = "md";
$proto9["m_columns"][] = "comment";
$proto9["m_columns"][] = "description";
$proto9["m_columns"][] = "c_acc";
$proto9["m_columns"][] = "delete";
$proto9["m_columns"][] = "accounting_code";
$obj = new SQLTable($proto9);

$proto8["m_table"] = $obj;
$proto8["m_sql"] = "`allocation_detail`";
$proto8["m_alias"] = "";
$proto8["m_srcTableName"] = "allocation.";
$proto10=array();
$proto10["m_sql"] = "";
$proto10["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto0["m_fromlist"][]=$obj;
$proto0["m_groupby"] = array();
												$proto12=array();
						$obj = new SQLField(array(
	"m_strName" => "date",
	"m_strTable" => "allocation_detail",
	"m_srcTableName" => "allocation."
));

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

$proto0["m_groupby"][]=$obj;
$proto0["m_orderby"] = array();
$proto0["m_srcTableName"]="allocation.";		
$obj = new SQLQuery($proto0);

	return $obj;
}
$queryData_allocation_ = createSqlQuery_allocation_();


	
		;

	

$tdataallocation_[".sqlquery"] = $queryData_allocation_;



include_once(getabspath("include/allocation__events.php"));
$tableEvents["allocation."] = new eventclass_allocation_;
$tdataallocation_[".hasEvents"] = true;

?>