Subversion Repositories wpShopGermany4

Rev

Rev 6503 | Rev 6680 | 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">
                                        <?php
                                                $cnt = 0;
                                                if (is_array($this->view['arData']) && sizeof($this->view['arData']) > 0) {
                                foreach ($this->view['arData'] as $oVoucher) {
                                        if (($this->get_option('wpsg_mod_gutschein_active') == '1') && ($oVoucher->getStatus() > 0)) $cnt=$cnt;
                                        else $cnt++;
                                }
                                                }
                                        ?>
                                        <li role="presentation" class="wpsg-voucher-tab-a active"><a href="#" onclick="return false;"><?php echo wpsg_translate(__("Gutscheinverwaltung (#1# Gutscheine)", "wpsg"), $cnt); ?></a></li>
                                        <li role="presentation" class="wpsg-voucher-tab-a wpsg_showhide_filter <?php echo (($this->view['hasFilter'])?'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)?'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 />

                                        </form>
                                </div>
                        </div>
        </div>

    </nav>

    <div class="wpsg_clear"></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) { ?>
                        <?php if (($this->get_option('wpsg_mod_gutschein_active') == '1') && ($oVoucher->getStatus() > 0)) continue; ?>
                        <tr>
                            <td class="col_checkbox">

                                <input class="col_set_checkbox" value="<?php echo $oVoucher->id; ?>" name="wpsg_multido[]" type="checkbox" />

                            </td>
                            <td class="col_code"><?php echo $oVoucher->code; ?></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'); ?>">&nbsp;[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>

            </div>

            <?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 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)


/* ]]> */</script>