Subversion Repositories wpShopGermany4

Rev

Rev 5439 | Rev 5532 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1067 daniel 1
<?php
2
 
3
	/**
4
	 * Template für die Länderverwaltung
5
	 */
6
 
7
?>
8
<div class="wpsg_admin_submenu">
9
 
5455 thomas 10
	<div class="list-group">
11
		<span class="list-group-head list-group-item"><?php echo __('Konfiguration'); ?></span>
12
		<?php foreach ($this->view['arSubAction'] as $k => $v) { ?>
13
		<a class="list-group-item <?php echo (($k == $this->view['subAction'])?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;subaction=<?php echo $k; ?>"><?php echo $v['Menutext']; ?></a>
1067 daniel 14
		<?php } ?>
5455 thomas 15
	</div>
1067 daniel 16
 
17
</div>
18
 
19
<div class="wpsg_admin_content">
4057 daniel 20
 
21
	<div class="wpsg_admin_box">
22
 
4079 daniel 23
		<h3>
24
			<?php echo __('Neues Land hinzufügen', 'wpsg'); ?>
25
			<a target="_blank" href="http://wpshopgermany.maennchen1.de/?p=839037" class="wpsg_form_help_notip"></a>
26
		</h3>
4057 daniel 27
 
28
		<?php echo $this->render(WPSG_PATH_VIEW.'/admin/laender_edit.phtml'); ?>
29
 
30
		<h3><?php echo __('Bestehende Länder', 'wpsg'); ?></h3>
1067 daniel 31
 
4057 daniel 32
		<?php if (wpsg_isSizedArray($this->view['data'])) { ?>
33
		<table class="wpsg_admin_laender_list wpsg_admin_table" cellpadding="0" cellspacing="0">
34
			<tr>
4083 daniel 35
				<th class="col_name"><?php echo __('Ländername', 'wpsg'); ?></th>
4057 daniel 36
				<th class="col_vz"><?php echo __('Versandzone', 'wpsg'); ?></th>
37
				<th class="col_mwstsetting"><?php echo __('MwSt.', 'wpsg'); ?></th>
38
				<th class="col_mwst"><?php echo __('MwSt. A', 'wpsg'); ?></th>
39
				<th class="col_mwst"><?php echo __('MwSt. B', 'wpsg'); ?></th>
40
				<th class="col_mwst"><?php echo __('MwSt. C', 'wpsg'); ?></th>
4083 daniel 41
				<th class="col_mwst"><?php echo __('MwSt. D', 'wpsg'); ?></th>
4057 daniel 42
				<th class="col_action"></th>
43
			</tr>
44
			<?php $i = 0; foreach ($this->view['data'] as $l) { $i ++; ?>
45
			<tr id="wpsg_laenderrow_<?php echo $l['id']; ?>" class="<?php echo (($i % 2 == 0)?'odd':'even'); ?>">
46
				<td class="col_name data_name"><?php echo wpsg_hspc($l['name'].((wpsg_isSizedString($l['kuerzel']))?' ('.$l['kuerzel'].')':'')); ?></td>
47
				<td class="col_vz data_vz">
48
					<?php if (wpsg_isSizedInt($l['vz']) && wpsg_isSizedString($this->view['vz'][$l['vz']])) { ?>
49
					<?php echo wpsg_hspc($this->view['vz'][$l['vz']]); ?>
50
					<?php } ?>
51
				</td>
52
				<td class="col_mwstsetting data_mwst">
53
					<?php if ($l['mwst'] == '2') { ?>
54
					<?php echo __('keine MwSt. bei USt.IdNr.', 'wpsg'); ?>
55
					<?php } else if ($l['mwst'] == '1') { ?>
56
					<?php echo __('keine MwSt.', 'wpsg'); ?>
57
					<?php } else { ?>
58
					<?php echo __('mit MwSt.', 'wpsg'); ?>
59
					<?php } ?>
60
				</td>
61
				<td class="col_mwst data_mwst_a">
62
					<?php if (wpsg_tf($l['mwst_a']) != NULL) { ?>
63
						<?php echo wpsg_ff(wpsg_tf($l['mwst_a']), '%'); ?>
64
					<?php } ?>
65
				</td>
66
				<td class="col_mwst data_mwst_b">
67
					<?php if (wpsg_tf($l['mwst_b']) != NULL) { ?>
68
						<?php echo wpsg_ff(wpsg_tf($l['mwst_b']), '%'); ?>
69
					<?php } ?>
70
				</td>
71
				<td class="col_mwst data_mwst_c">
72
					<?php if (wpsg_tf($l['mwst_c']) != NULL) { ?>
73
						<?php echo wpsg_ff(wpsg_tf($l['mwst_c']), '%'); ?>
74
					<?php } ?>
75
				</td>
76
				<td class="col_mwst data_mwst_d">
77
					<?php if (wpsg_tf($l['mwst_d']) != NULL) { ?>
78
						<?php echo wpsg_ff(wpsg_tf($l['mwst_d']), '%'); ?>
79
					<?php } ?>
80
				</td>
81
				<td class="col_action">
1067 daniel 82
 
4057 daniel 83
					<a class="wpsg_icon wpsg_icon_edit" href="#" onclick="return wpsg_laender_edit(<?php echo $l['id']; ?>);"></a>
84
					<a class="wpsg_icon wpsg_icon_remove" href="#" onclick="return wpsg_laender_remove(<?php echo $l['id']; ?>);"></a>
85
 
86
				</td>
87
			</tr>
88
			<?php } ?>
89
		</table>
90
		<?php } else { ?>
91
		<p><?php echo __('Noch keine Länder angelegt.', 'wpsg'); ?>
92
		<?php } ?>
1067 daniel 93
 
4094 daniel 94
		<br /><br />
1067 daniel 95
 
4057 daniel 96
		<input type="button" onclick="return wpsg_laender_import();" value="<?php echo __('Standardländer importieren', 'wpsg'); ?>" class="button" />
4094 daniel 97
		<input type="button" onclick="return wpsg_eu_laender_import();" value="<?php echo __('Standard EU-Länder importieren', 'wpsg'); ?>" class="button" />
1067 daniel 98
 
4057 daniel 99
		<script type="text/javascript">/* <![CDATA[ */
100
 
101
			var land_load = false;
102
 
103
			function wpsg_laender_import()
104
			{
105
 
106
				if (!confirm('<?php echo __('Sind sie sich sicher ?', 'wpsg'); ?>')) return false;
107
 
108
				location.href = "<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=laender&do=import&noheader=1";
109
 
110
				return false;
111
 
112
			}
113
 
4094 daniel 114
			function wpsg_eu_laender_import()
115
			{
116
 
117
				if (!confirm('<?php echo __('Sind sie sich sicher ?', 'wpsg'); ?>')) return false;
118
 
119
				location.href = "<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=laender&do=eu_import&noheader=1";
120
 
121
				return false;
122
 
123
			}
124
 
4057 daniel 125
			function wpsg_laender_save()
126
			{
127
 
128
				jQuery.ajax( {
129
					url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=laender&do=saveEdit&noheader=1',
130
					data: {
131
						form_data: jQuery('#wpsg_land_edit_form_edit').serialize()
132
					},
133
					success: function(data) {
134
 
135
						if (typeof data === 'object')
136
						{
137
 
138
							land_load = true;
139
 
140
							for (var i in data)
141
							{
142
 
143
								jQuery('#wpsg_laenderrow_' + data['id']).find('.data_' + i).html(data[i]);
144
 
145
							}
146
 
147
							jQuery('#wpsg_laenderrow_edit > td > div').slideUp(100, function() {
148
 
149
								jQuery('#wpsg_laenderrow_edit').remove();
150
								land_load = false;
151
 
152
							} );
153
 
154
						}
155
						else alert(data);
156
 
157
					}
158
				} );
159
 
160
				return false;
161
 
162
			}
163
 
164
			function wpsg_laender_edit(land_id)
165
			{
166
 
167
				if (land_load == true) return; land_load = true;
168
 
169
				var edit_timeout = 0;
170
 
171
				if (jQuery('#wpsg_laenderrow_edit > td > div').is(':visible'))
172
				{
173
 
174
					edit_timeout = 150;
175
 
176
					jQuery('#wpsg_laenderrow_edit > td > div').slideUp(100, function() {
177
 
178
						jQuery('#wpsg_laenderrow_edit').remove();
179
 
180
					} );
181
 
182
				}
183
 
184
				window.setTimeout(function() {
185
 
4059 daniel 186
					jQuery('#wpsg_laenderrow_' + land_id).after('<tr id="wpsg_laenderrow_edit"><td colspan="8"><img src="<?php echo $this->getRessourceURL('gfx/ajax-loader.gif'); ?>" alt="" /><div style="display:none;"></div></td></tr>');
4057 daniel 187
 
188
					jQuery.ajax( {
189
						url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=laender&do=edit&noheader=1',
190
						data: {
191
							land_id: land_id
192
						},
193
						success: function(data) {
194
 
195
							jQuery('#wpsg_laenderrow_edit > td > div').html(data);
196
							jQuery('#wpsg_laenderrow_edit > td > img').hide();
197
							jQuery('#wpsg_laenderrow_edit > td > div').slideDown(300, function() { land_load = false; } );
198
 
199
						}
200
					} );
201
 
202
				}, edit_timeout);
203
 
204
				return false;
205
 
206
			}
207
 
208
			function wpsg_laender_remove(land_id)
209
			{
210
 
211
				if (!confirm('<?php echo __('Sind Sie sich sicher?', 'wpsg'); ?>')) return false;
212
 
213
				jQuery.ajax( {
214
					url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=laender&do=remove&noheader=1',
215
					data: {
216
						land_id: land_id
217
					},
218
					success: function(data) {
219
 
220
						if (data === "1") jQuery('#wpsg_laenderrow_' + land_id).remove();
221
						else alert(data);
222
 
223
					}
224
				} );
225
 
226
				return false;
227
 
4079 daniel 228
			}
4057 daniel 229
 
230
		/* ]]> */</script>
231
 
232
	</div>
233
 
1067 daniel 234
</div>