<?php
	require_once("config/connect.php");
	require_once("config/pageConfig.php");
	require_once("global_functions.php");
	check_login('', '', 'ENABLERKEY_ADMIN_HAPPYHOUR');
?>
<head>
	<title>SITPOS Zeitpreise</title>
	<?php echo META_DATA_ADMIN; ?>
	<script src="jquery/datepicker-de.js"></script>	
	<script src="jquery/jquery.ui.timepicker.js"></script>	
	<link rel="stylesheet" href="jquery/jquery.ui.timepicker.css">
	<style type="text/css">
		<?php include 'include/main.css'; ?>
		<?php include 'include/menue.css'; ?>
	</style>
</head>
<body >
	<div id="wrapper_admin" class="wrapper_admin">
	
	<script>
		  $( function() {
			$( "input[name='PME_data_von'], input[name='PME_data_bis']" ).timepicker({
				hourText: 'Stunden',
				minuteText: 'Minuten',
				defaultTime: '10:00',
				amPmText: ['', ''],
				timeSeparator: ':',
				atPosition: 'right top', 
				showPeriod: false,
				showPeriodLabels: false,
				showCloseButton: false,
			});

		});
	
	
	</script>
<?php
	menue_anzeigen();

	$opts['hn'] = SQL_HOST;
	$opts['un'] = SQL_USER;
	$opts['pw'] = SQL_PW;
	$opts['db'] = SQL_DB;
	$opts['tb'] = 'happyHourProfil';

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

	// Type of key field (int/real/string/date etc.)
	$opts['key_type'] = 'int';

	// Sorting field(s)
	$opts['sort_field'] = array('ID');

	// Number of records to display on the screen
	// Value of -1 lists all records in a table
	$opts['inc'] = 15;

	// Options you wish to give the users
	// A - add,  C - change, P - copy, V - view, D - delete,
	// F - filter, I - initial sort suppressed
	// $opts['options'] = 'ACPVDF';
	$opts['options'] = 'ACPVD';

	// Number of lines to display on multiple selection filters
	$opts['multiple'] = '4';

	// Navigation style: B - buttons (default), T - text links, G - graphic links
	// Buttons position: U - up, D - down (default)
	$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;


	// Display special page elements
	$opts['display'] = array(
		'form'  => true,
		'query' => true,
		'sort'  => true,
		'time'  => true,
		'tabs'  => true
	);

	// Set default prefixes for variables
	$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_';

	/* Get the user's default language and use it if possible or you can
	   specify particular one you want to use. Refer to official documentation
	   for list of available languages. */
	$opts['language'] = 'DE-UTF8';
	
	/*
	
		Erklärung:
		Required Field ->   #	$opts['fdd']['NAME']['js']['required'] = true;    od = false;
		gibt es auf der ganzen seite kein field mit einer js option gesetzt, kommt ein PME_js_form_control Error
		auf der seite stornogründe wurde das extra dafür eingefügt
	
	
	
	*/
	
	$opts['fdd']['id'] = array(
	  'name'     => 'id',
	  'select'   => 'T',
	  'options'  => '', // auto increment
	  'maxlen'   => 11,
	  'default'  => '0'
	);
	
	$opts['fdd']['tag'] = array(
	  'name'     => 'Wochentag',
	  'select'   => 'D',
	  'maxlen'   => 2,
	  'values2'   => array(0=>'So',1=>'Mo',2=>'Di',3=>'Mi',4=>'Do',5=>'Fr',6=>'Sa'),
	  'js'   	 => array('required' => 'true', 'hint' => 'Eingabe erforderlich'),   // * siehe Erklärung PME_js_form_control Error
	  'sort'     => true
	);
	$opts['fdd']['tagset'] = array(
	  'name'     => 'Aktiviert',
	  'select'   => 'D',
	  'maxlen'   => 1,
	  'values2'   => array(0=>'Nein',1=>'Ja'),
	  'default'  => '0'
	);
	$opts['fdd']['von'] = array(
	  'name'     => 'Beginn (von)',
	  'select'   => 'T',
	  'maxlen'   => 16
	);
	$opts['fdd']['bis'] = array(
	  'name'     => 'Ende (bis)',
	  'select'   => 'T',
	  'maxlen'   => 16
	);




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

?>

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