Subversion Repositories wpShopGermany4

Rev

Rev 5752 | Rev 6081 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php 

        /**
         * Template für die Kundenübersichtsseite im Backend
         */

?>
<div class="wpsg_customer" 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-customer-tab-a active"><a href="#" onclick="return false;"><?php echo __("Kundenverwaltung", "wpsg"); ?></a></li>
                                        <li role="presentation" class="wpsg-customer-tab-a wpsg_showhide_filter <?php echo (($this->view['hasFilter'])?'active':''); ?>" id="wpsg-customer-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-Customer&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-Customer&action=import&noheader=1"><span class="glyphicon glyphicon-import"></span><?php echo __("Import", "wpsg"); ?></a></li>
                                        <?php if (wpsg_isSizedArray($this->view['data'])) { ?>
                                        <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-Customer&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-customer-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(__('Produkte suchen')); ?><br />

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

    </nav>

    <?php if ($this->view['pages'] > 1) { ?>
        <nav class="pagination_wrap">
            <ul class="pagination">
                <?php if ($this->view['arFilter']['page'] > 1) { ?>
                    <li><a onclick="return goPage(<?php echo $this->view['arFilter']['page'] - 1; ?>);" href="#" aria-label="<?php echo __('Vorherige Seite'); ?>"><span aria-hidden="true">&laquo;</span></a></li>
                <?php } ?>
                <?php for ($i = 1; $i <= $this->view['pages']; $i ++) { ?>
                    <li class="<?php echo (($i == $this->view['arFilter']['page'])?'active':''); ?>"><a onclick="return goPage(<?php echo $i; ?>);" href="#"><?php echo $i; ?></a></li>
                <?php } ?>
                <?php if ($this->view['arFilter']['page'] + 1 <= $this->view['pages']) { ?>
                    <li><a onclick="return goPage(<?php echo $this->view['arFilter']['page'] + 1; ?>);" href="#" aria-label="<?php echo __('Nächste Seite'); ?>"><span aria-hidden="true">&raquo;</span></a></li>
                <?php } ?>
            </ul>
        </nav>
        <?php } ?>

        <div class="wpsg_clear"></div>

        <?php echo $this->writeBackendMessage(); ?>

        <div class="content">

        <?php if (is_array($this->view['arData']) && sizeof($this->view['arData']) > 0) { ?>

            <table class="table wpsg-table-order table-bordered table-hover table-striped wpsg-table-customer">
                <thead>
                    <tr>
                        <th class="manage-column column-title wpsg_pic_col"></th>
                        <th class="wpsg_order col_name" data-order="nr"><?php echo __("Nr/Name", 'wpsg'); ?></th>
                        <th class="wpsg_order col_adress" data-order="adress"><?php echo __("Anschrift", '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 $c) { ?>
                    <tr>
                        <td class="wpsg_pic_col">

                            <img src="https://www.gravatar.com/avatar/<?php echo md5(strtolower(trim($c->getEMail()))); ?>?s=40&d=mm" alt=""" />

                        </td>
                        <td class="col_name column-title">
                            <strong><a title="<?php echo __("Diesen Kunden bearbeiten", "wpsg"); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customer&action=edit&edit_id=<?php echo $c->id; ?>" class="row-title"><?php echo trim($c->GetNr().' '.$c->getLabel()); ?></a></strong>
                            <?php if (strlen($c->getEMail()) > 0) { ?>
                                <a href="mailto:<?php echo $c->getEMail(); ?>" title="<?php echo __('Dem Kunden eine E-Mail schreiben.', 'wpsg'); ?>"><?php echo $c->getEMail();  ?></a>
                            <?php } ?>
                            <div class="row-actions">
                                <span class="edit"><a title="<?php echo __("Diesen Kunden bearbeiten", "wpsg"); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customer&action=edit&edit_id=<?php echo $c->id; ?>"><?php echo __("Bearbeiten", "wpsg"); ?></a></span>
                                |
                                <span class="del"><a onclick="if (!confirm('<?php echo __("Sind Sie sicher, dass Sie den Kunden löschen wollen?", "wpsg"); ?>')) return false;" title="<?php echo __("Diesen Kunden löschen", "wpsg"); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customer&action=del&edit_id=<?php echo $c->id; ?>&noheader=1"><?php echo __("Löschen", "wpsg"); ?></a></span>
                                |
                                <span class="order"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&filter%5Bk_id%5D=<?php echo $k['id']; ?>"><?php echo __('Bestellungen einsehen', 'wpsg'); ?></a></span>
                            </div>
                        </td>
                        <td class="col_adress">
                            <?php echo ((strlen($c->getCompany()) > 0)?$c->getCompany().'<br />':''); ?>
                            <?php echo $c->getStreet(); ?><br />
                            <?php echo trim($c->getZip().' '.$c->getCity()); ?>
                            <?php /*echo $c->plz.' '.$c->ort.' '.$c->land_kuerzel; */?><br />
                        </td>
                        <td class="col_status">
                            <?php echo wpsg_translate(__('#1# Bestellungen', 'wpsg'), $c->getOrderCount()); ?><br />
                            <?php echo wpsg_translate(__('Umsatz: #1#', 'wpsg'), wpsg_ff($c->getOrderAmount(), $this->get_option('wpsg_currency'))); ?>
                            <?php if ($c->getOrderCount() > 0) { ?>
                            <br />
                            <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&filter[k_id]=<?php echo $c->id; ?>"><?php echo __('Bestellungen einsehen', 'wpsg'); ?></a>
                            <?php } ?>
                        </td>
                    </tr>
                    <?php } ?>
                </tbody>
            </table>

            <?php if ($this->view['pages'] > 1) { ?>
                <nav class="pagination_wrap pagination_wrap_bottom">
                    <ul class="pagination">
                        <?php if ($this->view['arFilter']['page'] > 1) { ?>
                            <li><a onclick="return goPage(<?php echo $this->view['arFilter']['page'] - 1; ?>);" href="#" aria-label="<?php echo __('Vorherige Seite'); ?>"><span aria-hidden="true">&laquo;</span></a></li>
                        <?php } ?>
                        <?php for ($i = 1; $i <= $this->view['pages']; $i ++) { ?>
                            <li class="<?php echo (($i == $this->view['arFilter']['page'])?'active':''); ?>"><a onclick="return goPage(<?php echo $i; ?>);" href="#"><?php echo $i; ?></a></li>
                        <?php } ?>
                        <?php if ($this->view['arFilter']['page'] + 1 <= $this->view['pages']) { ?>
                            <li><a onclick="return goPage(<?php echo $this->view['arFilter']['page'] + 1; ?>);" href="#" aria-label="<?php echo __('Nächste Seite'); ?>"><span aria-hidden="true">&raquo;</span></a></li>
                        <?php } ?>
                    </ul>
                </nav>
            <?php } ?>

        <?php } else { ?>

            <?php echo wpsg_drawForm_AdminboxStart(); ?>
                <?php echo __('Keine Kunden 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>