Rev 7025 | Rev 7486 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php
/**
* Template für die Übersicht der Gutschein
*/
?>
<div class="wpsg_voucher" id="wpsg-bs">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#"><?php echo __('wpShopGermany', 'wpsg'); ?></a>
</div>
<div class="collapse navbar-collapse" id="bs-customer-navbar-collapse-1">
<ul class="nav navbar-nav">
<li role="presentation" class="wpsg-voucher-tab-a active"><a href="#" onclick="return false;"><?php echo __("Gutscheinverwaltung", "wpsg"); ?></a></li>
<li role="presentation" class="wpsg-voucher-tab-a wpsg_showhide_filter <?php echo ((($this->view['hasFilter']) && (wpsg_getStr($this->view['arFilter']['s']) != ''))?'active':''); ?>" id="wpsg-voucher-tab-0"><a href="#" onclick="return false;"><span class="glyphicon glyphicon-search"></span><?php echo __("Suche", "wpsg"); ?></a></li>
<li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'add'))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=add"><span class="glyphicon glyphicon-plus"></span><?php echo __("Hinzufügen", "wpsg"); ?></a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'import'))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=import&noheader=1"><span class="glyphicon glyphicon-import"></span><?php echo __("Import", "wpsg"); ?></a></li>
<?php if (wpsg_isSizedArray($this->view['arData'])) { ?>
<li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'export'))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=export&noheader=1"><span class="glyphicon glyphicon-export"></span><?php echo __("Export", "wpsg"); ?></a></li>
<?php } ?>
</ul>
</div>
</div>
<div class="wpsg-filter wpsg-customer-tab wpsg-voucher-tab-0 container-fluid form-horizontal" style="display:<?php echo ((($this->view['hasFilter'] === true) && ($this->view['arFilter']['s'] != ''))?'block':'none'); ?>;">
<div class="row">
<div class="col-lg-4">
<form method="post" id="filter_form">
<input id="wpsg_seite" type="hidden" name="filter[page]" value="<?php echo @$this->view['page']; ?>" class="current-page" />
<input id="wpsg_order" type="hidden" name="filter[order]" value="<?php echo @$this->view['arFilter']['order']; ?>" />
<input id="wpsg_ascdesc" type="hidden" name="filter[ascdesc]" value="<?php echo @$this->view['arFilter']['ascdesc']; ?>" />
<?php echo wpsg_drawForm_Input('filter[s]', __('Suchfeld', 'wpsg'), wpsg_getStr($this->view['arFilter']['s'])); ?>
<?php echo wpsg_drawForm_SubmitButton(__('Gutscheine suchen')); ?><br />
<input type="hidden" id="filterstatus" name="filter[status]" value="<?php echo @$this->view['arFilter']['status']; ?>" />
</form>
</div>
</div>
</div>
</nav>
<div class="wpsg_msg_wrap"><hr class="wp-header-end wpsg-wp-header-end"/></div>
<div class="pagination_wrap wpsg_status_link_wrap">
<ul class="pagination">
<?php foreach ($this->view['arStatus'] as $status_key => $status_info) { ?>
<li class="<?php echo ((wpsg_getStr($this->view['arFilter']['status']) == $status_key)?'active':''); ?>"><a href="#" onclick="return wpsg_setFilterStatus('<?php echo $status_key; ?>');"><?php echo wpsg_translate(__('#1# <span>(#2#)<span>', 'wpsg'), $status_info['label'], $status_info['count']); ?></a></li>
<?php } ?>
</ul>
</div>
<?php $this->render(WPSG_PATH_VIEW.'/admin/pager.phtml'); ?>
<div class="content">
<?php if (is_array($this->view['arData']) && sizeof($this->view['arData']) > 0) { ?>
<form method="POST" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=index&noheader=1">
<table class="table wpsg-table-order table-bordered table-hover table-striped wpsg-table-customer">
<thead>
<tr>
<th class="col_checkbox"><input type="checkbox" onclick="jQuery('.col_set_checkbox').each(function() { jQuery(this).prop('checked', !jQuery(this).prop('checked')); } );" /></th>
<th class="wpsg_order col_code" data-order="code"><?php echo __("Code", 'wpsg'); ?></th>
<th class="wpsg_order col_start" data-order="start_date"><?php echo __("Start", 'wpsg'); ?></th>
<th class="wpsg_order col_end" data-order="end_date"><?php echo __("Ende", 'wpsg'); ?></th>
<th class="wpsg_order col_value" data-order="value"><?php echo __("Wert", 'wpsg'); ?></th>
<th class="wpsg_order col_status" data-order="status"><?php echo __("Status", 'wpsg'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($this->view['arData'] as $oVoucher) { ?>
<tr>
<td class="col_checkbox">
<input class="col_set_checkbox" value="<?php echo $oVoucher->id; ?>" name="wpsg_multido[]" type="checkbox" />
</td>
<?php /* <td class="col_code"><?php echo $oVoucher->code; ?></td> */ ?>
<td class="col_code">
<a title="<?php echo __('Gutschein bearbeiten', 'wpsg'); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Voucher&action=edit&edit_id=<?php echo $oVoucher->id; ?>"><?php echo $oVoucher->code; ?></a>
<?php if ($this->hasMod('wpsg_mod_voucherproduct') && $oVoucher->isAutoCreated()) { ?>
[ <a href="<?php echo WPSG_URL_WP . 'wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_voucherproduct&gs_id='.$oVoucher->id.'&order_id='.$oVoucher->autocreate_order.'&noheader=1&cmd=getVoucher'; ?>"><?php echo __('PDF', 'wpsg'); ?></a> ]
<?php } ?>
</td>
<td class="col_start"><?php echo wpsg_formatTimestamp($oVoucher->start_date); ?></td>
<td class="col_end"><?php echo wpsg_formatTimestamp($oVoucher->end_date); ?></td>
<td class="col_value"><?php
if ($oVoucher->calc_typ == 'w') echo wpsg_ff($oVoucher->value, $this->get_option('wpsg_currency'));
else if ($oVoucher->calc_typ == 'p') echo wpsg_ff($oVoucher->value, '%');
?></td>
<td class="col_status">
<?php $comment = $oVoucher->comment; if (wpsg_isSizedString($comment)) { ?>
<a title="<?php echo __("Kommentar (Admin): ", "wpsg").htmlspecialchars($comment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign admincomment" href="#"></a>
<?php } ?>
<?php echo $oVoucher->getStatusLabel(); ?>
<?php $used = $oVoucher->getUsed(); if (wpsg_isSizedInt($used)) { ?>
<?php echo wpsg_translate(__('#1# mal benutzt.', 'wpsg'), $used); ?>
<?php } ?>
<?php if ($oVoucher->multi === '1') { ?>
<span title="<?php echo __('Mehrfach benutzbar', 'wpsg'); ?>"> [M]</span>
<?php } ?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<div class="alignleft actions">
<input onclick="if (!confirm('<?php echo __('Sind Sie sich sicher?', 'wpsg'); ?>')) return false;" type="submit" value="<?php echo __('Markierte Gutscheine löschen', 'wpsg'); ?>" class="button-secondary action" id="doaction" name="submit-multidelete" />
</div>
</form>
<?php $this->render(WPSG_PATH_VIEW.'/admin/pager.phtml'); ?>
<?php } else { ?>
<?php echo wpsg_drawForm_AdminboxStart(); ?>
<?php echo __('Keine Gutscheine in der Datenbank.', 'wpsg'); ?>
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
<?php } ?>
</div>
</div>
<script type="text/javascript">/* <![CDATA[ */
<?php if (wpsg_isSizedString($this->view['arFilter']['order']) && wpsg_isSizedString($this->view['arFilter']['ascdesc'])) { ?>
jQuery('th[data-order="<?php echo $this->view['arFilter']['order']; ?>"]').addClass('wpsg_order_<?php echo strtolower($this->view['arFilter']['ascdesc']); ?>');
<?php } ?>
function wpsg_setFilterStatus(state)
{
jQuery('#filterstatus').val(state);
jQuery('#seite').val(1);
jQuery('#filter_form').submit();
return false;
}
function goPage(page)
{
//if (page <= 0 || page == <?php echo $this->view['arFilter']['page']; ?> || page > <?php echo $this->view['pages']; ?>) return;
jQuery('#wpsg_seite').val(page);
jQuery('#filter_form').submit();
return false;
} // function goPage(page)
jQuery(document).ready(function() {
jQuery('.wpsg-order-tab-mods').bind('click', function() {
if (jQuery(this).hasClass('active'))
{
jQuery(this).removeClass('active');
jQuery('.' + jQuery(this).attr("id")).slideUp(250);
}
else
{
jQuery(this).addClass('active');
jQuery('.' + jQuery(this).attr("id")).slideDown(250);
}
return false;
} );
} );
/* ]]> */</script>