<?php
$tdataunits = array();
$tdataunits[".searchableFields"] = array();
$tdataunits[".ShortName"] = "units";
$tdataunits[".OwnerID"] = "branch_code";
$tdataunits[".OriginalTable"] = "units";


$tdataunits[".pagesByType"] = my_json_decode( "{\"add\":[\"add\"],\"edit\":[\"edit\"],\"export\":[\"export\"],\"import\":[\"import\"],\"list\":[\"list\"],\"print\":[\"print\"],\"search\":[\"search\"],\"view\":[\"view\"]}" );
$tdataunits[".originalPagesByType"] = $tdataunits[".pagesByType"];
$tdataunits[".pages"] = types2pages( my_json_decode( "{\"add\":[\"add\"],\"edit\":[\"edit\"],\"export\":[\"export\"],\"import\":[\"import\"],\"list\":[\"list\"],\"print\":[\"print\"],\"search\":[\"search\"],\"view\":[\"view\"]}" ) );
$tdataunits[".originalPages"] = $tdataunits[".pages"];
$tdataunits[".defaultPages"] = my_json_decode( "{\"add\":\"add\",\"edit\":\"edit\",\"export\":\"export\",\"import\":\"import\",\"list\":\"list\",\"print\":\"print\",\"search\":\"search\",\"view\":\"view\"}" );
$tdataunits[".originalDefaultPages"] = $tdataunits[".defaultPages"];

//	field labels
$fieldLabelsunits = array();
$fieldToolTipsunits = array();
$pageTitlesunits = array();
$placeHoldersunits = array();

if(mlang_getcurrentlang()=="English")
{
	$fieldLabelsunits["English"] = array();
	$fieldToolTipsunits["English"] = array();
	$placeHoldersunits["English"] = array();
	$pageTitlesunits["English"] = array();
	$fieldLabelsunits["English"]["id"] = "Id";
	$fieldToolTipsunits["English"]["id"] = "";
	$placeHoldersunits["English"]["id"] = "";
	$fieldLabelsunits["English"]["unit"] = "Unit";
	$fieldToolTipsunits["English"]["unit"] = "";
	$placeHoldersunits["English"]["unit"] = "";
	$fieldLabelsunits["English"]["branch_code"] = "Branch Code";
	$fieldToolTipsunits["English"]["branch_code"] = "";
	$placeHoldersunits["English"]["branch_code"] = "";
	if (count($fieldToolTipsunits["English"]))
		$tdataunits[".isUseToolTips"] = true;
}


	$tdataunits[".NCSearch"] = true;



$tdataunits[".shortTableName"] = "units";
$tdataunits[".nSecOptions"] = 1;

$tdataunits[".mainTableOwnerID"] = "branch_code";
$tdataunits[".entityType"] = 0;
$tdataunits[".connId"] = "test2_at_localhost";


$tdataunits[".strOriginalTableName"] = "units";

	



$tdataunits[".showAddInPopup"] = false;

$tdataunits[".showEditInPopup"] = false;

$tdataunits[".showViewInPopup"] = false;

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


$tdataunits[".listAjax"] = false;
//	temporary
$tdataunits[".listAjax"] = false;

	$tdataunits[".audit"] = true;

	$tdataunits[".locking"] = false;


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

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

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

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



$tdataunits[".strSortControlSettingsJSON"] = "";




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

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

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

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



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

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

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

$tdataunits[".isUseAjaxSuggest"] = true;

$tdataunits[".rowHighlite"] = true;



																																																			

$tdataunits[".ajaxCodeSnippetAdded"] = false;

$tdataunits[".buttonsAdded"] = false;

$tdataunits[".addPageEvents"] = false;

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


$tdataunits[".badgeColor"] = "CD853F";


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

$tdataunits[".googleLikeFields"] = array();
$tdataunits[".googleLikeFields"][] = "id";
$tdataunits[".googleLikeFields"][] = "unit";
$tdataunits[".googleLikeFields"][] = "branch_code";



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

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

$tdataunits[".nPrinterSplitRecords"] = 40;

$tdataunits[".geocodingEnabled"] = false;










$tdataunits[".pageSize"] = 20;

$tdataunits[".warnLeavingPages"] = true;



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

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


$tdataunits[".sqlHead"] = "SELECT id,  	unit,  	branch_code";
$tdataunits[".sqlFrom"] = "FROM units";
$tdataunits[".sqlWhereExpr"] = "";
$tdataunits[".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;
$tdataunits[".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;
$tdataunits[".arrGroupsPerPage"] = $arrGPP;

$tdataunits[".highlightSearchResults"] = true;

$tableKeysunits = array();
$tableKeysunits[] = "id";
$tdataunits[".Keys"] = $tableKeysunits;


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




//	id
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 1;
	$fdata["strName"] = "id";
	$fdata["GoodName"] = "id";
	$fdata["ownerTable"] = "units";
	$fdata["Label"] = GetFieldLabel("units","id");
	$fdata["FieldType"] = 3;

	
		$fdata["AutoInc"] = true;

	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "id";

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

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

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

	
	
	
	
	
	
	
	
	
	
	
		
	
		$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" => "Text field");

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


	
	



		$edata["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
			$edata["HTML5InuptType"] = "text";

		$edata["EditParams"] = "";
		
		$edata["controlWidth"] = 200;

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

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


	$fdata["isSeparate"] = false;




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

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", 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


	$tdataunits["id"] = $fdata;
		$tdataunits[".searchableFields"][] = "id";
//	unit
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "unit";
	$fdata["GoodName"] = "unit";
	$fdata["ownerTable"] = "units";
	$fdata["Label"] = GetFieldLabel("units","unit");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "unit";

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

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

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

	
	
	
	
	
	
	
	
	
	
	
		
	
		$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" => "Text field");

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


	
	



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

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
			$edata["HTML5InuptType"] = "text";

		$edata["EditParams"] = "";
			$edata["EditParams"].= " maxlength=50";

		$edata["controlWidth"] = 200;

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

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


	$fdata["isSeparate"] = false;




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

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", 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


	$tdataunits["unit"] = $fdata;
		$tdataunits[".searchableFields"][] = "unit";
//	branch_code
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "branch_code";
	$fdata["GoodName"] = "branch_code";
	$fdata["ownerTable"] = "units";
	$fdata["Label"] = GetFieldLabel("units","branch_code");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "branch_code";

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

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

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

	
	
	
	
	
	
	
	
	
	
	
		
	
		$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" => "Readonly");

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


	
	



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

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
	
	
		$edata["controlWidth"] = 200;

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

	//	End validation

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


	$fdata["isSeparate"] = false;




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

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", 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


	$tdataunits["branch_code"] = $fdata;
		$tdataunits[".searchableFields"][] = "branch_code";


$tables_data["units"]=&$tdataunits;
$field_labels["units"] = &$fieldLabelsunits;
$fieldToolTips["units"] = &$fieldToolTipsunits;
$placeHolders["units"] = &$placeHoldersunits;
$page_titles["units"] = &$pageTitlesunits;

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

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



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



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











function createSqlQuery_units()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "id,  	unit,  	branch_code";
$proto0["m_strFrom"] = "FROM units";
$proto0["m_strWhere"] = "";
$proto0["m_strOrderBy"] = "";
	
		;
			$proto0["cipherer"] = null;
$proto2=array();
$proto2["m_sql"] = "";
$proto2["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto2["m_column"]=$obj;
$proto2["m_contained"] = array();
$proto2["m_strCase"] = "";
$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" => "id",
	"m_strTable" => "units",
	"m_srcTableName" => "units"
));

$proto6["m_sql"] = "id";
$proto6["m_srcTableName"] = "units";
$proto6["m_expr"]=$obj;
$proto6["m_alias"] = "";
$obj = new SQLFieldListItem($proto6);

$proto0["m_fieldlist"][]=$obj;
						$proto8=array();
			$obj = new SQLField(array(
	"m_strName" => "unit",
	"m_strTable" => "units",
	"m_srcTableName" => "units"
));

$proto8["m_sql"] = "unit";
$proto8["m_srcTableName"] = "units";
$proto8["m_expr"]=$obj;
$proto8["m_alias"] = "";
$obj = new SQLFieldListItem($proto8);

$proto0["m_fieldlist"][]=$obj;
						$proto10=array();
			$obj = new SQLField(array(
	"m_strName" => "branch_code",
	"m_strTable" => "units",
	"m_srcTableName" => "units"
));

$proto10["m_sql"] = "branch_code";
$proto10["m_srcTableName"] = "units";
$proto10["m_expr"]=$obj;
$proto10["m_alias"] = "";
$obj = new SQLFieldListItem($proto10);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto12=array();
$proto12["m_link"] = "SQLL_MAIN";
			$proto13=array();
$proto13["m_strName"] = "units";
$proto13["m_srcTableName"] = "units";
$proto13["m_columns"] = array();
$proto13["m_columns"][] = "id";
$proto13["m_columns"][] = "unit";
$proto13["m_columns"][] = "branch_code";
$obj = new SQLTable($proto13);

$proto12["m_table"] = $obj;
$proto12["m_sql"] = "units";
$proto12["m_alias"] = "";
$proto12["m_srcTableName"] = "units";
$proto14=array();
$proto14["m_sql"] = "";
$proto14["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

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

	return $obj;
}
$queryData_units = createSqlQuery_units();


	
		;

			

$tdataunits[".sqlquery"] = $queryData_units;



include_once(getabspath("include/units_events.php"));
$tableEvents["units"] = new eventclass_units;
$tdataunits[".hasEvents"] = true;

?>