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