<?php
$tdataloans_status = array();
$tdataloans_status[".searchableFields"] = array();
$tdataloans_status[".ShortName"] = "loans_status";
$tdataloans_status[".OwnerID"] = "";
$tdataloans_status[".OriginalTable"] = "loans";


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

//	field labels
$fieldLabelsloans_status = array();
$fieldToolTipsloans_status = array();
$pageTitlesloans_status = array();
$placeHoldersloans_status = array();

if(mlang_getcurrentlang()=="English")
{
	$fieldLabelsloans_status["English"] = array();
	$fieldToolTipsloans_status["English"] = array();
	$placeHoldersloans_status["English"] = array();
	$pageTitlesloans_status["English"] = array();
	$fieldLabelsloans_status["English"]["id"] = "Id";
	$fieldToolTipsloans_status["English"]["id"] = "";
	$placeHoldersloans_status["English"]["id"] = "";
	$fieldLabelsloans_status["English"]["emp_id"] = "Emp Id";
	$fieldToolTipsloans_status["English"]["emp_id"] = "";
	$placeHoldersloans_status["English"]["emp_id"] = "";
	$fieldLabelsloans_status["English"]["loan_id"] = "Loan Id";
	$fieldToolTipsloans_status["English"]["loan_id"] = "";
	$placeHoldersloans_status["English"]["loan_id"] = "";
	$fieldLabelsloans_status["English"]["loan_amount"] = "Loan Amount";
	$fieldToolTipsloans_status["English"]["loan_amount"] = "";
	$placeHoldersloans_status["English"]["loan_amount"] = "";
	$fieldLabelsloans_status["English"]["date"] = "Date";
	$fieldToolTipsloans_status["English"]["date"] = "";
	$placeHoldersloans_status["English"]["date"] = "";
	$fieldLabelsloans_status["English"]["user"] = "User";
	$fieldToolTipsloans_status["English"]["user"] = "";
	$placeHoldersloans_status["English"]["user"] = "";
	$fieldLabelsloans_status["English"]["DETAILS"] = "DETAILS";
	$fieldToolTipsloans_status["English"]["DETAILS"] = "";
	$placeHoldersloans_status["English"]["DETAILS"] = "";
	$fieldLabelsloans_status["English"]["status"] = "Status";
	$fieldToolTipsloans_status["English"]["status"] = "";
	$placeHoldersloans_status["English"]["status"] = "";
	$fieldLabelsloans_status["English"]["left_amount"] = "Left Amount";
	$fieldToolTipsloans_status["English"]["left_amount"] = "";
	$placeHoldersloans_status["English"]["left_amount"] = "";
	if (count($fieldToolTipsloans_status["English"]))
		$tdataloans_status[".isUseToolTips"] = true;
}


	$tdataloans_status[".NCSearch"] = true;



$tdataloans_status[".shortTableName"] = "loans_status";
$tdataloans_status[".nSecOptions"] = 0;

$tdataloans_status[".mainTableOwnerID"] = "";
$tdataloans_status[".entityType"] = 1;
$tdataloans_status[".connId"] = "test2_at_localhost";


$tdataloans_status[".strOriginalTableName"] = "loans";

	



$tdataloans_status[".showAddInPopup"] = false;

$tdataloans_status[".showEditInPopup"] = false;

$tdataloans_status[".showViewInPopup"] = false;

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


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

	$tdataloans_status[".audit"] = true;

	$tdataloans_status[".locking"] = false;


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

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

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

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



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




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

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

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

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



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

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

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

$tdataloans_status[".isUseAjaxSuggest"] = true;

$tdataloans_status[".rowHighlite"] = true;



																																																																																																						

$tdataloans_status[".ajaxCodeSnippetAdded"] = false;

$tdataloans_status[".buttonsAdded"] = false;

$tdataloans_status[".addPageEvents"] = false;

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


$tdataloans_status[".badgeColor"] = "9acd32";


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

$tdataloans_status[".googleLikeFields"] = array();
$tdataloans_status[".googleLikeFields"][] = "id";
$tdataloans_status[".googleLikeFields"][] = "emp_id";
$tdataloans_status[".googleLikeFields"][] = "loan_id";
$tdataloans_status[".googleLikeFields"][] = "loan_amount";
$tdataloans_status[".googleLikeFields"][] = "date";
$tdataloans_status[".googleLikeFields"][] = "user";
$tdataloans_status[".googleLikeFields"][] = "DETAILS";
$tdataloans_status[".googleLikeFields"][] = "status";
$tdataloans_status[".googleLikeFields"][] = "left_amount";



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

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

$tdataloans_status[".nPrinterSplitRecords"] = 40;

$tdataloans_status[".geocodingEnabled"] = false;










$tdataloans_status[".pageSize"] = 20;

$tdataloans_status[".warnLeavingPages"] = true;



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

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


$tdataloans_status[".sqlHead"] = "SELECT loans.id,  loans.emp_id,  loans.loan_id,  loans.loan_amount,  loans.`date`,  loans.`user`,  CONCAT(sys_manage.fullname, \" - \", loa_types.loan_name) AS DETAILS,  CONCAT(loans.loan_amount,\" - \",ifnull(pur.st1,0)) as status,  loans.loan_amount - ifnull(pur.st1,0) as left_amount";
$tdataloans_status[".sqlFrom"] = "FROM loans  LEFT OUTER JOIN loa_types ON loans.loan_id = loa_types.id  LEFT OUTER JOIN sys_manage ON loans.emp_id = sys_manage.ID  LEFT JOIN (select loan,sum(amount) as st1 from payment_of_loan_installments  group by loan ) as pur on loans.id=pur.loan";
$tdataloans_status[".sqlWhereExpr"] = "";
$tdataloans_status[".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;
$tdataloans_status[".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;
$tdataloans_status[".arrGroupsPerPage"] = $arrGPP;

$tdataloans_status[".highlightSearchResults"] = true;

$tableKeysloans_status = array();
$tableKeysloans_status[] = "id";
$tdataloans_status[".Keys"] = $tableKeysloans_status;


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




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

	
		$fdata["AutoInc"] = true;

	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "loans.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


	$tdataloans_status["id"] = $fdata;
		$tdataloans_status[".searchableFields"][] = "id";
//	emp_id
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "emp_id";
	$fdata["GoodName"] = "emp_id";
	$fdata["ownerTable"] = "loans";
	$fdata["Label"] = GetFieldLabel("loans_status","emp_id");
	$fdata["FieldType"] = 3;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "loans.emp_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["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");
							
	
	//	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


	$tdataloans_status["emp_id"] = $fdata;
		$tdataloans_status[".searchableFields"][] = "emp_id";
//	loan_id
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "loan_id";
	$fdata["GoodName"] = "loan_id";
	$fdata["ownerTable"] = "loans";
	$fdata["Label"] = GetFieldLabel("loans_status","loan_id");
	$fdata["FieldType"] = 3;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "loans.loan_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" => "Lookup wizard");

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


	
	

// Begin Lookup settings
				$edata["LookupType"] = 2;
	$edata["LookupTable"] = "loa_types";
			$edata["autoCompleteFieldsOnEdit"] = 0;
	$edata["autoCompleteFields"] = array();
		$edata["LCType"] = 0;

	
		
	$edata["LinkField"] = "id";
	$edata["LinkFieldType"] = 0;
	$edata["DisplayField"] = "loan_name";

	

	
	$edata["LookupOrderBy"] = "";

	
	
	
	

	
	
		$edata["SelectSize"] = 1;

// End Lookup Settings


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

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
	
	
		$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"] = "Equals";

			// 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


	$tdataloans_status["loan_id"] = $fdata;
		$tdataloans_status[".searchableFields"][] = "loan_id";
//	loan_amount
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "loan_amount";
	$fdata["GoodName"] = "loan_amount";
	$fdata["ownerTable"] = "loans";
	$fdata["Label"] = GetFieldLabel("loans_status","loan_amount");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "loans.loan_amount";

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

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

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

	
	
	
	
	
	
		$vdata["DecimalDigits"] = 2;

	
	
	
	
		
	
		$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["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");
							
	
	//	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


	$tdataloans_status["loan_amount"] = $fdata;
		$tdataloans_status[".searchableFields"][] = "loan_amount";
//	date
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 5;
	$fdata["strName"] = "date";
	$fdata["GoodName"] = "date";
	$fdata["ownerTable"] = "loans";
	$fdata["Label"] = GetFieldLabel("loans_status","date");
	$fdata["FieldType"] = 135;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "loans.`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" => "", "messageType" => "Text");
	$edata["weekdays"] = "[]";


	
	



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

		$edata["maxNumberOfFiles"] = 1;

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

	
	
	
		$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"] = "Equals";

			// 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


	$tdataloans_status["date"] = $fdata;
		$tdataloans_status[".searchableFields"][] = "date";
//	user
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 6;
	$fdata["strName"] = "user";
	$fdata["GoodName"] = "user";
	$fdata["ownerTable"] = "loans";
	$fdata["Label"] = GetFieldLabel("loans_status","user");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "loans.`user`";

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

		$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


	$tdataloans_status["user"] = $fdata;
		$tdataloans_status[".searchableFields"][] = "user";
//	DETAILS
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 7;
	$fdata["strName"] = "DETAILS";
	$fdata["GoodName"] = "DETAILS";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("loans_status","DETAILS");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "CONCAT(sys_manage.fullname, \" - \", loa_types.loan_name)";

	
	
				$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["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


	$tdataloans_status["DETAILS"] = $fdata;
		$tdataloans_status[".searchableFields"][] = "DETAILS";
//	status
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 8;
	$fdata["strName"] = "status";
	$fdata["GoodName"] = "status";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("loans_status","status");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "CONCAT(loans.loan_amount,\" - \",ifnull(pur.st1,0))";

	
	
				$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["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


	$tdataloans_status["status"] = $fdata;
		$tdataloans_status[".searchableFields"][] = "status";
//	left_amount
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 9;
	$fdata["strName"] = "left_amount";
	$fdata["GoodName"] = "left_amount";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("loans_status","left_amount");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "loans.loan_amount - ifnull(pur.st1,0)";

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

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

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

	
	
	
	
	
	
		$vdata["DecimalDigits"] = 0;

	
	
	
	
		
	
		$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


	$tdataloans_status["left_amount"] = $fdata;
		$tdataloans_status[".searchableFields"][] = "left_amount";


$tables_data["loans status"]=&$tdataloans_status;
$field_labels["loans_status"] = &$fieldLabelsloans_status;
$fieldToolTips["loans_status"] = &$fieldToolTipsloans_status;
$placeHolders["loans_status"] = &$placeHoldersloans_status;
$page_titles["loans_status"] = &$pageTitlesloans_status;

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

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



	
				$strOriginalDetailsTable="salary_voucher";
	$masterParams = array();
	$masterParams["mDataSourceTable"]="salary_slips";
	$masterParams["mOriginalTable"]= $strOriginalDetailsTable;
	$masterParams["mShortTable"]= "salary_slips";
	$masterParams["masterKeys"]= array();
	$masterParams["detailKeys"]= array();

	$masterParams["type"] = PAGE_LIST;
					$masterTablesData["loans status"][0] = $masterParams;
				$masterTablesData["loans status"][0]["masterKeys"] = array();
	$masterTablesData["loans status"][0]["masterKeys"][]="emp_id";
				$masterTablesData["loans status"][0]["detailKeys"] = array();
	$masterTablesData["loans status"][0]["detailKeys"][]="emp_id";
		
// -----------------end  prepare master-details data arrays ------------------------------//



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











function createSqlQuery_loans_status()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "loans.id,  loans.emp_id,  loans.loan_id,  loans.loan_amount,  loans.`date`,  loans.`user`,  CONCAT(sys_manage.fullname, \" - \", loa_types.loan_name) AS DETAILS,  CONCAT(loans.loan_amount,\" - \",ifnull(pur.st1,0)) as status,  loans.loan_amount - ifnull(pur.st1,0) as left_amount";
$proto0["m_strFrom"] = "FROM loans  LEFT OUTER JOIN loa_types ON loans.loan_id = loa_types.id  LEFT OUTER JOIN sys_manage ON loans.emp_id = sys_manage.ID  LEFT JOIN (select loan,sum(amount) as st1 from payment_of_loan_installments  group by loan ) as pur on loans.id=pur.loan";
$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" => "loans",
	"m_srcTableName" => "loans status"
));

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

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

$proto8["m_sql"] = "loans.emp_id";
$proto8["m_srcTableName"] = "loans status";
$proto8["m_expr"]=$obj;
$proto8["m_alias"] = "";
$obj = new SQLFieldListItem($proto8);

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

$proto10["m_sql"] = "loans.loan_id";
$proto10["m_srcTableName"] = "loans status";
$proto10["m_expr"]=$obj;
$proto10["m_alias"] = "";
$obj = new SQLFieldListItem($proto10);

$proto0["m_fieldlist"][]=$obj;
						$proto12=array();
			$obj = new SQLField(array(
	"m_strName" => "loan_amount",
	"m_strTable" => "loans",
	"m_srcTableName" => "loans status"
));

$proto12["m_sql"] = "loans.loan_amount";
$proto12["m_srcTableName"] = "loans status";
$proto12["m_expr"]=$obj;
$proto12["m_alias"] = "";
$obj = new SQLFieldListItem($proto12);

$proto0["m_fieldlist"][]=$obj;
						$proto14=array();
			$obj = new SQLField(array(
	"m_strName" => "date",
	"m_strTable" => "loans",
	"m_srcTableName" => "loans status"
));

$proto14["m_sql"] = "loans.`date`";
$proto14["m_srcTableName"] = "loans status";
$proto14["m_expr"]=$obj;
$proto14["m_alias"] = "";
$obj = new SQLFieldListItem($proto14);

$proto0["m_fieldlist"][]=$obj;
						$proto16=array();
			$obj = new SQLField(array(
	"m_strName" => "user",
	"m_strTable" => "loans",
	"m_srcTableName" => "loans status"
));

$proto16["m_sql"] = "loans.`user`";
$proto16["m_srcTableName"] = "loans status";
$proto16["m_expr"]=$obj;
$proto16["m_alias"] = "";
$obj = new SQLFieldListItem($proto16);

$proto0["m_fieldlist"][]=$obj;
						$proto18=array();
			$proto19=array();
$proto19["m_functiontype"] = "SQLF_CUSTOM";
$proto19["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "sys_manage.fullname"
));

$proto19["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "\" - \""
));

$proto19["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "loa_types.loan_name"
));

$proto19["m_arguments"][]=$obj;
$proto19["m_strFunctionName"] = "CONCAT";
$obj = new SQLFunctionCall($proto19);

$proto18["m_sql"] = "CONCAT(sys_manage.fullname, \" - \", loa_types.loan_name)";
$proto18["m_srcTableName"] = "loans status";
$proto18["m_expr"]=$obj;
$proto18["m_alias"] = "DETAILS";
$obj = new SQLFieldListItem($proto18);

$proto0["m_fieldlist"][]=$obj;
						$proto23=array();
			$proto24=array();
$proto24["m_functiontype"] = "SQLF_CUSTOM";
$proto24["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "loans.loan_amount"
));

$proto24["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "\" - \""
));

$proto24["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "ifnull(pur.st1,0)"
));

$proto24["m_arguments"][]=$obj;
$proto24["m_strFunctionName"] = "CONCAT";
$obj = new SQLFunctionCall($proto24);

$proto23["m_sql"] = "CONCAT(loans.loan_amount,\" - \",ifnull(pur.st1,0))";
$proto23["m_srcTableName"] = "loans status";
$proto23["m_expr"]=$obj;
$proto23["m_alias"] = "status";
$obj = new SQLFieldListItem($proto23);

$proto0["m_fieldlist"][]=$obj;
						$proto28=array();
			$obj = new SQLNonParsed(array(
	"m_sql" => "loans.loan_amount - ifnull(pur.st1,0)"
));

$proto28["m_sql"] = "loans.loan_amount - ifnull(pur.st1,0)";
$proto28["m_srcTableName"] = "loans status";
$proto28["m_expr"]=$obj;
$proto28["m_alias"] = "left_amount";
$obj = new SQLFieldListItem($proto28);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto30=array();
$proto30["m_link"] = "SQLL_MAIN";
			$proto31=array();
$proto31["m_strName"] = "loans";
$proto31["m_srcTableName"] = "loans status";
$proto31["m_columns"] = array();
$proto31["m_columns"][] = "id";
$proto31["m_columns"][] = "emp_id";
$proto31["m_columns"][] = "loan_id";
$proto31["m_columns"][] = "loan_amount";
$proto31["m_columns"][] = "date";
$proto31["m_columns"][] = "user";
$proto31["m_columns"][] = "outlet_code";
$obj = new SQLTable($proto31);

$proto30["m_table"] = $obj;
$proto30["m_sql"] = "loans";
$proto30["m_alias"] = "";
$proto30["m_srcTableName"] = "loans status";
$proto32=array();
$proto32["m_sql"] = "";
$proto32["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto0["m_fromlist"][]=$obj;
												$proto34=array();
$proto34["m_link"] = "SQLL_LEFTJOIN";
			$proto35=array();
$proto35["m_strName"] = "loa_types";
$proto35["m_srcTableName"] = "loans status";
$proto35["m_columns"] = array();
$proto35["m_columns"][] = "id";
$proto35["m_columns"][] = "loan_name";
$obj = new SQLTable($proto35);

$proto34["m_table"] = $obj;
$proto34["m_sql"] = "LEFT OUTER JOIN loa_types ON loans.loan_id = loa_types.id";
$proto34["m_alias"] = "";
$proto34["m_srcTableName"] = "loans status";
$proto36=array();
$proto36["m_sql"] = "loans.loan_id = loa_types.id";
$proto36["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "loan_id",
	"m_strTable" => "loans",
	"m_srcTableName" => "loans status"
));

$proto36["m_column"]=$obj;
$proto36["m_contained"] = array();
$proto36["m_strCase"] = "= loa_types.id";
$proto36["m_havingmode"] = false;
$proto36["m_inBrackets"] = false;
$proto36["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto36);

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

$proto0["m_fromlist"][]=$obj;
												$proto38=array();
$proto38["m_link"] = "SQLL_LEFTJOIN";
			$proto39=array();
$proto39["m_strName"] = "sys_manage";
$proto39["m_srcTableName"] = "loans status";
$proto39["m_columns"] = array();
$proto39["m_columns"][] = "ID";
$proto39["m_columns"][] = "username";
$proto39["m_columns"][] = "password";
$proto39["m_columns"][] = "email";
$proto39["m_columns"][] = "fullname";
$proto39["m_columns"][] = "groupid";
$proto39["m_columns"][] = "active";
$proto39["m_columns"][] = "ext_security_id";
$proto39["m_columns"][] = "reset_token";
$proto39["m_columns"][] = "reset_date";
$proto39["m_columns"][] = "teliphone_number";
$proto39["m_columns"][] = "date";
$proto39["m_columns"][] = "branch_code";
$proto39["m_columns"][] = "outlet_code";
$proto39["m_columns"][] = "MyTheme";
$proto39["m_columns"][] = "MyThemeSize";
$proto39["m_columns"][] = "password2";
$obj = new SQLTable($proto39);

$proto38["m_table"] = $obj;
$proto38["m_sql"] = "LEFT OUTER JOIN sys_manage ON loans.emp_id = sys_manage.ID";
$proto38["m_alias"] = "";
$proto38["m_srcTableName"] = "loans status";
$proto40=array();
$proto40["m_sql"] = "loans.emp_id = sys_manage.ID";
$proto40["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "emp_id",
	"m_strTable" => "loans",
	"m_srcTableName" => "loans status"
));

$proto40["m_column"]=$obj;
$proto40["m_contained"] = array();
$proto40["m_strCase"] = "= sys_manage.ID";
$proto40["m_havingmode"] = false;
$proto40["m_inBrackets"] = false;
$proto40["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto40);

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

$proto0["m_fromlist"][]=$obj;
												$proto42=array();
$proto42["m_link"] = "SQLL_LEFTJOIN";
			$proto43=array();
$proto43["m_strHead"] = "select";
$proto43["m_strFieldList"] = "loan,sum(amount) as st1";
$proto43["m_strFrom"] = "from payment_of_loan_installments";
$proto43["m_strWhere"] = "";
$proto43["m_strOrderBy"] = "";
	
		;
			$proto43["cipherer"] = null;
$proto45=array();
$proto45["m_sql"] = "";
$proto45["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

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

$proto43["m_having"] = $obj;
$proto43["m_fieldlist"] = array();
						$proto49=array();
			$obj = new SQLField(array(
	"m_strName" => "loan",
	"m_strTable" => "payment_of_loan_installments",
	"m_srcTableName" => "loans status"
));

$proto49["m_sql"] = "loan";
$proto49["m_srcTableName"] = "loans status";
$proto49["m_expr"]=$obj;
$proto49["m_alias"] = "";
$obj = new SQLFieldListItem($proto49);

$proto43["m_fieldlist"][]=$obj;
						$proto51=array();
			$proto52=array();
$proto52["m_functiontype"] = "SQLF_SUM";
$proto52["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "payment_of_loan_installments",
	"m_srcTableName" => "loans status"
));

$proto52["m_arguments"][]=$obj;
$proto52["m_strFunctionName"] = "sum";
$obj = new SQLFunctionCall($proto52);

$proto51["m_sql"] = "sum(amount)";
$proto51["m_srcTableName"] = "loans status";
$proto51["m_expr"]=$obj;
$proto51["m_alias"] = "st1";
$obj = new SQLFieldListItem($proto51);

$proto43["m_fieldlist"][]=$obj;
$proto43["m_fromlist"] = array();
												$proto54=array();
$proto54["m_link"] = "SQLL_MAIN";
			$proto55=array();
$proto55["m_strName"] = "payment_of_loan_installments";
$proto55["m_srcTableName"] = "loans status";
$proto55["m_columns"] = array();
$proto55["m_columns"][] = "id";
$proto55["m_columns"][] = "loan";
$proto55["m_columns"][] = "emp_id";
$proto55["m_columns"][] = "month";
$proto55["m_columns"][] = "loan_status";
$proto55["m_columns"][] = "amount";
$proto55["m_columns"][] = "user";
$proto55["m_columns"][] = "date";
$proto55["m_columns"][] = "pay_slip_link";
$obj = new SQLTable($proto55);

$proto54["m_table"] = $obj;
$proto54["m_sql"] = "payment_of_loan_installments";
$proto54["m_alias"] = "";
$proto54["m_srcTableName"] = "loans status";
$proto56=array();
$proto56["m_sql"] = "";
$proto56["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto43["m_fromlist"][]=$obj;
$proto43["m_groupby"] = array();
												$proto58=array();
						$obj = new SQLField(array(
	"m_strName" => "loan",
	"m_strTable" => "payment_of_loan_installments",
	"m_srcTableName" => "loans status"
));

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

$proto43["m_groupby"][]=$obj;
$proto43["m_orderby"] = array();
$proto43["m_srcTableName"]="loans status";		
$obj = new SQLQuery($proto43);

$proto42["m_table"] = $obj;
$proto42["m_sql"] = "LEFT JOIN (select loan,sum(amount) as st1 from payment_of_loan_installments  group by loan ) as pur on loans.id=pur.loan";
$proto42["m_alias"] = "pur";
$proto42["m_srcTableName"] = "loans status";
$proto60=array();
$proto60["m_sql"] = "loans.id=pur.loan";
$proto60["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "id",
	"m_strTable" => "loans",
	"m_srcTableName" => "loans status"
));

$proto60["m_column"]=$obj;
$proto60["m_contained"] = array();
$proto60["m_strCase"] = "=pur.loan";
$proto60["m_havingmode"] = false;
$proto60["m_inBrackets"] = false;
$proto60["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto60);

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

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

	return $obj;
}
$queryData_loans_status = createSqlQuery_loans_status();


	
		;

									

$tdataloans_status[".sqlquery"] = $queryData_loans_status;



$tableEvents["loans status"] = new eventsBase;
$tdataloans_status[".hasEvents"] = false;

?>