// Todo:	filter bei query setzen
			wenn filter, dann beim hinzufügen auch nur diesen zulassen
			zweimal öffnen von Modal macht es kleiner
			Filter funktioniert beim editieren derzeit nur für Text Feld - für andere Felder auch programmieren!
			Filter bei Feld edit oder add funktioniert nur bei operator '='
			
Define the Table, to operate on
	$konfiguration['table'] = 'einkauf_bon';
Define the key Field of the table (should be auto increment!!)
	$konfiguration['key'] = 'ek_bon_id';
	
Define the functions to show and what table operations are allowed
	$konfiguration['functions'] = array (	'delete' => true,
								'edit' => true,
								'view' => true,
								'copy' => true,
								'css' => 'width:200px',		
								'style' => 'image'
							)
	Define the style how the function buttons will be shown:
	allowed values: 'text' of 'image' - all but 'text' will show images!
	$konfiguration['functions']['style'] = 'image'
	Define the css style of the row that hold the function images or buttons
	$konfiguration['functions']['css'] = 'width:200px'


Define a SQL command to run instead of the standard delete Function.
This could be used to mark a line as deleted but not actually delete it!
'functions_delete_sql' => 'UPDATE lager SET geloescht="1" WHERE lager_id="§§id§§"',
	
Define Javascript to run after loading the overview Page
		'javascript' => '
							$(".einkauf_bon_produkte_ek_netto_summe").each(function (index, value) 
								{ 
									
									var row = $(this).closest("tr");
									var ek_price= parseFloat(row.find(".einkauf_bon_produkte_PRICEBUY").html());
									var stueck= parseFloat(row.find(".einkauf_bon_produkte_stueck").html());
									var summe=ek_price*stueck;
									$(this).html(summe.toFixed(2));
								});
								',
								
Define Javascript to run after loading the edit Page
		f.e. After Loading Edit Page multiply the field stueck with field PRICEBUY 
		     do the same when a key is pressed in one of that fields
		'javascript_edit_line' => '
								function calc_sum_netto()
								{
									stueck=$("#stueck_sIT_id").val();
									ek_preis=$("#PRICEBUY_sIT_id").val();
									$("#ek_netto_summe_sIT_id").val(stueck*ek_preis);
									
								}
								calc_sum_netto();
								$("#stueck_sIT_id").keyup(calc_sum_netto);
								$("#PRICEBUY_sIT_id").keyup(calc_sum_netto);
								',
								

Field Functions	- Array of Arrays what fields can be edited
	Feldname 	.... 	the name of the field in the table to be edited (must correspond to database field)
	type		....	the type of the the field to edit
						allowed values are: 'text', 'table_lookup', 'array_lookup'
						
						'text' option can be set: 'edit'		=> 'datepicker' shows a jquery datepicker for this field
						'array_lookup' : requires $konfiguration['fields']['lookup_array']= array ('0' => 'Nein','1' => 'Ja')
						'table_lookup' : requires $konfiguration['fields']['lookup_table'] => array ('table' => 'kunden','lookup_field' => 'id','lookup_show_fields' => array ('firma', 'nachname' ),'lookup_show_fields_glue' => '-')
	header		....	the header name which should be shown for this field $konfiguration['fields']['header']	= 'Invoice'
	view_options....	'view_options'	=> array ('table_list', 'view', 'edit') where should this field be shown
						'table_list' shows the field in the overview table
						'view' shows field in view AND delete option
						'edit' shows field in edit AND copy option
	readonly	....	'readonly' 	=> true set if field should be readonly
	hidden		....	'hidden' 	=> true - set if field should be hidden !!!! this field is not saved !!!! if set to hidden
	validation  ....	'required'	checks if the input field is not empty
	
	
Field examples:
	Text field:
			$konfiguration['fields'] => array(
			array (
				'feldname' 	=> 'ek_bon_id',
				'type' 		=> 'text',
				'header'	=> 'EK Rechnung',
				'view_options'	=> array ('table_list', 'view', 'edit'),
				'css_option' => array('css_table_list' => 'width:30px;', 'css' => 'width:500px;'),
				'readonly' 	=> true
			)
			)
			
	array lookup field:
			view No if value is 0 and Yes if value is 1
			array (
				'feldname' 	=> 'ist_payd',
				'type' 		=> 'array_lookup',
				'lookup_array'		=> array (
								'0' => 'No',
								'1' => 'Yes'
									),
				'view_options'	=> array ('table_list', 'view', 'edit'),
				'header'	=> 'Ist bezahlt'
			)
	
	table lookup field
			Lookup value of field customer_id in table customer
			Field to lookup in table customer is id.
			'edit' can be 'lookup' or 'dropdown'
			Show the fields firma and nachname and separate by -
			array (
				'feldname' 	=> 'customer_id',
				'type' 		=> 'table_lookup',
				'lookup_table' => array (
								'table' => 'customer',
								'lookup_field' => 'id',
								'lookup_filter' => 'geloescht<>1',
								'lookup_show_fields' => array (
									'firma', 'nachname' 
								),
								'lookup_show_fields_glue' => '-',
								),
				'edit'		=> 'lookup',
				'view_options'	=> array ('table_list', 'view', 'edit'),
				'header'	=> 'Kunde'
			)
			
	dialog iframe field
			Opens a dialog including a iframe which loads a php file
			array (
				'feldname' 	=> 'dummy1',
				'type' 		=> 'iframe_dialog',
				'button_text'=> 'Produkte',
				'header'	=> 'Produkte editieren',
				'php_file'	=>	'einkauf_produkte.php',
				'view_options'	=> array ('table_list'),
				'readonly' 	=> true
			),
	
	dummy Field
			A dummy field is a input field, but not saved in database:
			f.e. calc net->cross price but save only net price in database:
			array (
				'feldname' 	=> 'PRICEBUY',
				'type' 		=> 'text',
				'header'	=> 'EK Netto',
				'css_option' => array('css_table_list' => 'text-align:right;'),
				'view_options'	=> array ('table_list', 'view', 'edit')
				
			),
			array (
				'feldname' 	=> 'PRICEBUY_brutto',
				'type' 		=> 'dummy',
				'header'	=> 'EK Brutto',
				'css_option' => array('css_edit' => 'text-align:right;'),
				'view_options'	=> array ('edit')
			),
			
			'javascript_edit_line' => '
			// Calculate cross price of product
			function calc_ek_brutto()
			{
				tax_rate=$("#tax_rate_sIT_id").val();
				ek_preis=$("#PRICEBUY_sIT_id").val();
				$("#PRICEBUY_brutto_sIT_id").val(ek_preis*(1+(tax_rate)*1));
				
			}
			calc_ek_brutto();
			$("#PRICEBUY_sIT_id").keyup(calc_ek_brutto);
			
			// Calculate net price of product
			function calc_ek_netto()
			{
				tax_rate=$("#tax_rate_sIT_id").val();
				ek_preis_brutto=$("#PRICEBUY_brutto_sIT_id").val();
				$("#PRICEBUY_sIT_id").val(ek_preis_brutto/(1+(tax_rate)*1));
			}
			$("#PRICEBUY_brutto_sIT_id").keyup(calc_ek_netto);
			
			',


Run ajax function on button press or in image click:

			array (
				'feldname' 	=> 'minus',
				'type' 		=> 'ajax_function',
				'button_text'=> '-',
				'image'		=> 'images/minus.png',
				'header'	=> '-',
				'php_file'	=>	'einkauf_produkte_funktionen.php?funktion=minus&ek_bon_id='.$bon_id.'&id=§§id§§',
				'view_options'	=> array ('table_list'),
				'css_option' => array('css_table_list' => 'width:20px;'),
				'readonly' 	=> true
			),
			array (
				'feldname' 	=> 'plus',
				'type' 		=> 'ajax_function',
				'button_text'=> '+',
				'image'		=> 'images/plus.png',
				'header'	=> '+',
				'php_file'	=>	'einkauf_produkte_funktionen.php?funktion=plus&ek_bon_id='.$bon_id.'&id=§§id§§',
				'view_options'	=> array ('table_list'),
				'css_option' => array('css_table_list' => 'width:20px;'),
				'readonly' 	=> true
			),

************************************************************************
Alles ausser Zahlen wegschneiden!
array (
		'feldname' 	=> 'mobil',
		'type' 		=> 'text',
		'view_options'	=> array ('table_list', 'view', 'edit'),
		'default_value' => $mobil,
		'header'	=> 'Mobil',
		'validation'=> 'nur_ziffern_zulassen'
	)								
