<?php
	require_once(__DIR__."/config/connect.php");
	require_once(__DIR__."/config/pageConfig.php");
	require_once(__DIR__."/global_functions.php");
	require_once(__DIR__."/sITeditor/sITeditor.php");
	
	check_login('', '', 'BENUTZERRECHT_KUNDEN_ANLEGEN');
	
?>

	<script src="include/global_js_functions.js"></script>
    
	<style type="text/css">
		<?php include 'include/main.css'; ?>
		<?php include 'include/menue.css'; ?>
	
	</style>

	<link rel="stylesheet" type="text/css" href="sITeditor/sITeditor.css">
	
</head>
<body>

<?php


$kunden_id=0;
$autoedit=false;


menue_anzeigen();
echo '<div id="wrapper_bon" class="wrapper_bon">';

if (isset($_REQUEST['kunden_id']))
{
	$kunden_id=$_REQUEST['kunden_id'];
	echo "Kunden ID: $kunden_id";
}

	$konfiguration= array (
		'table'		=> 'telefon_anrufprotokoll',
		'key'		=> 'ID',
		'functions' => array (	'delete' => true,
								'edit' => true,
								'autoedit' => $autoedit,
								'view' => true,
								'download_csv' => true,
								'download_pdf' => true,
								'css' => 'width:100px; min-width:100px; ',
								'style' => 'image'
							),
		'orderby'		=> ' ORDER by ID DESC ',
		'fields'	=> array(
			array (
				'feldname' 	=> 'create_ts',
				'type' 		=> 'text',
				'view_options'	=> array ('table_list', 'view', 'edit'),
				'header'	=> 'datum'
			),
			array (
				'feldname' 	=> 'ID',
				'type' 		=> 'text',
				'header'	=> 'ID',
				'view_options'	=> array ('table_list', 'view', 'edit'),
				'edit_input_option' => array('size' => '10', 'maxlength'=>'10'),
				'readonly' 	=> true
			),
			array (
				'feldname' 	=> 'telefon_nummer',
				'type' 		=> 'text',
				'header'	=> 'Nummer',
				'view_options'	=> array ('table_list', 'view', 'edit'),
				'edit_input_option' => array('size' => '20', 'maxlength'=>'10'),
				'readonly' 	=> true
			),
			array (
				'feldname' 	=> 'kunden_id',
				'type' 		=> 'table_lookup',
				'lookup_table' => array (
								'table' => 'kunden',
								'lookup_field' => 'id',
								'lookup_show_fields' => array (
									'vorname', 'nachname' 
									)
								),
				'edit'		=> 'lookup',
				'view_options'	=> array ('table_list', 'edit'),
				'header'	=> 'Kunde',
				'edit_input_option' => array('size' => '10', 'maxlength'=>'10'),
				'disabled' 	=> true
			),

			array (
				'feldname' 	=> 'ist_abgeschlossen',
				'type' 		=> 'array_lookup',
				'lookup_array'		=> array (
								'0' => 'Nein',
								'1' => 'Ja'
									),
				'view_options'	=> array ('table_list', 'view', 'edit'),
				'header'	=> 'Ist abgeschlossen',
			),
			array (
				'feldname' 	=> 'tisch_id',
				'type' 		=> 'table_lookup',
				'lookup_table' => array (
								'table' => 'tische',
								'lookup_field' => 'id',
								'lookup_show_fields' => array (
									'tischName' 
									)
								),
				'edit'		=> 'lookup',
				'view_options'	=> array ('table_list', 'edit'),
				'header'	=> 'Tisch',
				'edit_input_option' => array('size' => '10', 'maxlength'=>'10'),
				'disabled' 	=> true
			)
		)
	
	);
	
	sIT_editor_tabelle($konfiguration, $kunden_id);

?>


</div>  <!-- end of wrapper div -->

</body>
