summaryrefslogtreecommitdiff
path: root/views/admin/laender.phtml
diff options
context:
space:
mode:
Diffstat (limited to 'views/admin/laender.phtml')
-rw-r--r--views/admin/laender.phtml213
1 files changed, 158 insertions, 55 deletions
diff --git a/views/admin/laender.phtml b/views/admin/laender.phtml
index ee7fbb0..41c5fdd 100644
--- a/views/admin/laender.phtml
+++ b/views/admin/laender.phtml
@@ -16,68 +16,171 @@
</div>
+<div class="modal fade" id="Modal_wpsg_country_edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
+ <div class="modal-dialog" role="document">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+ <h4 class="modal-title" id="myModalLabel"><?php echo __('Land anlegen/bearbeiten', 'wpsg'); ?></h4>
+ </div>
+ <div class="modal-body">
+
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-default" onclick="return wpsg_country_save();" data-dismiss="modal"><?php echo __('Speichern und schließen', 'wpsg'); ?></button>
+ </div>
+ </div>
+ </div>
+</div>
+
<div class="wpsg_admin_content">
- <?php echo wpsg_drawForm_AdminboxStart(__('Länderverwaltung', 'wpsg')); ?>
-
- <?php if (wpsg_isSizedArray($this->view['data'])) { ?>
- <table class="table wpsg_table_country">
-
- <tr>
- <th class="col_name"><?php echo __('Ländername', 'wpsg'); ?></th>
- <th class="col_vz"><?php echo __('Versandzone', 'wpsg'); ?></th>
- <th class="col_mwstsetting"><?php echo __('MwSt.', 'wpsg'); ?></th>
- <th class="col_mwst"><?php echo __('MwSt. A', 'wpsg'); ?></th>
- <th class="col_mwst"><?php echo __('MwSt. B', 'wpsg'); ?></th>
- <th class="col_mwst"><?php echo __('MwSt. C', 'wpsg'); ?></th>
- <th class="col_mwst"><?php echo __('MwSt. D', 'wpsg'); ?></th>
- <th class="col_action"></th>
- </tr>
-
- <?php foreach ($this->view['data'] as $l) { ?>
- <tr id="<?php echo $l['id']; ?>">
- <td class="col_name"><?php echo wpsg_hspc($l['name'].((wpsg_isSizedString($l['kuerzel']))?' ('.$l['kuerzel'].')':'')); ?></td>
- <td class="col_vz">
- <?php if (wpsg_isSizedInt($l['vz']) && wpsg_isSizedString($this->view['vz'][$l['vz']])) { ?>
- <?php echo wpsg_hspc($this->view['vz'][$l['vz']]); ?>
- <?php } ?>
- </td>
- <td class="col_mwstsetting">
- <?php if ($l['mwst'] == '2') { ?>
- <?php echo __('keine MwSt. bei USt.IdNr.', 'wpsg'); ?>
- <?php } else if ($l['mwst'] == '1') { ?>
- <?php echo __('keine MwSt.', 'wpsg'); ?>
- <?php } else { ?>
- <?php echo __('mit MwSt.', 'wpsg'); ?>
+ <form name="form1" method="post" enctype="multipart/form-data" action="<?php echo wpsg_hspc(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=laender&noheader=1'); ?>">
+
+ <?php echo wpsg_drawForm_AdminboxStart(__('Länderverwaltung', 'wpsg')); ?>
+
+ <div id="wpsg_country_list">
+
+ <?php if (wpsg_isSizedArray($this->view['data'])) { ?>
+ <table class="table wpsg_table_country">
+
+ <tr>
+ <th class="col_check"><input type="checkbox" onclick="return wpsg_country_check_all();" style="margin-top:-2px;" /></th>
+ <th class="col_name"><?php echo __('Ländername', 'wpsg'); ?></th>
+ <th class="col_vz"><?php echo __('Versandzone', 'wpsg'); ?></th>
+ <th class="col_mwstsetting"><?php echo __('MwSt.', 'wpsg'); ?></th>
+ <th class="col_mwst"><?php echo __('MwSt. A', 'wpsg'); ?></th>
+ <th class="col_mwst"><?php echo __('MwSt. B', 'wpsg'); ?></th>
+ <th class="col_mwst"><?php echo __('MwSt. C', 'wpsg'); ?></th>
+ <th class="col_mwst"><?php echo __('MwSt. D', 'wpsg'); ?></th>
+ <th class="col_action"></th>
+ </tr>
+
+ <?php foreach ($this->view['data'] as $l) { ?>
+ <tr id="<?php echo $l['id']; ?>">
+ <td class="col_check"><input type="checkbox" value="1" name="arDelete[<?php echo $l['id']; ?>]" /></td>
+ <td class="col_name"><?php echo wpsg_hspc($l['name'].((wpsg_isSizedString($l['kuerzel']))?' ('.$l['kuerzel'].')':'')); ?></td>
+ <td class="col_vz">
+ <?php if (wpsg_isSizedInt($l['vz']) && wpsg_isSizedString($this->view['vz'][$l['vz']])) { ?>
+ <?php echo wpsg_hspc($this->view['vz'][$l['vz']]); ?>
+ <?php } ?>
+ </td>
+ <td class="col_mwstsetting">
+ <?php if ($l['mwst'] == '2') { ?>
+ <?php echo __('keine MwSt. bei USt.IdNr.', 'wpsg'); ?>
+ <?php } else if ($l['mwst'] == '1') { ?>
+ <?php echo __('keine MwSt.', 'wpsg'); ?>
+ <?php } else { ?>
+ <?php echo __('mit MwSt.', 'wpsg'); ?>
+ <?php } ?>
+ </td>
+ <td class="col_mwst"><?php if (wpsg_tf($l['mwst_a']) != NULL) { ?>
+ <?php echo wpsg_ff(wpsg_tf($l['mwst_a']), '%'); ?>
+ <?php } ?></td>
+ <td class="col_mwst"><?php if (wpsg_tf($l['mwst_b']) != NULL) { ?>
+ <?php echo wpsg_ff(wpsg_tf($l['mwst_b']), '%'); ?>
+ <?php } ?></td>
+ <td class="col_mwst"><?php if (wpsg_tf($l['mwst_c']) != NULL) { ?>
+ <?php echo wpsg_ff(wpsg_tf($l['mwst_c']), '%'); ?>
+ <?php } ?></td>
+ <td class="col_mwst"><?php if (wpsg_tf($l['mwst_d']) != NULL) { ?>
+ <?php echo wpsg_ff(wpsg_tf($l['mwst_d']), '%'); ?>
+ <?php } ?></td>
+ <td class="col_action">
+
+ <a href="#" onclick="return wpsg_country_edit('<?php echo $l['id']; ?>');" class="glyphicon glyphicon-pencil"></a>
+ <a href="#" class="glyphicon glyphicon-trash"></a>
+
+ </td>
+ </tr>
<?php } ?>
- </td>
- <td class="col_mwst"><?php if (wpsg_tf($l['mwst_a']) != NULL) { ?>
- <?php echo wpsg_ff(wpsg_tf($l['mwst_a']), '%'); ?>
- <?php } ?></td>
- <td class="col_mwst"><?php if (wpsg_tf($l['mwst_b']) != NULL) { ?>
- <?php echo wpsg_ff(wpsg_tf($l['mwst_b']), '%'); ?>
- <?php } ?></td>
- <td class="col_mwst"><?php if (wpsg_tf($l['mwst_c']) != NULL) { ?>
- <?php echo wpsg_ff(wpsg_tf($l['mwst_c']), '%'); ?>
- <?php } ?></td>
- <td class="col_mwst"><?php if (wpsg_tf($l['mwst_d']) != NULL) { ?>
- <?php echo wpsg_ff(wpsg_tf($l['mwst_d']), '%'); ?>
- <?php } ?></td>
- <td class="col_action"></td>
- </tr>
- <?php } ?>
-
- </table>
- <?php } else { ?>
- <p><?php echo __('Noch keine Länder angelegt.', 'wpsg'); ?>
- <?php } ?>
-
- <br /><br />
-
+
+ <tr>
+
+ <td class="col_check"><span class="glyphicon glyphicon-trash"></span></td>
+ <td colspan="8">
+
+ <input type="submit" name="submit" onclick="return confirm('<?php echo __('Sind Sie sich sicher?', 'wpsg'); ?>');" class="button btn-xs" value="<?php echo __('Markierte Länder löschen', 'wpsg'); ?>" />
+
+ </td>
+
+ </tr>
+
+ </table>
+ <?php } else { ?>
+ <p><?php echo __('Noch keine Länder angelegt.', 'wpsg'); ?></p>
+ <?php } ?>
+
+ </div>
+
+ <br />
+
+ </form>
+
+ <a href="#" onclick="return wpsg_country_add();"><span class="wpsg-glyphicon glyphicon glyphicon-plus"></span><?php echo __('Neues Land anlegen.', 'wpsg'); ?></a><br /><br />
<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>
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
+ <script type="text/javascript">/* <![CDATA[ */
+
+ function wpsg_country_check_all() { jQuery('td.col_check input').each(function() { jQuery(this).prop('checked', !jQuery(this).prop('checked')); } ); }
+
+ function wpsg_country_add()
+ {
+
+ jQuery('#Modal_wpsg_country_edit .modal-body').html('<img src="<?php echo $this->getRessourceURL('gfx/ajax-loader.gif'); ?>" alt="" />');
+ jQuery('#Modal_wpsg_country_edit').modal('show');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=laender&do=add&noheader=1',
+ success: function(data) { jQuery('#Modal_wpsg_country_edit .modal-body').html(data); }
+ } );
+
+ return false;
+
+ } // function wpsg_country_add()
+
+ function wpsg_country_save()
+ {
+
+ jQuery('#wpsg_country_list').html('<img src="<?php echo $this->getRessourceURL('gfx/ajax-loader.gif'); ?>" alt="" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=laender&do=save&noheader=1',
+ data: {
+ form_data: jQuery('#wpsg_land_edit_form_edit').serialize()
+ },
+ success: function(data) {
+
+ jQuery('#wpsg_country_list').html(data);
+
+ }
+ } );
+
+ } // function wpsg_country_save()
+
+ function wpsg_country_edit(land_id)
+ {
+
+ jQuery('#Modal_wpsg_country_edit .modal-body').html('<img src="<?php echo $this->getRessourceURL('gfx/ajax-loader.gif'); ?>" alt="" />');
+ jQuery('#Modal_wpsg_country_edit').modal('show');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=laender&do=edit&noheader=1&land_id' + land_id,
+ success: function(data) { jQuery('#Modal_wpsg_country_edit .modal-body').html(data); }
+ } );
+
+ return false;
+
+ } // function wpsg_country_edit(edit_id)
+
+ /* ]]> */</script>
+
+
+
+
+
<div class="wpsg_admin_box">
<h3>