<?php

	/**
	 * Template für die Integration des Videodownload Moduls in die Bestellverwaltung
	 * Sollte nicht verändert werden
	 */

?>
<script type="text/javascript">
/* <![CDATA[ */
 
	function wpsg_mod_videodownload_schedule(file)
	{

		jQuery('#wpsg_mod_videodownload_target').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
    	
		jQuery.ajax( { 
			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_videodownload&edit_id=<?php echo $this->view['order_id']; ?>&noheader=1&cmd=schedule_file&file=' + file,
			success: function(data) {
				jQuery('#wpsg_mod_videodownload_target').html(data);
			}
		} );
		
		return false;
		
	} // function wpsg_mod_videodownload_schedule(file)

	function wpsg_mod_videodownload_reindiv()
	{

		jQuery('#wpsg_mod_videodownload_target').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
    	
		jQuery.ajax( { 
			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_videodownload&edit_id=<?php echo $this->view['order_id']; ?>&noheader=1&cmd=reindiv',
			success: function(data) {

				jQuery('#wpsg_mod_videodownload_target').html(data); 
				
			}
		} );
		
		return false;
		
	} // function wpsg_mod_videodownload_reindiv()

	function wpsg_mod_videodownload_reset()
	{

		jQuery('#wpsg_mod_videodownload_target').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
    	
		jQuery.ajax( { 
			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_videodownload&edit_id=<?php echo $this->view['order_id']; ?>&noheader=1&cmd=reset',
			success: function(data) {

				jQuery('#wpsg_mod_videodownload_target').html(data); 
				
			}
		} );
		
		return false;
		
	} // function wpsg_mod_videodownload_reset()
	
	function wpsg_mod_videodownload_send()
	{

		jQuery('#wpsg_mod_videodownload_target').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
    	
		jQuery.ajax( { 
			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_videodownload&edit_id=<?php echo $this->view['order_id']; ?>&noheader=1&cmd=send_files',
			success: function(data) {

				jQuery('#wpsg_mod_videodownload_target').html(data);
				wpsg_reloadOrderLog();
				
			}
		} );
		
		return false;

	} // function wpsg_mod_videodownload_send()		
	
	function wpsg_mod_videodownload_cangelschedule(file)
	{

		jQuery('#wpsg_mod_videodownload_target').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
    	
		jQuery.ajax( { 
			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_videodownload&edit_id=<?php echo $this->view['order_id']; ?>&noheader=1&cmd=cancelschedule_file&file=' + file,
			success: function(data) {
				jQuery('#wpsg_mod_videodownload_target').html(data);
			}
		} );
		
		return false;
		
	} // function wpsg_mod_videodownload_cangelschedule(file)
	
/* ]]> */
</script>

<div class="postbox" id="wpsg_videodownloadbox">
	<h3 class="wpsg_handlediv">
		<span title="<?php echo __('Zum Ein/Ausklappen hier klicken', 'wpsg'); ?>" class="handlediv"><br /></span>
		<span><?php echo __('Videoprodukte', 'wpsg'); ?></span>
	</h3> 
	<div class="inside" id="wpsg_mod_videodownload_target">
		<?php echo $this->callMod('wpsg_mod_videodownload', 'order_view_sidebar_renderList', array($this->view['order_id'])); ?>		 
	</div>
</div>