<?php 

	/**
	 * Templatedatei für die Einstellungsseite im Backend
	 */

?>
<div class="wpsg_admin_submenu">
	
	<div class="head">
		<div class="title"><?php echo __("Einstellungen", "wpsg"); ?></div>			
		<div style="clear:both;"></div>
	</div>

	<ul>		
		<?php foreach ($this->view['arSubAction'] as $k => $v) { ?>		
		<li class="<?php echo (($k == $this->view['subAction'])?'current':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;subaction=<?php echo $k; ?>"><?php echo $v['Menutext']; ?></a></li>
		<?php } ?>
	</ul>
			
</div>
		
<div style="padding:0px; margin:0px; float:left;">
	<form name="form1" method="post" enctype="multipart/form-data" action="<?php echo wpsg_hspc(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=konfiguration&noheader=1'); ?>">
  
  		<?php if ($this->hasMod('wpsg_mod_core')) { ?>
			<?php if ($this->arLizenz['l'] == 0) { ?>
			<div class="wpsg_form_field">
				<div class="wpsg_form_left">
					<?php echo __("Lizenzende", "wpsg"); ?>:
				</div>
				<div class="wpsg_form_right">
					<?php if ($this->getDemoDays() < 0) { ?>
					<p><?php echo wpsg_translate(__('Vor #1# Tage(n) abgelaufen.', 'wpsg'), abs($this->getDemoDays())); ?></p>
					<?php } else { ?>
					<p><?php echo wpsg_translate(__('#1# Tage verbleibend.', 'wpsg'), $this->getDemoDays()); ?></p>
					<?php } ?>
					<a rel="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=DemoMode" title="DemoMode" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=DemoMode" class="wpsg_form_help"></a>
				</div>
				<div class="wpsg_clear"></div>
			</div>		
			<?php } else { ?>
			<div class="wpsg_form_field">
				<div class="wpsg_form_left">
					<?php echo __('Lizenzstatus', 'wpsg'); ?>:
				</div>
				<div class="wpsg_form_right">
					<p>
					<?php 
					
						switch ($this->arLizenz['l']) 
						{ 
					
							case '1': echo __('Light Version', 'wpsg'); break;
							case '2': echo __('Pro Version', 'wpsg'); break;
							case '3': echo __('Enterprise Version', 'wpsg'); break;
							default: die();
							
						}					
	 
					?>				
					</p>
				</div>
				<div class="wpsg_clear"></div>
			</div>
			<?php } ?>
		<?php } else { ?> 
		<div class="wpsg_form_field">
			<div class="wpsg_form_left">&nbsp;</div>
			<div class="wpsg_form_right">
				<?php echo wpsg_translate(
					__('<span style="color:red; font-weight:bold;">Weitere Funktionen in der Vollversion.</span><br />[ <a target="_blank" href="#1#">Vollversion kaufen</a> ] [ <a target="_blank" href="#2#">Weitere Infos</a> ]', 'wpsg'),
					'http://shop.maennchen1.de/produkte/wpshopgermany-lizenzkey/',
					'http://wpshopgermany.de/'
				); ?>
			</div>
			<div class="wpsg_clear"></div>
		</div>		
		<?php } ?>
		
		<?php if ($this->get_option("wpsg_version_installed", true) != WPSG_VERSION) { ?>
		<div class="wpsg_form_field">
			<div class="wpsg_form_left">
				<span style="color:red;"><?php echo __("Update", "wpsg"); ?>:</span>
			</div>
			<div class="wpsg_form_right">
				<p><?php echo __("Die Version der Datenbank stimmt nicht mit der installierten Version überein!<br />Bitte klicken Sie auf ", "wpsg").'<a href="'.WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&amp;subaction=allgemein&amp;do=update&amp;submit=1&amp;noheader=1">'.__("Aktualisieren", "wpsg").'</a>&nbsp;('.__("Produkte etc. werden dabei nicht gelöscht.", "wpsg"); ?>)</p>				
				<a rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=DBUpdate" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=DBUpdate" class="wpsg_form_help"></a>
			</div>
			<div class="wpsg_clear"></div>
		</div>
		<?php } else { ?>
		<div class="wpsg_form_field">
			<div class="wpsg_form_left">
				<?php echo __("Installierte DB Version", "wpsg"); ?>:
			</div>
			<div class="wpsg_form_right">
				<p><?php echo WPSG_VERSION; ?>&nbsp;<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;subaction=allgemein&amp;do=update&amp;submit=1&amp;noheader=1"><?php echo __("Aktualisieren", "wpsg"); ?></a></p>
				<a rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=DBUpdate" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=DBUpdate" class="wpsg_form_help"></a>
			</div>
			<div class="wpsg_clear"></div>
		</div>	
		<?php } ?>
		<br />
		
		<div class="wpsg_form_field">
			<div class="wpsg_form_left">
				<?php echo __("Währung", "wpsg"); ?>:
			</div>
			<div class="wpsg_form_right">
				<input type="text" value="<?php echo wpsg_hspc($this->get_option('wpsg_currency')); ?>" name="wpsg_currency" />
				<a rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=Einstellungen_Allgemein_Waehrung" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=Einstellungen_Allgemein_Waehrung" class="wpsg_form_help"></a>				
			</div>
			<div class="wpsg_clear"></div>
		</div>	

		<?php if (wpsg_isSizedArray($this->view['arLanguages'])) { ?>
		<?php echo wpsg_drawForm_Select('wpsg_backend_language', __('Standardsprache (Backend)', 'wpsg'), $this->view['arLanguages'], $this->get_option('wpsg_backend_language'), array('help' => 'Einstellungen_Allgemein_Standardsprachebackend')); ?>
		<?php } ?>
					
		<div class="wpsg_form_field">
			<div class="wpsg_form_left">
				<?php echo __('Produkte pro Seite', 'wpsg'); ?>:				
			</div>
			<div class="wpsg_form_right">
				<input type="text" value="<?php echo wpsg_hspc($this->get_option('wpsg_produkte_perpage')); ?>" name="wpsg_produkte_perpage" />
				<a rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=ProduktePerPage" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=ProduktePerPage" class="wpsg_form_help"></a>				
			</div>
			<div class="wpsg_clear"></div>
		</div>
		
		<?php echo wpsg_drawForm_Input('wpsg_order_perpage', __('Bestellungen pro Seite', 'wpsg'), $this->get_option('wpsg_order_perpage')); ?>
		<?php echo wpsg_drawForm_Checkbox('wpsg_showincompleteorder', __('Unvollständige Best. in Bestellverwaltung anzeigen', 'wpsg'), $this->get_option('wpsg_showincompleteorder')); ?>
		<?php echo wpsg_drawForm_Checkbox('wpsg_emptyorder_clear', wpsg_translate(__('Bestellungen für 0 #1# direkt abschließen', 'wpsg'), $this->get_option('wpsg_currency')), $this->get_option('wpsg_emptyorder_clear')); ?>
		<?php echo wpsg_drawForm_Select('wpsg_afterinsert', __('Nach neuem Produkt im Warenkorb', 'wpsg'), array(
			'0' => __('Auf Seite bleiben', 'wpsg'),
			'1' => __('Zum Warenkorb leiten', 'wpsg'),
			'2' => __('Warenkorb im Fenster anzeigen', 'wpsg'),
			'3' => __('Lightbox Meldung', 'wpsg')
		), $this->get_option('wpsg_afterinsert')); ?>
		<?php echo wpsg_drawForm_Checkbox('wpsg_skip_checkout2', __('Auswahl der Zahlung/Versandart überspringen wenn möglich', 'wpsg'), $this->get_option('wpsg_skip_checkout2')); ?>
		<?php echo wpsg_drawForm_Select('wpsg_afterorder', __('Kundendaten nach Bestellung', 'wpsg'), array(
			'0' => __('In Session belassen', 'wpsg'),
			'1' => __('Löschen', 'wpsg')
		), $this->get_option('wpsg_afterorder')); ?>
		<?php echo wpsg_drawForm_Input('wpsg_format_knr', __('Formatierung Kundennummer', 'wpsg'), $this->get_option('wpsg_format_knr'), array('help' => 'Formatierung_Kundennummer')); ?>
		<?php echo wpsg_drawForm_Select('wpsg_order_knr', __('Sortierung Kundennummer (Backend)', 'wpsg'), array('0' => __('Numerisch', 'wpsg'), '1' => __('Alphabetisch', 'wpsg')), $this->get_option('wpsg_order_knr')); ?>		
		<?php echo wpsg_drawForm_Input('wpsg_customer_start', __('Start für Kundennummer', 'wpsg'), $this->get_option('wpsg_customer_start')); ?>		
		<?php echo wpsg_drawForm_Input('wpsg_format_onr', __('Formatierung Bestellnummer', 'wpsg'), $this->get_option('wpsg_format_onr'), array('help' => 'Formatierung_Bestellnummer')); ?>
		<?php echo wpsg_drawForm_Input('wpsg_order_start', __('Start für Bestellnummer', 'wpsg'), $this->get_option('wpsg_order_start')); ?>
			
		<script type="text/javascript">

			jQuery(document).ready(function() {
 
				jQuery('.wpsg_form_help').tipTip();
				
			} );
		
		</script>
		
		<input type="hidden" name="subaction" value="konfiguration" />
			
		<p class="submit"><input type="submit" value="<?php echo __('Einstellungen speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit" /></p>
			
	</form>		
</div>