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&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 |
|
5532 |
daniel |
21 |
<?php echo wpsg_drawForm_AdminboxStart(__('Länderverwaltung', 'wpsg')); ?>
|
|
|
22 |
|
|
|
23 |
<?php if (wpsg_isSizedArray($this->view['data'])) { ?>
|
|
|
24 |
<table class="table wpsg_table_country">
|
|
|
25 |
|
|
|
26 |
<tr>
|
|
|
27 |
<th class="col_name"><?php echo __('Ländername', 'wpsg'); ?></th>
|
|
|
28 |
<th class="col_vz"><?php echo __('Versandzone', 'wpsg'); ?></th>
|
|
|
29 |
<th class="col_mwstsetting"><?php echo __('MwSt.', 'wpsg'); ?></th>
|
|
|
30 |
<th class="col_mwst"><?php echo __('MwSt. A', 'wpsg'); ?></th>
|
|
|
31 |
<th class="col_mwst"><?php echo __('MwSt. B', 'wpsg'); ?></th>
|
|
|
32 |
<th class="col_mwst"><?php echo __('MwSt. C', 'wpsg'); ?></th>
|
|
|
33 |
<th class="col_mwst"><?php echo __('MwSt. D', 'wpsg'); ?></th>
|
|
|
34 |
<th class="col_action"></th>
|
|
|
35 |
</tr>
|
|
|
36 |
|
|
|
37 |
<?php foreach ($this->view['data'] as $l) { ?>
|
|
|
38 |
<tr id="<?php echo $l['id']; ?>">
|
|
|
39 |
<td class="col_name"><?php echo wpsg_hspc($l['name'].((wpsg_isSizedString($l['kuerzel']))?' ('.$l['kuerzel'].')':'')); ?></td>
|
|
|
40 |
<td class="col_vz">
|
|
|
41 |
<?php if (wpsg_isSizedInt($l['vz']) && wpsg_isSizedString($this->view['vz'][$l['vz']])) { ?>
|
|
|
42 |
<?php echo wpsg_hspc($this->view['vz'][$l['vz']]); ?>
|
|
|
43 |
<?php } ?>
|
|
|
44 |
</td>
|
|
|
45 |
<td class="col_mwstsetting">
|
|
|
46 |
<?php if ($l['mwst'] == '2') { ?>
|
|
|
47 |
<?php echo __('keine MwSt. bei USt.IdNr.', 'wpsg'); ?>
|
|
|
48 |
<?php } else if ($l['mwst'] == '1') { ?>
|
|
|
49 |
<?php echo __('keine MwSt.', 'wpsg'); ?>
|
|
|
50 |
<?php } else { ?>
|
|
|
51 |
<?php echo __('mit MwSt.', 'wpsg'); ?>
|
|
|
52 |
<?php } ?>
|
|
|
53 |
</td>
|
|
|
54 |
<td class="col_mwst"><?php if (wpsg_tf($l['mwst_a']) != NULL) { ?>
|
|
|
55 |
<?php echo wpsg_ff(wpsg_tf($l['mwst_a']), '%'); ?>
|
|
|
56 |
<?php } ?></td>
|
|
|
57 |
<td class="col_mwst"><?php if (wpsg_tf($l['mwst_b']) != NULL) { ?>
|
|
|
58 |
<?php echo wpsg_ff(wpsg_tf($l['mwst_b']), '%'); ?>
|
|
|
59 |
<?php } ?></td>
|
|
|
60 |
<td class="col_mwst"><?php if (wpsg_tf($l['mwst_c']) != NULL) { ?>
|
|
|
61 |
<?php echo wpsg_ff(wpsg_tf($l['mwst_c']), '%'); ?>
|
|
|
62 |
<?php } ?></td>
|
|
|
63 |
<td class="col_mwst"><?php if (wpsg_tf($l['mwst_d']) != NULL) { ?>
|
|
|
64 |
<?php echo wpsg_ff(wpsg_tf($l['mwst_d']), '%'); ?>
|
|
|
65 |
<?php } ?></td>
|
|
|
66 |
<td class="col_action"></td>
|
|
|
67 |
</tr>
|
|
|
68 |
<?php } ?>
|
|
|
69 |
|
|
|
70 |
</table>
|
|
|
71 |
<?php } else { ?>
|
|
|
72 |
<p><?php echo __('Noch keine Länder angelegt.', 'wpsg'); ?>
|
|
|
73 |
<?php } ?>
|
|
|
74 |
|
|
|
75 |
<br /><br />
|
|
|
76 |
|
|
|
77 |
<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=vz"><span class="wpsg-glyphicon glyphicon glyphicon-wrench"></span><?php echo __('Zur Versandzonenverwaltung', 'wpsg'); ?></a>
|
|
|
78 |
|
|
|
79 |
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
|
|
|
80 |
|
4057 |
daniel |
81 |
<div class="wpsg_admin_box">
|
|
|
82 |
|
4079 |
daniel |
83 |
<h3>
|
|
|
84 |
<?php echo __('Neues Land hinzufügen', 'wpsg'); ?>
|
|
|
85 |
<a target="_blank" href="http://wpshopgermany.maennchen1.de/?p=839037" class="wpsg_form_help_notip"></a>
|
|
|
86 |
</h3>
|
4057 |
daniel |
87 |
|
|
|
88 |
<?php echo $this->render(WPSG_PATH_VIEW.'/admin/laender_edit.phtml'); ?>
|
|
|
89 |
|
|
|
90 |
<h3><?php echo __('Bestehende Länder', 'wpsg'); ?></h3>
|
1067 |
daniel |
91 |
|
4057 |
daniel |
92 |
<?php if (wpsg_isSizedArray($this->view['data'])) { ?>
|
|
|
93 |
<table class="wpsg_admin_laender_list wpsg_admin_table" cellpadding="0" cellspacing="0">
|
|
|
94 |
<tr>
|
4083 |
daniel |
95 |
<th class="col_name"><?php echo __('Ländername', 'wpsg'); ?></th>
|
4057 |
daniel |
96 |
<th class="col_vz"><?php echo __('Versandzone', 'wpsg'); ?></th>
|
|
|
97 |
<th class="col_mwstsetting"><?php echo __('MwSt.', 'wpsg'); ?></th>
|
|
|
98 |
<th class="col_mwst"><?php echo __('MwSt. A', 'wpsg'); ?></th>
|
|
|
99 |
<th class="col_mwst"><?php echo __('MwSt. B', 'wpsg'); ?></th>
|
|
|
100 |
<th class="col_mwst"><?php echo __('MwSt. C', 'wpsg'); ?></th>
|
4083 |
daniel |
101 |
<th class="col_mwst"><?php echo __('MwSt. D', 'wpsg'); ?></th>
|
4057 |
daniel |
102 |
<th class="col_action"></th>
|
|
|
103 |
</tr>
|
|
|
104 |
<?php $i = 0; foreach ($this->view['data'] as $l) { $i ++; ?>
|
|
|
105 |
<tr id="wpsg_laenderrow_<?php echo $l['id']; ?>" class="<?php echo (($i % 2 == 0)?'odd':'even'); ?>">
|
|
|
106 |
<td class="col_name data_name"><?php echo wpsg_hspc($l['name'].((wpsg_isSizedString($l['kuerzel']))?' ('.$l['kuerzel'].')':'')); ?></td>
|
|
|
107 |
<td class="col_vz data_vz">
|
|
|
108 |
<?php if (wpsg_isSizedInt($l['vz']) && wpsg_isSizedString($this->view['vz'][$l['vz']])) { ?>
|
|
|
109 |
<?php echo wpsg_hspc($this->view['vz'][$l['vz']]); ?>
|
|
|
110 |
<?php } ?>
|
|
|
111 |
</td>
|
|
|
112 |
<td class="col_mwstsetting data_mwst">
|
|
|
113 |
<?php if ($l['mwst'] == '2') { ?>
|
|
|
114 |
<?php echo __('keine MwSt. bei USt.IdNr.', 'wpsg'); ?>
|
|
|
115 |
<?php } else if ($l['mwst'] == '1') { ?>
|
|
|
116 |
<?php echo __('keine MwSt.', 'wpsg'); ?>
|
|
|
117 |
<?php } else { ?>
|
|
|
118 |
<?php echo __('mit MwSt.', 'wpsg'); ?>
|
|
|
119 |
<?php } ?>
|
|
|
120 |
</td>
|
|
|
121 |
<td class="col_mwst data_mwst_a">
|
|
|
122 |
<?php if (wpsg_tf($l['mwst_a']) != NULL) { ?>
|
|
|
123 |
<?php echo wpsg_ff(wpsg_tf($l['mwst_a']), '%'); ?>
|
|
|
124 |
<?php } ?>
|
|
|
125 |
</td>
|
|
|
126 |
<td class="col_mwst data_mwst_b">
|
|
|
127 |
<?php if (wpsg_tf($l['mwst_b']) != NULL) { ?>
|
|
|
128 |
<?php echo wpsg_ff(wpsg_tf($l['mwst_b']), '%'); ?>
|
|
|
129 |
<?php } ?>
|
|
|
130 |
</td>
|
|
|
131 |
<td class="col_mwst data_mwst_c">
|
|
|
132 |
<?php if (wpsg_tf($l['mwst_c']) != NULL) { ?>
|
|
|
133 |
<?php echo wpsg_ff(wpsg_tf($l['mwst_c']), '%'); ?>
|
|
|
134 |
<?php } ?>
|
|
|
135 |
</td>
|
|
|
136 |
<td class="col_mwst data_mwst_d">
|
|
|
137 |
<?php if (wpsg_tf($l['mwst_d']) != NULL) { ?>
|
|
|
138 |
<?php echo wpsg_ff(wpsg_tf($l['mwst_d']), '%'); ?>
|
|
|
139 |
<?php } ?>
|
|
|
140 |
</td>
|
|
|
141 |
<td class="col_action">
|
1067 |
daniel |
142 |
|
4057 |
daniel |
143 |
<a class="wpsg_icon wpsg_icon_edit" href="#" onclick="return wpsg_laender_edit(<?php echo $l['id']; ?>);"></a>
|
|
|
144 |
<a class="wpsg_icon wpsg_icon_remove" href="#" onclick="return wpsg_laender_remove(<?php echo $l['id']; ?>);"></a>
|
|
|
145 |
|
|
|
146 |
</td>
|
|
|
147 |
</tr>
|
|
|
148 |
<?php } ?>
|
|
|
149 |
</table>
|
|
|
150 |
<?php } else { ?>
|
|
|
151 |
<p><?php echo __('Noch keine Länder angelegt.', 'wpsg'); ?>
|
|
|
152 |
<?php } ?>
|
1067 |
daniel |
153 |
|
4094 |
daniel |
154 |
<br /><br />
|
1067 |
daniel |
155 |
|
4057 |
daniel |
156 |
<input type="button" onclick="return wpsg_laender_import();" value="<?php echo __('Standardländer importieren', 'wpsg'); ?>" class="button" />
|
4094 |
daniel |
157 |
<input type="button" onclick="return wpsg_eu_laender_import();" value="<?php echo __('Standard EU-Länder importieren', 'wpsg'); ?>" class="button" />
|
1067 |
daniel |
158 |
|
4057 |
daniel |
159 |
<script type="text/javascript">/* <![CDATA[ */
|
|
|
160 |
|
|
|
161 |
var land_load = false;
|
|
|
162 |
|
|
|
163 |
function wpsg_laender_import()
|
|
|
164 |
{
|
|
|
165 |
|
|
|
166 |
if (!confirm('<?php echo __('Sind sie sich sicher ?', 'wpsg'); ?>')) return false;
|
|
|
167 |
|
|
|
168 |
location.href = "<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=laender&do=import&noheader=1";
|
|
|
169 |
|
|
|
170 |
return false;
|
|
|
171 |
|
|
|
172 |
}
|
|
|
173 |
|
4094 |
daniel |
174 |
function wpsg_eu_laender_import()
|
|
|
175 |
{
|
|
|
176 |
|
|
|
177 |
if (!confirm('<?php echo __('Sind sie sich sicher ?', 'wpsg'); ?>')) return false;
|
|
|
178 |
|
|
|
179 |
location.href = "<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=laender&do=eu_import&noheader=1";
|
|
|
180 |
|
|
|
181 |
return false;
|
|
|
182 |
|
|
|
183 |
}
|
|
|
184 |
|
4057 |
daniel |
185 |
function wpsg_laender_save()
|
|
|
186 |
{
|
|
|
187 |
|
|
|
188 |
jQuery.ajax( {
|
|
|
189 |
url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=laender&do=saveEdit&noheader=1',
|
|
|
190 |
data: {
|
|
|
191 |
form_data: jQuery('#wpsg_land_edit_form_edit').serialize()
|
|
|
192 |
},
|
|
|
193 |
success: function(data) {
|
|
|
194 |
|
|
|
195 |
if (typeof data === 'object')
|
|
|
196 |
{
|
|
|
197 |
|
|
|
198 |
land_load = true;
|
|
|
199 |
|
|
|
200 |
for (var i in data)
|
|
|
201 |
{
|
|
|
202 |
|
|
|
203 |
jQuery('#wpsg_laenderrow_' + data['id']).find('.data_' + i).html(data[i]);
|
|
|
204 |
|
|
|
205 |
}
|
|
|
206 |
|
|
|
207 |
jQuery('#wpsg_laenderrow_edit > td > div').slideUp(100, function() {
|
|
|
208 |
|
|
|
209 |
jQuery('#wpsg_laenderrow_edit').remove();
|
|
|
210 |
land_load = false;
|
|
|
211 |
|
|
|
212 |
} );
|
|
|
213 |
|
|
|
214 |
}
|
|
|
215 |
else alert(data);
|
|
|
216 |
|
|
|
217 |
}
|
|
|
218 |
} );
|
|
|
219 |
|
|
|
220 |
return false;
|
|
|
221 |
|
|
|
222 |
}
|
|
|
223 |
|
|
|
224 |
function wpsg_laender_edit(land_id)
|
|
|
225 |
{
|
|
|
226 |
|
|
|
227 |
if (land_load == true) return; land_load = true;
|
|
|
228 |
|
|
|
229 |
var edit_timeout = 0;
|
|
|
230 |
|
|
|
231 |
if (jQuery('#wpsg_laenderrow_edit > td > div').is(':visible'))
|
|
|
232 |
{
|
|
|
233 |
|
|
|
234 |
edit_timeout = 150;
|
|
|
235 |
|
|
|
236 |
jQuery('#wpsg_laenderrow_edit > td > div').slideUp(100, function() {
|
|
|
237 |
|
|
|
238 |
jQuery('#wpsg_laenderrow_edit').remove();
|
|
|
239 |
|
|
|
240 |
} );
|
|
|
241 |
|
|
|
242 |
}
|
|
|
243 |
|
|
|
244 |
window.setTimeout(function() {
|
|
|
245 |
|
4059 |
daniel |
246 |
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 |
247 |
|
|
|
248 |
jQuery.ajax( {
|
|
|
249 |
url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=laender&do=edit&noheader=1',
|
|
|
250 |
data: {
|
|
|
251 |
land_id: land_id
|
|
|
252 |
},
|
|
|
253 |
success: function(data) {
|
|
|
254 |
|
|
|
255 |
jQuery('#wpsg_laenderrow_edit > td > div').html(data);
|
|
|
256 |
jQuery('#wpsg_laenderrow_edit > td > img').hide();
|
|
|
257 |
jQuery('#wpsg_laenderrow_edit > td > div').slideDown(300, function() { land_load = false; } );
|
|
|
258 |
|
|
|
259 |
}
|
|
|
260 |
} );
|
|
|
261 |
|
|
|
262 |
}, edit_timeout);
|
|
|
263 |
|
|
|
264 |
return false;
|
|
|
265 |
|
|
|
266 |
}
|
|
|
267 |
|
|
|
268 |
function wpsg_laender_remove(land_id)
|
|
|
269 |
{
|
|
|
270 |
|
|
|
271 |
if (!confirm('<?php echo __('Sind Sie sich sicher?', 'wpsg'); ?>')) return false;
|
|
|
272 |
|
|
|
273 |
jQuery.ajax( {
|
|
|
274 |
url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=laender&do=remove&noheader=1',
|
|
|
275 |
data: {
|
|
|
276 |
land_id: land_id
|
|
|
277 |
},
|
|
|
278 |
success: function(data) {
|
|
|
279 |
|
|
|
280 |
if (data === "1") jQuery('#wpsg_laenderrow_' + land_id).remove();
|
|
|
281 |
else alert(data);
|
|
|
282 |
|
|
|
283 |
}
|
|
|
284 |
} );
|
|
|
285 |
|
|
|
286 |
return false;
|
|
|
287 |
|
4079 |
daniel |
288 |
}
|
4057 |
daniel |
289 |
|
|
|
290 |
/* ]]> */</script>
|
|
|
291 |
|
|
|
292 |
</div>
|
|
|
293 |
|
1067 |
daniel |
294 |
</div>
|