<?php

namespace DataView;

class Fop_fints_konto {
  
  

  
  

    // --- Statische Methoden ---
  
  public static function exportCSVAction($attachTo = null ) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: before-header ---
    
		$data = self::getData('', $_GET);
	
    // --- BLOCK: before-header-filename ---
    
	$filename = preg_replace('/[~"#%&\*:<>\?\/\\\{|\}]/', '_', _('Bankkonten') . ' ' . self::getFilterHTML($_GET, ', ', false) . '.csv'); // sanitize
    // --- BLOCK: before-main ---
    
	if (!$attachTo) {
		header('Content-Type: ' . 'text/csv');
		header('Content-Disposition: attachment; filename="'.$filename.'"');
	} else if ($attachTo === 'string') {
		
	ob_start();
	} else if ($attachTo === 'file') {
		
		$ob_tmp = tempnam(sys_get_temp_dir(), 'fop-file');
		$ob_tmp_handle = fopen($ob_tmp, 'w');
		ob_start(function ($data) use ($ob_tmp_handle) {
			fwrite($ob_tmp_handle, $data);
			return '';
		}, 1024*1024);
	} else if ($attachTo instanceof \PHPMailer\PHPMailer\PHPMailer) {
		
		ob_start();
	} else if ($attachTo instanceof \ZipArchive) {
		
		ob_start();
	} else {
		throw new \FOP\AccessDeniedException('unknown attachment object');
	}
    // --- BLOCK: main ---
    
		?>"Bezeichnung";"Kontostand";"IBAN";"Bank";"Bank-Link";"Tan Modus";"Tan Modus-Link";"Zustand";"Letztes Synchronisationsdatum";"PIN Versuche";"Gläubiger-ID Lastschriften"<?php
		echo "\n";
		$sums = [];
		foreach ($data['items'] AS $item) {
			$val = $item['kontoname'];
			$val = $val;
			if (is_numeric($val)) {
				echo $val;
			} else {
				echo '"' . str_replace("\n", "\\n", str_replace('"', '""', $val)) . '"';
			}
			echo ';';
			$val = $item['kontostand'];
			$val = \Types\Euro::print($val) .  ' €'
	;
			if (is_numeric($val)) {
				echo $val;
			} else {
				echo '"' . str_replace("\n", "\\n", str_replace('"', '""', $val)) . '"';
			}
			echo ';';
			$val = $item['iban'];
			$val = $val;
			if (is_numeric($val)) {
				echo $val;
			} else {
				echo '"' . str_replace("\n", "\\n", str_replace('"', '""', $val)) . '"';
			}
			echo ';';
			$val = $item['bank'];
			$val = 
  \FOP\Database::query('SELECT CONCAT('.qi('fop_fints_bank').'.'.qi('institut').', \' : \', '.qi('fop_fints_bank').'.'.qi('blz').') AS description FROM '.qi('fop_fints_bank').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('')
;
			if (is_numeric($val)) {
				echo $val;
			} else {
				echo '"' . str_replace("\n", "\\n", str_replace('"', '""', $val)) . '"';
			}
			$val = $item['bank'];
			echo ';' . '"' . str_replace("\n", "\\n", str_replace('"', '""', (\TablesRouter\Fop_fints_bank::viewURL($val)))) . '"';
			echo ';';
			$val = $item['tanMode'];
			$val = 
  \FOP\Database::query('SELECT CONCAT('.qi('fop_fints_tanMode').'.'.qi('tanName').', \' <=> \', '.qi('fop_fints_tanMode').'.'.qi('tanMediaName').') AS description FROM '.qi('fop_fints_tanMode').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('')
;
			if (is_numeric($val)) {
				echo $val;
			} else {
				echo '"' . str_replace("\n", "\\n", str_replace('"', '""', $val)) . '"';
			}
			$val = $item['tanMode'];
			echo ';' . '"' . str_replace("\n", "\\n", str_replace('"', '""', (\TablesRouter\Fop_fints_tanMode::viewURL($val)))) . '"';
			echo ';';
			$val = $item['fop_konto_zustand'];
			$val = \Types\Fop_konto_zustand::toString($val);
			if (is_numeric($val)) {
				echo $val;
			} else {
				echo '"' . str_replace("\n", "\\n", str_replace('"', '""', $val)) . '"';
			}
			echo ';';
			$val = $item['last_sync'];
			$val = ($val) ? strftime(_('datetimeformat_php2'), intval($val)) : '';
			if (is_numeric($val)) {
				echo $val;
			} else {
				echo '"' . str_replace("\n", "\\n", str_replace('"', '""', $val)) . '"';
			}
			echo ';';
			$val = $item['pin_versuch'];
			$val = \Types\Integer::print($val)
	;
			if (is_numeric($val)) {
				echo $val;
			} else {
				echo '"' . str_replace("\n", "\\n", str_replace('"', '""', $val)) . '"';
			}
			echo ';';
			$val = $item['glaeubigerid'];
			$val = $val;
			if (is_numeric($val)) {
				echo $val;
			} else {
				echo '"' . str_replace("\n", "\\n", str_replace('"', '""', $val)) . '"';
			}
			
			echo "\n";
		}
		
	
    // --- BLOCK: main-~method ---
    
	if (!$attachTo) { ;
	} else if ($attachTo === 'string') {
		
	$content = ob_get_clean();
	return $content;
	} else if ($attachTo === 'file') {
		
		ob_end_flush();
		fclose($ob_tmp_handle);
		return \FOP\Files::uploadFromFile($ob_tmp, $filename);
	} else if ($attachTo instanceof \PHPMailer\PHPMailer\PHPMailer) {
		
		$content = ob_get_clean();
		$attachTo->AddStringAttachment($content, $filename);

	} else if ($attachTo instanceof \ZipArchive) {
		
		$content = ob_get_clean();
		$attachTo->addFromString($filename, $content);
	
	}
    
  }

  public static function renderScript() { 
    
    
    // --- BLOCK: main ---
    
								\FOP\I18n::ensureIsLoaded();
								?>
								<script type="text/javascript">
									
    function changefilter_fop_fints_konto_bankListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_fints_konto_bank', val, cb.checked);
		  } else {
			  delete query['filter_fop_fints_konto_bank'];
		  }reloadfop_fints_konto();
        
    }

		var i8b3d99568761c93925fc205c7ef96ec727b1f4d9830041ddb1189d8fda4ff3a4timeout = null;
		function changefilter_fop_fints_konto_bankSearchFilter(val, callback) {
			if(i8b3d99568761c93925fc205c7ef96ec727b1f4d9830041ddb1189d8fda4ff3a4timeout) clearTimeout(i8b3d99568761c93925fc205c7ef96ec727b1f4d9830041ddb1189d8fda4ff3a4timeout);

			i8b3d99568761c93925fc205c7ef96ec727b1f4d9830041ddb1189d8fda4ff3a4timeout = setTimeout(function() {
				$.getJSON(reloadfop_fints_konto({action: 'getfilter_fop_fints_konto_bankItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_fints_konto_bank_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_fints_konto_bankListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_fop_fints_konto_bank_orig']) ? json_encode($_GET['filter_fop_fints_konto_bank_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="8b3d99568761c93925fc205c7ef96ec727b1f4d9830041ddb1189d8fda4ff3a4" type="text">' +
			'<label class="mdl-textfield__label" for="8b3d99568761c93925fc205c7ef96ec727b1f4d9830041ddb1189d8fda4ff3a4">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_fop_fints_konto_bank', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_fints_konto_bank_orig'] = '';
					delete query['filter_fop_fints_konto_bank'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_fints_konto();
					
				} else {
					$('#table_fop_fints_konto').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_fints_konto_bankSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\Fop_fints_konto::getfilter_fop_fints_konto_bankItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_fop_fints_konto_bank_orig'] = '';
				delete query['filter_fop_fints_konto_bank'];
				reload('', items);reloadfop_fints_konto();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_fop_fints_konto_bank', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_fints_konto_bankListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
    function changefilter_fop_fints_konto_tanModeListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_fints_konto_tanMode', val, cb.checked);
		  } else {
			  delete query['filter_fop_fints_konto_tanMode'];
		  }reloadfop_fints_konto();
        
    }

		var i62a77dbc7fe47aa6f7884f42960649b2096406b410af3ba84b2707cba3f3cddctimeout = null;
		function changefilter_fop_fints_konto_tanModeSearchFilter(val, callback) {
			if(i62a77dbc7fe47aa6f7884f42960649b2096406b410af3ba84b2707cba3f3cddctimeout) clearTimeout(i62a77dbc7fe47aa6f7884f42960649b2096406b410af3ba84b2707cba3f3cddctimeout);

			i62a77dbc7fe47aa6f7884f42960649b2096406b410af3ba84b2707cba3f3cddctimeout = setTimeout(function() {
				$.getJSON(reloadfop_fints_konto({action: 'getfilter_fop_fints_konto_tanModeItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_fints_konto_tanMode_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_fints_konto_tanModeListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_fop_fints_konto_tanMode_orig']) ? json_encode($_GET['filter_fop_fints_konto_tanMode_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="62a77dbc7fe47aa6f7884f42960649b2096406b410af3ba84b2707cba3f3cddc" type="text">' +
			'<label class="mdl-textfield__label" for="62a77dbc7fe47aa6f7884f42960649b2096406b410af3ba84b2707cba3f3cddc">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_fop_fints_konto_tanMode', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_fints_konto_tanMode_orig'] = '';
					delete query['filter_fop_fints_konto_tanMode'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_fints_konto();
					
				} else {
					$('#table_fop_fints_konto').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_fints_konto_tanModeSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\Fop_fints_konto::getfilter_fop_fints_konto_tanModeItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_fop_fints_konto_tanMode_orig'] = '';
				delete query['filter_fop_fints_konto_tanMode'];
				reload('', items);reloadfop_fints_konto();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_fop_fints_konto_tanMode', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_fints_konto_tanModeListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
									
    function changefilter_fop_fints_konto_bankListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_fints_konto_bank', val, cb.checked);
		  } else {
			  delete query['filter_fop_fints_konto_bank'];
		  }reloadfop_fints_konto();
        
    }

		var i8b3d99568761c93925fc205c7ef96ec727b1f4d9830041ddb1189d8fda4ff3a4timeout = null;
		function changefilter_fop_fints_konto_bankSearchFilter(val, callback) {
			if(i8b3d99568761c93925fc205c7ef96ec727b1f4d9830041ddb1189d8fda4ff3a4timeout) clearTimeout(i8b3d99568761c93925fc205c7ef96ec727b1f4d9830041ddb1189d8fda4ff3a4timeout);

			i8b3d99568761c93925fc205c7ef96ec727b1f4d9830041ddb1189d8fda4ff3a4timeout = setTimeout(function() {
				$.getJSON(reloadfop_fints_konto({action: 'getfilter_fop_fints_konto_bankItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_fints_konto_bank_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_fints_konto_bankListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_fop_fints_konto_bank_orig']) ? json_encode($_GET['filter_fop_fints_konto_bank_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="8b3d99568761c93925fc205c7ef96ec727b1f4d9830041ddb1189d8fda4ff3a4" type="text">' +
			'<label class="mdl-textfield__label" for="8b3d99568761c93925fc205c7ef96ec727b1f4d9830041ddb1189d8fda4ff3a4">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_fop_fints_konto_bank', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_fints_konto_bank_orig'] = '';
					delete query['filter_fop_fints_konto_bank'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_fints_konto();
					
				} else {
					$('#table_fop_fints_konto').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_fints_konto_bankSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\Fop_fints_konto::getfilter_fop_fints_konto_bankItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_fop_fints_konto_bank_orig'] = '';
				delete query['filter_fop_fints_konto_bank'];
				reload('', items);reloadfop_fints_konto();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_fop_fints_konto_bank', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_fints_konto_bankListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
    function changefilter_fop_fints_konto_tanModeListMultiFilter(val, cb) {
		  if (val) {
			  querySet('filter_fop_fints_konto_tanMode', val, cb.checked);
		  } else {
			  delete query['filter_fop_fints_konto_tanMode'];
		  }reloadfop_fints_konto();
        
    }

		var i62a77dbc7fe47aa6f7884f42960649b2096406b410af3ba84b2707cba3f3cddctimeout = null;
		function changefilter_fop_fints_konto_tanModeSearchFilter(val, callback) {
			if(i62a77dbc7fe47aa6f7884f42960649b2096406b410af3ba84b2707cba3f3cddctimeout) clearTimeout(i62a77dbc7fe47aa6f7884f42960649b2096406b410af3ba84b2707cba3f3cddctimeout);

			i62a77dbc7fe47aa6f7884f42960649b2096406b410af3ba84b2707cba3f3cddctimeout = setTimeout(function() {
				$.getJSON(reloadfop_fints_konto({action: 'getfilter_fop_fints_konto_tanModeItemsByString', 'fstr': val}, true), function(r) {
					callback(r);
					query['filter_fop_fints_konto_tanMode_orig'] = val;
				});
			}, 300);
		}

	function getfilter_fop_fints_konto_tanModeListMultiFilter() {
		var gui = $("<div class='fop-floatsorter'></div>");
		// TODO: usability #1866 auf ajax warten bevor ENTER behandelt wird
		var fstr = <?php echo(isset($_GET['filter_fop_fints_konto_tanMode_orig']) ? json_encode($_GET['filter_fop_fints_konto_tanMode_orig']) : '""') ?>;
		var search = $('<div class="mdl-textfield mdl-js-textfield">' + 
			'<input value="" class="mdl-textfield__input" id="62a77dbc7fe47aa6f7884f42960649b2096406b410af3ba84b2707cba3f3cddc" type="text">' +
			'<label class="mdl-textfield__label" for="62a77dbc7fe47aa6f7884f42960649b2096406b410af3ba84b2707cba3f3cddc">Filter...</label>' +
			'</div>');
		search.find('input').val(fstr).keyup(function (event) {
			var self = this;
			if ((event.keyCode || e.which) == 13) {
				var hasChecked = false;
				if (this.value) {
					// search value + tick all search results
					checkboxes.find('input').each(function (i, inp) {
						if (!inp.checked && $(inp).data('value')) {
							inp.checked = true;
							querySet('filter_fop_fints_konto_tanMode', $(inp).data('value'), true);
							hasChecked = true;
						}
					});
				} else {
					// untick all
					search.find('input').val('');
					query['filter_fop_fints_konto_tanMode_orig'] = '';
					delete query['filter_fop_fints_konto_tanMode'];
					reload('', items);
					hasChecked = true;
				}
				if (hasChecked) {reloadfop_fints_konto();
					
				} else {
					$('#table_fop_fints_konto').find('.fop-table-row:first').click();
				}
			} else {
				changefilter_fop_fints_konto_tanModeSearchFilter(this.value, function (result) {
					reload(self.value, result);
				});
			}
		});
		gui.append(search);

		var checkboxes = $("<div></div>").css({maxHeight: '200px', overflow: 'auto'});
		var items = <?php
			// TODO: deps-Variable füllen mit DV-Parametern vom DataView id
			echo json_encode(\DataView\Fop_fints_konto::getfilter_fop_fints_konto_tanModeItemsByStringAction(''));
		?>;

		function reload(fstr, items) {
			// rerender checkbox list
			checkboxes.empty();
			checkboxes.append($('<i style="cursor: pointer;"><?php echo _('show all'); ?></i>').click(function () {
				search.find('input').val('');
				query['filter_fop_fints_konto_tanMode_orig'] = '';
				delete query['filter_fop_fints_konto_tanMode'];
				reload('', items);reloadfop_fints_konto();
				
			})).append('<br/>');
			// NULL-Wert auch suchbar #2057 (kommt als ID=0 an, muss für die idlist in _null geändert werden)
			for (var i = 0; i < items.length; i++) {
				let value = (items[i].ID === '0' ? '_null' : items[i].ID);
				let descr = items[i].description;
				let checked = querySet('filter_fop_fints_konto_tanMode', value);
				if (!fstr || checked || descr.toLowerCase().includes(fstr.toLowerCase())) {
					checkboxes.append($('<input type=\'checkbox\'  onclick=\'changefilter_fop_fints_konto_tanModeListMultiFilter("' + value + '", this)\' ' + (checked ? ' checked>': '> ')).data('value', value)).append($('<span></span>').text(descr).prepend('&nbsp;')).append('<br/>');
				}
			 }
		}
		reload(fstr, items);
		gui.append(checkboxes);

		return gui;
	}
									function updateNumberfop_fints_konto(col) {
										//var checklist = window.DataViewChecked['fop_fints_konto'][col];
										//if (checklist.id) {
											// checklist is online
											// TODO: check if cache is alive, otherwise reload from ajax, delay execution and return now
											//checklist.ranges = [[1,10000000]]; // mostly we use indirect idlists to tick all marks; so this is an approximation
										//}
										// checkboxes aktualisieren
										if (window.DataViewChecked && window.DataViewChecked['fop_fints_konto'] && window.DataViewChecked['fop_fints_konto'][col].ranges.length > 0) {
											$('.fop_fints_konto__mass-action').css('visibility', 'visible');
											$('.fop_fints_konto__action').css('visibility', 'hidden');
										} else {
											$('.fop_fints_konto__mass-action').css('visibility', 'hidden');
											$('.fop_fints_konto__action').css('visibility', 'visible');
										}
										$('.fop_fints_konto__checkbox').each(function (idx, x) {
											for (var cssclass of x.classList) {
												if (cssclass.startsWith('fop_fints_konto__checkbox-'+col+'-')) {
													var my_id = cssclass.substr(('fop_fints_konto__checkbox-'+col+'-').length);
													if (window.DataViewChecked) {
														x.MaterialCheckbox[checklist.has(my_id) ? 'check' : 'uncheck']();
													}
												}
											}
										});
									}
									function reloadfop_fints_konto (params, returnUrl, onlyScroll, addPadding = 0) {
										// copy query
										let nq = JSON.parse(JSON.stringify(query));
										nq['parent_request'] = <?php echo json_encode(strtok(\FOP\Util::getBackUrl(), '?')); ?>;
										<?php if (isset($_GET['select'])) { ?>nq['select'] = 'select';<?php } ?>
										
										if (params) {
											for (var i in params) nq[i] = params[i];
											var action = nq['action'];
											delete nq['action'];
											let querystr = "DataView/Fop_fints_konto/" + action + "?" + Object.keys(nq).map(function(k){ return k + "=" +  encodeURIComponent(nq[k]); }).join("&");
											// direkt aufrufen (ist wohl ein Download oder so)
											if (returnUrl) return querystr;
											window.location.href = querystr;
										} else {
											let querystr;
											
											
											<?php if (((\FOP\User::getBuchhaltung())) && (!\FOP\User::getIsGuest())) { ?>
											delete nq['action'];
											querystr = "DataView/Fop_fints_konto/renderTabTable?" + Object.keys(nq).map(function(k){ return k + "=" +  encodeURIComponent(nq[k]); }).join("&");
											// per Ajax laden
											if(!$("#fop_fints_konto-table")?.parent()?.parent()?.hasClass('fop-form-feature-collapsed') || $("#fop_fints_konto-table")?.parent()?.parent()?.hasClass('fop-form-feature-mode-area')) {
											$.get(querystr, function(data){
												var tab = $("#fop_fints_konto-table");
												var top = tab.find('.fop-table-body-inner');
												var el;
												if (onlyScroll && (el = $('<div class="tabcontent">' + data + '</div>').find('.fop-table-body-inner'))) {
													// nur Scroll-Bereich ersetzen
													var paddingTop = parseInt(el.css('paddingTop') || '0px', 10);
													var minHeight = parseInt(el.css('minHeight'), 10)
													paddingTop += addPadding;
													minHeight += addPadding;
													top.css({paddingTop: paddingTop.toString()+'px', minHeight: minHeight.toString()+'px'}); // Offset
													el = el.children();
													top.empty();
													top.append(el);
													el = top; // top-upgrade doppelt machen, dadurch vermeiden wir das Array-upgrade => Performance
												} else {
													// gesamten Tab ersetzen
													tab.children().remove();
													el = tab.html('<div class="tabcontent">' + data + '</div>');
												}
												try {
													for (var i = 0; i < el.length; i++) upgradeDOM(el[i]);
												} catch (e) {
													console.log(e);
												}
												upgradeTable(el.find('.fop-table .fop-table-header')); // Falls es Tabellen-Layout ist: Spalten-Order anpassen
												flushURL(); // Neue URL in Titelleiste eintragen

												// Checkbox-Auswahl ankreuzen
												updateNumberfop_fints_konto('ID');
											});
											} else {
												// gesamten Tab ersetzen
												var tab = $("#fop_fints_konto-table");
												tab.children().remove();
												el = tab.html('<div class="fop-lazy-reload" onclick="reloadfop_fints_konto()"></div>');
											}
											<?php } ?>
											
										}
									}
									function checkfop_fints_konto (id, col, checked) {
										// ID-Liste aufbauen
										if (!window.DataViewChecked) window.DataViewChecked = {};
										if (!window.DataViewChecked['fop_fints_konto']) window.DataViewChecked['fop_fints_konto'] = {};
										if (!window.DataViewChecked['fop_fints_konto'][col]) window.DataViewChecked['fop_fints_konto'][col] = new IDList();

										// Abfrage aller gecheckten IDs für eine Tabelle
										if (!id) {
											return window.DataViewChecked['fop_fints_konto'][col].toString();
										}

										// check all, check id
										if (id == 'all') {
											// TODO: umbauen #1289: 'all' auch nur auf ne idlist reduzieren
											if (checked) {
												$.get(reloadfop_fints_konto({action: 'getids', col: col}, true), function (ids) {
													window.DataViewChecked['fop_fints_konto'][col] = new IDList(ids);
													updateNumberfop_fints_konto(col);
												});
											} else {
												window.DataViewChecked['fop_fints_konto'][col] = new IDList();
												updateNumberfop_fints_konto(col);
											}
										} else {
											var ids = new IDList(id);
											var allcb = $('#fop_fints_konto__all-checkbox');
											if (allcb[0]) {
												allcb[0].parentElement.MaterialCheckbox.uncheck(); // TODO: prüfen, ob Gruppen-CBs voll werden
											}
											if (checked == 'set') {
												window.DataViewChecked['fop_fints_konto'][col] = ids;
											} else for (id of ids.all()) {
												if (checked) {
													window.DataViewChecked['fop_fints_konto'][col].push(id);
												} else {
													window.DataViewChecked['fop_fints_konto'][col].remove(id);
												}
											}
											updateNumberfop_fints_konto(col);
										}
									}
								</script><?php

    
  }

  public static function renderSpecialFilters() { 
    
    
    // --- BLOCK: main ---
    ?>
	
	<script type"text/javascript">
		function updateSpecialFilter(param, val) {
			query[param] = val.toString();reloadfop_fints_konto();
			
		}

	</script>
	<?php
	
    
  }

  public static function renderTabTableAction() { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
     ?><div class='fop-dv-buttonbar'><?php if(((\FOP\User::getBuchhaltung()))) { ?><a class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" onclick="
		var self = this;
		event.preventDefault();
		$.get(reloadfop_fints_konto({action: 'open', fop_table: 'fop_fints_konto', fop_id: '_', fop_from: location.href}, true))
		.then(function () {
			window.open_url(self.href, false);
		});" href="<?php echo htmlentities(\TablesRouter\Fop_fints_konto::createURL2(['from' => $_GET['from'] ?? null, 'popup' => $_GET['popup'] ?? null])); ?>"><i class="material-icons">add</i> <?php echo(sprintf(_('create %s'), _('Bankkonto'))); ?></a><?php }if(((\FOP\User::getBuchhaltung())) && (!\FOP\User::getIsGuest())) { ?><a class="mdl-button mdl-js-button mdl-button--raised mdl-button--colored" href="#" onclick="reloadfop_fints_konto({action: 'exportCSV'}); return false;">
		<i class="material-icons">view_comfy</i>
		<?php echo(_('CSV-Export')); ?>
	</a><?php } ?></div><?php 
								\FOP\User::getIsGuest();
								$itemheight = 32;
								$itemsperpage = ceil(1080 / $itemheight * 0.8);
								$page = (isset($_GET['page_fop_fints_konto']) ? intval($_GET['page_fop_fints_konto']) : 0);
								$addlines = (isset($_GET['addlines_fop_fints_konto']) ? intval($_GET['addlines_fop_fints_konto']) : 0);
								$firstitem = $page * $itemsperpage;
								$sqladdon = ' LIMIT ' . ($itemsperpage * 2) . ' OFFSET ' . ($firstitem);
								$data = self::getData($sqladdon, $_GET);
								$arr = $data["items"];
								$itemcount = $data["itemcount"];
								$lastPage = ceil($itemcount/$itemsperpage-1);
								// calculate width of first column: 67px + 32px for each shortcut
								$firstColumnWidth = 66 + 34 + 34;
								$additionalLines = 0;

									// Spaltenliste zuerst aufbauen, damit sie noch umsortiert werden kann
									$order = 1000;
									$columns = [];
									
										if(true){
											$col = [
												'id' => 'kontoname',
												'desc' => _('Bezeichnung'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['kontoname'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'kontostand',
												'desc' => _('Kontostand'),
												'order' => ++$order,
												'width' => 120, // default value
												'collapsed' => 0

											];
											$columns['kontostand'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'iban',
												'desc' => _('IBAN'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['iban'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'bank',
												'desc' => _('Bank'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['bank'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'tanMode',
												'desc' => _('Tan Modus'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['tanMode'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'fop_konto_zustand',
												'desc' => _('Zustand'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['fop_konto_zustand'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'last_sync',
												'desc' => _('Letztes Synchronisationsdatum'),
												'order' => ++$order,
												'width' => 160, // default value
												'collapsed' => 0

											];
											$columns['last_sync'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'pin_versuch',
												'desc' => _('PIN Versuche'),
												'order' => ++$order,
												'width' => 60, // default value
												'collapsed' => 0

											];
											$columns['pin_versuch'] = $col;
										}
									
										if(true){
											$col = [
												'id' => 'glaeubigerid',
												'desc' => _('Gläubiger-ID Lastschriften'),
												'order' => ++$order,
												'width' => 180, // default value
												'collapsed' => 0

											];
											$columns['glaeubigerid'] = $col;
										}
									

									// gespeicherte Spaltenanordnung
									foreach (\FOP\Database::query('SELECT * FROM fop_dataview WHERE '.qi('user').' = ' . \FOP\Database::quote(\FOP\User::getID()) . ' AND dataview = ' . \FOP\Database::quote('fop_fints_konto'))->fetchAll(\PDO::FETCH_ASSOC) AS $column => $c) {
										if (isset($columns[$c['column']])) {
											$columns[$c['column']]['order'] = $c['order']; // order, width, collapsed
											$columns[$c['column']]['width'] = $c['width']; // order, width, collapsed
											$columns[$c['column']]['collapsed'] = $c['collapsed']; // order, width, collapsed
										}
									}

									// DOM vor-rendern
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='kontoname'
												data-order='<?php echo intval($columns['kontoname']['order']); ?>'
												data-width='<?php echo intval($columns['kontoname']['width']); ?>'
												data-collapsed='<?php echo intval($columns['kontoname']['collapsed']); ?>'
												style='width: <?php echo intval($columns['kontoname']['width']); ?>px; <?php if ($columns['kontoname']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_konto(); 
		}});
		
		var el = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label fop-floatsorter\' style=\'width: calc(100% - 42px);\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(_('search')); ?></label></div>');
		win.append(el);
		var text = el.find('input');
		text.val(query['search_fop_fints_konto_kontoname'])
		text.on('change keyup paste', function () { if (text.val()) { query['search_fop_fints_konto_kontoname'] = text.val(); } else { delete query['search_fop_fints_konto_kontoname']; } changed = true; });
		text.focus();
		text.select();
		text.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_konto').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});

		var el2 = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(htmlentities(htmlentities(_('filter_contains_not')))); ?></label></div>');
		win.append(el2);
		var text2 = el2.find('input');
		text2.val(query['searchnot_fop_fints_konto_kontoname'])
		text2.on('change keyup paste', function () { if (text2.val()) { query['searchnot_fop_fints_konto_kontoname'] = text2.val(); } else { delete query['searchnot_fop_fints_konto_kontoname']; } changed = true; });
		text2.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_konto').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});
	
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_fints_konto'] == 'kontoname ASC') {
			query['sort_fop_fints_konto'] = 'kontoname DESC';
		 } else if (query['sort_fop_fints_konto'] == 'kontoname DESC') {
		 	delete query['sort_fop_fints_konto'];
		 } else {
			query['sort_fop_fints_konto'] = 'kontoname ASC';
		 }
		 reloadfop_fints_konto();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('Bezeichnung')); ?>'><?php echo(_('Bezeichnung')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'kontoname ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'kontoname DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_konto_kontoname']) || isset($_GET['range_max_fop_fints_konto_kontoname']) || isset($_GET['deps_fop_fints_konto_kontoname']) || isset($_GET['fullsearch_fop_fints_konto_kontoname']) || isset($_GET['dynamic_fop_fints_konto_kontoname']) || isset($_GET['search_fop_fints_konto_kontoname']) || isset($_GET['searchnot_fop_fints_konto_kontoname']) || isset($_GET['filter_fop_fints_konto_kontoname'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['kontoname']['header'] = ob_get_contents(); ob_end_clean();
											$columns['kontoname']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['kontoname']['width']); ?>px; <?php if ($columns['kontoname']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='kontoname'><span class='overflow-text' title="<?php echo htmlentities($item['kontoname']); ?>"><?php echo htmlentities($item['kontoname']); ?></span></div><?php
											};
											$columns['kontoname']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='kontoname'
													data-order='<?php echo intval($columns['kontoname']['order']); ?>'
													data-width='<?php echo intval($columns['kontoname']['width']); ?>'
													data-collapsed='<?php echo intval($columns['kontoname']['collapsed']); ?>'
													style='width: <?php echo intval($columns['kontoname']['width']); ?>px; <?php if ($columns['kontoname']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='kontostand'
												data-order='<?php echo intval($columns['kontostand']['order']); ?>'
												data-width='<?php echo intval($columns['kontostand']['width']); ?>'
												data-collapsed='<?php echo intval($columns['kontostand']['collapsed']); ?>'
												style='width: <?php echo intval($columns['kontostand']['width']); ?>px; <?php if ($columns['kontostand']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_konto(); 
		}});
		var von, bis; win.append('<div class=\'fop-floatsorter\'>' + window.i18n_von + '</div>').append(von = $('<input type=\'number\' step=\'any\'><br>').val(query['range_min_fop_fints_konto_kontostand']).on('change keyup paste', function () { query['range_min_fop_fints_konto_kontostand'] = von.val(); delete query['page_fop_fints_konto']; changed = true; }))
.append('<div>' + window.i18n_bis + '</div>').append(bis = $('<input type=\'number\' step=\'any\'>').val(query['range_max_fop_fints_konto_kontostand']).on('change keyup paste', function () { query['range_max_fop_fints_konto_kontostand'] = bis.val(); delete query['page_fop_fints_konto']; changed = true; }))
; von.focus(); von.select();
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_fints_konto'] == 'kontostand ASC') {
			query['sort_fop_fints_konto'] = 'kontostand DESC';
		 } else if (query['sort_fop_fints_konto'] == 'kontostand DESC') {
		 	delete query['sort_fop_fints_konto'];
		 } else {
			query['sort_fop_fints_konto'] = 'kontostand ASC';
		 }
		 reloadfop_fints_konto();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	" style='text-align: right;'>
													<span class='title-title' title='<?php echo(_('Kontostand')); ?>'><?php echo(_('Kontostand')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'kontostand ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'kontostand DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_konto_kontostand']) || isset($_GET['range_max_fop_fints_konto_kontostand']) || isset($_GET['deps_fop_fints_konto_kontostand']) || isset($_GET['fullsearch_fop_fints_konto_kontostand']) || isset($_GET['dynamic_fop_fints_konto_kontostand']) || isset($_GET['search_fop_fints_konto_kontostand']) || isset($_GET['searchnot_fop_fints_konto_kontostand']) || isset($_GET['filter_fop_fints_konto_kontostand'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['kontostand']['header'] = ob_get_contents(); ob_end_clean();
											$columns['kontostand']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['kontostand']['width']); ?>px; <?php if ($columns['kontostand']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='kontostand'><span style="white-space: nowrap; width: 100%; display: inline-block; text-align: right;"><?php echo htmlentities(\Types\Euro::print($item['kontostand'])); ?><?php echo '&nbsp;' .  htmlentities('€'); ?>
	</span></div><?php
											};
											$columns['kontostand']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='kontostand'
													data-order='<?php echo intval($columns['kontostand']['order']); ?>'
													data-width='<?php echo intval($columns['kontostand']['width']); ?>'
													data-collapsed='<?php echo intval($columns['kontostand']['collapsed']); ?>'
													style='width: <?php echo intval($columns['kontostand']['width']); ?>px; <?php if ($columns['kontostand']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='iban'
												data-order='<?php echo intval($columns['iban']['order']); ?>'
												data-width='<?php echo intval($columns['iban']['width']); ?>'
												data-collapsed='<?php echo intval($columns['iban']['collapsed']); ?>'
												style='width: <?php echo intval($columns['iban']['width']); ?>px; <?php if ($columns['iban']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_konto(); 
		}});
		
		var el = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label fop-floatsorter\' style=\'width: calc(100% - 42px);\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(_('search')); ?></label></div>');
		win.append(el);
		var text = el.find('input');
		text.val(query['search_fop_fints_konto_iban'])
		text.on('change keyup paste', function () { if (text.val()) { query['search_fop_fints_konto_iban'] = text.val(); } else { delete query['search_fop_fints_konto_iban']; } changed = true; });
		text.focus();
		text.select();
		text.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_konto').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});

		var el2 = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(htmlentities(htmlentities(_('filter_contains_not')))); ?></label></div>');
		win.append(el2);
		var text2 = el2.find('input');
		text2.val(query['searchnot_fop_fints_konto_iban'])
		text2.on('change keyup paste', function () { if (text2.val()) { query['searchnot_fop_fints_konto_iban'] = text2.val(); } else { delete query['searchnot_fop_fints_konto_iban']; } changed = true; });
		text2.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_konto').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});
	
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_fints_konto'] == 'iban ASC') {
			query['sort_fop_fints_konto'] = 'iban DESC';
		 } else if (query['sort_fop_fints_konto'] == 'iban DESC') {
		 	delete query['sort_fop_fints_konto'];
		 } else {
			query['sort_fop_fints_konto'] = 'iban ASC';
		 }
		 reloadfop_fints_konto();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('IBAN')); ?>'><?php echo(_('IBAN')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'iban ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'iban DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_konto_iban']) || isset($_GET['range_max_fop_fints_konto_iban']) || isset($_GET['deps_fop_fints_konto_iban']) || isset($_GET['fullsearch_fop_fints_konto_iban']) || isset($_GET['dynamic_fop_fints_konto_iban']) || isset($_GET['search_fop_fints_konto_iban']) || isset($_GET['searchnot_fop_fints_konto_iban']) || isset($_GET['filter_fop_fints_konto_iban'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['iban']['header'] = ob_get_contents(); ob_end_clean();
											$columns['iban']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['iban']['width']); ?>px; <?php if ($columns['iban']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='iban'><span class='overflow-text' title="<?php echo htmlentities($item['iban']); ?>"><?php echo htmlentities($item['iban']); ?></span></div><?php
											};
											$columns['iban']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='iban'
													data-order='<?php echo intval($columns['iban']['order']); ?>'
													data-width='<?php echo intval($columns['iban']['width']); ?>'
													data-collapsed='<?php echo intval($columns['iban']['collapsed']); ?>'
													style='width: <?php echo intval($columns['iban']['width']); ?>px; <?php if ($columns['iban']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='bank'
												data-order='<?php echo intval($columns['bank']['order']); ?>'
												data-width='<?php echo intval($columns['bank']['width']); ?>'
												data-collapsed='<?php echo intval($columns['bank']['collapsed']); ?>'
												style='width: <?php echo intval($columns['bank']['width']); ?>px; <?php if ($columns['bank']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_konto(); 
		}});
		
		win.append(getfilter_fop_fints_konto_bankListMultiFilter()); win.find('input').first().focus();
		return false;
	">
													<span class='title-title' title='<?php echo(_('Bank')); ?>'><?php echo(_('Bank')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'bank ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'bank DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_konto_bank']) || isset($_GET['range_max_fop_fints_konto_bank']) || isset($_GET['deps_fop_fints_konto_bank']) || isset($_GET['fullsearch_fop_fints_konto_bank']) || isset($_GET['dynamic_fop_fints_konto_bank']) || isset($_GET['search_fop_fints_konto_bank']) || isset($_GET['searchnot_fop_fints_konto_bank']) || isset($_GET['filter_fop_fints_konto_bank'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['bank']['header'] = ob_get_contents(); ob_end_clean();
											$columns['bank']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['bank']['width']); ?>px; <?php if ($columns['bank']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='bank'><?php
	
	call_user_func(function () use ($item) {
	$id = $item['bank'];
	$val = $item['bank::description'];
	$canView = $item['bank::canView'];
	if ($val !== null) {
		if ($canView) echo "<a tabindex=\"-1\" class=\"mdl-button mdl-button-small tbl-link\" data-tbl=\"fop_fints_bank\" data-id=\"".htmlentities($id)."\" onclick=\"event.stopPropagation(); event.preventDefault(); open_url(this.href, false);\" href=\"" . \TablesRouter\Fop_fints_bank::viewURL($id, ['from' => \FOP\Util::getBackURL()]) . "\">(…)</a>";echo htmlentities($val);
	} else {
		echo htmlentities(_('') ?: '-');
	}
	});
	
?>
</div><?php
											};
											$columns['bank']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='bank'
													data-order='<?php echo intval($columns['bank']['order']); ?>'
													data-width='<?php echo intval($columns['bank']['width']); ?>'
													data-collapsed='<?php echo intval($columns['bank']['collapsed']); ?>'
													style='width: <?php echo intval($columns['bank']['width']); ?>px; <?php if ($columns['bank']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='tanMode'
												data-order='<?php echo intval($columns['tanMode']['order']); ?>'
												data-width='<?php echo intval($columns['tanMode']['width']); ?>'
												data-collapsed='<?php echo intval($columns['tanMode']['collapsed']); ?>'
												style='width: <?php echo intval($columns['tanMode']['width']); ?>px; <?php if ($columns['tanMode']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_konto(); 
		}});
		
		win.append(getfilter_fop_fints_konto_tanModeListMultiFilter()); win.find('input').first().focus();
		return false;
	">
													<span class='title-title' title='<?php echo(_('Tan Modus')); ?>'><?php echo(_('Tan Modus')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'tanMode ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'tanMode DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_konto_tanMode']) || isset($_GET['range_max_fop_fints_konto_tanMode']) || isset($_GET['deps_fop_fints_konto_tanMode']) || isset($_GET['fullsearch_fop_fints_konto_tanMode']) || isset($_GET['dynamic_fop_fints_konto_tanMode']) || isset($_GET['search_fop_fints_konto_tanMode']) || isset($_GET['searchnot_fop_fints_konto_tanMode']) || isset($_GET['filter_fop_fints_konto_tanMode'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['tanMode']['header'] = ob_get_contents(); ob_end_clean();
											$columns['tanMode']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['tanMode']['width']); ?>px; <?php if ($columns['tanMode']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='tanMode'><?php
	
	call_user_func(function () use ($item) {
	$id = $item['tanMode'];
	$val = $item['tanMode::description'];
	$canView = $item['tanMode::canView'];
	if ($val !== null) {
		if ($canView) echo "<a tabindex=\"-1\" class=\"mdl-button mdl-button-small tbl-link\" data-tbl=\"fop_fints_tanMode\" data-id=\"".htmlentities($id)."\" onclick=\"event.stopPropagation(); event.preventDefault(); open_url(this.href, false);\" href=\"" . \TablesRouter\Fop_fints_tanMode::viewURL($id, ['from' => \FOP\Util::getBackURL()]) . "\">(…)</a>";echo htmlentities($val);
	} else {
		echo htmlentities(_('') ?: '-');
	}
	});
	
?>
</div><?php
											};
											$columns['tanMode']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='tanMode'
													data-order='<?php echo intval($columns['tanMode']['order']); ?>'
													data-width='<?php echo intval($columns['tanMode']['width']); ?>'
													data-collapsed='<?php echo intval($columns['tanMode']['collapsed']); ?>'
													style='width: <?php echo intval($columns['tanMode']['width']); ?>px; <?php if ($columns['tanMode']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='fop_konto_zustand'
												data-order='<?php echo intval($columns['fop_konto_zustand']['order']); ?>'
												data-width='<?php echo intval($columns['fop_konto_zustand']['width']); ?>'
												data-collapsed='<?php echo intval($columns['fop_konto_zustand']['collapsed']); ?>'
												style='width: <?php echo intval($columns['fop_konto_zustand']['width']); ?>px; <?php if ($columns['fop_konto_zustand']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_konto(); 
		}});
		win.append($('<input type=\'checkbox\'' + (querySet('filter_fop_fints_konto_fop_konto_zustand', '0') ? ' checked>': '>')).change(function (){querySet('filter_fop_fints_konto_fop_konto_zustand', '0', $(this).prop('checked')); changed=true;})).append('<span> </span><?php echo(_('noch nicht freigeschalten')); ?><br/>').append($('<input type=\'checkbox\'' + (querySet('filter_fop_fints_konto_fop_konto_zustand', '1') ? ' checked>': '>')).change(function (){querySet('filter_fop_fints_konto_fop_konto_zustand', '1', $(this).prop('checked')); changed=true;})).append('<span> </span><?php echo(_('Synchronisation aktiviert')); ?><br/>').append($('<input type=\'checkbox\'' + (querySet('filter_fop_fints_konto_fop_konto_zustand', '2') ? ' checked>': '>')).change(function (){querySet('filter_fop_fints_konto_fop_konto_zustand', '2', $(this).prop('checked')); changed=true;})).append('<span> </span><?php echo(_('Synchronisation deaktiviert')); ?><br/>').append($('<input type=\'checkbox\'' + (querySet('filter_fop_fints_konto_fop_konto_zustand', '3') ? ' checked>': '>')).change(function (){querySet('filter_fop_fints_konto_fop_konto_zustand', '3', $(this).prop('checked')); changed=true;})).append('<span> </span><?php echo(_('Synchronisation Error')); ?><br/>').append($('<input type=\'checkbox\'' + (querySet('filter_fop_fints_konto_fop_konto_zustand', '4') ? ' checked>': '>')).change(function (){querySet('filter_fop_fints_konto_fop_konto_zustand', '4', $(this).prop('checked')); changed=true;})).append('<span> </span><?php echo(_('PIN falsch')); ?><br/>');
		return false;
	">
													<span class='title-title' title='<?php echo(_('Zustand')); ?>'><?php echo(_('Zustand')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'fop_konto_zustand ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'fop_konto_zustand DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_konto_fop_konto_zustand']) || isset($_GET['range_max_fop_fints_konto_fop_konto_zustand']) || isset($_GET['deps_fop_fints_konto_fop_konto_zustand']) || isset($_GET['fullsearch_fop_fints_konto_fop_konto_zustand']) || isset($_GET['dynamic_fop_fints_konto_fop_konto_zustand']) || isset($_GET['search_fop_fints_konto_fop_konto_zustand']) || isset($_GET['searchnot_fop_fints_konto_fop_konto_zustand']) || isset($_GET['filter_fop_fints_konto_fop_konto_zustand'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['fop_konto_zustand']['header'] = ob_get_contents(); ob_end_clean();
											$columns['fop_konto_zustand']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['fop_konto_zustand']['width']); ?>px; <?php if ($columns['fop_konto_zustand']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='fop_konto_zustand'><?php echo htmlentities(\Types\Fop_konto_zustand::toStringShort($item['fop_konto_zustand'])); ?></div><?php
											};
											$columns['fop_konto_zustand']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='fop_konto_zustand'
													data-order='<?php echo intval($columns['fop_konto_zustand']['order']); ?>'
													data-width='<?php echo intval($columns['fop_konto_zustand']['width']); ?>'
													data-collapsed='<?php echo intval($columns['fop_konto_zustand']['collapsed']); ?>'
													style='width: <?php echo intval($columns['fop_konto_zustand']['width']); ?>px; <?php if ($columns['fop_konto_zustand']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='last_sync'
												data-order='<?php echo intval($columns['last_sync']['order']); ?>'
												data-width='<?php echo intval($columns['last_sync']['width']); ?>'
												data-collapsed='<?php echo intval($columns['last_sync']['collapsed']); ?>'
												style='width: <?php echo intval($columns['last_sync']['width']); ?>px; <?php if ($columns['last_sync']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_konto(); 
		}}, 600);
		date_filter(win, 'fop_fints_konto', 'last_sync', <?php echo htmlentities(json_encode(_('period'))); ?>, <?php echo htmlentities(json_encode(\FOP\I18n::getShortLocale())); ?>, <?php echo htmlentities(json_encode(_('dateformat_moment'))); ?>, function() { reloadfop_fints_konto();  reloadfop_fints_konto(); });
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_fints_konto'] == 'last_sync ASC') {
			query['sort_fop_fints_konto'] = 'last_sync DESC';
		 } else if (query['sort_fop_fints_konto'] == 'last_sync DESC') {
		 	delete query['sort_fop_fints_konto'];
		 } else {
			query['sort_fop_fints_konto'] = 'last_sync ASC';
		 }
		 reloadfop_fints_konto();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('Letztes Synchronisationsdatum')); ?>'><?php echo(_('Letztes Synchronisationsdatum')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'last_sync ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'last_sync DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_konto_last_sync']) || isset($_GET['range_max_fop_fints_konto_last_sync']) || isset($_GET['deps_fop_fints_konto_last_sync']) || isset($_GET['fullsearch_fop_fints_konto_last_sync']) || isset($_GET['dynamic_fop_fints_konto_last_sync']) || isset($_GET['search_fop_fints_konto_last_sync']) || isset($_GET['searchnot_fop_fints_konto_last_sync']) || isset($_GET['filter_fop_fints_konto_last_sync'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['last_sync']['header'] = ob_get_contents(); ob_end_clean();
											$columns['last_sync']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['last_sync']['width']); ?>px; <?php if ($columns['last_sync']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='last_sync'><span class='overflow-text' title="<?php echo htmlentities(($item['last_sync']) ? strftime(_('datetimeformat_php2'), intval($item['last_sync'])) : ''); ?>"><?php echo htmlentities(($item['last_sync']) ? strftime(_('datetimeformat_php2'), intval($item['last_sync'])) : ''); ?></span></div><?php
											};
											$columns['last_sync']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='last_sync'
													data-order='<?php echo intval($columns['last_sync']['order']); ?>'
													data-width='<?php echo intval($columns['last_sync']['width']); ?>'
													data-collapsed='<?php echo intval($columns['last_sync']['collapsed']); ?>'
													style='width: <?php echo intval($columns['last_sync']['width']); ?>px; <?php if ($columns['last_sync']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='pin_versuch'
												data-order='<?php echo intval($columns['pin_versuch']['order']); ?>'
												data-width='<?php echo intval($columns['pin_versuch']['width']); ?>'
												data-collapsed='<?php echo intval($columns['pin_versuch']['collapsed']); ?>'
												style='width: <?php echo intval($columns['pin_versuch']['width']); ?>px; <?php if ($columns['pin_versuch']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_konto(); 
		}});
		var von, bis; win.append('<div class=\'fop-floatsorter\'>' + window.i18n_von + '</div>').append(von = $('<input type=\'number\' step=\'any\'><br>').val(query['range_min_fop_fints_konto_pin_versuch']).on('change keyup paste', function () { query['range_min_fop_fints_konto_pin_versuch'] = von.val(); delete query['page_fop_fints_konto']; changed = true; }))
.append('<div>' + window.i18n_bis + '</div>').append(bis = $('<input type=\'number\' step=\'any\'>').val(query['range_max_fop_fints_konto_pin_versuch']).on('change keyup paste', function () { query['range_max_fop_fints_konto_pin_versuch'] = bis.val(); delete query['page_fop_fints_konto']; changed = true; }))
; von.focus(); von.select();
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_fints_konto'] == 'pin_versuch ASC') {
			query['sort_fop_fints_konto'] = 'pin_versuch DESC';
		 } else if (query['sort_fop_fints_konto'] == 'pin_versuch DESC') {
		 	delete query['sort_fop_fints_konto'];
		 } else {
			query['sort_fop_fints_konto'] = 'pin_versuch ASC';
		 }
		 reloadfop_fints_konto();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	" style='text-align: right;'>
													<span class='title-title' title='<?php echo(_('PIN Versuche')); ?>'><?php echo(_('PIN Versuche')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'pin_versuch ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'pin_versuch DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_konto_pin_versuch']) || isset($_GET['range_max_fop_fints_konto_pin_versuch']) || isset($_GET['deps_fop_fints_konto_pin_versuch']) || isset($_GET['fullsearch_fop_fints_konto_pin_versuch']) || isset($_GET['dynamic_fop_fints_konto_pin_versuch']) || isset($_GET['search_fop_fints_konto_pin_versuch']) || isset($_GET['searchnot_fop_fints_konto_pin_versuch']) || isset($_GET['filter_fop_fints_konto_pin_versuch'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['pin_versuch']['header'] = ob_get_contents(); ob_end_clean();
											$columns['pin_versuch']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['pin_versuch']['width']); ?>px; <?php if ($columns['pin_versuch']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='pin_versuch'><span style="white-space: nowrap; width: 100%; display: inline-block; text-align: right;"><?php echo htmlentities(\Types\Integer::print($item['pin_versuch'])); ?>
	</span></div><?php
											};
											$columns['pin_versuch']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='pin_versuch'
													data-order='<?php echo intval($columns['pin_versuch']['order']); ?>'
													data-width='<?php echo intval($columns['pin_versuch']['width']); ?>'
													data-collapsed='<?php echo intval($columns['pin_versuch']['collapsed']); ?>'
													style='width: <?php echo intval($columns['pin_versuch']['width']); ?>px; <?php if ($columns['pin_versuch']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									
										
										if(true){
											ob_start();
											?><div class="fop-table-column overlay"
												data-column='glaeubigerid'
												data-order='<?php echo intval($columns['glaeubigerid']['order']); ?>'
												data-width='<?php echo intval($columns['glaeubigerid']['width']); ?>'
												data-collapsed='<?php echo intval($columns['glaeubigerid']['collapsed']); ?>'
												style='width: <?php echo intval($columns['glaeubigerid']['width']); ?>px; <?php if ($columns['glaeubigerid']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
												<span class='title' onclick="
		var changed = false, win = dropDownFixPosition($(this), null, function() { if (changed) {
			
			reloadfop_fints_konto(); 
		}});
		
		var el = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label fop-floatsorter\' style=\'width: calc(100% - 42px);\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(_('search')); ?></label></div>');
		win.append(el);
		var text = el.find('input');
		text.val(query['search_fop_fints_konto_glaeubigerid'])
		text.on('change keyup paste', function () { if (text.val()) { query['search_fop_fints_konto_glaeubigerid'] = text.val(); } else { delete query['search_fop_fints_konto_glaeubigerid']; } changed = true; });
		text.focus();
		text.select();
		text.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_konto').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});

		var el2 = $('<div class=\'mdl-textfield mdl-js-textfield mdl-textfield--floating-label\'><input class=\'mdl-textfield__input\' style=\'display: inline-block;\' type=\'text\'><label class=\'mdl-textfield__input\'><?php echo(htmlentities(htmlentities(_('filter_contains_not')))); ?></label></div>');
		win.append(el2);
		var text2 = el2.find('input');
		text2.val(query['searchnot_fop_fints_konto_glaeubigerid'])
		text2.on('change keyup paste', function () { if (text2.val()) { query['searchnot_fop_fints_konto_glaeubigerid'] = text2.val(); } else { delete query['searchnot_fop_fints_konto_glaeubigerid']; } changed = true; });
		text2.keydown(function (event) {if ((event.keyCode || event.which) == 13) {$('#table_fop_fints_konto').find('.fop-table-row:first').click();} if (event.key === 'Escape') { win.close(); }});
	
	var icon, sortbtn	= $('<a class=\'mdl-button mdl-js-button mdl-button--icon mdl-button--colored\' style=\'display: inline-block;\'></a>')
		.append(icon = $('<i class=\'material-icons\'></i>').text('unfold_more'))
		.click(function() {
		 if (query['sort_fop_fints_konto'] == 'glaeubigerid ASC') {
			query['sort_fop_fints_konto'] = 'glaeubigerid DESC';
		 } else if (query['sort_fop_fints_konto'] == 'glaeubigerid DESC') {
		 	delete query['sort_fop_fints_konto'];
		 } else {
			query['sort_fop_fints_konto'] = 'glaeubigerid ASC';
		 }
		 reloadfop_fints_konto();
		 return false;
	});
	if (win.children().first().hasClass('fop-floatsorter')) {
		// floating layout
		win.prepend(sortbtn.css({float: 'right', margin: '0px'}));
	} else {
		// append to the end
		win.append(sortbtn);
	}
		return false;
	">
													<span class='title-title' title='<?php echo(_('Gläubiger-ID Lastschriften')); ?>'><?php echo(_('Gläubiger-ID Lastschriften')); ?></span>
													<?php // sort indicator
														if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'glaeubigerid ASC') {
															?><i class='material-icons fop-small'>keyboard_arrow_down</i><?php
														} else if (isset($_GET['sort_fop_fints_konto']) && $_GET['sort_fop_fints_konto'] == 'glaeubigerid DESC') {
															?><i class='material-icons fop-small'>keyboard_arrow_up</i><?php
														}
														if (isset($_GET['range_min_fop_fints_konto_glaeubigerid']) || isset($_GET['range_max_fop_fints_konto_glaeubigerid']) || isset($_GET['deps_fop_fints_konto_glaeubigerid']) || isset($_GET['fullsearch_fop_fints_konto_glaeubigerid']) || isset($_GET['dynamic_fop_fints_konto_glaeubigerid']) || isset($_GET['search_fop_fints_konto_glaeubigerid']) || isset($_GET['searchnot_fop_fints_konto_glaeubigerid']) || isset($_GET['filter_fop_fints_konto_glaeubigerid'])) {
															// filter indicator
															?><i class='material-icons fop-small'>filter_list</i><?php
														}
														// search indicator
														?><i class='material-icons fop-small'>search</i>
													</span>
												<div class='fop-column-handle'></div>
											</div><?php
											$columns['glaeubigerid']['header'] = ob_get_contents(); ob_end_clean();
											$columns['glaeubigerid']['render'] = function ($item) use (&$columns, $itemheight) {
												// Render-Callback für eine Zelle
												?><div class='fop-table-column'
													style='width: <?php echo intval($columns['glaeubigerid']['width']); ?>px; <?php if ($columns['glaeubigerid']['collapsed'] == 1) { echo ' display: none;'; } ?> height: <?php echo $itemheight; ?>px; ' data-column='glaeubigerid'><span class='overflow-text' title="<?php echo htmlentities($item['glaeubigerid']); ?>"><?php echo htmlentities($item['glaeubigerid']); ?></span></div><?php
											};
											$columns['glaeubigerid']['renderSum'] = function ($item) use (&$columns) {
												// Render-Callback Summe
												?><div class='fop-table-column fop-table-column-aggregate'
													data-column='glaeubigerid'
													data-order='<?php echo intval($columns['glaeubigerid']['order']); ?>'
													data-width='<?php echo intval($columns['glaeubigerid']['width']); ?>'
													data-collapsed='<?php echo intval($columns['glaeubigerid']['collapsed']); ?>'
													style='width: <?php echo intval($columns['glaeubigerid']['width']); ?>px; <?php if ($columns['glaeubigerid']['collapsed'] == 1) { echo ' display: none;'; } ?>'>
													</div><?php
											};
										}
										
									

									// sort by order
									uasort($columns, function ($a, $b) {
										return $a['order'] - $b['order'];
									});
									?>
									<style type='text/css'>
										#fop_fints_konto-table .fop-table-header {
											height: <?php echo 32; ?>px;
										}
										#fop_fints_konto-table .fop-table-header .fop-table-column .title,
										#fop_fints_konto-table .fop-column-handle,
										#fop_fints_konto-table .fop-table-row,
										#fop_fints_konto-table .fop-table-row .fop-table-column,
										#fop_fints_konto-table .fop-table-column-multicontrol,
										#fop_fints_konto-table .fop-filter-button {
											height: 32px;
											line-height: 32px;
										}
										</style>
											<div class="fop-table" data-table-id="fop_fints_konto">
											<div class="fop-legend"></div>
											<div class="fop-filter-string-wrapper"><div class="fop-filter-string"><label>Filter:</label> <span><?php echo self::getFilterHTML($_GET); ?></span></div></div>
											
											<?php if (isset($_GET['select'])) { echo '<br>'; } ?>
											<div class="fop-table-header">
											<?php if (!isset($_GET['select'])) { ?>
												<div class="fop-table-column noprint" style="width: <?php echo json_encode($firstColumnWidth); ?>px;">
													
													<div class="fop-table-column-multicontrol">
													<label class="mdl-checkbox mdl-js-checkbox"  style='width: auto;' for="fop_fints_konto__all-checkbox">
														<input class="mdl-checkbox__input" id="fop_fints_konto__all-checkbox" type="checkbox" onchange="checkfop_fints_konto('all', 'ID', this.checked);">
														</label>
														<button type="button" class="mdl-button mdl-js-button mdl-button--icon fop_fints_konto__mass-action" style='visibility: hidden;' onclick="$.get('DataView/Fop_fints_konto/permissions?id=' + checkfop_fints_konto(null, 'ID'), function (data) { for (var method in data) if (method != '__cnt') { var btn = $('[data-interaction-name=&quot;' + method + '&quot;]'); if (data[method] >= 1) btn.show(); else btn.hide(); btn.find('.cnt').text(data[method]); }; }); dropDownFixPosition($(this), $(this).next())">
															<i class="material-icons">more_vert</i>
														</button>
														<ul class="mdl-list mdl-card mdl-shadow--4dp fop-scroll-menu">
															<?php
		if(true) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="filterall" style="margin-right:auto; text-align:left;"
					onclick="for (key in query) if (key.indexOf('range_min_fop_fints_konto_') == 0 || key.indexOf('range_max_fop_fints_konto_') == 0 || key.indexOf('deps_fop_fints_konto_') == 0 || key.indexOf('fullsearch_fop_fints_konto_') == 0 || key.indexOf('dynamic_fop_fints_konto_') == 0 || key.indexOf('search_fop_fints_konto_') == 0 || key.indexOf('searchnot_fop_fints_konto_') == 0 || key.indexOf('filter_fop_fints_konto_') == 0) delete query[key]; reloadfop_fints_konto(); $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">list</i></span><span class="fop-menu-caption" title="<?php echo(_('view all elements')); ?>"><?php echo(_('view all elements')); ?> 
					</span>
				</span>
			</span>
		<?php } ?><?php
		if(true) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="filteronly" style="margin-right:auto; text-align:left;"
					onclick="query['filter_fop_fints_konto_ID'] = checkfop_fints_konto(null, 'ID'); delete query['page_fop_fints_konto']; reloadfop_fints_konto(); $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">arrow_forward</i></span><span class="fop-menu-caption" title="<?php echo(_('view only these elements')); ?>"><?php echo(_('view only these elements')); ?> (<span class='cnt'></span>)
					</span>
				</span>
			</span>
		<?php } ?><?php
		if(true) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="filterrange" style="margin-right:auto; text-align:left;"
					onclick="
		var ticks = new IDList(checkfop_fints_konto(null, 'ID'));
		var range = prompt('Bitte geben Sie den Bereich ein', '1-' + ticks.count());
		var newticks = new IDList();
		if (range) {
			range = range.split('-');
			if (range.length == 1) {
				range.push(range[0]);
			}
			var skip = (range[0] || 1) - 1;
			var take = (range[1] || Infinity) - skip;
			for (var item of ticks.all()) {
				if (skip > 0) {
					skip--;
				} else if (take > 0) {
					newticks.push(item);
					take--;
				} else break;
			}
			checkfop_fints_konto(newticks, 'ID', 'set');
		} $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">colorize</i></span><span class="fop-menu-caption" title="<?php echo(_('limit range')); ?>"><?php echo(_('limit range')); ?> (<span class='cnt'></span>)
					</span>
				</span>
			</span>
		<?php } ?><?php
		if(true && ((\FOP\User::getBuchhaltung())) && (!\FOP\User::getIsGuest())) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="exportCSV_multi" style="margin-right:auto; text-align:left;"
					onclick="location.href = 'DataView/Fop_fints_konto/exportCSV?ajax&from=<?php echo urlencode(\FOP\Util::getBackUrl()); ?>&filter_fop_fints_konto_ID=' + escape(checkfop_fints_konto(null, 'ID')); $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">view_comfy</i></span><span class="fop-menu-caption" title="<?php echo(_('CSV-Export')); ?>"><?php echo(_('CSV-Export')); ?> (<span class='cnt'></span>)
					</span>
				</span>
			</span>
		<?php } ?><?php
		if(true && ((\FOP\User::getBuchhaltung()))) { ?>
			<span class="mdl-list__item mdl-button">
				<span class="mdl-list__item mdl-button" data-interaction-name="delete" style="margin-right:auto; text-align:left;"
					onclick="if(!confirm(<?php echo htmlentities(json_encode(_('confirmdelete'))); ?>)) return;$.get('Tables/Fop_fints_konto/delete?ajax&from=<?php echo urlencode(\FOP\Util::getBackUrl()); ?>&id=' + escape(checkfop_fints_konto(null, 'ID'))).then(function () { reloadfop_fints_konto(); }, function (err) { if (err.responseText.startsWith('http')) { window.location.href = err.responseText; } else {alert(err.responseText); }}); $(this).closest('.overlay').click(); return false;">
					<span style="float:left;"><i class="material-icons">delete</i></span><span class="fop-menu-caption" title="<?php echo(_('delete')); ?>"><?php echo(_('delete')); ?> (<span class='cnt'></span>)
					</span>
				</span>
			</span>
		<?php } ?>
														</ul>
														<!-- column hide -->
														<button type="button" class="mdl-button mdl-js-button mdl-button--icon" onclick="dropDownFixPosition($(this), $(this).next())">
															<i class="material-icons">visibility</i>
														</button>
														<ul class="mdl-list mdl-card mdl-shadow--4dp fop-scroll-menu">
															<?php foreach ($columns AS $col) { ?>
																<li class="mdl-list__item mdl-button" onclick="
																	var isVisible = this.firstElementChild.innerText !== 'clear';
																	this.firstElementChild.innerText = isVisible ? 'clear' : 'visibility'; // switch icon
																	tableColumnVisibility('fop_fints_konto', <?php echo htmlentities(json_encode($col['id'])); ?>, !isVisible); // the rest is up to a helper function in layout/tables.fop
																	">
																	<i class="material-icons"><?php if ($col['collapsed']) { echo 'clear'; } else { echo 'visibility'; }?></i>
																	<?php echo htmlentities($col['desc']); ?>
																</li>
															<?php } ?>
															<li class="mdl-list__item mdl-button" onclick="
																$.get('FOP/Index/dataview?data='+encodeURIComponent(JSON.stringify({dataview: 'fop_fints_konto', reset: true}))).then(function () { location.reload(); });
																">
																<i class="material-icons">refresh</i>
																<?php echo _('reset all'); ?>
															</li>
														</ul>
													</div>
												</div><?php }
												
												foreach ($columns AS $col) {
													// Spalten-Überschrift rendern
													echo $col['header'];
												} ?>
											 </div>
											
											<div class="fop-table-body" id="table_fop_fints_konto" <?php \EasyEditor\Navigation::printScroll('dv.Fop_fints_konto', '/* scroll horiz */ this.previousElementSibling.firstElementChild.style.marginLeft = \'-\' + this.scrollLeft + \'px\';
												/* scroll verti */
												var self = this;
												if (window.DataViewScrollReloadTimeout) clearTimeout(window.DataViewScrollReloadTimeout);
												window.DataViewScrollReloadTimeout = setTimeout(function () {
													var currentPage = parseInt(query[\'page_fop_fints_konto\'] || 0);
													var paddingTop = parseInt( self.lastElementChild.style.paddingTop, 10);
													var wantedPage = Math.max(0, currentPage + Math.floor((self.scrollTop - paddingTop) / ' . ($itemheight * $itemsperpage) . '));
													if (wantedPage != currentPage) {
														query[\'page_fop_fints_konto\'] = wantedPage;
														reloadfop_fints_konto(undefined, undefined, true);
													}
												}, 50);
											'); ?>>
												<div class="fop-table-body-inner" style="min-height: <?php echo 12 + $itemheight * ($itemcount + $additionalLines); ?>px; padding-top: <?php echo $itemheight * $itemsperpage * $page; ?>px;">
												<?php foreach($arr as $itempos => $item) {
													?>
													<div class="fop-table-row" style="<?php echo 'background: ' .htmlentities((function ($item) {return $item['::color'];})($item)).'!important;'; ?> " data-fop_fints_konto-id="<?php echo htmlentities($item['ID']); ?>"<?php if (isset($item['ID'])){
														if (isset($_GET['select']) && isset($_GET['from'])) {
															echo 'onclick="event.preventDefault(); if (!window.getSelection().toString()) window.location.href=' . htmlentities(json_encode($_GET['from'] . '&colvalue=' . urlencode($item['ID']))) . ';" ';
														} else {
															echo 'onclick="event.preventDefault(); if (!window.getSelection().toString()) open_url(reloadfop_fints_konto({action: \'open\', fop_table: \'fop_fints_konto\', fop_id: ' .  htmlentities(json_encode($item['ID'])) . ', fop_from: location.href}, true), false);"';
														}
													}?> >

													<?php if (!isset($_GET['select'])) { ?>
													<div class='fop-table-column noprint' style="width: <?php echo json_encode($firstColumnWidth); ?>px;" onclick="$(this).find('input[type=checkbox]').first().click(); event.stopPropagation();">
													<label onclick="event.stopPropagation();" class="mdl-checkbox mdl-js-checkbox fop_fints_konto__checkbox fop_fints_konto__checkbox fop_fints_konto__checkbox-ID-<?php echo htmlentities($item['ID']); ?>" style="width: auto;" for="fop_fints_konto__<?php echo htmlentities($itempos); ?>-checkbox">
													<input class="mdl-checkbox__input" id="fop_fints_konto__<?php echo htmlentities($itempos); ?>-checkbox" type="checkbox" onchange="<?php if (isset($item['ID'])) echo 'checkfop_fints_konto(' . htmlentities(json_encode($item['ID'])) . ', \'ID\', this.checked); ' ?>">
													</label><button type="button" class="mdl-button mdl-js-button mdl-button--icon fop_fints_konto__action" onclick="
														event.stopPropagation();
														dropDownFixPosition($(this), $(this).next());
														">
														<i class="material-icons">more_vert</i>
													</button><ul class="mdl-list mdl-card mdl-shadow--4dp fop-scroll-menu" id="fop-scroll-menu-fop_fints_konto-action-<?php echo $item['ID'] ?? 0; ?>">
														<?php
		if(isset($item['ID']) && $item['operation::view']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="view" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Fop_fints_konto::viewURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick=" if (!event.ctrlKey) { open_url(reloadfop_fints_konto({action: 'open', fop_table: 'fop_fints_konto', fop_id: <?php echo htmlentities(json_encode($item['ID'])); ?>, fop_from: location.href}, true), false); return false; } $(this).closest('.overlay').click(); return false;  
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">find_in_page</i></span><span class="fop-menu-caption" title="<?php echo(_('open')); ?>"><?php echo(_('open')); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && $item['operation::view'] && $item['operation::edit']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="edit" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Fop_fints_konto::editURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">edit</i></span><span class="fop-menu-caption" title="<?php echo(_('edit')); ?>"><?php echo(_('edit')); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && $item['operation::view']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="activate" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Fop_fints_konto::activateURL2(['id' => $item['ID'], 'from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">refresh</i></span><span class="fop-menu-caption" title="<?php echo(_('Aktivieren/Deaktivieren')); ?>"><?php echo(_('Aktivieren/Deaktivieren')); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && ((false) && (\FOP\User::getBuchhaltung()) && (\FOP\User::getBuchhaltung())) && $item['operation::f1b1852a9f071208b1f353b6ed4a3cb0f49045524eb521e4e364bb12d54a1615'] && $item['operation::RcATHOIs']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="create_fop_fints_buchung_konto" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Fop_fints_buchung::createURL2(['column_konto' => $item['ID'], 'from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">create</i></span><span class="fop-menu-caption" title="<?php echo(sprintf(_('create %s'), _('Buchung'))); ?>"><?php echo(sprintf(_('create %s'), _('Buchung'))); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && ((\FOP\User::getBuchhaltung()))) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="create_fop_fints_file_konto" style="margin-right:auto; text-align:left;" href="<?php echo htmlentities(\TablesRouter\Fop_fints_file::createURL2(['column_konto' => $item['ID'], 'from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="   
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">create</i></span><span class="fop-menu-caption" title="<?php echo(sprintf(_('create %s'), _('SEPA-Datei'))); ?>"><?php echo(sprintf(_('create %s'), _('SEPA-Datei'))); ?></span>
			</a>
		<?php } ?><?php
		if(isset($item['ID']) && $item['operation::delete']) { ?>
			<a class="mdl-list__item mdl-button" data-interaction-name="delete" style="margin-right:auto; text-align:left;" href="#"
				onclick="if(!confirm(<?php echo htmlentities(json_encode(_('confirmdelete'))); ?>)) return false;   $.get('Tables/Fop_fints_konto/delete?ajax&id=<?php echo htmlentities($item['ID']);?>&from=<?php echo htmlentities(\FOP\Util::getBackUrl());?>').then(function () { reloadfop_fints_konto(); }, function (err) { if (err.responseText.startsWith('http')) { window.location.href = err.responseText; } else {alert(err.responseText); }}); $(this).closest('.overlay').click(); return false;
					open_url(this.href, false);
					$(this).closest('.overlay').click();
					return false;">
				<span><i class="material-icons">delete</i></span><span class="fop-menu-caption" title="<?php echo(_('delete')); ?>"><?php echo(_('delete')); ?></span>
			</a>
		<?php } ?>
													</ul><?php
		if(isset($item['ID']) && $item['operation::view'] && $item['operation::edit']) {
			?><a class="mdl-button mdl-js-button mdl-button--icon tbl-link" data-tbl="fop_fints_konto" data-id="<?php echo htmlentities($item['ID']); ?>" data-interaction-name="edit" href="<?php echo htmlentities(\TablesRouter\Fop_fints_konto::editURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="event.stopPropagation();    reloadfop_fints_konto();
					$(this).closest('.overlay').click();
					if (this.href != '#') {
						open_url(this.href, false);
					}
					event.preventDefault();"
				title="<?php echo(_('edit')); ?>">
				<i class="material-icons">edit</i>
			</a><?php } ?><?php
		if(isset($item['ID']) && $item['operation::view']) {
			?><a class="mdl-button mdl-js-button mdl-button--icon tbl-link" data-tbl="fop_fints_konto" data-id="<?php echo htmlentities($item['ID']); ?>" data-interaction-name="view" href="<?php echo htmlentities(\TablesRouter\Fop_fints_konto::viewURL($item['ID'], ['from' => \FOP\Util::getBackUrl()])); ?>"
				onclick="event.stopPropagation();  if (!event.ctrlKey) { open_url(reloadfop_fints_konto({action: 'open', fop_table: 'fop_fints_konto', fop_id: <?php echo htmlentities(json_encode($item['ID'])); ?>, fop_from: location.href}, true), false); return false; }  reloadfop_fints_konto();
					$(this).closest('.overlay').click();
					if (this.href != '#') {
						open_url(this.href, false);
					}
					event.preventDefault();"
				title="<?php echo(_('open')); ?>">
				<i class="material-icons">find_in_page</i>
			</a><?php } ?>
													</div><?php } ?><?php
													
													foreach ($columns AS $col) {
														$col['render']($item);
													}
													?></div>
												 <?php }?>

													</div>
												</div>

												
												
												</div><?php
												
	
    
  }

  public static function getidsAction($col) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
			$q = \FOP\Database::query('SELECT t.'.qi($col).' '.self::getSQL($_GET));
			$result = new \FOP\IDList();
			while ($item = $q->fetchColumn()) {
				$result->push($item);
			}
			die($result->toString());

    
  }

  public static function permissionsAction($id) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
		$ids = new \FOP\IDList($id);
		header('Content-Type: application/json');
		
		$perms = \FOP\Database::query('SELECT COUNT(*) AS __cnt, SUM(CASE (TRUE) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('exportCSV_multi').', SUM(CASE (TRUE) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('filteronly').', SUM(CASE (TRUE) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('filterrange').', SUM(CASE (TRUE) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('filterall').', SUM(CASE (('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).')) WHEN TRUE THEN 1 ELSE 0 END) AS '.qi('delete').' FROM '.qi('fop_fints_konto').' WHERE ' . $ids->toSQL(qi('ID')))->fetch(\PDO::FETCH_ASSOC);
		
		return $perms;
	
    
  }

  public static function getSQL($params) { 
    
    
    // --- BLOCK: dependency-fop_fints_konto ---
    
		if (isset($params['select']) && $params['select'] == 'fop_fints_konto') {
			$deps = [];
		}
	
    // --- BLOCK: main ---
    
								// returns a sql snippet 'FROM (...) AS t WHERE' where you can prepend your select clauses and append your ORDER LIMIT
								$sql = 'FROM (SELECT /* ::color */ CASE  WHEN ('.qi('fop_fints_konto').'.'.qi('fop_konto_zustand').') = (1) THEN (\'#17e61194\')  WHEN ('.qi('fop_fints_konto').'.'.qi('fop_konto_zustand').') = (2) THEN (\'#4a434396\')  WHEN ('.qi('fop_fints_konto').'.'.qi('fop_konto_zustand').') = (3) THEN (\'#e6111196\')  ELSE NULL END AS '.qi('::color').',
									/* ID */ '.qi('ID').' AS '.qi('ID').',
									/* bank */ '.qi('bank').' AS '.qi('bank').',
									/* bank::canView */ '.qi('ref:bank').'.'.qi('bank:canView').' AS '.qi('bank::canView').',
									/* bank::description */ '.qi('ref:bank').'.'.qi('bank:description').' AS '.qi('bank::description').',
									/* first_sync */ '.qi('first_sync').' AS '.qi('first_sync').',
									/* fop_konto_zustand */ '.qi('fop_konto_zustand').' AS '.qi('fop_konto_zustand').',
									/* fopuser */ '.qi('fopuser').' AS '.qi('fopuser').',
									/* glaeubigerid */ '.qi('glaeubigerid').' AS '.qi('glaeubigerid').',
									/* iban */ '.qi('iban').' AS '.qi('iban').',
									/* kontoname */ '.qi('kontoname').' AS '.qi('kontoname').',
									/* kontostand */ (SELECT ('.qi('mfwAIop9').'.'.qi('saldo').') FROM '.qi('fop_fints_buchung').' '.qi('mfwAIop9').' WHERE '.qi('mfwAIop9').'.'.qi('konto').' = '.qi('fop_fints_konto').'.'.qi('ID').' ORDER BY '.qi('mfwAIop9').'.'.qi('bdate').' DESC, '.qi('mfwAIop9').'.'.qi('ID').' DESC LIMIT 1) AS '.qi('kontostand').',
									/* last_sync */ '.qi('last_sync').' AS '.qi('last_sync').',
									/* operation::RcATHOIs */ ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') AS '.qi('operation::RcATHOIs').',
									/* operation::create */ ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') AS '.qi('operation::create').',
									/* operation::delete */ ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') AS '.qi('operation::delete').',
									/* operation::edit */ ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') AS '.qi('operation::edit').',
									/* operation::f1b1852a9f071208b1f353b6ed4a3cb0f49045524eb521e4e364bb12d54a1615 */ '.\FOP\Database::quote(\FOP\User::getBuchhaltung()).' AS '.qi('operation::f1b1852a9f071208b1f353b6ed4a3cb0f49045524eb521e4e364bb12d54a1615').',
									/* operation::index */ ' . (!\FOP\User::getIsGuest() ? 1 : 0) . ' AS '.qi('operation::index').',
									/* operation::view */ ('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).') AS '.qi('operation::view').',
									/* password */ '.qi('password').' AS '.qi('password').',
									/* pin_versuch */ '.qi('pin_versuch').' AS '.qi('pin_versuch').',
									/* tanMode */ '.qi('tanMode').' AS '.qi('tanMode').',
									/* tanMode::canView */ '.qi('ref:tanMode').'.'.qi('tanMode:canView').' AS '.qi('tanMode::canView').',
									/* tanMode::description */ '.qi('ref:tanMode').'.'.qi('tanMode:description').' AS '.qi('tanMode::description').',
									/* tanMode::tanModeDep */ '.qi('fop_fints_konto').'.'.qi('ID').' AS '.qi('tanMode::tanModeDep').',
									/* user */ '.qi('user').' AS '.qi('user').',
									1
								FROM '.qi('fop_fints_konto').' '.qi('fop_fints_konto').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('bank:ID').', CONCAT('.qi('fop_fints_bank').'.'.qi('institut').', \' : \', '.qi('fop_fints_bank').'.'.qi('blz').') AS '.qi('bank:description').', ('.(\FOP\User::getIsGuest() ? 'false' : 'true').') AS '.qi('bank:canView').' FROM '.qi('fop_fints_bank').') '.qi('ref:bank').' ON '.qi('ref:bank').'.'.qi('bank:ID').' = '.qi('bank').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('tanMode:ID').', CONCAT('.qi('fop_fints_tanMode').'.'.qi('tanName').', \' <=> \', '.qi('fop_fints_tanMode').'.'.qi('tanMediaName').') AS '.qi('tanMode:description').', ('.(\FOP\User::getIsGuest() ? 'false' : 'true').') AS '.qi('tanMode:canView').' FROM '.qi('fop_fints_tanMode').') '.qi('ref:tanMode').' ON '.qi('ref:tanMode').'.'.qi('tanMode:ID').' = '.qi('tanMode').'
								WHERE ((('.\FOP\Database::quote(\FOP\User::getBuchhaltung()).')))
									AND (' . (isset($_GET['select']) && $_GET['select'] == 'fop_fints_konto' ? 'TRUE' : 'TRUE') . ')) AS t
								WHERE ' . (isset($params['range_min_fop_fints_konto_pin_versuch']) ? ($params['range_min_fop_fints_konto_pin_versuch'] !== '' && is_numeric($params['range_min_fop_fints_konto_pin_versuch']) ? 't.'.qi('pin_versuch').' >= ' . \FOP\Database::quote($params['range_min_fop_fints_konto_pin_versuch']) . ' AND ' : '') : '') . 
								(isset($params['range_min_fop_fints_konto_kontostand']) ? ($params['range_min_fop_fints_konto_kontostand'] !== '' && is_numeric($params['range_min_fop_fints_konto_kontostand']) ? 't.'.qi('kontostand').' >= ' . \FOP\Database::quote($params['range_min_fop_fints_konto_kontostand']) . ' AND ' : '') : '') . 
								(isset($params['range_min_fop_fints_konto_first_sync']) ? ($params['range_min_fop_fints_konto_first_sync'] !== '' && is_numeric($params['range_min_fop_fints_konto_first_sync']) ? 't.'.qi('first_sync').' >= ' . \FOP\Database::quote($params['range_min_fop_fints_konto_first_sync']) . ' AND ' : '') : '') . 
								(isset($params['range_min_fop_fints_konto_last_sync']) ? ($params['range_min_fop_fints_konto_last_sync'] !== '' && is_numeric($params['range_min_fop_fints_konto_last_sync']) ? 't.'.qi('last_sync').' >= ' . \FOP\Database::quote($params['range_min_fop_fints_konto_last_sync']) . ' AND ' : '') : '') . 
								(isset($params['range_max_fop_fints_konto_pin_versuch']) ? ($params['range_max_fop_fints_konto_pin_versuch'] !== '' && is_numeric($params['range_max_fop_fints_konto_pin_versuch']) ? 't.'.qi('pin_versuch').' <= ' . \FOP\Database::quote($params['range_max_fop_fints_konto_pin_versuch']) . ' AND ' : '') : '') . 
								(isset($params['range_max_fop_fints_konto_kontostand']) ? ($params['range_max_fop_fints_konto_kontostand'] !== '' && is_numeric($params['range_max_fop_fints_konto_kontostand']) ? 't.'.qi('kontostand').' <= ' . \FOP\Database::quote($params['range_max_fop_fints_konto_kontostand']) . ' AND ' : '') : '') . 
								(isset($params['range_max_fop_fints_konto_first_sync']) ? ($params['range_max_fop_fints_konto_first_sync'] !== '' && is_numeric($params['range_max_fop_fints_konto_first_sync']) ? 't.'.qi('first_sync').' <= ' . \FOP\Database::quote($params['range_max_fop_fints_konto_first_sync']) . ' AND ' : '') : '') . 
								(isset($params['range_max_fop_fints_konto_last_sync']) ? ($params['range_max_fop_fints_konto_last_sync'] !== '' && is_numeric($params['range_max_fop_fints_konto_last_sync']) ? 't.'.qi('last_sync').' <= ' . \FOP\Database::quote($params['range_max_fop_fints_konto_last_sync']) . ' AND ' : '') : '') . 
								(isset($params['filter_fop_fints_konto_kontoname']) ? ($params['filter_fop_fints_konto_kontoname'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_konto_kontoname']))->toSQL('t.'.qi('kontoname').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_konto_kontostand']) ? ($params['filter_fop_fints_konto_kontostand'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_konto_kontostand']))->toSQL('t.'.qi('kontostand').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_konto_iban']) ? ($params['filter_fop_fints_konto_iban'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_konto_iban']))->toSQL('t.'.qi('iban').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_konto_bank']) ? ($params['filter_fop_fints_konto_bank'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_konto_bank']))->toSQL('t.'.qi('bank').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_konto_user']) ? ($params['filter_fop_fints_konto_user'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_konto_user']))->toSQL('t.'.qi('user').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_konto_password']) ? ($params['filter_fop_fints_konto_password'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_konto_password']))->toSQL('t.'.qi('password').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_konto_tanMode']) ? ($params['filter_fop_fints_konto_tanMode'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_konto_tanMode']))->toSQL('t.'.qi('tanMode').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_konto_fop_konto_zustand']) ? ($params['filter_fop_fints_konto_fop_konto_zustand'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_konto_fop_konto_zustand']))->toSQL('t.'.qi('fop_konto_zustand').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_konto_first_sync']) ? ($params['filter_fop_fints_konto_first_sync'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_konto_first_sync']))->toSQL('t.'.qi('first_sync').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_konto_last_sync']) ? ($params['filter_fop_fints_konto_last_sync'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_konto_last_sync']))->toSQL('t.'.qi('last_sync').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_konto_pin_versuch']) ? ($params['filter_fop_fints_konto_pin_versuch'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_konto_pin_versuch']))->toSQL('t.'.qi('pin_versuch').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_konto_glaeubigerid']) ? ($params['filter_fop_fints_konto_glaeubigerid'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_konto_glaeubigerid']))->toSQL('t.'.qi('glaeubigerid').'') . ') AND ') : '') : '') . 
								(isset($params['filter_fop_fints_konto_ID']) ? ($params['filter_fop_fints_konto_ID'] !== '' ? ('(' . (new \FOP\IDList($params['filter_fop_fints_konto_ID']))->toSQL('t.'.qi('ID').'') . ') AND ') : '') : '') . 
								(isset($params['search_fop_fints_konto_kontoname']) ? 't.'.qi('kontoname').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_konto_kontoname'] . '%') . ' AND ' : '') . 
								(isset($params['search_fop_fints_konto_iban']) ? 't.'.qi('iban').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_konto_iban'] . '%') . ' AND ' : '') . 
								(isset($params['search_fop_fints_konto_user']) ? 't.'.qi('user').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_konto_user'] . '%') . ' AND ' : '') . 
								(isset($params['search_fop_fints_konto_glaeubigerid']) ? 't.'.qi('glaeubigerid').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_konto_glaeubigerid'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_fop_fints_konto_kontoname']) ? 'NOT t.'.qi('kontoname').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_fop_fints_konto_kontoname'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_fop_fints_konto_iban']) ? 'NOT t.'.qi('iban').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_fop_fints_konto_iban'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_fop_fints_konto_user']) ? 'NOT t.'.qi('user').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_fop_fints_konto_user'] . '%') . ' AND ' : '') . 
								(isset($params['searchnot_fop_fints_konto_glaeubigerid']) ? 'NOT t.'.qi('glaeubigerid').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['searchnot_fop_fints_konto_glaeubigerid'] . '%') . ' AND ' : '') . 
								(isset($params['search_fop_fints_konto']) ? '(' . 't.'.qi('kontoname').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_konto'] . '%') . ' OR ' . 't.'.qi('iban').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_konto'] . '%') . ' OR ' . 't.'.qi('user').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_konto'] . '%') . ' OR ' . 't.'.qi('glaeubigerid').' '.(\FOP\Database::getDriver() == 'pgsql' ? 'ILIKE' : 'LIKE').' ' . \FOP\Database::quote('%' . $params['search_fop_fints_konto'] . '%') . ') AND ' : '') . 
								'
								 TRUE ';
								return $sql;
	
    
  }

  public static function getfilter_fop_fints_konto_bankItemsByStringAction($fstr) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
		// Auf aktive DataView-Items einschränken
		$params = $_GET;
		unset($params['filter_fop_fints_konto_bank']);
		return \Types\Bank::getItems(null, -1, $fstr, ''.qi('ID').' IN (SELECT DISTINCT t.'.qi('bank').''.self::getSQL($params).')');
	

    
  }

  public static function getfilter_fop_fints_konto_tanModeItemsByStringAction($fstr) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
		// Auf aktive DataView-Items einschränken
		$params = $_GET;
		unset($params['filter_fop_fints_konto_tanMode']);
		return \Types\Fop_fints_tanMode::getItems(null, -1, $fstr, ''.qi('ID').' IN (SELECT DISTINCT t.'.qi('tanMode').''.self::getSQL($params).')');
	

    
  }

  public static function getData($sqladdon, $params, $stream = false ) { 
    
    
    // --- BLOCK: main ---
    
								$sql = self::getSQL($params);

								$order = (\FOP\Util::array_value(array(
									'kontoname ASC' => 'ORDER BY t.'.qi('kontoname').' ASC',
									'user ASC' => 'ORDER BY t.'.qi('user').' ASC',
									'glaeubigerid ASC' => 'ORDER BY t.'.qi('glaeubigerid').' ASC',
									'iban ASC' => 'ORDER BY t.'.qi('iban').' ASC',
									'pin_versuch ASC' => 'ORDER BY t.'.qi('pin_versuch').' ASC',
									'kontostand ASC' => 'ORDER BY t.'.qi('kontostand').' ASC',
									'first_sync ASC' => 'ORDER BY t.'.qi('first_sync').' ASC',
									'last_sync ASC' => 'ORDER BY t.'.qi('last_sync').' ASC',
									'kontoname DESC' => 'ORDER BY t.'.qi('kontoname').' DESC',
									'user DESC' => 'ORDER BY t.'.qi('user').' DESC',
									'glaeubigerid DESC' => 'ORDER BY t.'.qi('glaeubigerid').' DESC',
									'iban DESC' => 'ORDER BY t.'.qi('iban').' DESC',
									'pin_versuch DESC' => 'ORDER BY t.'.qi('pin_versuch').' DESC',
									'kontostand DESC' => 'ORDER BY t.'.qi('kontostand').' DESC',
									'first_sync DESC' => 'ORDER BY t.'.qi('first_sync').' DESC',
									'last_sync DESC' => 'ORDER BY t.'.qi('last_sync').' DESC',
									'' => ''), isset($params['sort_fop_fints_konto']) ? $params['sort_fop_fints_konto'] : '') ?: '');
								// wenn sqladdon bereits ein ORDER enthält, kein order aufbauen
								if (strpos($sqladdon, 'ORDER') !== false) {
									$order = '';
								}
								if ($stream) {
									// als Stream (währenddessen darf keine weitere SQL-Query laufen) für große Datenmengen und Statistiken
									$result = (function () use ($sql, $order, $sqladdon) {
										$stream = \FOP\Database::query('SELECT t.* ' . $sql . $order . $sqladdon);
										while ($item = $stream->fetch(\PDO::FETCH_ASSOC)) {
											$item['kontostand'] = \Types\Euro::unpack($item['kontostand']);
											$item['iban'] = \FOP\Sanitizers::a_text($item['iban']);
											$item['bank'] = \FOP\Sanitizers::null_converter($item['bank']);
											$item['tanMode'] = \FOP\Sanitizers::null_converter($item['tanMode']);
											$item['fop_konto_zustand'] = \FOP\Util::IntStringNull($item['fop_konto_zustand']);
											$item['first_sync'] = intval($item['first_sync']);
											$item['last_sync'] = intval($item['last_sync']);
											$item['pin_versuch'] = \Types\Integer::unpack($item['pin_versuch']);
											
											yield $item;
										}
									})();
								} else {
									// als RAM-Array
									$result = \FOP\Database::query('SELECT t.* ' . $sql . $order . $sqladdon);
									$arr = $result->fetchAll(\PDO::FETCH_ASSOC);
									$itemcount = count($arr);

									foreach($arr as $i => &$item){
										$item['kontostand'] = \Types\Euro::unpack($item['kontostand']);
										$item['iban'] = \FOP\Sanitizers::a_text($item['iban']);
										$item['bank'] = \FOP\Sanitizers::null_converter($item['bank']);
										$item['tanMode'] = \FOP\Sanitizers::null_converter($item['tanMode']);
										$item['fop_konto_zustand'] = \FOP\Util::IntStringNull($item['fop_konto_zustand']);
										$item['first_sync'] = intval($item['first_sync']);
										$item['last_sync'] = intval($item['last_sync']);
										$item['pin_versuch'] = \Types\Integer::unpack($item['pin_versuch']);
										
									}
									unset($item);

									$result = ["items" => $arr, "itemcount" => $itemcount];

									
								}

								return $result;
	
    
  }

  public static function getFilterHTML($params, $delimiter = ', ' , $showButton = true ) { 
    
    
    // --- BLOCK: main ---
    
		// Contract: ist showButton == false, sollten keine HTML-Tags im Output enthalten sein (Verwendung in Dateinamen!!)
		$filters = [];
		
	if (isset($params['range_min_fop_fints_konto_pin_versuch']) && isset($params['range_max_fop_fints_konto_pin_versuch'])) {
		array_push($filters, _('PIN Versuche') . ': ' . (\Types\Integer::print($params['range_min_fop_fints_konto_pin_versuch'])
	) . ' ' . _('filters_between') . ' ' . (\Types\Integer::print($params['range_max_fop_fints_konto_pin_versuch'])
	));
	} else if (isset($params['range_min_fop_fints_konto_pin_versuch'])) {
		array_push($filters, _('PIN Versuche') . ': ' . _('filters_from') . ' ' . (\Types\Integer::print($params['range_min_fop_fints_konto_pin_versuch'])
	));
	} else if (isset($params['range_max_fop_fints_konto_pin_versuch'])) {
		array_push($filters, _('PIN Versuche') . ': ' . _('filters_to') . ' ' . (\Types\Integer::print($params['range_max_fop_fints_konto_pin_versuch'])
	));
	}
	if (isset($params['range_min_fop_fints_konto_kontostand']) && isset($params['range_max_fop_fints_konto_kontostand'])) {
		array_push($filters, _('Kontostand') . ': ' . (\Types\Euro::print($params['range_min_fop_fints_konto_kontostand']) .  ' €'
	) . ' ' . _('filters_between') . ' ' . (\Types\Euro::print($params['range_max_fop_fints_konto_kontostand']) .  ' €'
	));
	} else if (isset($params['range_min_fop_fints_konto_kontostand'])) {
		array_push($filters, _('Kontostand') . ': ' . _('filters_from') . ' ' . (\Types\Euro::print($params['range_min_fop_fints_konto_kontostand']) .  ' €'
	));
	} else if (isset($params['range_max_fop_fints_konto_kontostand'])) {
		array_push($filters, _('Kontostand') . ': ' . _('filters_to') . ' ' . (\Types\Euro::print($params['range_max_fop_fints_konto_kontostand']) .  ' €'
	));
	}
	
	if ( // Corner Case: Monat
		isset($params['range_min_fop_fints_konto_first_sync'])
		&& isset($params['range_max_fop_fints_konto_first_sync'])
		&& (date('d', $params['range_min_fop_fints_konto_first_sync']) == '01') //check first day of month
		&& (date('d', $params['range_max_fop_fints_konto_first_sync']) == date('t', $params['range_max_fop_fints_konto_first_sync'])) //check last day of month
		&& (date('Y-m', $params['range_min_fop_fints_konto_first_sync']) == date('Y-m', $params['range_max_fop_fints_konto_first_sync'])) //check if same year and month
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_konto_first_sync&apos;] = &apos;'.strtotime('first day of last month', $params['range_min_fop_fints_konto_first_sync']).'&apos;;
				query[&apos;range_max_fop_fints_konto_first_sync&apos;] = &apos;'.strtotime('last day of last month', $params['range_min_fop_fints_konto_first_sync']).'&apos;;
				reloadfop_fints_konto(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_konto_first_sync&apos;] = &apos;'.strtotime('first day of next month', $params['range_min_fop_fints_konto_first_sync']).'&apos;;
				query[&apos;range_max_fop_fints_konto_first_sync&apos;] = &apos;'.strtotime('last day of next month', $params['range_min_fop_fints_konto_first_sync']).'&apos;;
				reloadfop_fints_konto(); ">add_circle_outline</i>' : ''),
			htmlentities(_('Frühestes Synchronisationsdatum') . ': ' . strftime('%B', $params['range_min_fop_fints_konto_first_sync']) . ' ' . date('Y', $params['range_min_fop_fints_konto_first_sync']))
		]);
	} else if ( // Corner Case: Tag
		isset($params['range_min_fop_fints_konto_first_sync'])
		&& isset($params['range_max_fop_fints_konto_first_sync'])
		&& (date('Y-m-d', $params['range_min_fop_fints_konto_first_sync']) == (date('Y-m-d', $params['range_max_fop_fints_konto_first_sync'])))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_konto_first_sync&apos;] = &apos;'.strtotime('last day', $params['range_min_fop_fints_konto_first_sync']).'&apos;;
				query[&apos;range_max_fop_fints_konto_first_sync&apos;] = &apos;'.strtotime('last day', $params['range_min_fop_fints_konto_first_sync']).'&apos;;
				reloadfop_fints_konto(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_konto_first_sync&apos;] = &apos;'.strtotime('next day', $params['range_min_fop_fints_konto_first_sync']).'&apos;;
				query[&apos;range_max_fop_fints_konto_first_sync&apos;] = &apos;'.strtotime('next day', $params['range_min_fop_fints_konto_first_sync']).'&apos;;
				reloadfop_fints_konto(); ">add_circle_outline</i>' : ''),
			htmlentities(_('Frühestes Synchronisationsdatum') . ': ' . date('d.m.Y', $params['range_min_fop_fints_konto_first_sync']))
		]);
	} else if ( // Corner Case: Jahr
		isset($params['range_min_fop_fints_konto_first_sync'])
		&& isset($params['range_max_fop_fints_konto_first_sync'])
		&& (date('Y', $params['range_min_fop_fints_konto_first_sync']) == (date('Y', $params['range_max_fop_fints_konto_first_sync'])))
		&& ((date('m-d', $params['range_min_fop_fints_konto_first_sync']) == '01-01'))
		&& ((date('m-d', $params['range_max_fop_fints_konto_first_sync']) == '12-31'))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_konto_first_sync&apos;] = &apos;'.strtotime('first day of January last year', $params['range_min_fop_fints_konto_first_sync']).'&apos;;
				query[&apos;range_max_fop_fints_konto_first_sync&apos;] = &apos;'.strtotime('last day of December last year', $params['range_min_fop_fints_konto_first_sync']).'&apos;;
				reloadfop_fints_konto(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_konto_first_sync&apos;] = &apos;'.strtotime('first day of January next year', $params['range_min_fop_fints_konto_first_sync']).'&apos;;
				query[&apos;range_max_fop_fints_konto_first_sync&apos;] = &apos;'.strtotime('last day of December next year', $params['range_min_fop_fints_konto_first_sync']).'&apos;;
				reloadfop_fints_konto(); ">add_circle_outline</i>' : ''),
			htmlentities(_('Frühestes Synchronisationsdatum') . ': ' . date('Y', $params['range_min_fop_fints_konto_first_sync']))
		]);
	} else if ( // Corner Case: Quartal
		isset($params['range_min_fop_fints_konto_first_sync'])
		&& isset($params['range_max_fop_fints_konto_first_sync'])
		&& ( (
		 ((date('m-d', $params['range_min_fop_fints_konto_first_sync']) == '01-01'))
		&& ((date('m-d', $params['range_max_fop_fints_konto_first_sync']) == '03-31')) )
		|| (
		 ((date('m-d', $params['range_min_fop_fints_konto_first_sync']) == '04-01'))
		&& ((date('m-d', $params['range_max_fop_fints_konto_first_sync']) == '06-30')) )
		|| (
		 ((date('m-d', $params['range_min_fop_fints_konto_first_sync']) == '07-01'))
		&& ((date('m-d', $params['range_max_fop_fints_konto_first_sync']) == '09-30')) )
		|| (
		 ((date('m-d', $params['range_min_fop_fints_konto_first_sync']) == '10-01'))
		&& ((date('m-d', $params['range_max_fop_fints_konto_first_sync']) == '12-31')) )
	) ) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
					query[&apos;range_min_fop_fints_konto_first_sync&apos;] = &apos;'.strtotime('first day of -3 months', $params['range_min_fop_fints_konto_first_sync']).'&apos;;
					query[&apos;range_max_fop_fints_konto_first_sync&apos;] = &apos;'.strtotime('last day of -3 months', $params['range_max_fop_fints_konto_first_sync']).'&apos;;
					reloadfop_fints_konto(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_konto_first_sync&apos;] = &apos;'.strtotime('first day of +3 months', $params['range_min_fop_fints_konto_first_sync']).'&apos;;
				query[&apos;range_max_fop_fints_konto_first_sync&apos;] = &apos;'.strtotime('last day of +3 months', $params['range_max_fop_fints_konto_first_sync']).'&apos;;
				reloadfop_fints_konto(); ">add_circle_outline</i>' : ''),	
			htmlentities(_('Frühestes Synchronisationsdatum') . ': Q' . (ceil((date('m', $params['range_min_fop_fints_konto_first_sync']))/3)) . ' (' . date('d.m.', $params['range_min_fop_fints_konto_first_sync']) . ' - ' . date('d.m.Y', $params['range_max_fop_fints_konto_first_sync']) . ')')
		]);
	}
	else if (isset($params['range_min_fop_fints_konto_first_sync']) && isset($params['range_max_fop_fints_konto_first_sync'])) {
		array_push($filters, _('Frühestes Synchronisationsdatum') . ': ' . (($params['range_min_fop_fints_konto_first_sync']) ? strftime(_('dateformat_php2'), intval($params['range_min_fop_fints_konto_first_sync'])) : '') . ' ' . _('filters_between') . ' ' . (($params['range_max_fop_fints_konto_first_sync']) ? strftime(_('dateformat_php2'), intval($params['range_max_fop_fints_konto_first_sync'])) : ''));
	} else if (isset($params['range_min_fop_fints_konto_first_sync'])) {
		array_push($filters, _('Frühestes Synchronisationsdatum') . ': ' . _('filters_from') . ' ' . (($params['range_min_fop_fints_konto_first_sync']) ? strftime(_('dateformat_php2'), intval($params['range_min_fop_fints_konto_first_sync'])) : ''));
	} else if (isset($params['range_max_fop_fints_konto_first_sync'])) {
		array_push($filters, _('Frühestes Synchronisationsdatum') . ': ' . _('filters_to') . ' ' . (($params['range_max_fop_fints_konto_first_sync']) ? strftime(_('dateformat_php2'), intval($params['range_max_fop_fints_konto_first_sync'])) : ''));
	}
	
	if ( // Corner Case: Monat
		isset($params['range_min_fop_fints_konto_last_sync'])
		&& isset($params['range_max_fop_fints_konto_last_sync'])
		&& (date('d', $params['range_min_fop_fints_konto_last_sync']) == '01') //check first day of month
		&& (date('d', $params['range_max_fop_fints_konto_last_sync']) == date('t', $params['range_max_fop_fints_konto_last_sync'])) //check last day of month
		&& (date('Y-m', $params['range_min_fop_fints_konto_last_sync']) == date('Y-m', $params['range_max_fop_fints_konto_last_sync'])) //check if same year and month
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_konto_last_sync&apos;] = &apos;'.strtotime('first day of last month', $params['range_min_fop_fints_konto_last_sync']).'&apos;;
				query[&apos;range_max_fop_fints_konto_last_sync&apos;] = &apos;'.strtotime('last day of last month', $params['range_min_fop_fints_konto_last_sync']).'&apos;;
				reloadfop_fints_konto(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_konto_last_sync&apos;] = &apos;'.strtotime('first day of next month', $params['range_min_fop_fints_konto_last_sync']).'&apos;;
				query[&apos;range_max_fop_fints_konto_last_sync&apos;] = &apos;'.strtotime('last day of next month', $params['range_min_fop_fints_konto_last_sync']).'&apos;;
				reloadfop_fints_konto(); ">add_circle_outline</i>' : ''),
			htmlentities(_('Letztes Synchronisationsdatum') . ': ' . strftime('%B', $params['range_min_fop_fints_konto_last_sync']) . ' ' . date('Y', $params['range_min_fop_fints_konto_last_sync']))
		]);
	} else if ( // Corner Case: Tag
		isset($params['range_min_fop_fints_konto_last_sync'])
		&& isset($params['range_max_fop_fints_konto_last_sync'])
		&& (date('Y-m-d', $params['range_min_fop_fints_konto_last_sync']) == (date('Y-m-d', $params['range_max_fop_fints_konto_last_sync'])))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_konto_last_sync&apos;] = &apos;'.strtotime('last day', $params['range_min_fop_fints_konto_last_sync']).'&apos;;
				query[&apos;range_max_fop_fints_konto_last_sync&apos;] = &apos;'.strtotime('last day', $params['range_min_fop_fints_konto_last_sync']).'&apos;;
				reloadfop_fints_konto(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_konto_last_sync&apos;] = &apos;'.strtotime('next day', $params['range_min_fop_fints_konto_last_sync']).'&apos;;
				query[&apos;range_max_fop_fints_konto_last_sync&apos;] = &apos;'.strtotime('next day', $params['range_min_fop_fints_konto_last_sync']).'&apos;;
				reloadfop_fints_konto(); ">add_circle_outline</i>' : ''),
			htmlentities(_('Letztes Synchronisationsdatum') . ': ' . date('d.m.Y', $params['range_min_fop_fints_konto_last_sync']))
		]);
	} else if ( // Corner Case: Jahr
		isset($params['range_min_fop_fints_konto_last_sync'])
		&& isset($params['range_max_fop_fints_konto_last_sync'])
		&& (date('Y', $params['range_min_fop_fints_konto_last_sync']) == (date('Y', $params['range_max_fop_fints_konto_last_sync'])))
		&& ((date('m-d', $params['range_min_fop_fints_konto_last_sync']) == '01-01'))
		&& ((date('m-d', $params['range_max_fop_fints_konto_last_sync']) == '12-31'))
	) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_konto_last_sync&apos;] = &apos;'.strtotime('first day of January last year', $params['range_min_fop_fints_konto_last_sync']).'&apos;;
				query[&apos;range_max_fop_fints_konto_last_sync&apos;] = &apos;'.strtotime('last day of December last year', $params['range_min_fop_fints_konto_last_sync']).'&apos;;
				reloadfop_fints_konto(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_konto_last_sync&apos;] = &apos;'.strtotime('first day of January next year', $params['range_min_fop_fints_konto_last_sync']).'&apos;;
				query[&apos;range_max_fop_fints_konto_last_sync&apos;] = &apos;'.strtotime('last day of December next year', $params['range_min_fop_fints_konto_last_sync']).'&apos;;
				reloadfop_fints_konto(); ">add_circle_outline</i>' : ''),
			htmlentities(_('Letztes Synchronisationsdatum') . ': ' . date('Y', $params['range_min_fop_fints_konto_last_sync']))
		]);
	} else if ( // Corner Case: Quartal
		isset($params['range_min_fop_fints_konto_last_sync'])
		&& isset($params['range_max_fop_fints_konto_last_sync'])
		&& ( (
		 ((date('m-d', $params['range_min_fop_fints_konto_last_sync']) == '01-01'))
		&& ((date('m-d', $params['range_max_fop_fints_konto_last_sync']) == '03-31')) )
		|| (
		 ((date('m-d', $params['range_min_fop_fints_konto_last_sync']) == '04-01'))
		&& ((date('m-d', $params['range_max_fop_fints_konto_last_sync']) == '06-30')) )
		|| (
		 ((date('m-d', $params['range_min_fop_fints_konto_last_sync']) == '07-01'))
		&& ((date('m-d', $params['range_max_fop_fints_konto_last_sync']) == '09-30')) )
		|| (
		 ((date('m-d', $params['range_min_fop_fints_konto_last_sync']) == '10-01'))
		&& ((date('m-d', $params['range_max_fop_fints_konto_last_sync']) == '12-31')) )
	) ) {
		array_push($filters, [
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
					query[&apos;range_min_fop_fints_konto_last_sync&apos;] = &apos;'.strtotime('first day of -3 months', $params['range_min_fop_fints_konto_last_sync']).'&apos;;
					query[&apos;range_max_fop_fints_konto_last_sync&apos;] = &apos;'.strtotime('last day of -3 months', $params['range_max_fop_fints_konto_last_sync']).'&apos;;
					reloadfop_fints_konto(); ">remove_circle_outline</i>' : ''),
			($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="
				query[&apos;range_min_fop_fints_konto_last_sync&apos;] = &apos;'.strtotime('first day of +3 months', $params['range_min_fop_fints_konto_last_sync']).'&apos;;
				query[&apos;range_max_fop_fints_konto_last_sync&apos;] = &apos;'.strtotime('last day of +3 months', $params['range_max_fop_fints_konto_last_sync']).'&apos;;
				reloadfop_fints_konto(); ">add_circle_outline</i>' : ''),	
			htmlentities(_('Letztes Synchronisationsdatum') . ': Q' . (ceil((date('m', $params['range_min_fop_fints_konto_last_sync']))/3)) . ' (' . date('d.m.', $params['range_min_fop_fints_konto_last_sync']) . ' - ' . date('d.m.Y', $params['range_max_fop_fints_konto_last_sync']) . ')')
		]);
	}
	else if (isset($params['range_min_fop_fints_konto_last_sync']) && isset($params['range_max_fop_fints_konto_last_sync'])) {
		array_push($filters, _('Letztes Synchronisationsdatum') . ': ' . (($params['range_min_fop_fints_konto_last_sync']) ? strftime(_('datetimeformat_php2'), intval($params['range_min_fop_fints_konto_last_sync'])) : '') . ' ' . _('filters_between') . ' ' . (($params['range_max_fop_fints_konto_last_sync']) ? strftime(_('datetimeformat_php2'), intval($params['range_max_fop_fints_konto_last_sync'])) : ''));
	} else if (isset($params['range_min_fop_fints_konto_last_sync'])) {
		array_push($filters, _('Letztes Synchronisationsdatum') . ': ' . _('filters_from') . ' ' . (($params['range_min_fop_fints_konto_last_sync']) ? strftime(_('datetimeformat_php2'), intval($params['range_min_fop_fints_konto_last_sync'])) : ''));
	} else if (isset($params['range_max_fop_fints_konto_last_sync'])) {
		array_push($filters, _('Letztes Synchronisationsdatum') . ': ' . _('filters_to') . ' ' . (($params['range_max_fop_fints_konto_last_sync']) ? strftime(_('datetimeformat_php2'), intval($params['range_max_fop_fints_konto_last_sync'])) : ''));
	}if (isset($params['filter_fop_fints_konto_kontoname'])) {
		if ($params['filter_fop_fints_konto_kontoname'] == '_null') {
			array_push($filters, _('Bezeichnung') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_konto_kontoname']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Bezeichnung') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_konto_kontostand'])) {
		if ($params['filter_fop_fints_konto_kontostand'] == '_null') {
			array_push($filters, _('Kontostand') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_konto_kontostand']))->all() AS $val) {
				$value = \Types\Euro::print($val) .  ' €'
	;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Kontostand') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_konto_iban'])) {
		if ($params['filter_fop_fints_konto_iban'] == '_null') {
			array_push($filters, _('IBAN') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_konto_iban']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('IBAN') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_konto_user'])) {
		if ($params['filter_fop_fints_konto_user'] == '_null') {
			array_push($filters, _('Legitimations-ID') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_konto_user']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Legitimations-ID') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_konto_password'])) {
		if ($params['filter_fop_fints_konto_password'] == '_null') {
			array_push($filters, _('PIN') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_konto_password']))->all() AS $val) {
				$value = '*****';
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('PIN') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_konto_fop_konto_zustand'])) {
		if ($params['filter_fop_fints_konto_fop_konto_zustand'] == '_null') {
			array_push($filters, _('Zustand') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_konto_fop_konto_zustand']))->all() AS $val) {
				$value = \Types\Fop_konto_zustand::toString($val);
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Zustand') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_konto_first_sync'])) {
		if ($params['filter_fop_fints_konto_first_sync'] == '_null') {
			array_push($filters, _('Frühestes Synchronisationsdatum') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_konto_first_sync']))->all() AS $val) {
				$value = ($val) ? strftime(_('dateformat_php2'), intval($val)) : '';
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Frühestes Synchronisationsdatum') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_konto_last_sync'])) {
		if ($params['filter_fop_fints_konto_last_sync'] == '_null') {
			array_push($filters, _('Letztes Synchronisationsdatum') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_konto_last_sync']))->all() AS $val) {
				$value = ($val) ? strftime(_('datetimeformat_php2'), intval($val)) : '';
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Letztes Synchronisationsdatum') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_konto_pin_versuch'])) {
		if ($params['filter_fop_fints_konto_pin_versuch'] == '_null') {
			array_push($filters, _('PIN Versuche') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_konto_pin_versuch']))->all() AS $val) {
				$value = \Types\Integer::print($val)
	;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('PIN Versuche') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_konto_glaeubigerid'])) {
		if ($params['filter_fop_fints_konto_glaeubigerid'] == '_null') {
			array_push($filters, _('Gläubiger-ID Lastschriften') . ': ' . 'NULL');
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_konto_glaeubigerid']))->all() AS $val) {
				$value = $val;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Gläubiger-ID Lastschriften') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_konto_bank'])) {
		if ($params['filter_fop_fints_konto_bank'] == '_null') {
			array_push($filters, _('Bank') . ': ' . _(''));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_konto_bank']))->all() AS $val) {
				$value = 
  \FOP\Database::query('SELECT CONCAT('.qi('fop_fints_bank').'.'.qi('institut').', \' : \', '.qi('fop_fints_bank').'.'.qi('blz').') AS description FROM '.qi('fop_fints_bank').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('')
;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Bank') . ': ' . implode(', ', $values));
		}
	}if (isset($params['filter_fop_fints_konto_tanMode'])) {
		if ($params['filter_fop_fints_konto_tanMode'] == '_null') {
			array_push($filters, _('Tan Modus') . ': ' . _(''));
		} else {
			$values = [];
			foreach ((new \FOP\IDList($params['filter_fop_fints_konto_tanMode']))->all() AS $val) {
				$value = 
  \FOP\Database::query('SELECT CONCAT('.qi('fop_fints_tanMode').'.'.qi('tanName').', \' <=> \', '.qi('fop_fints_tanMode').'.'.qi('tanMediaName').') AS description FROM '.qi('fop_fints_tanMode').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($val))->fetchColumn() ?: _('')
;
				if ($value) array_push($values, $value);
			}
			array_push($filters, _('Tan Modus') . ': ' . implode(', ', $values));
		}
	}if (isset($params['search_fop_fints_konto_kontoname'])) {
		array_push($filters, _('kontoname') . ' ' . _('filter_contains') . ' ' . $params['search_fop_fints_konto_kontoname']);
	}if (isset($params['search_fop_fints_konto_iban'])) {
		array_push($filters, _('iban') . ' ' . _('filter_contains') . ' ' . $params['search_fop_fints_konto_iban']);
	}if (isset($params['search_fop_fints_konto_user'])) {
		array_push($filters, _('user') . ' ' . _('filter_contains') . ' ' . $params['search_fop_fints_konto_user']);
	}if (isset($params['search_fop_fints_konto_glaeubigerid'])) {
		array_push($filters, _('glaeubigerid') . ' ' . _('filter_contains') . ' ' . $params['search_fop_fints_konto_glaeubigerid']);
	}if (isset($params['searchnot_fop_fints_konto_kontoname'])) {
		array_push($filters, _('kontoname') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_fop_fints_konto_kontoname']);
	}if (isset($params['searchnot_fop_fints_konto_iban'])) {
		array_push($filters, _('iban') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_fop_fints_konto_iban']);
	}if (isset($params['searchnot_fop_fints_konto_user'])) {
		array_push($filters, _('user') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_fop_fints_konto_user']);
	}if (isset($params['searchnot_fop_fints_konto_glaeubigerid'])) {
		array_push($filters, _('glaeubigerid') . ' ' . _('filter_contains_not') . ' ' . $params['searchnot_fop_fints_konto_glaeubigerid']);
	}
		if (count($filters)) {
			$result = implode($delimiter, array_map(function ($filter) {
				if (is_array($filter)) {
					return implode('', $filter);
				}
				return htmlentities($filter);
			}, $filters))
			// Button, um Filter zu entfernen
			. ($showButton ? '<i class="material-icons fop-small" style="cursor: pointer;" onclick="for (var q in query) {if (q.includes(\'_fop_fints_konto_\')) delete query[q];} reloadfop_fints_konto(); ">clear</i>' : '');
		} else {
			$result = _('no_filter');
		}
		return $result;
	
    
  }

  public static function openAction($fop_table, $fop_id, $fop_from) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    

if ($fop_table == 'fop_fints_konto') {
	\FOP\Session::setPayload('dv-fop_fints_konto', [
		'id' => 'fop_fints_konto',
		'tbl' => 'fop_fints_konto',
		'idcol' => 'ID',
		'prev' => \DataViewRouter\Fop_fints_konto::stepURL('fop_fints_konto', 'XXX', -1),
		'next' => \DataViewRouter\Fop_fints_konto::stepURL('fop_fints_konto', 'XXX',  1),
		'from' => $fop_from
	]);
	
	if ($fop_id == '_') return; // nur Rückreferenz setzen, nicht öffnen
	$params = [];
	if (isset($_GET['popup'])) $params['popup'] = true;
	if (isset($_GET['from'])) $params['from'] = $_GET['from'];
	$params['id'] = $fop_id;
	
	$url = \TablesRouter\Fop_fints_konto::viewURL2($params);
	header('Location: ' . $url);
}

die();
    
  }

  public static function stepAction($tbl, $id, $step) { 
    
    
    // --- BLOCK: access ---
    
    // --- BLOCK: main ---
    
	$dv = \FOP\Session::getPayload('dv-'.$tbl);
	$url = $dv['from'];
	$parts = parse_url($url);
	parse_str($parts['query'], $query);
	$data = self::getData('', $query);
	$col = $dv['idcol'];
	$ids = array_map(function ($x) use ($col) {return $x[$col];}, $data['items']);
	if (!count($ids)) {
		header('Location: ' . \FOP\Util::getCurrentBaseurl() . 'Tables/' . preg_replace('/[^a-zA-Z0-9_]/', '_', ucfirst($dv['tbl'])));
		die();
	}
	$idx = array_search($id, $ids);
	$idx += count($ids) + $step;
	$idx = $idx % count($ids);
	header('Location: ' . \FOP\Util::getCurrentBaseurl() . 'Tables/' . preg_replace('/[^a-zA-Z0-9_]/', '_', ucfirst($dv['tbl'])) . '/view?id=' . urlencode($ids[$idx]));
	die();

    
  }


  
  

  
  
}



