<?php

	/**
	 * Rendert die Liste der Paketverfolgungs Datensätze
	 */

?>
<?php if (wpsg_isSizedArray($this->view['wpsg_mod_packagetracking']['provider'])) { ?>
<table class="trackingprovider_table">
	 <colgroup>
    	<col class="wpsg_label" />
    	<col class="wpsg_value" /> 
    	<col class="wpsg_delcol" />
  	</colgroup>
  	<?php $i = 0; foreach ($this->view['wpsg_mod_packagetracking']['provider'] as $p) { $i ++; ?>
  	<tr>
		<td class="wpsg_label"><?php echo __('ID', 'wpsg'); ?>:</td>
		<td class="wpsg_value"><?php echo $p['id']; ?></td>	
		<td class="wpsg_delcol">
			<a class="wpsg_icon wpsg_icon_remove" href="#" title="<?php echo __('Anbieter löschen', 'wpsg'); ?>" onclick="return wpsg_mod_packagetracking_delete(<?php echo $p['id']; ?>);"></a>					
		</td>
	</tr>
	<tr>
		<td class="wpsg_label"><?php echo __('Name', 'wpsg'); ?>:</td>
		<td class="wpsg_value wpsg_editable" id="tp_<?php echo $p['id']; ?>_name"><?php echo wpsg_hspc(__($p['name'], 'wpsg')); ?></td>
		<td class="wpsg_delcol">
			
			<a class="wpsg_form_help" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=wpsg_mod_packagetracking_name" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=wpsg_mod_packagetracking_name"></a>
		
		</td>
	</tr>
	<tr>
		<td class="wpsg_label"><?php echo __('Url', 'wpsg'); ?>:</td>
		<td class="wpsg_value wpsg_editable" id="tp_<?php echo $p['id']; ?>_url"><?php echo $p['url']; ?></td>
		<td class="wpsg_delcol">
		
			<a class="wpsg_form_help" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=wpsg_mod_packagetracking_url" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=wpsg_mod_packagetracking_url"></a>
							
			<script type="text/javascript">/* <![CDATA[ */

				jQuery(document).ready(function() {

					jQuery('#tp_<?php echo $p['id']; ?>_name').editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_packagetracking&do=inlinedit&noheader=1', {
						submitdata: { 
				    		field: 'name',
				    		trackingprovider_id: '<?php echo $p['id']; ?>'
						}, 					
						submit  : '<?php echo __('Speichern', 'wpsg'); ?>',
						placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
						indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
				    	tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
					} );

					jQuery('#tp_<?php echo $p['id']; ?>_url').editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_packagetracking&do=inlinedit&noheader=1', {
						submitdata: { 
				    		field: 'url',
				    		trackingprovider_id: '<?php echo $p['id']; ?>'
						}, 					
						submit  : '<?php echo __('Speichern', 'wpsg'); ?>',
						placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
						indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
				    	tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
					} );
			
				} );

			/* ]]> */</script>
		
		</td>
	</tr>
	<?php if ($i < sizeof($this->view['wpsg_mod_packagetracking']['provider'])) { ?>
	<tr class="wpsg_spacer"><td colspan="3"><hr /></td></tr>
	<?php } ?>
	<?php } ?>
</table>
<script type="text/javascript">/* <![CDATA[ */

	jQuery(document).ready(function() {
	
		jQuery('.wpsg_form_help').tipTip();
	
	} );

/* ]]> */</script>
<?php } else { ?>
<p><?php echo __('Es wurden noch keine Anbieter für die Paketverfolgung angelegt.', 'wpsg'); ?>
<?php } ?>