Subversion Repositories wpShopGermany4

Rev

Rev 8040 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6134 daniel 1
<?php
2
 
3
	/**
4
	 * Template für die Produktgruppenübersicht
5
	 */
6
 
7
?>
8
 
9
<div class="wpsg_productgroups" id="wpsg-bs">
10
 
11
    <nav class="navbar navbar-default">
12
 
13
		<div class="container-fluid">
14
			<div class="navbar-header">
15
				<a class="navbar-brand" href="#"><?php echo __('wpShopGermany', 'wpsg'); ?></a>
16
			</div>
17
			<div class="collapse navbar-collapse" id="bs-customer-navbar-collapse-1">
18
				<ul class="nav navbar-nav">
6135 thomas 19
					<li role="presentation" class="wpsg-customer-tab-a active"><a href="#" onclick="return false;"><?php echo wpsg_translate(__("Produktgruppenverwaltung (#1# Produktgruppen)", "wpsg"), $this->view['countAll']); ?></a></li>
6134 daniel 20
                    <li role="presentation" class="wpsg-customer-tab-a wpsg_showhide_filter" id="wpsg-customer-tab-0"><a href="#" onclick="return false;"><span class="glyphicon glyphicon-search"></span><?php echo __("Suche", "wpsg"); ?></a></li>
7561 daniel 21
                    <li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'add'))?'active':''); ?>"><a href="<?php
22
 
23
						echo wpsg_admin_url('Productgroups', '', ['wpsg_mod_action' => 'add']);
24
 
25
					?>"><span class="glyphicon glyphicon-plus"></span><?php echo __("Hinzufügen", "wpsg"); ?></a></li>
6134 daniel 26
				</ul>
27
				<ul class="nav navbar-nav navbar-right">
28
				</ul>
29
			</div>
30
		</div>
31
 
32
        <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'); ?>;">
33
            <div class="row">
34
                <div class="col-lg-4">
35
                    <form method="post" id="filter_form">
36
 
7561 daniel 37
						<?php echo wp_nonce_field('wpsg-mod-productgroups-search'); ?>
38
 
6134 daniel 39
                        <input id="wpsg_seite" type="hidden" name="filter[page]" value="<?php echo @$this->view['page']; ?>" class="current-page" />
40
 
41
                        <input id="wpsg_order" type="hidden" name="filter[order]" value="<?php echo @$this->view['arFilter']['order']; ?>" />
42
                        <input id="wpsg_ascdesc" type="hidden" name="filter[ascdesc]" value="<?php echo @$this->view['arFilter']['ascdesc']; ?>" />
43
 
44
                        <?php echo wpsg_drawForm_Input('filter[s]', __('Suchfeld', 'wpsg'), wpsg_getStr($this->view['arFilter']['s'])); ?>
45
 
46
                        <?php echo wpsg_drawForm_SubmitButton(__('Produktgruppen suchen')); ?><br />
47
 
48
                    </form>
49
                </div>
50
            </div>
51
        </div>
52
 
53
    </nav>
7549 daniel 54
 
55
	<div class="wpsg_msg_wrap"><hr class="wp-header-end wpsg-wp-header-end"/></div>
56
	<div class="wpsg_clear"></div>
57
 
6134 daniel 58
    <?php if ($this->view['pages'] > 1) { ?>
59
        <nav class="pagination_wrap">
60
            <ul class="pagination">
61
                <?php if ($this->view['arFilter']['page'] > 1) { ?>
62
                    <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>
63
                <?php } ?>
64
                <?php for ($i = 1; $i <= $this->view['pages']; $i ++) { ?>
65
                    <li class="<?php echo (($i == $this->view['arFilter']['page'])?'active':''); ?>"><a onclick="return goPage(<?php echo $i; ?>);" href="#"><?php echo $i; ?></a></li>
66
                <?php } ?>
67
                <?php if ($this->view['arFilter']['page'] + 1 <= $this->view['pages']) { ?>
68
                    <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>
69
                <?php } ?>
70
            </ul>
71
        </nav>
72
	<?php } ?>
73
 
74
    <div class="wpsg_clear"></div>
75
 
76
	<div class="content">
77
 
78
        <?php if (is_array($this->view['arData']) && sizeof($this->view['arData']) > 0) { ?>
79
 
80
            <table class="table wpsg-table-order table-bordered table-hover table-striped wpsg-table-customer">
81
                <thead>
82
                    <tr>
8198 daniel 83
                        <th class="wpsg_pic_col"></th>
6134 daniel 84
                        <th class="wpsg_order col_name" data-order="nr"><?php echo __("Name", 'wpsg'); ?></th>
85
                        <th class="wpsg_order col_template" data-order="template"><?php echo __("Template", 'wpsg'); ?></th>
86
                        <th class="wpsg_order col_products" data-order="products"><?php echo __("Produkte", 'wpsg'); ?></th>
87
                    </tr>
88
                </thead>
89
                <tbody>
8198 daniel 90
                    <?php foreach ($this->view['arData'] as /** @var wpsg_productgroup */ $pg) { ?>
6134 daniel 91
                    <tr>
8198 daniel 92
                        <td class="wpsg_pic_col">
93
                            <?php if ($pg->getImage() > 0) { ?>
94
 
95
                                <?php echo \wp_get_attachment_image($pg->getImage(), [75, 75]); ?>
96
 
97
                            <?php } ?>
98
                        </td>
6134 daniel 99
                        <td class="col_name">
8198 daniel 100
                            <strong><a title="<?php echo __("Diese Produktgruppe bearbeiten", "wpsg"); ?>" href="<?php
101
 
102
                                echo wpsg_admin_url('Productgroups', '', ['wpsg_mod_action' => 'edit', 'edit_id' => $pg->id]);
103
 
104
                            ?>" class="row-title"><?php echo $pg->name; ?></a></strong>
6134 daniel 105
					        <div class="row-actions">
7561 daniel 106
                                <span class="edit"><a title="<?php echo __("Diese Produktgruppe bearbeiten", "wpsg"); ?>" href="<?php
107
 
108
									echo wpsg_admin_url('Productgroups', '', ['wpsg_mod_action' => 'edit', 'edit_id' => $pg->id]);
109
 
110
								?>"><?php echo __("Bearbeiten", "wpsg"); ?></a>
6134 daniel 111
                                |
7549 daniel 112
                                <span class="del"><a onclick="if (!confirm('<?php echo __("Sind Sie sich sicher?", "wpsg"); ?>')) return false;" title="<?php echo __("Diese Produktgruppe löschen", "wpsg"); ?>" href="<?php
113
 
7561 daniel 114
									echo wpsg_admin_url('Productgroups', '', ['wpsg_mod_action' => 'del', 'edit_id' => $pg->id], ['noheader' => '1']);
7549 daniel 115
 
116
								?>"><?php echo __("Löschen", "wpsg"); ?></a>
6134 daniel 117
                                <?php if ($pg->countProducts() > 0) { ?>
118
                                |
119
                                <span class="edit"><a title="<?php echo __("Zur Produktliste", "wpsg"); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&search[pgruppe]=<?php echo $pg->id; ?>"><?php echo __("Zur Produktliste", "wpsg"); ?></a>
120
                                <?php } ?>
121
                            </div>
122
                        </td>
123
                        <td class="col_template">
124
                            <?php echo (($pg->template_file == "0")?'Individuelle Produkttemplates':$pg->template_file); ?>
125
                        </td>
126
                        <td class="col_products">
127
                            <?php echo $pg->countProducts(); ?>
128
                        </td>
129
                    </tr>
130
                    <?php } ?>
131
                </tbody>
132
            </table>
133
 
134
            <?php if ($this->view['pages'] > 1) { ?>
135
                <nav class="pagination_wrap pagination_wrap_bottom">
136
                    <ul class="pagination">
137
                        <?php if ($this->view['arFilter']['page'] > 1) { ?>
138
                            <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>
139
                        <?php } ?>
140
                        <?php for ($i = 1; $i <= $this->view['pages']; $i ++) { ?>
141
                            <li class="<?php echo (($i == $this->view['arFilter']['page'])?'active':''); ?>"><a onclick="return goPage(<?php echo $i; ?>);" href="#"><?php echo $i; ?></a></li>
142
                        <?php } ?>
143
                        <?php if ($this->view['arFilter']['page'] + 1 <= $this->view['pages']) { ?>
144
                            <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>
145
                        <?php } ?>
146
                    </ul>
147
                </nav>
148
            <?php } ?>
149
 
150
        <?php } else { ?>
151
 
152
            <?php echo wpsg_drawForm_AdminboxStart(); ?>
153
    		<?php echo __('Keine Produktgruppen in der Datenbank.', 'wpsg'); ?>
154
            <?php echo wpsg_drawForm_AdminboxEnd(); ?>
155
 
156
        <?php } ?>
157
 
158
</div>
159
 
160
<script type="text/javascript">/* <![CDATA[ */
161
 
162
    <?php if (wpsg_isSizedString($this->view['arFilter']['order']) && wpsg_isSizedString($this->view['arFilter']['ascdesc'])) { ?>
163
    jQuery('th[data-order="<?php echo $this->view['arFilter']['order']; ?>"]').addClass('wpsg_order_<?php echo strtolower($this->view['arFilter']['ascdesc']); ?>');
164
    <?php } ?>
165
 
166
	function goPage(page)
167
	{
168
 
6152 thomas 169
		//if (page <= 0 || page == <?php echo $this->view['arFilter']['page']; ?> || page > <?php echo $this->view['pages']; ?>) return;
6134 daniel 170
 
171
		jQuery('#wpsg_seite').val(page);
8040 karl 172
		jQuery('#filter_form').trigger('submit');
6134 daniel 173
 
174
		return false;
175
 
176
	} // function goPage(page)
177
 
178
/* ]]> */</script>