<?php

	/**
	 * Template für die Integration in die Produktverwaltung
	 */

?><div id="wpsg_funding" class="postbox">	
	<h3 class="wpsg_handlediv">
		<span title="<?php echo __('Zum Ein/Ausklappen hier klicken', 'wpsg'); ?>" class="handlediv"><br /></span>
		<span><?php echo __('Finanzierungsprodukt', 'wpsg'); ?> </span>
	</h3>
	<div class="inside">
	
		<?php if (wpsg_isSizedInt($_REQUEST['edit_id'])) { ?>
		
		<input type="hidden" name="wpsg_mod_funding_save" value="1" />
		
		<?php echo wpsg_drawForm_Checkbox('wpsg_mod_funding[activ]', __('Finanzierungsprodukt', 'wpsg'), wpsg_getStr($this->view['wpsg_mod_funding']['activ']), array('id' => 'wpsg_mod_funding_activ')); ?>
		
		<div id="wpsg_mod_funding_activ_layer">
		
			<?php echo wpsg_drawForm_Input('wpsg_mod_funding[start]', __('Start der Runde', 'wpsg'), wpsg_getStr($this->view['wpsg_mod_funding']['start']), array('datepicker' => true)); ?>
			<?php echo wpsg_drawForm_Input('wpsg_mod_funding[end]', __('Ende der Runde', 'wpsg'), wpsg_getStr($this->view['wpsg_mod_funding']['end']), array('datepicker' => true)); ?>
			<?php echo wpsg_drawForm_Input('wpsg_mod_funding[limit]', __('Mögliche Bestellungen', 'wpsg'), ((wpsg_isSizedInt($this->view['wpsg_mod_funding']['limit']))?$this->view['wpsg_mod_funding']['limit']:'10')); ?>
		
		</div>
		
		<script type="text/javascript">/* <![CDATA[ */

			jQuery(document).ready(function() {

				jQuery('#wpsg_mod_funding_activ').bind('change', function() {

					if (jQuery(this).is(':checked')) jQuery('#wpsg_mod_funding_activ_layer').show();
					else jQuery('#wpsg_mod_funding_activ_layer').hide();
					
				} ).change();
				
			} );
        
		/* ]]> */</script>
		
		<?php } else { ?>
		<p><?php echo __('Das Produkt muss einmalig gespeichert werden bevor die Option "Finanzierungsprodukt" aktiviert werden kann.', 'wpsg'); ?></p>
		<?php } ?>
	
	</div>	
</div>