<?php
	require_once("config/connect.php");
	require_once("config/pageConfig.php");
	require_once("global_functions.php");
	$backLink=true;
	if(isset($_GET['callfrom']) && $_GET['callfrom'] == 'kassieren'){
		# geändert, Link zur VK Maske immer da !!!!
		#$backLink=true;
	}
	else check_login('', '', 'ENABLERKEY_ADMIN_KUNDEN');
?>
<head>
	<title>SITPOS Kunden</title>
	<?php echo META_DATA_ADMIN; ?>
	<style type="text/css">
		<?php include 'include/main.css'; ?>
		<?php include 'include/menue.css'; 
			if($backLink==true){ 
		?>
				.menuDivRight{visibility: visible;			}
		<?php
			}
		?>
		
		#menuDivRight{visibility: visible;			}
	</style>
</head>
<body >
	<div id="wrapper_admin" class="wrapper_admin">

<?php
menue_anzeigen();

if (FILIALSYSTEM_IST_FILIALSYSTEM == "ja" && FILIALSYSTEM_SYNCHRONISATION_KUNDEN_BON == "ja") 
{
	
	echo '<iframe src="'.FILIALSYSTEM_URL_ZENTRALSYSTEM.'/kunden.php?token='.FILIALSYSTEM_TOKEN.'" height="100%" width="100%"></iframe>'; 
}
else
{
	$opts['hn'] = SQL_HOST;
	$opts['un'] = SQL_USER;
	$opts['pw'] = SQL_PW;
	$opts['db'] = SQL_DB;
	$opts['tb'] = 'kunden';

	// Name of field which is the unique key
	$opts['key'] = 'ID';

	// Type of key field (int/real/string/date etc.)
	$opts['key_type'] = 'int';
	$opts['sort_field'] = array('ID');
	$opts['inc'] = 15;
	$opts['options'] = 'ACPVDF';
	$opts['multiple'] = '4';
		$opts['navigation'] = 'UDG';

		$opts['buttons']['L']['up'] = array('<<','<','add','>','>>','goto_combo');
		$opts['buttons']['F']['up'] = $opts['buttons']['L']['up'];

		$opts['buttons']['L']['down'] = $opts['buttons']['L']['up']; 
		$opts['buttons']['V']['down'] = false;
		$opts['buttons']['C']['down'] = false;
	$opts['display'] = array(
		'form'  => true,
		'query' => true,
		'sort'  => true,
		'time'  => true,
		'tabs'  => true
	);
	$opts['js']['prefix']               = 'PME_js_';
	$opts['dhtml']['prefix']            = 'PME_dhtml_';
	$opts['cgi']['prefix']['operation'] = 'PME_op_';
	$opts['cgi']['prefix']['sys']       = 'PME_sys_';
	$opts['cgi']['prefix']['data']      = 'PME_data_';

	$opts['language'] = 'DE-UTF8';

	$opts['fdd']['ID'] = array(
	  'name'     => 'ID',
	  'select'   => 'T',
	  'options'  => '', // auto increment
	  'maxlen'   => 11,
	  'default'  => '0',
	  'sort'     => true
	);
	$opts['fdd']['kundennummer'] = array(
	  'name'     => 'Kunden Nr.',
	  'select'   => 'T',
	  'maxlen'   => 255,
	  'sort'     => true
	);
	$opts['fdd']['loyality_card'] = array(
	  'name'     => 'Loyality Karte Nr',
	  'select'   => 'T',
	  'maxlen'   => 255,
	  'sort'     => true
	);
	$opts['fdd']['adressnummer'] = array(
	  'name'     => 'Adressen Nr.',
	  'select'   => 'T',
	  'maxlen'   => 255,
	  'sort'     => true
	);
	$opts['fdd']['Firma'] = array(
	  'name'     => 'Firma',
	  'select'   => 'T',
	  'maxlen'   => 255,
	  'sort'     => true
	);
			
	$opts['fdd']['anrede'] = array(
	  'name'     => 'Anrede',
	  'select'   => 'T',
	  'maxlen'   => 255,
	  'sort'     => true
	);
	$opts['fdd']['titel'] = array(
	  'name'     => 'Titel',
	  'select'   => 'T',
	  'maxlen'   => 255,
	  'sort'     => true
	);
	$opts['fdd']['vorname'] = array(
	  'name'     => 'Vorname',
	  'select'   => 'T',
	  'maxlen'   => 255,
	  'sort'     => true
	);
	$opts['fdd']['nachname'] = array(
	  'name'     => 'Nachname',
	  'select'   => 'T',
	  'maxlen'   => 255,
	  'sort'     => true
	);

	$opts['fdd']['strasse1'] = array(
	  'name'     => 'Straße-1',
	  'select'   => 'T',
	  'maxlen'   => 255,
	  'sort'     => true
	);
	$opts['fdd']['strasse2'] = array(
	  'name'     => 'Straße-2',
	  'select'   => 'T',
	  'maxlen'   => 255,
	  'sort'     => true
	);
	$opts['fdd']['plz'] = array(
	  'name'     => 'Plz',
	  'select'   => 'T',
	  'maxlen'   => 10,
	  'sort'     => true
	);
	$opts['fdd']['Ort'] = array(
	  'name'     => 'Ort',
	  'select'   => 'T',
	  'maxlen'   => 64,
	  'sort'     => true
	);
	$opts['fdd']['Land'] = array(
	  'name'     => 'Land',
	  'select'   => 'T',
	  'maxlen'   => 64,
	  'sort'     => true
	);

	$opts['fdd']['telefon1'] = array(
	  'name'     => 'Telefon 1',
	  'select'   => 'T',
	  'maxlen'   => 64,
	  'sort'     => true
	);
	$opts['fdd']['telefon2'] = array(
	  'name'     => 'Telefon 2',
	  'select'   => 'T',
	  'maxlen'   => 64,
	  'sort'     => true
	);
	$opts['fdd']['email'] = array(
	  'name'     => 'eMail',
	  'select'   => 'T',
	  'maxlen'   => 64,
	  'sort'     => true
	);
	$opts['fdd']['fax'] = array(
	  'name'     => 'Fax Nr.',
	  'select'   => 'T',
	  'maxlen'   => 64,
	  'sort'     => true
	);
	$opts['fdd']['geburtstag'] = array(
	  'name'     => 'Geburtstag.',
	  'select'   => 'T',
	  'maxlen'   => 64,
	  'sort'     => true
	);
		$opts['fdd']['sachbearbeiter'] = array(
			 'name'     => 'Notizen',
			 'select'   => 'T',
			 'required' => false,
			 'maxlen'   => 64,
			 'textarea' => array( 'html' => true, 'rows' => 5, 'cols' => 55)
		);

	// Now important call to phpMyEdit
	require_once 'phpmyedit/phpMyEdit.class.php';
	new phpMyEdit($opts);
}
?>

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