<?php
	
	/**
	 * Erweiterung der Verwaltung der Versandarten
	 */

?> 

<tr class="wpsg_mod_versandarten_packagetracking">
	<td class="wpsg_label"><?php echo __('Anbieter für Paketverfolgung', 'wpsg'); ?>:</td>
	<td class="wpsg_value">
		<select name="wpsg_mod_packagetracking_provider" class="wpsg_mod_packagetracking_provider" id="wpsg_mod_packagetracking_providerselect_<?php echo $this->view['wpsg_mod_packagetracking']['va']['id']; ?>">
			<option value="0"><?php echo __('Keine Vorauswahl', 'wpsg'); ?></option>
			<?php if (wpsg_isSizedArray($this->view['wpsg_mod_packagetracking']['provider'])) { ?>
			<?php foreach ($this->view['wpsg_mod_packagetracking']['provider'] as $p) { ?>
			<option value="<?php echo wpsg_hspc($p['id']); ?>" <?php echo (($p['id'] == $this->view['wpsg_mod_packagetracking']['va']['wpsg_mod_packagetracking_provider'])?'selected="selected"':''); ?>><?php echo wpsg_hspc($p['name']); ?></option>
			<?php } ?>
			<?php } ?>
		</select>
	</td>
	<td class="wpsg_delcol">
	
		<a class="wpsg_form_help" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=wpsg_mod_packagetracking_versandarten" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=wpsg_mod_packagetracking_versandarten"></a>
			
		<script type="text/javascript">/* <![CDATA[ */
       
			jQuery('#wpsg_mod_packagetracking_providerselect_<?php echo $this->view['wpsg_mod_packagetracking']['va']['id']; ?>').bind('change', function() {

				jQuery.ajax( {
					url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_packagetracking&noheader=1&do=setDefaultProvider',
					data: {
						'va_id': <?php echo $this->view['wpsg_mod_packagetracking']['va']['id']; ?>,
						'trackingprovider_id': jQuery(this).val()
					}
				} ); 
				
			} );

		/* ]]> */</script>
	
	</td>
</tr>